-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Allow Evaluation Using Multiple Python Versions #158
Comments
I think it would be a nice idea to be able to have different packages installed. Any c-extension could compile differently based on the targeted python version, so it would be nice to have different versions. |
This is until snekbox supports multi-version natively python-discord/snekbox#158
A breaking change was made to snekbox, and we decided to not backport the change to a 3.10 container. Instead we have opted to support multiple Python versions within snekbox natively. python-discord/snekbox#158
A breaking change was made to snekbox, and we decided to not backport the change to a 3.10 container. Instead we have opted to support multiple Python versions within snekbox natively. python-discord/snekbox#158
With python-discord/bot#2618 there will only be 1 snekbox container, that runs the latest verison of snekbox. Supporting multiple versions of snekbox will be covered by python-discord/snekbox#158 where a single instance of snekbox will nativly support multiple Python verisons.
With python-discord/bot#2618 there will only be 1 snekbox container, that runs the latest verison of snekbox. Supporting multiple versions of snekbox will be covered by python-discord/snekbox#158 where a single instance of snekbox will nativly support multiple Python verisons.
With python-discord/bot#2618 there will only be 1 snekbox container, that runs the latest verison of snekbox. Supporting multiple versions of snekbox will be covered by python-discord/snekbox#158 where a single instance of snekbox will nativly support multiple Python verisons.
* Temporarily remove suport for evaling under 3.10 This is until snekbox supports multi-version natively python-discord/snekbox#158 * Remove special case 3.11 snekbox container 3.11 is the default in snekbox:latest now, so no need to have a special container. This also removes all notion of there being diferent containers for different snekbox versions
The snekbox Dockerfile now installs both 3.12.0 and 3.13-dev to Now we need to update snekbox's API to support multiple versions. A new endpoint
|
@ChrisLovering This was essentially the approach taken in #175, which has some discussion. I think it is better to accept an arbitrary path to a binary to execute. I'm hesitant to make design decisions that pigeon-hole snekbox into just a Python evaluator or just a code evaluator in general. Technically there is not much difference between that and sandboxing arbitrary binaries. On the other hand, that is the common use case, so we can compromise here. I don't see a strong need for exposing versions via an API, but if we were to do it, I think it should return the paths to the binaries, so they can be passed to the eval endpoint. |
Description
Install multiple python versions within the container, and add an option in the API to select between them.
Rationale
Currently, the bot supports evaluation of both 3.10 and 3.11 code, something I think should be kept and expanded in the future (to include major/important python versions). This is achieved by using the latest 3.10 image published here. This is fine for now, but it makes it harder to provide feature parity and avoid issues when users switch between modes, and it makes it difficult to patch and fix security issues.
Implementation
The way I see us doing this is by building all the versions of python we want to support directly into the image, then aiming the jail at the right executable. This would simplify implementation by having one server, with one codebase, while allowing us to evaluate user code on any version.
Specifics
Some more specific implementation details that can be up for debate:
The text was updated successfully, but these errors were encountered: