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

Install Multiple Python Versions in the Image #181

Merged
merged 7 commits into from
Aug 29, 2023

Commits on Aug 8, 2023

  1. Remove explicit package versions from Dockerfile

    It's using a stable version of Debian, so it's redundant to lock
    packages to specific versions.
    MarkKoz committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    fae8053 View commit details
    Browse the repository at this point in the history
  2. Use buildpack-deps as the builder base image

    Get some of the NsJail build dependencies pre-installed thanks to the
    base image.
    MarkKoz committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    9b3f23b View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2023

  1. Install multiple Python versions in image

    Separate snekbox's Python interpreter from the interpreter used by
    NsJail. This allows for the interpreters to be updated on different
    cadences and provides better isolation of packages.
    
    Each Python interpreter adds about 70 MB to the built image.
    MarkKoz committed Aug 20, 2023
    Configuration menu
    Copy the full SHA
    0db60fc View commit details
    Browse the repository at this point in the history
  2. Use --link with COPY in Dockerfile

    Re-use already built COPY layers in subsequent builds even if the
    previous layers have changed, which is especially helpful when copying
    from another build stage.
    
    See https://docs.docker.com/engine/reference/builder/#copy---link
    MarkKoz committed Aug 20, 2023
    Configuration menu
    Copy the full SHA
    a53e235 View commit details
    Browse the repository at this point in the history
  3. Remove leading empty strings from NsJail config args

    Prevent an empty exec_bin.args from manifesting as an empty string in
    the fully built arguments.
    MarkKoz committed Aug 20, 2023
    Configuration menu
    Copy the full SHA
    e423b7c View commit details
    Browse the repository at this point in the history
  4. Fix numpy install for test

    Need to use `export` to set vars when && is used between the commands.
    MarkKoz committed Aug 20, 2023
    Configuration menu
    Copy the full SHA
    0b0b0fd View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. Install eval dependencies with --user & ensure user base var is set

    Due to the way that `find` executes -exec arguments we need to
    run the pip install's inside another `sh` instance so that the
    PYTHONUSERBASE environment variable is correctly picked up.
    
    Additionally, we need to specify `--user` so that pip respects
    the PYTHONUSERBASE variable at all.
    jb3 committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    70d0e1a View commit details
    Browse the repository at this point in the history