Skip to content

Commit

Permalink
Merge pull request #30 from Heliozoa/master
Browse files Browse the repository at this point in the history
Update python to 3.12.0 and make updating Python easier
  • Loading branch information
Heliozoa authored Nov 9, 2023
2 parents fdc9c60 + 13dd672 commit f11eb93
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/upload-python-alp-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-python-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-tmc-langs-rust-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions env
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 12 additions & 1 deletion python-alp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
13 changes: 12 additions & 1 deletion python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 && \
Expand Down
13 changes: 12 additions & 1 deletion tmc-langs-rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/
Expand Down

0 comments on commit f11eb93

Please sign in to comment.