My submissions keep failing. To troubleshoot the problem I’ve been trying to submit the example_submission main.py file that’s provided in the competition GitHub repo.
The steps I’ve followed are as follows:
Create a folder named “submission”
Put the example main.py file inside the “submission” folder
Put a folder named “assets” inside the submission folder
Zip the submission folder so that it’s named “submission.zip”
Submit to the competition
The submission fails when the submission status reaches “scoring”. This happens for both the normal submission and the smoke test submission. Although the smoke test submission fails during the scoring, the error message in the log is always:
/code_execution/.pixi/envs/gpu/bin/python: can’t open file ‘/code_execution/main.py’: [Errno 2] No such file or directory
Is the submission process I’m following incorrect? It’s also possible that there’s an issue with the example main.py file or there’s a bug in the submission system.
Hi @vbookshelf ! From looking through your smoke test logs, it seems like your main.py file may not be at the root level within submission.zip. The logs show everything being inside of ./_MACOSX/submission or ./submission rather than at the top level. In your smoke test logs (id-267514), it says:
A file named main.py must exist at the root level of your zipped archive. So for a correctly formatted submission, the logs will show:
inflating: ./main.py
It’s possible there is something happening during the creation of the zip archive that is adding nested directories. I’d recommend using the make pack-submission command and instructions from the runtime repository to create submission.zip. You can also test it locally before submitting to the platform to make sure it runs correctly.
1. Create a folder named “submission”
…
4. Zip the submission folder so that it’s named “submission.zip”
One common gotcha is that right-clicking on the submission/ folder and using your OS’s Compress "submission" (on macOS) or Compressed (zipped) folder (on Windows) will typically create an archive where the folder itself is at the archive root (so you end up with ./submission/main.py rather than ./main.py like @kwetstone described). Instead, you should be inside the submission/ folder, select all of the files you want to include in your submission, and then use the right-click command.
Or, the easiest way to do this correctly is to not use the right-click ZIP creation functionality and instead use make pack-submission like @kwetstone suggests.
Thank you @kwetstone and @jayqi . You are correct. The error was being caused by nested folders being added when the submission folder was zipped. I’ve now been able to make a submission.
For others who may read this thread, this is how I solved the problem on Mac by using the terminal to zip the folder:
Place the folder named “submission” on the Desktop
Open the terminal
$ cd Desktop
$ zip -j submission.zip submission/*
As a side note, the example_submission main.py cannot be submitted because there’s an error in the code:
Line 19: predictions[“InjuryLocationType”] = 11
InjuryLocationType can only have values from 1 to 6.
When I have directory that contains only main.py then everything works fine. Howewer when in directory I have main.py at root level and additional subdirectories e.g. assets then all solutions produce root dir submission after creating zip
So finally I’ve resolved that. Both solutions work for Windows, not work for MacOs (probably there is no way to zip dir without root itself), on Linux also works