Skip to content

Commit

Permalink
Add Python3.9
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
Jacob Woffenden authored Jun 6, 2024
1 parent c4ced8d commit 2f27073
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ apt-get install --yes \
"mandoc=1.14.6-1" \
"python3.12=3.12.3-1" \
"python3-pip=24.0+dfsg-1ubuntu1" \
"software-properties-common=0.99.48" \
"unzip=6.0-28ubuntu4"

apt-get clean --yes
Expand Down Expand Up @@ -181,6 +182,19 @@ install --owner=root --group=root --mode=775 ollama /usr/local/bin/ollama
rm --force ollama
EOF

# Python 3.9 (Provides compatability with JupyterLab)
RUN <<EOF
add-apt-repository --yes ppa:deadsnakes/ppa

apt-get update --yes

apt-get install --yes "python3.9=3.9.19-1+noble2"

apt-get clean --yes

rm --force --recursive /var/lib/apt/lists/*
EOF

USER ${CONTAINER_USER}
WORKDIR /home/${CONTAINER_USER}
EXPOSE 8080
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Additionally the following tools are installed:
- [Miniconda](https://docs.anaconda.com/free/miniconda/index.html)
- [.NET SDK](https://learn.microsoft.com/en-us/dotnet/core/sdk)
- [Ollama](https://ollama.com/)
- [Python 3.9.19](https://www.python.org/downloads/release/python-3919/) (To provide compatability with Analytical Platform JupyterLab)

## Running Locally

Expand Down Expand Up @@ -142,5 +143,22 @@ Ollama don't currently provide SHA256 checksum for their installation file. For
curl --location --fail-with-body "https://github.com/ollama/ollama/releases/download/$(curl --silent https://api.github.com/repos/ollama/ollama/releases/latest | jq -r .tag_name)/ollama-linux-amd64" | sha256sum
```

### Python 3.9

The latest version of Python 3.9 can be obtained by running:

```bash
docker run -it --rm --platform linux/amd64 public.ecr.aws/ubuntu/ubuntu:24.04

export DEBIAN_FRONTEND="noninteractive"

apt-get update --yes

apt-get install --yes software-properties-common

add-apt-repository --yes ppa:deadsnakes/ppa

apt-get update --yes

apt-cache policy python3.9
```
10 changes: 10 additions & 0 deletions test/container-structure-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ commandTests:
args: ["info"]
expectedOutput: [".*active environment.*"]

- name: "python3.12"
command: "python3"
args: ["--version"]
expectedOutput: ["Python 3.12.*"]

- name: "python3.9"
command: "python3.9"
args: ["--version"]
expectedOutput: ["Python 3.9.*"]

- name: "pip"
command: "pip"
args: ["--version"]
Expand Down

0 comments on commit 2f27073

Please sign in to comment.