Skip to content

Conversation

@ihsaan-ullah
Copy link
Collaborator

@ihsaan-ullah ihsaan-ullah commented Feb 12, 2025

@Didayolo @ObadaS

Description

User quota was configured in bytes. Now I have changed it to GB so that it is readable. After deployment, all users quota should be updated from bytes to GB.

This documentation here shows how you can do that. I have reorganized the wiki page to gather quota related admin procedures at one place here

Manual intervention

Reset User Quota from Bytes to GB

Using django shell

docker compose exec django ./manage.py shell_plus
from profiles.quota import reset_all_users_quota_to_gb
reset_all_users_quota_to_gb()

Issues this PR resolves

A checklist for hand testing

  • check that function to reset user quota to GB works
  • check that you cannot upload files when your quota is filled
  • check that you can now understand and can easily change the quota in the django admin and using the shell as shown in the documentation
  • check that it is clear for you and for wiki readers that the quota is in GB e.g. 15 GB

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

@ihsaan-ullah ihsaan-ullah mentioned this pull request Feb 12, 2025
5 tasks
@ObadaS
Copy link
Collaborator

ObadaS commented Feb 13, 2025

Hello,
The function to update user quota from bytes to GB is only used once after we deploy this PR, right ?
If yes, then we should move it from the Admin Procedures page to the Upgrade Codabench page

@ObadaS
Copy link
Collaborator

ObadaS commented Feb 13, 2025

I deployed the changes on my local PC and everything seems to be working fine. The conversion went fine, without resetting custom quotas, changing quota worked correctly, created new users shows the updated quota display in GB instead of bytes, and it's not possible to submit something if the quota is over the limit already

@Didayolo
Copy link
Member

Manual intervention

Reset User Quota from Bytes to GB

Using django shell

docker compose exec django ./manage.py shell_plus
from profiles.quota import reset_all_users_quota_to_gb
reset_all_users_quota_to_gb()

@Didayolo Didayolo self-assigned this Mar 21, 2025
@Didayolo
Copy link
Member

Didayolo commented Mar 21, 2025

@ihsaan-ullah

I am testing this locally. It seems that the quota is inconsistent depending on the user account:

  • Newest accounts have 15 GB
  • Older accounts have 16 GB
  • My main account has only 1 GB but I guessed I reduced it in the past for testing purpose
Capture d’écran 2025-03-21 à 14 23 22 Capture d’écran 2025-03-21 à 14 23 26

@ihsaan-ullah
Copy link
Collaborator Author

  • Newest accounts have 15 GB

This is correct

  • Older accounts have 16 GB

Yes because I converted the existing quota in GiB to GB. If you want everyone to have 15 GB maybe we can run a script to convert all 16 to 15.

@Didayolo
Copy link
Member

@ihsaan-ullah

OK, I merge this pull request and add a TODO note in the manual intervention to think about this 16 --> 15 GB conversion.

@Didayolo Didayolo merged commit 2883349 into develop Mar 23, 2025
1 check passed
@Didayolo Didayolo deleted the user_quota_bytes_to_GB branch March 23, 2025 00:19
curious-broccoli added a commit to curious-broccoli/codabench that referenced this pull request May 27, 2025
* show server error instead of fronend parsing error

* show back button in edit only. Show help in create only

* do not allow special chars in usernames

* Enable/Disable competition forum (codalab#1774)

* forum enable/disable functionality added

* new forum_enabled field added to competition dump data

* Email in lowercase (codalab#1769)

* on signup email stored in lower case letters. Whitelist emails conveted to lowercased

* whitespace removed

* convert email to lowercased during login

* latest competition fields added to dump (codalab#1786)

Co-authored-by: Adrien Pavão <adrien.pavao@gmail.com>

* User quota is updated to GB from Bytes (codalab#1749)

* user assigned quota will now be in GB instead of bytes

* unused counter removed

* File Sizes cleanup (codalab#1752)

* sizes Kib to Bytes, size formatting functions cleanup

* space between size and unit, removed factor multiplication from size calcualtion

* file_size to bytes in SubmissionDetail

* added missing migration

* migration conflict resolved

* reseting file sizes task removed

* Resource interface: quota unit is now GB instead of B

* Create CODE_OF_CONDUCT.md

* Added log rolling to limit log size to 5GB for now, can be changed

* Maintenance mode option added in Caddyfile, used by creating a maintenance.on file in the maintenance_mode/ directory (codalab#1799)

* Maintenance mode option added in Caddyfile, used by creating a maintenance.on file in the maintenance_mode/ directory

* Add offline.png

* Fixed image not loading

---------

Co-authored-by: Obada Haddad <obada.haddad@lisn.fr>
Co-authored-by: didayolo <adrien.pavao@gmail.com>

* Update version.json for release 1.18.0

* Add remove button for cancelled submissions (codalab#1808)

* Add remove button for cancelled submissions

* Allow remove of cancelled submissions

* Update compute_worker.py

* Add permissions check for bulk download

* flake8 fix

* Add hide_score_output option (codalab#1838)

* Add hide_score_output option

* Update test

* Add the options for v1 bundles

* Make more generic tests (v1, v2)

* version update workflow removed

* Add hide_prediction_output feature

* Calendar lock fixed, additional check added for start and end date

* Simplify code

* Version bump

* Removed time and updated date to today

---------

Co-authored-by: Ihsan Ullah <ihsan2131@gmail.com>
Co-authored-by: Adrien Pavão <adrien.pavao@gmail.com>
Co-authored-by: Obada Haddad <obada.haddad@lisn.fr>
Co-authored-by: Obada Haddad-Soussac <11889208+ObadaS@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants