Skip to content

Commit 40621ca

Browse files
authored
Merge pull request #426 from pyiron/mpie_cmti_standalone
make `mpie-cmti` standalone
2 parents 98c9c88 + 0ecf5ca commit 40621ca

File tree

5 files changed

+163
-34
lines changed

5 files changed

+163
-34
lines changed

.github/workflows/push.yml

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ jobs:
5656
tail --lines=+5 base/environment.yml >> experimental/environment.yml
5757
docker build -t pyiron/experimental:latest experimental/
5858
docker tag pyiron/experimental:latest pyiron/experimental:"$(date +%F)"
59-
- name: Build pyiron/mpie_cmti
60-
timeout-minutes: 5
61-
run: |
62-
tail --lines=+5 pyiron/environment.yml >> mpie_cmti/environment.yml
63-
docker build -t pyiron/mpie_cmti:latest mpie_cmti/
64-
docker tag pyiron/mpie_cmti:latest pyiron/mpie_cmti:"$(date +%F)"
6559
# Publish
6660
- run: docker images
6761
- run: docker push pyiron/base:latest
@@ -76,8 +70,6 @@ jobs:
7670
- run: docker push pyiron/experimental:"$(date +%F)"
7771
- run: docker push pyiron/continuum:latest
7872
- run: docker push pyiron/continuum:"$(date +%F)"
79-
- run: docker push pyiron/mpie_cmti:latest
80-
- run: docker push pyiron/mpie_cmti:"$(date +%F)"
8173
# Export Environments
8274
- run: mkdir -p environment; chmod 777 environment
8375
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/base /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_base_$(date +%F).yml;'
@@ -86,8 +78,56 @@ jobs:
8678
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/pyiron /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_pyiron_$(date +%F).yml;'
8779
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/potentialworkshop /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_potentialworkshop_$(date +%F).yml;'
8880
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/experimental /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_experimental_$(date +%F).yml;'
81+
- run: ls -al environment
82+
- name: cache
83+
uses: actions/cache/save@v4
84+
with:
85+
path: environment/*.yml
86+
key: all_env_${{ steps.date.outputs.date }}$
87+
build_cmti:
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v4
91+
- name: Get current date
92+
id: date
93+
run: echo "date=$(date +%F)" >> $GITHUB_OUTPUT
94+
- name: Build pyiron/mpie_cmti
95+
timeout-minutes: 5
96+
run: |
97+
tail --lines=+5 pyiron/environment.yml >> mpie_cmti/environment.yml
98+
docker build -t pyiron/mpie_cmti:latest mpie_cmti/
99+
docker tag pyiron/mpie_cmti:latest pyiron/mpie_cmti:"$(date +%F)"
100+
# Publish
101+
- run: docker images
102+
- run: docker push pyiron/mpie_cmti:latest
103+
- run: docker push pyiron/mpie_cmti:"$(date +%F)"
104+
# Export Environments
105+
- run: mkdir -p environment; chmod 777 environment
89106
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/mpie_cmti /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_mpie_cmti_$(date +%F).yml;'
90107
- run: ls -al environment
108+
- name: cache
109+
uses: actions/cache/save@v4
110+
with:
111+
path: environment/*.yml
112+
key: cmti_env_${{ steps.date.outputs.date }}$
113+
release:
114+
needs: [build, build_cmti]
115+
runs-on: ubuntu-latest
116+
steps:
117+
- run: ls -al environment
118+
- name: Get current date
119+
id: date
120+
run: echo "date=$(date +%F)" >> $GITHUB_OUTPUT
121+
- name: cache_cmti
122+
uses: actions/cache/restore@v4
123+
with:
124+
path: environment/*.yml
125+
key: cmti_env_${{ steps.date.outputs.date }}$
126+
- name: cache
127+
uses: actions/cache/restore@v4
128+
with:
129+
path: environment/*.yml
130+
key: all_env_${{ steps.date.outputs.date }}$
91131
- name: Release
92132
uses: softprops/action-gh-release@v1
93133
with:

.github/workflows/testing.yml

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
needs: [pip_check]
3636
runs-on: ubuntu-latest
3737
steps:
38+
- name: Get current date
39+
id: date
40+
run: echo "date=$(date +%F)" >> $GITHUB_OUTPUT
3841
- uses: actions/checkout@v4
3942
- name: Build pyiron/base
4043
timeout-minutes: 5
@@ -70,12 +73,6 @@ jobs:
7073
tail --lines=+5 base/environment.yml >> experimental/environment.yml
7174
docker build -t pyiron/experimental:latest experimental/
7275
docker tag pyiron/experimental:latest pyiron/experimental:"$(date +%F)"
73-
- name: Build pyiron/mpie_cmti
74-
timeout-minutes: 5
75-
run: |
76-
tail --lines=+5 pyiron/environment.yml >> mpie_cmti/environment.yml
77-
docker build -t pyiron/mpie_cmti:latest mpie_cmti/
78-
docker tag pyiron/mpie_cmti:latest pyiron/mpie_cmti:"$(date +%F)"
7976
# Testing
8077
- run: docker images
8178
#- name: Test pyiron/continuum
@@ -98,11 +95,53 @@ jobs:
9895
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/pyiron /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_pyiron_$(date +%F).yml;'
9996
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/potentialworkshop /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_potentialworkshop_$(date +%F).yml;'
10097
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/experimental /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/pyiron_experimental_$(date +%F).yml;'
98+
- name: cache
99+
uses: actions/cache/save@v4
100+
with:
101+
path: environment/*.yml
102+
key: all_env_-${{ steps.date.outputs.date }}
103+
build_cmti:
104+
needs: [pip_check]
105+
runs-on: ubuntu-latest
106+
steps:
107+
- name: Get current date
108+
id: date
109+
run: echo "date=$(date +%F)" >> $GITHUB_OUTPUT
110+
- uses: actions/checkout@v4
111+
- name: Build pyiron/mpie_cmti
112+
timeout-minutes: 15
113+
run: |
114+
docker build -t pyiron/mpie_cmti:latest mpie_cmti/
115+
docker tag pyiron/mpie_cmti:latest pyiron/mpie_cmti:"$(date +%F)"
116+
- run: docker images
117+
- run: mkdir -p environment; chmod 777 environment
101118
- run: docker run -v $(pwd)/environment:/home/jovyan/ --rm pyiron/mpie_cmti /bin/bash -c 'source /opt/conda/bin/activate; conda env export > /home/jovyan/mpie_cmti_$(date +%F).yml;'
119+
- name: cache
120+
uses: actions/cache/save@v4
121+
with:
122+
path: environment/*.yml
123+
key: cmti_env_-${{ steps.date.outputs.date }}
124+
check:
125+
needs: [build, build_cmti]
126+
runs-on: ubuntu-latest
127+
steps:
128+
- name: Get current date
129+
id: date
130+
run: echo "date=$(date +%F)" >> $GITHUB_OUTPUT
131+
- name: cache_cmti
132+
uses: actions/cache/restore@v4
133+
with:
134+
path: environment/*.yml
135+
key: cmti_env_-${{ steps.date.outputs.date }}
136+
- name: cache
137+
uses: actions/cache/restore@v4
138+
with:
139+
path: environment/*.yml
140+
key: all_env_-${{ steps.date.outputs.date }}
102141
- run: ls -al environment
103142

104143
autobot:
105-
needs: [build]
144+
needs: [build, build_cmti]
106145
permissions:
107146
contents: write
108147
pull-requests: write

mpie_cmti/Dockerfile

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,52 @@
1-
ARG ROOT_CONTAINER=pyiron/pyiron:latest
2-
ARG BASE_CONTAINER=$ROOT_CONTAINER
3-
FROM $BASE_CONTAINER
1+
ARG ROOT_IMAGE=jupyter/base-notebook:ubuntu-22.04@sha256:0ec801994602a53d3917d0f07ccf4474a1ddf5ae419483b24681a3c42abc4ce5 AS root_image
2+
FROM $ROOT_IMAGE
43

5-
MAINTAINER Jan Janssen <janssen@mpie.de>
4+
MAINTAINER Jan Janssen <janssen@mpie.de>, Marian Bruns <m.bruns@mpie.de>
65

7-
USER $DOCKER_UID
8-
WORKDIR $HOME
6+
ARG DOCKER_UID="1000"
7+
ARG DOCKER_GID="100"
8+
9+
# Configure environment
10+
ENV CONDA_DIR=/opt/conda \
11+
SHELL=/bin/bash \
12+
LC_ALL=en_US.UTF-8 \
13+
LANG=en_US.UTF-8 \
14+
LANGUAGE=en_US.UTF-8 \
15+
DOCKER_UID=$DOCKER_UID \
16+
DOCKER_GID=$DOCKER_GID \
17+
HOME=/home/$NB_USER \
18+
OMPI_MCA_plm=isolated \
19+
OMPI_MCA_rmaps_base_oversubscribe=yes \
20+
OMPI_MCA_btl_vader_single_copy_mechanism=none
21+
22+
# apt installation as root
23+
USER root
24+
25+
# copy list of apt packages to be installed
26+
COPY apt.txt /tmp/
27+
28+
# install the packages and clean up
29+
RUN apt-get update -y &&\
30+
xargs -a /tmp/apt.txt apt-get install -y &&\
31+
apt-get clean &&\
32+
rm /tmp/apt.txt
33+
34+
# install conda packages as $DOCKER_USER
35+
USER ${DOCKER_UID}
36+
WORKDIR ${HOME}
937
ARG PYTHON_VERSION=default
1038

1139
COPY . ${HOME}/
1240
RUN mamba env update -n base -f ${HOME}/environment.yml && \
1341
mamba clean --all -f -y && \
1442
mamba list
1543

44+
# Fix permissions on /etc/jupyter as root
45+
USER root
46+
RUN fix-permissions /etc/jupyter/ &&\
47+
fix-permissions ${HOME} && \
48+
fix-permissions ${CONDA_DIR}
49+
50+
# switch back to DOCKER_USER
51+
USER $DOCKER_UID
1652
WORKDIR $HOME

mpie_cmti/apt.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
libgl1-mesa-glx
2+
patch

mpie_cmti/environment.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,42 @@ dependencies:
55
- aimsgb =1.1.1
66
- atomicrex =1.0.4
77
- bader =1.0.5
8+
- bokeh =3.6.3
89
- calphy =1.3.13
910
- fitsnap3 =3.1.0.4
11+
- flux-core =0.64.0
12+
- git =2.46.0
13+
- gpaw =24.6.0=*openmpi*
14+
- jupyter-server-proxy =4.4.0
15+
- jupyterhub =5.2.1
16+
- lammps =2023.08.02=*openmpi*
17+
- llama-index =0.12.19
18+
- matgl =1.1.2
19+
- maxvolpy =0.3.8
1020
- nbgitpuller =1.2.2
21+
- netcdf4 =1.7.1
22+
- nglview =3.1.4
23+
- mkl =2023.2.0
24+
- mlip =2.0
25+
- numba =0.60.0
26+
- openkim-models =2021.01.28
27+
- psycopg2 =2.9.9
28+
- pyiron =0.5.2
29+
- pyiron-data =0.0.30
30+
- pyiron_atomistics =0.6.23
31+
- pyiron_base =0.11.1
1132
- pyiron_contrib =0.1.18
1233
- pyiron_potentialfit =0.3.8
1334
- pyiron_workflow =0.12.0
1435
- pyiron_gui =0.0.12
15-
- pyironflow =0.0.9
16-
- matgl =1.1.2
17-
- mlip =2.0
18-
- sqsgenerator =0.3
1936
- pyiron_gpl =0.0.5
37+
- pyironflow =0.0.9
2038
- python-ace =0.3.0
2139
- pytorch =2.1.2
2240
- pyxtal =1.0.6
2341
- runner =1.3
42+
- sphinxdft =3.1
43+
- sqsgenerator =0.3
2444
- structdbrest =0.0.1
2545
- tensorflow =2.17.0
26-
- psycopg2 =2.9.9
27-
- numba =0.60.0
28-
- llama-index =0.12.19
29-
- jupyter-server-proxy =4.4.0
30-
- jupyterhub =5.2.1
31-
- flux-core =0.64.0
32-
- netcdf4 =1.7.1
33-
- maxvolpy =0.3.8
34-
- bokeh =3.6.3
46+

0 commit comments

Comments
 (0)