From 280d6bf3130bb3555f6e9bb638686769d06b1068 Mon Sep 17 00:00:00 2001 From: Henry Wallace Date: Mon, 27 Jan 2025 11:19:30 -0500 Subject: [PATCH 1/5] Update workflows to build on ubuntu --- .github/workflows/CDImage.yml | 4 +++ .github/workflows/CIBuild.yml | 10 +++--- .github/workflows/CoreDevelopTest.yml | 49 +++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/CoreDevelopTest.yml diff --git a/.github/workflows/CDImage.yml b/.github/workflows/CDImage.yml index 10d3aa7..58b821f 100644 --- a/.github/workflows/CDImage.yml +++ b/.github/workflows/CDImage.yml @@ -24,6 +24,10 @@ jobs: - os: alma9 file: doc/MaCh3DockerFiles/Alma9/Dockerfile tag_latest: alma9latest + - os: Ubuntu22.04 + file: doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile + tag: ubuntulatest + name: Image CD ${{ matrix.os }} diff --git a/.github/workflows/CIBuild.yml b/.github/workflows/CIBuild.yml index 69c9197..bab9f2b 100644 --- a/.github/workflows/CIBuild.yml +++ b/.github/workflows/CIBuild.yml @@ -6,8 +6,8 @@ name: Build CI # The events that trigger the workflow on: pull_request: - branches: [ develop ] - + branches: [ develop ] + permissions: contents: read packages: write @@ -22,9 +22,9 @@ jobs: - os: Alma9 file: doc/MaCh3DockerFiles/Alma9/Dockerfile tag: alma9latest - # - os: Rocky9 - # file: doc/MaCh3DockerFiles/Rocky9/Dockerfile - # tag: rocky9latest + - os: Ubuntu22.04 + file: doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile + tag: ubuntulatest name: Build CI ${{ matrix.os }} diff --git a/.github/workflows/CoreDevelopTest.yml b/.github/workflows/CoreDevelopTest.yml new file mode 100644 index 0000000..1e039aa --- /dev/null +++ b/.github/workflows/CoreDevelopTest.yml @@ -0,0 +1,49 @@ +# Runs weekly build against develop idea is to give us +# a reasonable warning when DUNE develop and core +# are incompatible! Also pushes container for easy testing + +name: Weekly Core Integration + +on: + schedule: + - cron: '0 0 * * 0' # Might as well do everything Sunday at midngiht + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false # KS: Prevents cancellation of remaining jobs if one fails + matrix: + include: + - os: alma9 + file: doc/MaCh3DockerFiles/Alma9/Dockerfile + tag_latest: alma9latest + + name: Image CD ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Build Docker image + run: | + docker build . \ + --file "${{ matrix.file }}" \ + --tag "ghcr.io/dune/mach3:${{ matrix.tag_latest }}_core_develop" \ + --build-arg MACH3_DUNE_VERSION="develop" \ + --build-arg MACH3_CORE_VERSION=develop + + - name: Push Docker image + run: | + docker push "ghcr.io/dune/mach3:${{ matrix.tag_latest }}_core_develop" + xw + - name: Delete old images + uses: actions/delete-package-versions@v5 + with: + package-name: 'mach3' + package-type: 'container' + min-versions-to-keep: 5 + delete-only-untagged-versions: 'true' \ No newline at end of file From 818142913f8931a4ffb6f50f60a5831a0cbe3f96 Mon Sep 17 00:00:00 2001 From: Henry Wallace Date: Mon, 27 Jan 2025 11:21:04 -0500 Subject: [PATCH 2/5] Delete accidentally commited test --- .github/workflows/CoreDevelopTest.yml | 49 --------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/CoreDevelopTest.yml diff --git a/.github/workflows/CoreDevelopTest.yml b/.github/workflows/CoreDevelopTest.yml deleted file mode 100644 index 1e039aa..0000000 --- a/.github/workflows/CoreDevelopTest.yml +++ /dev/null @@ -1,49 +0,0 @@ -# Runs weekly build against develop idea is to give us -# a reasonable warning when DUNE develop and core -# are incompatible! Also pushes container for easy testing - -name: Weekly Core Integration - -on: - schedule: - - cron: '0 0 * * 0' # Might as well do everything Sunday at midngiht - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false # KS: Prevents cancellation of remaining jobs if one fails - matrix: - include: - - os: alma9 - file: doc/MaCh3DockerFiles/Alma9/Dockerfile - tag_latest: alma9latest - - name: Image CD ${{ matrix.os }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to GitHub Container Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Build Docker image - run: | - docker build . \ - --file "${{ matrix.file }}" \ - --tag "ghcr.io/dune/mach3:${{ matrix.tag_latest }}_core_develop" \ - --build-arg MACH3_DUNE_VERSION="develop" \ - --build-arg MACH3_CORE_VERSION=develop - - - name: Push Docker image - run: | - docker push "ghcr.io/dune/mach3:${{ matrix.tag_latest }}_core_develop" - xw - - name: Delete old images - uses: actions/delete-package-versions@v5 - with: - package-name: 'mach3' - package-type: 'container' - min-versions-to-keep: 5 - delete-only-untagged-versions: 'true' \ No newline at end of file From 6a706f723ebee850863b0e8383fa7b2b619aa224 Mon Sep 17 00:00:00 2001 From: Henry Wallace Date: Mon, 27 Jan 2025 11:22:19 -0500 Subject: [PATCH 3/5] Add Docker file... --- doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile diff --git a/doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile b/doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile new file mode 100644 index 0000000..5f5e42b --- /dev/null +++ b/doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile @@ -0,0 +1,30 @@ +#To run use: docker build --secret id=tokens,src=tokens.txt -t mach3dune . +FROM rootproject/root:6.32.02-ubuntu22.04 AS mach3_dune_build + +RUN apt update && apt upgrade -y +RUN apt-get install -y nlohmann-json3-dev +#MISC_SW +RUN apt install -y --no-install-recommends \ + vim less nano gdb csh tcsh ed quota python3 python3-dev python3-pip \ + cvs procmail ca-certificates cmake ninja-build + + +# Declare the build argument +ARG MACH3_DUNE_VERSION +ENV MACH3_DUNE_VERSION=${MACH3_DUNE_VERSION:-develop} + +ENV MACH3_DUNE_WORK_DIR=/opt/MaCh3DUNE/ +ENV MACH3_DUNE_INSTALL_DIR=${MACH3_DUNE_WORK_DIR}/build + + +RUN --mount=type=ssh git clone https://github.com/DUNE/MaCh3_DUNE.git ${MACH3_DUNE_WORK_DIR} + +WORKDIR ${MACH3_DUNE_WORK_DIR} +RUN git checkout ${MACH3_DUNE_VERSION} + +RUN mkdir -p ${MACH3_DUNE_INSTALL_DIR} +WORKDIR ${MACH3_DUNE_INSTALL_DIR} + +RUN cmake ../ + +RUN make -j && make install \ No newline at end of file From 88bc73430de278487a0a8b144ae532491ec574d1 Mon Sep 17 00:00:00 2001 From: Henry Wallace Date: Mon, 27 Jan 2025 11:43:58 -0500 Subject: [PATCH 4/5] should have been more careful checking CD, tag->tag_latest --- .github/workflows/CDImage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CDImage.yml b/.github/workflows/CDImage.yml index 58b821f..dca115b 100644 --- a/.github/workflows/CDImage.yml +++ b/.github/workflows/CDImage.yml @@ -7,6 +7,7 @@ on: push: branches: - develop + - hwallace/patch/ubuntu_cd tags: - 'v*' @@ -26,7 +27,7 @@ jobs: tag_latest: alma9latest - os: Ubuntu22.04 file: doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile - tag: ubuntulatest + tag_latest: ubuntulatest name: Image CD ${{ matrix.os }} From 5386e5f5b14a9460651192fee5e401087f23e6b4 Mon Sep 17 00:00:00 2001 From: Henry Wallace Date: Mon, 27 Jan 2025 11:45:58 -0500 Subject: [PATCH 5/5] remove debug statement --- .github/workflows/CDImage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CDImage.yml b/.github/workflows/CDImage.yml index dca115b..be514db 100644 --- a/.github/workflows/CDImage.yml +++ b/.github/workflows/CDImage.yml @@ -7,7 +7,6 @@ on: push: branches: - develop - - hwallace/patch/ubuntu_cd tags: - 'v*'