Skip to content

Conversation

@ihsaan-ullah
Copy link
Collaborator

@ihsaan-ullah ihsaan-ullah commented Jan 31, 2025

@ mention of reviewers

@Didayolo

A brief description of the purpose of the changes contained in this PR.

A new feature to soft-delete submissions has been added. Now participants can delete their submissions from their submissions panel without requesting organizers or platform admins. This will allow users to freeup some space to submit more submissions BUT this will not affect the submissions daily or overall limit.

The following is the summary of what is done in this PR:

  • Allow users to soft delete their own submissions if the submission is failed, finished (but not on the leaderboard). This deletion deletes the submissions data but keeps the record in the db
Screenshot 2025-01-31 at 7 15 22 PM
  • Organizers can view the soft delete submissions from the admin view
Screenshot 2025-01-31 at 6 20 08 PM
  • Soft-deleted submissions are not shown in the server status page anymore
  • With deletion of the submission data, the filename is also removed because it is associated with the data, so now users will see Deleted file in place of the submission file name
  • Organizers can still hard-delete the submissions as they were already able to do
  • Soft-deleting submission clears a bunch of data that include:
    -- prediction_result
    -- scoring_result
    -- detailed_result
    -- data
  • tests are added to make sure the functionality works as expected

Issues this PR resolves

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 linked an issue Jan 31, 2025 that may be closed by this pull request
@Didayolo Didayolo self-assigned this Jan 31, 2025
@Didayolo
Copy link
Member

Didayolo commented Feb 4, 2025

@ihsaan-ullah

I think the deletion button should only appear in the resources interface:

Capture d’écran 2025-02-04 à 16 26 07

and not in the submissions table from the competition:

Capture d’écran 2025-02-04 à 16 26 16

By the way, it looks like only new submissions (after deployment of this feature) are possible to delete:

Capture d’écran 2025-02-04 à 16 28 38

@ihsaan-ullah
Copy link
Collaborator Author

I think normal users only submit their submissions to a competition and it makes sense to allow them to delete submissions from the competition interface.

We do show submissions in the resource interface but we should redesign the resource interface (I will present a plan soon).

You can only delete submissions that are not on the leaderboard. In your last screenshot, the last submission is on the leaderboard that is why you don't see a delete button

@Didayolo
Copy link
Member

Didayolo commented Feb 4, 2025

OK, works for me. I think the deletion from resources interface is not working then, only from the competition page.

@Didayolo
Copy link
Member

Didayolo commented Feb 4, 2025

  • Updating the error message on resources interface (you can go to the competition etc.)
  • Testing big files to see if you save the quota

@ObadaS
Copy link
Collaborator

ObadaS commented Feb 5, 2025

Hello @ihsaan-ullah, I tested the deletion features on a big file (2 GB)

Here are the pictures of the resource tab I took before uploading it, after uploading it (and waiting for it to finish running. The space used goes during the run, not just once) and then a picture after I deleted the submissions from the competition submission page as a user.
As you can see, some space is not freed up afterward.
image
image
image

@ihsaan-ullah
Copy link
Collaborator Author

@ObadaS this is interesting. I will check on my side with a big file to see why full space is not freed.

@ihsaan-ullah
Copy link
Collaborator Author

ihsaan-ullah commented Feb 6, 2025

@ObadaS I checked on my side and I think when a submission is processed, some additional files are stored somewhere that takes additional space. Below are the details of my test

  • No file upload
    Quota: 0.0B / 15.0GiB
  • Uploaded Iris bundle:
    Quota: 907.1KiB / 15.0GiB
  • Uploaded big submission (zip size: 1.34 GB)
    Quota: 1.3GiB / 15.0GiB --- (1.40 GB)
  • Uploaded big submission (zip size: 1.34 GB)
    Quota: 2.5GiB / 15.0GiB --- (2.68 GB)
  • After both submissions ran successfully
    Quota: 5.0GiB / 15.0GiB
  • Deleted submission 1
    Quota: 3.8GiB / 15.0GiB
  • Deleted submission 2
    Quota: 2.5GiB / 15.0GiB

