Skip to content

Commit cf5c824

Browse files
psaveryjourdain
authored andcommitted
ci(docker): use uv instead of pip
This allows the Python version to be selected in child images, so we are also able to eliminate Python versions in the build matrix. Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
1 parent a1e4432 commit cf5c824

File tree

5 files changed

+38
-54
lines changed

5 files changed

+38
-54
lines changed

.github/workflows/docker.yml

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
config:
14-
- ubuntu: 20.04
15-
python: 3.9
16-
label: 3.9
1714
- ubuntu: 22.04
18-
python: 3
19-
label: "3.10"
15+
python: 3.12
2016

2117
# Start a local registry to which we will push trame-common, so that
2218
# docker buildx may access it in later steps.
@@ -82,89 +78,71 @@ jobs:
8278
push: true
8379
tags: localhost:5000/trame-common-cuda-ubuntu${{ matrix.config.ubuntu }}
8480

85-
# --- NOT WORKING YET -----------------------------------------
86-
# - name: Build and push (py3.12-uv)
87-
# uses: docker/build-push-action@v2
88-
# with:
89-
# platforms: linux/amd64,linux/arm64
90-
# context: docker
91-
# file: docker/Dockerfile.uv
92-
# build-args: |
93-
# BASE_IMAGE=localhost:5000/trame-common-ubuntu22.04
94-
# PYTHON_VERSION=3.12
95-
# push: true
96-
# tags: |
97-
# kitware/trame:py3.12-uv
98-
# --- NOT WORKING YET -----------------------------------------
99-
100-
- name: Build and push (py${{ matrix.config.label }}-pip)
81+
- name: Build and push (uv)
10182
uses: docker/build-push-action@v2
10283
with:
10384
platforms: linux/amd64,linux/arm64
10485
context: docker
105-
file: docker/Dockerfile.pip
86+
file: docker/Dockerfile.uv
10687
build-args: |
10788
BASE_IMAGE=localhost:5000/trame-common-ubuntu${{ matrix.config.ubuntu }}
10889
PYTHON_VERSION=${{ matrix.config.python }}
10990
push: true
110-
tags: |
111-
kitware/trame:py${{ matrix.config.label }}
112-
kitware/trame:py${{ matrix.config.label }}-ubuntu${{ matrix.config.ubuntu }}
113-
kitware/trame:py${{ matrix.config.label }}-${{ env.MONTH_STAMP }}
91+
tags: kitware/trame:uv
11492

115-
- name: Build and push (pip py${{ matrix.config.label }}-glvnd)
93+
- name: Build and push (uv glvnd)
11694
uses: docker/build-push-action@v2
11795
with:
11896
context: docker
119-
file: docker/Dockerfile.pip
97+
file: docker/Dockerfile.uv
12098
build-args: |
12199
BASE_IMAGE=localhost:5000/trame-common-glvnd-ubuntu${{ matrix.config.ubuntu }}
122100
PYTHON_VERSION=${{ matrix.config.python }}
123101
push: true
124102
tags: |
125-
kitware/trame:py${{ matrix.config.label }}-glvnd
126-
kitware/trame:py${{ matrix.config.label }}-1.2-glvnd-runtime-ubuntu${{ matrix.config.ubuntu }}
127-
kitware/trame:py${{ matrix.config.label }}-glvnd-${{ env.MONTH_STAMP }}
103+
kitware/trame:uv-glvnd
104+
kitware/trame:uv-1.2-glvnd-runtime-ubuntu${{ matrix.config.ubuntu }}
105+
kitware/trame:uv-glvnd-${{ env.MONTH_STAMP }}
128106
129-
- name: Build and push (pip py${{ matrix.config.label }}-cuda)
107+
- name: Build and push (uv cuda)
130108
uses: docker/build-push-action@v2
131109
with:
132110
context: docker
133-
file: docker/Dockerfile.pip
111+
file: docker/Dockerfile.uv
134112
build-args: |
135113
BASE_IMAGE=localhost:5000/trame-common-cuda-ubuntu${{ matrix.config.ubuntu }}
136114
PYTHON_VERSION=${{ matrix.config.python }}
137115
push: true
138116
tags: |
139-
kitware/trame:py${{ matrix.config.label }}-cuda
140-
kitware/trame:py${{ matrix.config.label }}-12.2.0-cuda-runtime-ubuntu${{ matrix.config.ubuntu }}
141-
kitware/trame:py${{ matrix.config.label }}-cuda-${{ env.MONTH_STAMP }}
117+
kitware/trame:uv-cuda
118+
kitware/trame:uv-12.2.0-cuda-runtime-ubuntu${{ matrix.config.ubuntu }}
119+
kitware/trame:uv-cuda-${{ env.MONTH_STAMP }}
142120
143-
- name: Build and push (py${{ matrix.config.label }}-conda)
121+
- name: Build and push (conda)
144122
uses: docker/build-push-action@v2
145123
with:
146124
platforms: linux/amd64,linux/arm64
147125
context: docker
148126
file: docker/Dockerfile.conda
149127
build-args: |
150128
BASE_IMAGE=localhost:5000/trame-common-ubuntu${{ matrix.config.ubuntu }}
151-
PYTHON_VERSION=${{ matrix.config.label }}
129+
PYTHON_VERSION=${{ matrix.config.python }}
152130
push: true
153131
tags: |
154-
kitware/trame:py${{ matrix.config.label }}-conda
155-
kitware/trame:py${{ matrix.config.label }}-conda-ubuntu${{ matrix.config.ubuntu }}
156-
kitware/trame:py${{ matrix.config.label }}-conda-${{ env.MONTH_STAMP }}
132+
kitware/trame:conda
133+
kitware/trame:conda-ubuntu${{ matrix.config.ubuntu }}
134+
kitware/trame:conda-${{ env.MONTH_STAMP }}
157135
158-
- name: Build and push (py${{ matrix.config.label }}-conda-glvnd)
136+
- name: Build and push (conda-glvnd)
159137
uses: docker/build-push-action@v2
160138
with:
161139
context: docker
162140
file: docker/Dockerfile.conda
163141
build-args: |
164142
BASE_IMAGE=localhost:5000/trame-common-glvnd-ubuntu${{ matrix.config.ubuntu }}
165-
PYTHON_VERSION=${{ matrix.config.label }}
143+
PYTHON_VERSION=${{ matrix.config.python }}
166144
push: true
167145
tags: |
168-
kitware/trame:py${{ matrix.config.label }}-conda-glvnd
169-
kitware/trame:py${{ matrix.config.label }}-conda-1.2-glvnd-runtime-ubuntu${{ matrix.config.ubuntu }}
170-
kitware/trame:py${{ matrix.config.label }}-conda-glvnd-${{ env.MONTH_STAMP }}
146+
kitware/trame:conda-glvnd
147+
kitware/trame:conda-1.2-glvnd-runtime-ubuntu${{ matrix.config.ubuntu }}
148+
kitware/trame:conda-glvnd-${{ env.MONTH_STAMP }}

