Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve instructions for dev env #86

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

JasonGrace2282
Copy link
Member

Just a bunch of patches and stuff I had to do to get local submissions working.
It also improves the documentation, and adds a script or two.

@JasonGrace2282 JasonGrace2282 added the maintenance Dependencies, deprecation warnings, etc. label Sep 10, 2024
@JasonGrace2282 JasonGrace2282 self-assigned this Sep 10, 2024
@JasonGrace2282 JasonGrace2282 requested a review from a team as a code owner September 10, 2024 23:28
@@ -65,8 +66,8 @@ def run_submission(submission_id):
if submission.assignment.venv_fully_created:
python_exe = os.path.join(submission.assignment.venv.path, "bin", "python")
elif settings.DEBUG:
python_exe = shutil.which("python") or shutil.which("python3")
else:
python_exe = sys.executable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart!

@JasonGrace2282 JasonGrace2282 changed the title Bugfixes to get a working dev env Improve instructions for dev env Sep 12, 2024
selsayed25
selsayed25 previously approved these changes Oct 7, 2024
Copy link
Member

@selsayed25 selsayed25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The improvements to the documentation and setup scripts are very helpful. These changes look good to me!

docs/source/contributing/setup.rst Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused on what this file's purpose is. I'm pretty sure that even without access to the sandboxing submodule, sandboxing code in the module here takes care of everything that's necessary (and you wouldn't need to define these redundant-looking wrappers..?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a while since I wrote this so I'll have to double check, but if I'm remembering correctly it has something to do with this reading from those wrappers to create a submission wrapper, which is passed to the grader here.
I'll try it without the wrappers tomorrow :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried without the wrappers and I got this error
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, you're right, I forgot about my lazy implementation (re: here if anyone's curious).

I still think the way you're getting around this is unideal - I think it would be better to edit the code itself to work without a sandboxing module, as opposed to "emulating" one yourself with a script.

Editing the run_submission code should be quite feasible (even good-first-issue level, almost) and would be the right way to go forward (correct me if I'm wrong). But I'd be happy to merge this in for now as a temporary workaround, so we don't hold back development. Let me know what you think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just committed a change that voids the need for the script. If you think it's too big of a change for this PR, I'd be happy to move it to a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this is a great change! I've had the idea for a while but never got the time, so I'm glad it's finally happening.

This wrapper will only take effect if DEBUG
is False and the sandboxing submodule isn't
cloned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Dependencies, deprecation warnings, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants