From 387fc25deefffc0fd7685707cf13a8e536cb846a Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 8 Jul 2021 09:50:09 +0100 Subject: [PATCH 1/5] moved to sequential docker building --- .github/workflows/docker_publish.yml | 186 +++++++++++++++++++++------ 1 file changed, 148 insertions(+), 38 deletions(-) diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index 57bbe87945..e4c5f2336f 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -2,36 +2,56 @@ on: push: paths: - 'CI/*' + - '.github/workflows/docker_publish.yml' jobs: - build-and-push-image: + + build_and_push_housekeeping: runs-on: ubuntu-latest + strategy: + matrix: + ubuntu_versions : [ + 16.04, + 18.04, + ] + + steps: + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - env: - hdf5_versions: 1.10.4 - hdf5_build_dir: hdf5_build_dir + - name: Build and push housekeeping + uses: docker/build-push-action@v2 + with: + file: CI/Dockerfile_1_housekeeping + context: . + push: true + build-args: | + UBUNTU_VERSION=${{ matrix.ubuntu_versions }} + tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping + + build_and_push_base: + runs-on: ubuntu-latest strategy: matrix: - ubuntu_versions : [ + ubuntu_versions : [ 16.04, 18.04, - ] - compiler : [ - gcc, - clang, - ] - hdf5_versions : [ - 1.10.4, - ] - moab_versions : [ - 9c96d17, - develop, - master, - ] - + ] steps: + - name: Checkout repository uses: actions/checkout@v2 @@ -45,7 +65,7 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Dockerfile_0_base + - name: Build and push base uses: docker/build-push-action@v2 with: file: CI/Dockerfile_0_base @@ -53,9 +73,39 @@ jobs: push: true build-args: | UBUNTU_VERSION=${{ matrix.ubuntu_versions }} - tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }} + tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }} + + + build_and_push_external_deps: + runs-on: ubuntu-latest + needs: build_and_push_base + strategy: + matrix: + ubuntu_versions : [ + 16.04, + 18.04, + ] + compiler : [ + gcc, + clang, + ] + + steps: + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Dockerfile_1_external_deps + - name: Build and push external_deps uses: docker/build-push-action@v2 with: file: CI/Dockerfile_1_external_deps @@ -64,9 +114,42 @@ jobs: build-args: | UBUNTU_VERSION=${{ matrix.ubuntu_versions }} COMPILER=${{ matrix.compiler }} - tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext + tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext - - name: Build and push Dockerfile_2_hdf5 + + build_and_push_hdf5: + runs-on: ubuntu-latest + needs: build_and_push_external_deps + strategy: + matrix: + ubuntu_versions : [ + 16.04, + 18.04, + ] + compiler : [ + gcc, + clang, + ] + hdf5_versions : [ + 1.10.4, + ] + + steps: + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push hdf5 uses: docker/build-push-action@v2 with: file: CI/Dockerfile_2_hdf5 @@ -76,9 +159,47 @@ jobs: UBUNTU_VERSION=${{ matrix.ubuntu_versions }} COMPILER=${{ matrix.compiler }} HDF5=${{ matrix.hdf5_versions }} - tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}} + tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}} + + + build_and_push_moab: + runs-on: ubuntu-latest + needs: build_and_push_hdf5 + strategy: + matrix: + ubuntu_versions : [ + 16.04, + 18.04, + ] + compiler : [ + gcc, + clang, + ] + hdf5_versions : [ + 1.10.4, + ] + moab_versions : [ + 9c96d17, + develop, + master, + ] + + steps: + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Dockerfile_3_moab + - name: Build and push moab uses: docker/build-push-action@v2 with: file: CI/Dockerfile_3_moab @@ -89,15 +210,4 @@ jobs: COMPILER=${{ matrix.compiler }} HDF5=${{ matrix.hdf5_versions }} MOAB=${{ matrix.moab_versions }} - tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }} - - - name: Build and push Dockerfile_1_housekeeping - uses: docker/build-push-action@v2 - with: - file: CI/Dockerfile_1_housekeeping - context: . - push: true - build-args: | - UBUNTU_VERSION=${{ matrix.ubuntu_versions }} - tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping - \ No newline at end of file + tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }} From ba3aca341e20d26ed00daa6d9ed13f886907259c Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 8 Jul 2021 09:59:56 +0100 Subject: [PATCH 2/5] added news file --- news/PR-0748.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 news/PR-0748.rst diff --git a/news/PR-0748.rst b/news/PR-0748.rst new file mode 100644 index 0000000000..86d1e80be7 --- /dev/null +++ b/news/PR-0748.rst @@ -0,0 +1,15 @@ +**Added:** None + + - Improved GitHub Action to build and upload Docker images. + +**Changed:** + + - Sequential building of Dockerimages + +**Deprecated:** None + +**Removed:** None + +**Fixed:** None + +**Security:** None From ca7a4ba418b873ce34c11c7c0e35a70f0f754e6e Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 8 Jul 2021 10:02:16 +0100 Subject: [PATCH 3/5] renamed from test fork repo to main repo --- .github/workflows/docker_publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index e4c5f2336f..2edf67f956 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -38,7 +38,7 @@ jobs: push: true build-args: | UBUNTU_VERSION=${{ matrix.ubuntu_versions }} - tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping + tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-housekeeping build_and_push_base: @@ -73,7 +73,7 @@ jobs: push: true build-args: | UBUNTU_VERSION=${{ matrix.ubuntu_versions }} - tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }} + tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }} build_and_push_external_deps: @@ -114,7 +114,7 @@ jobs: build-args: | UBUNTU_VERSION=${{ matrix.ubuntu_versions }} COMPILER=${{ matrix.compiler }} - tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext + tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext build_and_push_hdf5: @@ -159,7 +159,7 @@ jobs: UBUNTU_VERSION=${{ matrix.ubuntu_versions }} COMPILER=${{ matrix.compiler }} HDF5=${{ matrix.hdf5_versions }} - tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}} + tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}} build_and_push_moab: @@ -210,4 +210,4 @@ jobs: COMPILER=${{ matrix.compiler }} HDF5=${{ matrix.hdf5_versions }} MOAB=${{ matrix.moab_versions }} - tags: ghcr.io/shimwell/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }} + tags: ghcr.io/svalinn/dagmc-ci-ubuntu-${{ matrix.ubuntu_versions }}-${{ matrix.compiler}}-ext-hdf5_${{ matrix.hdf5_versions}}-moab_${{ matrix.moab_versions }} From de2ad1aa87d9d69605d22623afea2e3b2459aeba Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 8 Jul 2021 15:13:39 +0100 Subject: [PATCH 4/5] Added badge for docker CI building on GH actions --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index d89a5ce173..71eb053447 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,9 @@ DAGMC: Direct Accelerated Geometry Monte Carlo .. image:: https://circleci.com/gh/svalinn/DAGMC.svg?style=shield :target: https://circleci.com/gh/svalinn/DAGMC +.. image:: https://github.com/svalinn/DAGMC/actions/workflows/docker_publish.yml/badge.svg?branch=develop + :target: https://github.com/svalinn/DAGMC/actions/workflows/docker_publish.yml + Direct Accelerated Geometry Monte Carlo (DAGMC) is a software package that allows users to perform Monte Carlo radiation transport directly on CAD models. From bf2edd346e79cbf33cd26a97db6c3f5517910cae Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 8 Jul 2021 15:16:23 +0100 Subject: [PATCH 5/5] removed ubuntu 18.04 from housekeeping image matrix --- .github/workflows/docker_publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index 2edf67f956..b961b7e80c 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -12,7 +12,6 @@ jobs: matrix: ubuntu_versions : [ 16.04, - 18.04, ] steps: