Skip to content

Allow Evaluation Using Multiple Python Versions #158

Open
@HassanAbouelela

Description

@HassanAbouelela

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:

  1. The docker image will simply install whatever versions of python you pass to it in the build arg, to well defined locations
  2. We'll build two images in CI, one with all versions we want supported, and one lightweight for dev
  3. We can expose an endpoint to get all supported versions
  4. We should investigate the best way to install all the versions to the docker image. I imagine the best solution is to just start from an image with all the required build-tools, install all the python versions, and use that as the base for the image. I found this docker image which has all the versions from 2.3-3.9 installed, and it comes out to a whooping... 600 MBs! I don't think this specific project would work for us since it hasn't been updated since 3.9, but it does make the idea seem feasiable.
  5. Are the exposed packages going to be an issue, or can we simply install all the same versions to all python interpreters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendRelated to internal functionality and utilitiesstatus: planningDiscussing detailstype: featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions