From 508cf74f98a3533a5ba36792984c8b362c1db33c Mon Sep 17 00:00:00 2001 From: Calvin Date: Thu, 9 Nov 2023 21:44:04 +0200 Subject: [PATCH 1/7] Added removal of unrequired files in order to free space --- .github/workflows/docker_build.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 99c14c6d..3f3374a3 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -37,7 +37,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2 + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: true + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: false + swap-storage: false - name: Login to Docker Hub uses: docker/login-action@v1 with: From 129fc0172de457d106f252adc3d8276c377da57a Mon Sep 17 00:00:00 2001 From: Calvin Date: Thu, 9 Nov 2023 21:44:30 +0200 Subject: [PATCH 2/7] Reworked cache ci to fix rms install --- .github/workflows/update-cache.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-cache.yml b/.github/workflows/update-cache.yml index ca6d1514..9e8b6cbc 100644 --- a/.github/workflows/update-cache.yml +++ b/.github/workflows/update-cache.yml @@ -87,6 +87,7 @@ jobs: run: | cd RMG-Py conda activate rmg_env + make clean make echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> $GITHUB_ENV echo "PATH=$(pwd):$PATH" >> $GITHUB_ENV @@ -113,13 +114,11 @@ jobs: ${{ runner.os }}-julia-${{ env.CACHE_NUMBER }}-rms - name: Install RMS Julia - run: julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main"));using ReactionMechanismSimulator' - - - name: Link Python-JL - run: | - ln -sfn $(which python-jl) $(which python) - cd .. - + run: julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master"));Pkg.build("PyCall");Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator;' + + - name: Install PyCall RMG_ENV + run: python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()" + - name: Install ARC run: | cd ARC From 25c41602ee3c1d3b5e73347d15a2451d8908dad5 Mon Sep 17 00:00:00 2001 From: Calvin Date: Thu, 9 Nov 2023 22:18:29 +0200 Subject: [PATCH 3/7] Adjusting the CI Check for Docker Build --- .github/workflows/docker_build.yml | 114 +++++++++++++++++------------ 1 file changed, 68 insertions(+), 46 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 3f3374a3..ccc6e625 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -5,73 +5,95 @@ on: - cron: "0 0 */7 * *" # every 7 days push: branches: - - main + - main pull_request: branches: - - main + - main paths: - - './Dockerfile' + - "./Dockerfile" jobs: ci-check: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: true + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: false + swap-storage: false - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4.1.1 # Add steps for CI checks of the Dockerfile + - name: Login to Docker Hub + uses: docker/login-action@v3.0.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.0.0 - name: Build RMG-Py - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5.0.0 with: context: . file: ./devtools/Dockerfile_rmgpy push: false + tags: ${{ secrets.DOCKERHUB_USERNAME }}/rmgpy:latest - name: Build T3 - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5.0.0 with: context: . file: ./Dockerfile push: false - + tags: ${{ secrets.DOCKERHUB_USERNAME }}/thetandemtool-t3:latest + build-and-push: if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: true - - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: false - swap-storage: false - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Build and push RMG-Py - uses: docker/build-push-action@v2 - with: - context: . - file: ./devtools/Dockerfile_rmgpy - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/rmgpy:latest - - name: Build and push T3 - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/thetandemtool-t3:latest - \ No newline at end of file + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: true + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: false + swap-storage: false + - name: Login to Docker Hub + uses: docker/login-action@v3.0.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.0.0 + - name: Build and push RMG-Py + uses: docker/build-push-action@v5.0.0 + with: + context: . + file: ./devtools/Dockerfile_rmgpy + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/rmgpy:latest + - name: Build and push T3 + uses: docker/build-push-action@v5.0.0 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/thetandemtool-t3:latest From dd498aca91d0c96be4570eadac98185d0bf3c34f Mon Sep 17 00:00:00 2001 From: Calvin Date: Thu, 9 Nov 2023 22:43:34 +0200 Subject: [PATCH 4/7] Adding PR types --- .github/workflows/docker_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index ccc6e625..71146aae 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -7,6 +7,7 @@ on: branches: - main pull_request: + types: [opened, synchronize, reopened] branches: - main paths: From b2256c8bb778618e4f44ac7f69b4b7fb53d4673b Mon Sep 17 00:00:00 2001 From: Calvin Date: Fri, 10 Nov 2023 21:33:22 +0200 Subject: [PATCH 5/7] Formatting Dockerfile and docker_build CI --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b9943e6d..815e6b91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,8 @@ # Using the a base image of rmgpy:latest from DockerHub - Not the official version but a custom version that is smaller in size FROM --platform=linux/amd64 laxzal/rmgpy:latest - USER rmguser - # Installing ARC # Change directory to Code WORKDIR /home/rmguser/Code From ab03b41f7243110fe8ea3b2bda310f2044e2c052 Mon Sep 17 00:00:00 2001 From: Calvin Date: Fri, 10 Nov 2023 21:33:45 +0200 Subject: [PATCH 6/7] Changing permissions to docker_build CI --- .github/workflows/docker_build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 71146aae..dc0692ac 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -1,5 +1,9 @@ name: Docker Image Build and Push +#Ensure that top-level permissions are not set to write-all +#https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions + + on: schedule: - cron: "0 0 */7 * *" # every 7 days @@ -12,6 +16,11 @@ on: - main paths: - "./Dockerfile" + +permissions: + contents: read + pull-requests: write + jobs: ci-check: if: github.event_name == 'pull_request' From da97d4ec00374ef0e8492b9df1ee92f260f39750 Mon Sep 17 00:00:00 2001 From: Calvin Date: Fri, 10 Nov 2023 21:59:34 +0200 Subject: [PATCH 7/7] Removed Cache RMS due to a package issue within RMS --- .github/workflows/cont_int.yml | 15 --------------- .github/workflows/update-cache.yml | 14 -------------- 2 files changed, 29 deletions(-) diff --git a/.github/workflows/cont_int.yml b/.github/workflows/cont_int.yml index e646e96d..ed861f8b 100644 --- a/.github/workflows/cont_int.yml +++ b/.github/workflows/cont_int.yml @@ -126,21 +126,6 @@ jobs: echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> ~/.bashrc echo "PATH=$(pwd):$PATH" >> ~/.bashrc echo "export rmgpy_path=$(pwd)" >> ~/.bashrc - - - - name: Cache RMS - id: cache-rms - uses: actions/cache@v2 - env: - CACHE_NUMBER: 0 - with: - path: | - /usr/share/miniconda3/envs/rmg_env/share/julia/artifacts/ - /usr/share/miniconda3/envs/rmg_env/share/julia/packages/ - /usr/share/miniconda3/envs/rmg_env/share/julia/registries/ - /usr/share/miniconda3/envs/rmg_env/share/julia/compiled/ - key: - ${{ runner.os }}-julia-${{ env.CACHE_NUMBER }}-rms - name: Install RMS Julia run: julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master"));Pkg.build("PyCall");Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator;' diff --git a/.github/workflows/update-cache.yml b/.github/workflows/update-cache.yml index 9e8b6cbc..51c2f0a8 100644 --- a/.github/workflows/update-cache.yml +++ b/.github/workflows/update-cache.yml @@ -99,20 +99,6 @@ jobs: - name: Install PyCall RMG_ENV run: python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()" - - name: Cache RMS - id: cache-rms - uses: actions/cache@v2 - env: - CACHE_NUMBER: 0 - with: - path: | - /usr/share/miniconda3/envs/rmg_env/share/julia/artifacts/ - /usr/share/miniconda3/envs/rmg_env/share/julia/packages/ - /usr/share/miniconda3/envs/rmg_env/share/julia/registries/ - /usr/share/miniconda3/envs/rmg_env/share/julia/compiled/ - key: - ${{ runner.os }}-julia-${{ env.CACHE_NUMBER }}-rms - - name: Install RMS Julia run: julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master"));Pkg.build("PyCall");Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator;'