From eee609853a28a01baa863682697d72f8a2a48bb4 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Tue, 24 Sep 2024 13:07:42 -0700 Subject: [PATCH 1/5] Install gtrieScanner. --- postBuild | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/postBuild b/postBuild index 1b6bcc9..b8f5745 100644 --- a/postBuild +++ b/postBuild @@ -1,5 +1,19 @@ #!/usr/bin/env bash +set -e + # installing chromium browser to enable webpdf conversion using nbconvert export PLAYWRIGHT_BROWSERS_PATH=${CONDA_DIR} playwright install chromium + +# As requested in slack. +# http://www.dcc.fc.up.pt/gtries/ +# https://github.com/ComplexNetworks-DCC-FCUP/gtrieScanner +cd /tmp +wget https://www.dcc.fc.up.pt/gtries/gtrieScanner_src_01.zip +unzip gtrieScanner_src_01.zip +cd gtrieScanner_src_01 +make +# CONDA_DIR is writable by our UID in postBuild. Ideally this would be +# in /usr/local/bin/. +install -m 0755 gtrieScanner ${CONDA_DIR}/bin/ From 4e732d106af6413da25c5f53360cf6094899210e Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Tue, 24 Sep 2024 13:28:38 -0700 Subject: [PATCH 2/5] Add repo2docker-action appendix. I chose the filename `Dockerfile.appendix` to reinforce the fact that the file should contain Dockerfile commands. There is also a convention for people to use filenames of the form `Dockerfile.dev`, `Dockerfile.prod`, etc. --- .github/workflows/build-push-image-commit.yaml | 1 + Dockerfile.appendix | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 Dockerfile.appendix diff --git a/.github/workflows/build-push-image-commit.yaml b/.github/workflows/build-push-image-commit.yaml index b998620..9823973 100644 --- a/.github/workflows/build-push-image-commit.yaml +++ b/.github/workflows/build-push-image-commit.yaml @@ -58,6 +58,7 @@ jobs: # so all contents put in /home/jovyan are lost. This particularly prevents any 'start' script from # working, as it is needed in runtime. REPO_DIR: /srv/repo + APPENDIX_FILE: Dockerfile.appendix # Lets us monitor disks getting full as images get bigger over time - name: Show how much disk space is left diff --git a/Dockerfile.appendix b/Dockerfile.appendix new file mode 100644 index 0000000..039d2b6 --- /dev/null +++ b/Dockerfile.appendix @@ -0,0 +1,2 @@ +USER root +RUN ls -ld /usr/local/bin/ From 1c7e5a2f138688a61aa53f37e593f1468ba9d539 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Tue, 24 Sep 2024 14:11:01 -0700 Subject: [PATCH 3/5] Try referencing APPENDEX_FILE in REPO_DIR. The action did not properly include the file, so let's try specifying the full path. --- .github/workflows/build-push-image-commit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push-image-commit.yaml b/.github/workflows/build-push-image-commit.yaml index 9823973..fd608d8 100644 --- a/.github/workflows/build-push-image-commit.yaml +++ b/.github/workflows/build-push-image-commit.yaml @@ -58,7 +58,7 @@ jobs: # so all contents put in /home/jovyan are lost. This particularly prevents any 'start' script from # working, as it is needed in runtime. REPO_DIR: /srv/repo - APPENDIX_FILE: Dockerfile.appendix + APPENDIX_FILE: /srv/repo/Dockerfile.appendix # Lets us monitor disks getting full as images get bigger over time - name: Show how much disk space is left From 9b20f6580ac475c7fb3e7454c0787a44f5138bb7 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Tue, 24 Sep 2024 14:20:08 -0700 Subject: [PATCH 4/5] Add APPENDEX_FILE to build-test-image.yaml. --- .github/workflows/build-push-image-commit.yaml | 2 +- .github/workflows/build-test-image.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-push-image-commit.yaml b/.github/workflows/build-push-image-commit.yaml index fd608d8..9823973 100644 --- a/.github/workflows/build-push-image-commit.yaml +++ b/.github/workflows/build-push-image-commit.yaml @@ -58,7 +58,7 @@ jobs: # so all contents put in /home/jovyan are lost. This particularly prevents any 'start' script from # working, as it is needed in runtime. REPO_DIR: /srv/repo - APPENDIX_FILE: /srv/repo/Dockerfile.appendix + APPENDIX_FILE: Dockerfile.appendix # Lets us monitor disks getting full as images get bigger over time - name: Show how much disk space is left diff --git a/.github/workflows/build-test-image.yaml b/.github/workflows/build-test-image.yaml index 097baa7..c10e0ec 100644 --- a/.github/workflows/build-test-image.yaml +++ b/.github/workflows/build-test-image.yaml @@ -43,6 +43,7 @@ jobs: FORCE_REPO2DOCKER_VERSION: jupyter-repo2docker==2024.07.0 REPO_DIR: /srv/repo NO_PUSH: true + APPENDIX_FILE: Dockerfile.appendix # Lets us monitor disks getting full as images get bigger over time - name: Show how much disk space is left From ddf4dbc8bf3a794e44b46ead2f126e3c856afef7 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Tue, 24 Sep 2024 14:41:12 -0700 Subject: [PATCH 5/5] Move gtrieScanner from postBuild to appendix. This writes out a binary to /usr/local/bin/. I think this is better than putting it in a conda path since it isn't a conda executable. The appendix is necessary since it can run as root. --- Dockerfile.appendix | 11 ++++++++++- postBuild | 12 ------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Dockerfile.appendix b/Dockerfile.appendix index 039d2b6..ebaadb4 100644 --- a/Dockerfile.appendix +++ b/Dockerfile.appendix @@ -1,2 +1,11 @@ USER root -RUN ls -ld /usr/local/bin/ + +# As requested in slack. +# http://www.dcc.fc.up.pt/gtries/ +# https://github.com/ComplexNetworks-DCC-FCUP/gtrieScanner +RUN wget -O /tmp/gtrieScanner.zip https://www.dcc.fc.up.pt/gtries/gtrieScanner_src_01.zip && \ + unzip -d /tmp /tmp/gtrieScanner.zip && \ + make -C /tmp/gtrieScanner_src_01 && \ + install -o root -g root -m 0755 /tmp/gtrieScanner_src_01/gtrieScanner /usr/local/bin/ + +USER $NB_USER diff --git a/postBuild b/postBuild index b8f5745..539a223 100644 --- a/postBuild +++ b/postBuild @@ -5,15 +5,3 @@ set -e # installing chromium browser to enable webpdf conversion using nbconvert export PLAYWRIGHT_BROWSERS_PATH=${CONDA_DIR} playwright install chromium - -# As requested in slack. -# http://www.dcc.fc.up.pt/gtries/ -# https://github.com/ComplexNetworks-DCC-FCUP/gtrieScanner -cd /tmp -wget https://www.dcc.fc.up.pt/gtries/gtrieScanner_src_01.zip -unzip gtrieScanner_src_01.zip -cd gtrieScanner_src_01 -make -# CONDA_DIR is writable by our UID in postBuild. Ideally this would be -# in /usr/local/bin/. -install -m 0755 gtrieScanner ${CONDA_DIR}/bin/