Edit:

  • I think we should use GB instead of GiB to avoid any confusion. What do you think?
  • I will run another test with empty db and minio to check which additional files are created

@ObadaS
Copy link
Collaborator

ObadaS commented Feb 6, 2025

@ihsaan-ullah I think you can get more information about the files that are stored and created by looking at the logs of the compute_worker. It seems like, after downloading the file and doing the work needed, it generates a new file that gets uploaded to the storage. If I remember well, I read something about predictions files, since the ingestion and scoring program can be different, the generated files needs to be uploaded to the storage ?
I will look into it later and try to get logs about those mysterious files.

I agree about changing the size unit to GB to be less confusing since people are more used to this. If not too complicated, it would also be nice if the size change dynamically (shows in MB or KB if needed, instead of showing 0GB or 0.1GB)

@ihsaan-ullah
Copy link
Collaborator Author

I agree about changing the size unit to GB to be less confusing since people are more used to this. If not too complicated, it would also be nice if the size change dynamically (shows in MB or KB if needed, instead of showing 0GB or 0.1GB)

Sounds good. I will check this

…ven after deleting everything, changed default quota size from 15 GiB to 15 GB, updated soft-deletion
@ihsaan-ullah
Copy link
Collaborator Author

@ObadaS @Didayolo

I made the following updates:

  • size formatter functions in both python and js updated to calculate size in GB/MB/KB instead of GiB/MiB/KiB
  • updated soft-deletion to fix the problem with remaining space that was left even after deleting everything
  • changed default user quota size from 15 GiB to 15 GB
  • updated user quota calculation to use GB/MB/KB instead of GiB/MiB/KiB

Some problems/thoughts

  • In the calculation of storage analytics I found the use of GiB/MiB/KiB. Maybe there are more places where we have such inconsistency. I suggest that we convert this point into a separate issue and fix it later.
  • I found redundant fields: prediction_result_file_size, scoring_result_file_size, detailed_result_file_size. These only keep the size of the files while the file fileds are also present and we can take the size from the file fields directly. We can ignore this point or we clean this up later in a separate issue/PR

@Didayolo
Copy link
Member

@ihsaan-ullah I confirm that now deleting submission does decrease the quota accordingly.

I've just seen something a bit shady.

I uploaded a submission with a size of 442 MB:

Capture d’écran 2025-02-10 à 16 56 29

When the submission was being processed, I could see a consistent quota:

Capture d’écran 2025-02-10 à 16 56 42

But at the end of the computation, the quota used by the submission doubled:

Capture d’écran 2025-02-10 à 16 56 24

Is that normal?

@ihsaan-ullah
Copy link
Collaborator Author

@ihsaan-ullah I confirm that now deleting submission does decrease the quota accordingly.

I've just seen something a bit shady.

I uploaded a submission with a size of 442 MB:

Capture d’écran 2025-02-10 à 16 56 29 When the submission was being processed, I could see a consistent quota: Capture d’écran 2025-02-10 à 16 56 42 But at the end of the computation, the quota used by the submission doubled: Capture d’écran 2025-02-10 à 16 56 24 Is that normal?

This needs a bit investigation but I think this comes from the prediction files stored after the submission is processed. If you remember, the prediction zip also includes the submission itself. BUT we should look into it together with my other points in my last comment

@Didayolo
Copy link
Member

Didayolo commented Feb 10, 2025

@ihsaan-ullah OK, for this PR it's fine, let's open a new one (or an issue) for the points you mentionned.


Deployed on production, it looks like the quota is not well computed:$

Capture d’écran 2025-02-10 à 18 34 18

The bundles have NaN value for size, and my total storage used is 1.9 MB (on my main account on production server, which does not make sense).

@Didayolo Didayolo merged commit 57a7f64 into develop Feb 10, 2025
1 check passed
@Didayolo Didayolo deleted the submission_soft_deletion branch February 10, 2025 17:13
@ihsaan-ullah ihsaan-ullah mentioned this pull request Feb 10, 2025
5 tasks
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.

15 GB quota; cannot delete submissions

4 participants