Skip to content

Commit 962f576

Browse files
committed
Revive Docker container
1 parent 0980763 commit 962f576

File tree

4 files changed

+69
-78
lines changed

4 files changed

+69
-78
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

.github/workflows/Tests.yaml

+36-36
Original file line numberDiff line numberDiff line change
@@ -62,39 +62,39 @@ jobs:
6262
# run: >
6363
# gwrender.py waveform $GITHUB_WORKSPACE/Examples/Rainbow/Rainbow.yaml
6464
# --time-merger 5064 --mass 150 -o ./ -v
65-
# deploy-container:
66-
# name: Deploy container
67-
# needs: tests
68-
# runs-on: ubuntu-latest
69-
# steps:
70-
# - uses: actions/checkout@v3
71-
# - uses: docker/build-push-action@v1
72-
# with:
73-
# dockerfile: containers/Dockerfile
74-
# username: ${{ secrets.DOCKER_USERNAME }}
75-
# password: ${{ secrets.DOCKER_PASSWORD }}
76-
# repository: nilsleiffischer/gwpv
77-
# tag_with_ref: true
78-
# cache_froms: nilsleiffischer/gwpv:latest-dev,nilsleiffischer/gwpv:latest
79-
# always_pull: true
80-
# examples:
81-
# name: Examples
82-
# needs: deploy-container
83-
# runs-on: ubuntu-latest
84-
# steps:
85-
# # Note that the container must run as the user `root` to be able to write
86-
# # to the $GITHUB_WORKSPACE directory:
87-
# # https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#docker-container-filesystem
88-
# - name: Rainbow still
89-
# run: >
90-
# docker run -v $PWD:/out nilsleiffischer/gwpv:latest
91-
# scene Examples/Rainbow/Still.yaml -o /out/Still
92-
# - name: Rainbow movie
93-
# run: >
94-
# docker run -v $PWD:/out nilsleiffischer/gwpv:latest
95-
# scene Examples/Rainbow/Rainbow.yaml
96-
# --render-movie-to-file /out/Rainbow --num-jobs 2
97-
# - name: Rainbow scenes
98-
# run: >
99-
# docker run -v $PWD:/out nilsleiffischer/gwpv:latest
100-
# scenes Examples/Rainbow/Scenes.yaml -o /out/Scenes --num-jobs 2
65+
deploy-container:
66+
name: Deploy container
67+
needs: tests
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v3
71+
- uses: docker/build-push-action@v1
72+
with:
73+
dockerfile: containers/Dockerfile
74+
username: ${{ secrets.DOCKER_USERNAME }}
75+
password: ${{ secrets.DOCKER_PASSWORD }}
76+
repository: nilsleiffischer/gwpv
77+
tag_with_ref: true
78+
cache_froms: nilsleiffischer/gwpv:latest-dev,nilsleiffischer/gwpv:latest
79+
always_pull: true
80+
examples:
81+
name: Examples
82+
needs: deploy-container
83+
runs-on: ubuntu-latest
84+
steps:
85+
# Note that the container must run as the user `root` to be able to write
86+
# to the $GITHUB_WORKSPACE directory:
87+
# https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#docker-container-filesystem
88+
- name: Rainbow still
89+
run: >
90+
docker run -v $PWD:/out nilsleiffischer/gwpv:latest
91+
scene Examples/Rainbow/Still.yaml -o /out/Still
92+
- name: Rainbow movie
93+
run: >
94+
docker run -v $PWD:/out nilsleiffischer/gwpv:latest
95+
scene Examples/Rainbow/Rainbow.yaml
96+
--render-movie-to-file /out/Rainbow --num-jobs 2
97+
- name: Rainbow scenes
98+
run: >
99+
docker run -v $PWD:/out nilsleiffischer/gwpv:latest
100+
scenes Examples/Rainbow/Scenes.yaml -o /out/Scenes --num-jobs 2

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ to make your scene configuration files and data available in the container (see
5252

5353
### Option 2: Native environment
5454

55-
1. Install [ParaView (v5.10 or above)](https://www.paraview.org/download/). Make
56-
sure to install a version with Python 3.
55+
1. Install ParaView (v5.10 or above). You can
56+
[download a pre-built binary](https://www.paraview.org/download/)
57+
or use [Spack](https://spack.readthedocs.io/en/latest/) to configure a build
58+
to your liking and compile it from source. Make sure to install ParaView with
59+
support for Python 3.
5760
2. Create a [virtual environment](https://docs.python.org/3/tutorial/venv.html)
58-
with ParaView's Python. With Python 3 you could do this:
61+
with ParaView's Python. You could do this:
5962
```sh
6063
path/to/python3 -m venv path/to/new/env
6164
```
@@ -72,7 +75,7 @@ to make your scene configuration files and data available in the container (see
7275
`/Applications/ParaView-X.Y.Z.app/Contents/bin`. The Python executable
7376
determined by the script above may be named `vtkpython`, in which case you
7477
can look for the `python3` executable in the same directory or a `bin`
75-
subdirectory. If you can't find ParaView's Python executable, try using any
78+
subdirectory. If you can't find ParaView's Python executable, try using a
7679
Python installation with the same version as ParaView's.
7780
3. Give ParaView access to the environment. If you have created the environment
7881
with Python 3's `venv` then copy the `scripts/activate_this.py` script to the

containers/Dockerfile

+25-38
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,42 @@
1-
FROM kitware/paraview:pv-v5.8.0-osmesa-py3 AS dev
1+
FROM ubuntu:latest AS dev
22
USER root
33

4-
WORKDIR /root
5-
6-
RUN apt-get update && apt-get install -y git wget ffmpeg
7-
8-
# Install the same HDF5 version that Paraview uses so we can build h5py with it
9-
RUN apt-get update && apt-get install -y g++ \
10-
&& wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/hdf5-1.10.5.tar.bz2 -O hdf5.tar.bz2 \
11-
&& tar jxf hdf5.tar.bz2 && rm hdf5.tar.bz2 && mv hdf5* hdf5 && cd hdf5 \
12-
&& ./configure --prefix=/opt/hdf5 && make -j && make install && cd .. \
13-
&& rm -r hdf5
14-
15-
# Install pip
16-
RUN wget https://bootstrap.pypa.io/get-pip.py \
17-
&& python get-pip.py \
18-
&& rm get-pip.py
4+
ENV DEBIAN_FRONTEND=noninteractive
195

20-
# Create a Python environment so our manually-installed versions of the Python
21-
# packages take precedence over the ParaView-bundled versions.
22-
# By setting `VIRTUAL_ENV` and `PATH` we essentially activate the environment.
23-
ENV VIRTUAL_ENV /opt/envs/gwpv
24-
RUN apt-get update && apt-get install -y python3-venv \
25-
&& python -m venv $VIRTUAL_ENV
26-
COPY scripts/activate_this.py /opt/envs/gwpv/bin
27-
ENV PATH $VIRTUAL_ENV/bin:$PATH
28-
29-
# Install h5py using the manually-installed HDF5.
30-
# Work around https://github.com/h5py/h5py/issues/1533 by installing from
31-
# master.
32-
RUN git clone https://github.com/h5py/h5py /opt/h5py && cd /opt/h5py \
33-
&& python setup.py configure --hdf5=/opt/hdf5 \
34-
&& python setup.py install && cd /root
35-
36-
# Install remaining Python dependencies
37-
RUN pip install numpy scipy spherical_functions numba pyyaml tqdm astropy \
38-
matplotlib requests
6+
WORKDIR /root
397

40-
# Make ParaView available in PATH
41-
ENV PATH /opt/paraview/bin:$PATH
8+
RUN apt-get -yqq update \
9+
&& apt-get -yqq upgrade \
10+
&& apt-get -yqq install --no-install-recommends \
11+
curl \
12+
ffmpeg \
13+
git \
14+
python3 \
15+
python3-pip \
16+
python-is-python3 \
17+
wget \
18+
&& apt-get clean
19+
20+
# Install ParaView
21+
RUN wget -O paraview.tar.gz --no-check-certificate "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v5.10&type=binary&os=Linux&downloadFile=ParaView-5.10.1-osmesa-MPI-Linux-Python3.9-x86_64.tar.gz" \
22+
&& tar -xzf paraview.tar.gz \
23+
&& rm paraview.tar.gz \
24+
&& mv ParaView-* /opt/paraview
25+
26+
ENV PYTHONPATH="/usr/local/lib/python3.10/dist-packages:/opt/paraview/lib/python3.9/site-packages" \
27+
PATH="/opt/paraview/bin:$PATH"
4228

4329
# Provide the pre-installed application as another build stage
4430
FROM dev AS install
31+
WORKDIR /opt/gwpv
4532
COPY setup.py ./
4633
COPY README.md ./
4734
COPY gwpv ./gwpv
4835
COPY scripts/gwrender.py ./scripts/gwrender.py
4936
COPY paraview_plugins ./paraview_plugins
5037
COPY scene_overrides ./scene_overrides
5138
RUN pip install .
52-
WORKDIR /home/pv-user
39+
WORKDIR /root
5340
COPY Examples/ ./Examples
5441

5542
# Provide access to the pre-installed application

0 commit comments

Comments
 (0)