From 13dd672a5c7b5ce40386eb22ab5474b7914b855d Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Thu, 9 Nov 2023 17:40:59 +0200 Subject: [PATCH] Update python to 3.12.0 and make updating Python easier --- .github/workflows/upload-python-alp-image.yml | 2 +- .github/workflows/upload-python-image.yml | 2 +- .github/workflows/upload-tmc-langs-rust-image.yml | 2 +- README.md | 5 +++++ env | 2 ++ python-alp/Dockerfile | 13 ++++++++++++- python/Dockerfile | 13 ++++++++++++- tmc-langs-rust/Dockerfile | 13 ++++++++++++- 8 files changed, 46 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upload-python-alp-image.yml b/.github/workflows/upload-python-alp-image.yml index 48a4495..ed0e308 100644 --- a/.github/workflows/upload-python-alp-image.yml +++ b/.github/workflows/upload-python-alp-image.yml @@ -40,7 +40,7 @@ jobs: run: | source ./env cd python-alp - docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-python-alp:$VERSION" --build-arg "RUST_CLI_URL=$RUST_CLI_URL" + docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-python-alp:$VERSION" --build-arg "RUST_CLI_URL=$RUST_CLI_URL" --build-arg "SANDBOX_PYTHON_VERSION=$SANDBOX_PYTHON_VERSION" cd .. - name: Pushing image run: | diff --git a/.github/workflows/upload-python-image.yml b/.github/workflows/upload-python-image.yml index 47c4727..4d5750c 100644 --- a/.github/workflows/upload-python-image.yml +++ b/.github/workflows/upload-python-image.yml @@ -40,7 +40,7 @@ jobs: run: | source ./env cd python - docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-python:$VERSION" --build-arg "RUST_CLI_URL=$RUST_CLI_URL" + docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-python:$VERSION" --build-arg "RUST_CLI_URL=$RUST_CLI_URL" --build-arg "SANDBOX_PYTHON_VERSION=$SANDBOX_PYTHON_VERSION" cd .. - name: Pushing image run: | diff --git a/.github/workflows/upload-tmc-langs-rust-image.yml b/.github/workflows/upload-tmc-langs-rust-image.yml index 6482c0d..f5d768a 100644 --- a/.github/workflows/upload-tmc-langs-rust-image.yml +++ b/.github/workflows/upload-tmc-langs-rust-image.yml @@ -40,7 +40,7 @@ jobs: run: | source ./env cd tmc-langs-rust - docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-tmc-langs-rust:$VERSION" --build-arg "RUST_CLI_URL=$RUST_CLI_URL" + docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-tmc-langs-rust:$VERSION" --build-arg "RUST_CLI_URL=$RUST_CLI_URL" --build-arg "SANDBOX_PYTHON_VERSION=$SANDBOX_PYTHON_VERSION" cd .. - name: Pushing image run: | diff --git a/README.md b/README.md index 588aac5..2d3d154 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,11 @@ The new version should have the `MINOR` version incremented. For example, if the Create a tag with the format `all-MAJOR.0` where the `MAJOR` is incremented by one from the current versions. +## Updating Python + +1. Change the `SANDBOX_PYTHON_VERSION` variable to a new version in the `env` file +2. Create a new tag(s) as instructed in the section above. + ## Updating tmc-langs-rust 1. Change the `RUST_CLI_VER` variable to a new version in the `env` file diff --git a/env b/env index 6d900b0..16158eb 100644 --- a/env +++ b/env @@ -3,3 +3,5 @@ RUST_CLI_VER=0.10.0.4 RUST_CLI_TAG=${RUST_CLI_NAME}:${RUST_CLI_VER} RUST_CLI_URL=https://download.mooc.fi/tmc-langs-rust/tmc-langs-cli-x86_64-unknown-linux-gnu-${RUST_CLI_VER} + +SANDBOX_PYTHON_VERSION=3.12.0 diff --git a/python-alp/Dockerfile b/python-alp/Dockerfile index f6fdcb4..6a046e4 100644 --- a/python-alp/Dockerfile +++ b/python-alp/Dockerfile @@ -3,6 +3,9 @@ FROM debian:buster ARG RUST_CLI_URL RUN test -n "$RUST_CLI_URL" +ARG SANDBOX_PYTHON_VERSION +RUN test -n "$SANDBOX_PYTHON_VERSION" + RUN \ apt update && \ # common utilities @@ -20,7 +23,15 @@ ENV LC_ALL en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 -RUN bash -c "mkdir -p /pythonbuild && cd /pythonbuild && wget https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz && tar -xzvf Python-3.9.10.tgz && cd Python-3.9.10/ && ./configure && make && make install" +RUN \ + bash -c "mkdir -p /pythonbuild && \ + cd /pythonbuild && \ + wget https://www.python.org/ftp/python/${SANDBOX_PYTHON_VERSION}/Python-${SANDBOX_PYTHON_VERSION}.tgz && \ + tar -xzvf Python-${SANDBOX_PYTHON_VERSION}.tgz && \ + cd Python-${SANDBOX_PYTHON_VERSION}/ && \ + ./configure && \ + make && \ + make install" COPY requirements.txt /requirements.txt diff --git a/python/Dockerfile b/python/Dockerfile index 476defb..afd683e 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -3,6 +3,9 @@ FROM debian:buster ARG RUST_CLI_URL RUN test -n "$RUST_CLI_URL" +ARG SANDBOX_PYTHON_VERSION +RUN test -n "$SANDBOX_PYTHON_VERSION" + RUN \ apt update && \ # common utilities @@ -20,7 +23,15 @@ ENV LC_ALL en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 -RUN bash -c "mkdir -p /pythonbuild && cd /pythonbuild && wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz && tar -xzvf Python-3.10.4.tgz && cd Python-3.10.4/ && ./configure && make && make install" +RUN \ + bash -c "mkdir -p /pythonbuild && \ + cd /pythonbuild && \ + wget https://www.python.org/ftp/python/${SANDBOX_PYTHON_VERSION}/Python-${SANDBOX_PYTHON_VERSION}.tgz && \ + tar -xzvf Python-${SANDBOX_PYTHON_VERSION}.tgz && \ + cd Python-${SANDBOX_PYTHON_VERSION}/ && \ + ./configure && \ + make && \ + make install" RUN \ pip3 install numpy scipy matplotlib scikit-learn scikit-image pandas seaborn lxml matplotlib statsmodels nbformat beautifulsoup4 pillow spacy pygame jupyter && \ diff --git a/tmc-langs-rust/Dockerfile b/tmc-langs-rust/Dockerfile index c539484..34e2e62 100644 --- a/tmc-langs-rust/Dockerfile +++ b/tmc-langs-rust/Dockerfile @@ -3,6 +3,9 @@ FROM debian:buster ARG RUST_CLI_URL RUN test -n "$RUST_CLI_URL" +ARG SANDBOX_PYTHON_VERSION +RUN test -n "$SANDBOX_PYTHON_VERSION" + RUN apt-get update && \ apt-get install -y makedev locales locales-all build-essential g++ nano procps xvfb iproute2 net-tools iputils-ping curl wget rsync libxrender-dev libxtst-dev check pkg-config valgrind libxslt-dev libxml2-dev libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion libffi-dev openssl libxrender-dev libxtst-dev xmlstarlet python2.7 python-pip python3-pip python-virtualenv maven ant python3-numpy python3-scipy python3-matplotlib python3-sklearn python3-skimage python3-tk moreutils python3-pandas libcurl4-openssl-dev libfreetype6 libfreetype6-dev libgl1-mesa-dev libfontconfig1-dev libx11-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev software-properties-common libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev zlib1g openjdk-11-jdk openjfx libdouble-conversion1 libxcb-xkb1 libxcb-render-util0 libxcb-xinerama0 libxcb-image0 libxcb-keysyms1 libxcb-icccm4 libxkbcommon-x11-0 libxcb-xkb1 zstd libbz2-dev @@ -13,7 +16,15 @@ ENV LC_ALL en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 -RUN bash -c "mkdir -p /pythonbuild && cd /pythonbuild && wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz && tar -xzvf Python-3.8.6.tgz && cd Python-3.8.6/ && ./configure && make && make install" +RUN \ + bash -c "mkdir -p /pythonbuild && \ + cd /pythonbuild && \ + wget https://www.python.org/ftp/python/${SANDBOX_PYTHON_VERSION}/Python-${SANDBOX_PYTHON_VERSION}.tgz && \ + tar -xzvf Python-${SANDBOX_PYTHON_VERSION}.tgz && \ + cd Python-${SANDBOX_PYTHON_VERSION}/ && \ + ./configure && \ + make && \ + make install" RUN mkdir -p /rbuild COPY installer1.sh /rbuild/