Skip to content

Commit

Permalink
Upgrade machine to support Python 3.9-3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
TaperChipmunk32 committed Oct 17, 2024
1 parent e0e3f08 commit 2532397
Show file tree
Hide file tree
Showing 12 changed files with 22,458 additions and 2,211 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"dockerfile": "./dockerfile"
},
"runArgs": [
"--gpus",
"all"
//"--gpus",
//"all"
],
"containerEnv": {
"AWS_REGION": "${localEnv:AWS_REGION}",
Expand Down
10 changes: 6 additions & 4 deletions .devcontainer/dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#compatability with Tensorflow 2.6.0 as per https://www.tensorflow.org/install/source#gpu
ARG PYTHON_VERSION=3.8
ARG UBUNTU_VERSION=focal
ARG PYTHON_VERSION=3.9
ARG UBUNTU_VERSION=noble
ARG POETRY_VERSION=1.6.1
ARG CUDA_VERSION=11.2.2-cudnn8-runtime-ubuntu20.04
ARG CUDA_VERSION=12.6.1-base-ubuntu24.04

FROM nvidia/cuda:$CUDA_VERSION
ARG PYTHON_VERSION
ARG POETRY_VERSION

ENV POETRY_VENV=/opt/poetry-venv
ENV PIP_DISABLE_PIP_VERSION_CHECK=on
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
Expand All @@ -33,7 +34,8 @@ RUN ln -sfn /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 & \
# Install python packages
RUN pip install -U pip setuptools \
&& pip install poetry==${POETRY_VERSION} black pipenv virtualenv clearml \
&& poetry config virtualenvs.in-project true
&& poetry config virtualenvs.in-project true \
&& pip install cffi

COPY ./.devcontainer/clearml.conf /root/clearml.conf

Expand Down
43 changes: 43 additions & 0 deletions .devcontainer/dockerfile-Python312
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#compatability with Tensorflow 2.6.0 as per https://www.tensorflow.org/install/source#gpu
ARG PYTHON_VERSION=3.12
ARG UBUNTU_VERSION=noble
ARG POETRY_VERSION=1.6.1
ARG CUDA_VERSION=12.6.1-base-ubuntu24.04

FROM nvidia/cuda:$CUDA_VERSION
ARG PYTHON_VERSION
ARG POETRY_VERSION

ENV POETRY_VENV=/opt/poetry-venv
ENV PIP_DISABLE_PIP_VERSION_CHECK=on
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && \
apt-get install --no-install-recommends -y software-properties-common && \
apt-get update && \
apt-get install --no-install-recommends -y \
python$PYTHON_VERSION \
python3-pip \
python3-venv \
git vim curl gdb ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \
libbz2-dev libreadline-dev libreadline6-dev libxml2-dev xz-utils libgdbm-dev libgdbm-compat-dev tk-dev dirmngr \
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev lzma lzma-dev uuid-dev && \
rm -rf /var/lib/apt/lists/*

# make some useful symlinks that are expected to exist
RUN ln -sfn /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 & \
ln -sfn /usr/bin/python${PYTHON_VERSION} /usr/bin/python

# Install poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
# Add `poetry` to PATH and configure
ENV PATH="${PATH}:${POETRY_VENV}/bin"
RUN poetry config virtualenvs.create true && \
poetry config virtualenvs.in-project true

COPY ./.devcontainer/clearml.conf /root/clearml.conf

CMD ["bash"]
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.9", "3.10", "3.12"]
defaults:
run:
shell: bash
Expand Down Expand Up @@ -71,11 +71,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
- name: Set up Python 3.9
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
Expand Down
Loading

0 comments on commit 2532397

Please sign in to comment.