docker/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Trame Docker images are intended to be used for deploying multi-client Parav
44

55
The images include an Apache front-end that is able to serve static web content and manage WebSocket routing, a launcher for starting new processes, and a Python virtual environment containing the runtime requirements for the ParaviewWeb/Trame application.
66

7-
A few different flavors of the Trame Docker images exist, including pip, pip with glvnd (for nvidia runtimes), and conda.
7+
A few different flavors of the Trame Docker images exist, including uv, uv with glvnd (for nvidia runtimes), and conda.
88

99
An example of its usage can be found [here](https://github.com/Kitware/trame/tree/master/examples/deploy/docker/SingleFile). The `trame-cookiecutter` package [also contains an example](https://github.com/Kitware/trame-cookiecutter/tree/master/%7B%7Bcookiecutter.package_name%7D%7D/bundles/docker).
1010

@@ -30,7 +30,7 @@ In case you aim the trame application to read/write files on a mounted directory
3030

3131
- __TRAME_USER_DATA__
3232

33-
Path iniside docker for checking ownership and remapping that UID/GID to the unpriviledge trame-user within docker.
33+
Path iniside docker for checking ownership and remapping that UID/GID to the unpriviledge trame-user within docker.
3434

3535
- __TRAME_URL_PREFIX__
3636

@@ -73,7 +73,7 @@ This indicates that the app `trame-app` may also be accessed at the `/hello.html
7373
### requirements.txt (optional)
7474

7575
This file contains requirements that will be installed during setup.
76-
For pip, the file will be installed via `pip install -r requirements.txt`.
76+
For uv, the file will be installed via `uv pip install -r requirements.txt`.
7777
For conda, the file will be installed via `conda install -y --file requirements.txt`.
7878
This file may include the actual trame application itself.
7979

@@ -83,7 +83,7 @@ This file is optional. If present, it may be used to run additional commands tha
8383

8484
### www/ (optional)
8585

86-
This directory will be merged with the generated one at build time inside `/deploy/server/www`. Its content if overlapping existing files will override any previously generated one. This allow you to add or customize/replace specific files for your static file delivery.
86+
This directory will be merged with the generated one at build time inside `/deploy/server/www`. Its content if overlapping existing files will override any previously generated one. This allow you to add or customize/replace specific files for your static file delivery.
8787

8888
### The Build Command
8989

examples/deploy/docker/RenderingInfo/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM kitware/trame:py3.10-glvnd
1+
FROM kitware/trame:uv-glvnd
2+
3+
ENV TRAME_PYTHON=3.13
24

35
RUN apt-get update \
46
&& apt-get install -y \
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
FROM kitware/trame:py3.10
1+
FROM kitware/trame:uv
2+
3+
ENV TRAME_PYTHON=3.13
4+
ENV TRAME_CLIENT_TYPE=vue2
25

36
COPY --chown=trame-user:trame-user . /deploy
47

5-
ENV TRAME_CLIENT_TYPE=vue2
68
RUN /opt/trame/entrypoint.sh build

examples/deploy/docker/VtkRendering/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM kitware/trame:py3.10-glvnd
1+
FROM kitware/trame:uv-glvnd
2+
3+
ENV TRAME_PYTHON=3.13
24

35
RUN apt-get update \
46
&& apt-get install -y \

0 commit comments

Comments
 (0)