From c9d338e532d3cba23b31a74fd4334731eb9ae301 Mon Sep 17 00:00:00 2001 From: mksanger Date: Wed, 10 Jan 2024 15:16:43 +0000 Subject: [PATCH 1/6] Add action to build and upload bundle on release --- .github/workflows/create-release.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 1cc7d9e..f5e679c 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -103,3 +103,25 @@ jobs: docker images make push GITHUB_ACTIONS=${GITHUB_ACTIONS} GITHUB_REPOSITORY_OWNER=${{ github.repository_owner }} + + bundle: + runs-on: ubuntu-latest + container: "ghcr.io/wtsi-npg/ub-16.04-irods-clients-4.2.7:latest" + + needs: deploy + + steps: + - name: install exodus + run: | + apt-get update + apt-get install -q -y python3-pip + pip3 install exodus-bundler + + - name: bundle clients + run: exodus --tarball --add /usr/lib/irods/plugins/ --output client_bundle.tgz /usr/local/bin/baton-* /usr/bin/ils /usr/bin/iinit /usr/bin/imeta + + - name: upload bundle + uses: actions/upload-artifact@v3 + with: + name: client_bundle + path: "client_bundle.tgz" \ No newline at end of file From 8100cfd5bbe85c92c15ae81f2bfa91bdd7adff5f Mon Sep 17 00:00:00 2001 From: mksanger Date: Tue, 16 Jan 2024 11:03:06 +0000 Subject: [PATCH 2/6] Add libnss shared objects to bundle --- .github/workflows/create-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index f5e679c..409fb70 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -118,7 +118,8 @@ jobs: pip3 install exodus-bundler - name: bundle clients - run: exodus --tarball --add /usr/lib/irods/plugins/ --output client_bundle.tgz /usr/local/bin/baton-* /usr/bin/ils /usr/bin/iinit /usr/bin/imeta + + run: exodus --tarball --add /usr/lib/irods/plugins/ --add /lib/x86_64-linux-gnu/ --output client_bundle.tgz /usr/local/bin/baton-* /usr/bin/ils /usr/bin/iinit /usr/bin/imeta - name: upload bundle uses: actions/upload-artifact@v3 From 608795fd47b2a692580547047455b294ad9b0261 Mon Sep 17 00:00:00 2001 From: mksanger Date: Tue, 16 Jan 2024 15:06:33 +0000 Subject: [PATCH 3/6] Upload bundle to release --- .github/workflows/create-release.yml | 75 +++++++++++++++++----------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 409fb70..d4aec77 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -6,50 +6,27 @@ on: - "*" jobs: - release: + + release_variables: runs-on: ubuntu-latest - - defaults: - run: - shell: bash -l -e -o pipefail {0} steps: - - name: "Checkout code" - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: "Fetch Tags" - # Workaround for https://github.com/actions/checkout/issues/290 - run: | - # Avoid git exiting when Actions runs - git config --global --add safe.directory "$PWD" - - git fetch --tags --force - - name: "Get release variables" run: | echo 'RELEASE_VERSION='$(git describe --always --tags) >> $GITHUB_ENV echo 'MASTER_SHA='$(git rev-parse origin/master) >> $GITHUB_ENV - - name: "Create Release" - uses: ncipollo/release-action@v1.12.0 - with: - name: ${{ env.RELEASE_VERSION }} - prerelease: ${{ !(github.sha == env.MASTER_SHA) }} - generateReleaseNotes: true - outputs: isRelease: ${{ github.sha == env.MASTER_SHA }} deploy: runs-on: ubuntu-latest - needs: release + needs: release_variables # Workaround for https://github.com/actions/runner/issues/1483 # Actions coerces boolean to string - if: needs.release.outputs.isRelease == 'true' + if: needs.release_variables.outputs.isRelease == 'true' steps: - name: "Free disk space on the runner" @@ -110,6 +87,8 @@ jobs: needs: deploy + if: always() + steps: - name: install exodus run: | @@ -125,4 +104,44 @@ jobs: uses: actions/upload-artifact@v3 with: name: client_bundle - path: "client_bundle.tgz" \ No newline at end of file + path: "client_bundle.tgz" + + release: + runs-on: ubuntu-latest + + needs: bundle + + if: always() + + defaults: + run: + shell: bash -l -e -o pipefail {0} + + steps: + - name: "Checkout code" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Fetch Tags" + # Workaround for https://github.com/actions/checkout/issues/290 + run: | + # Avoid git exiting when Actions runs + git config --global --add safe.directory "$PWD" + + git fetch --tags --force + + - name: "Download artifact" + uses: actions/download-artifact@v3 + with: + name: client_bundle + + - name: "Create Release" + uses: ncipollo/release-action@v1.12.0 + with: + name: ${{ env.RELEASE_VERSION }} + prerelease: ${{ !(github.sha == env.MASTER_SHA) }} + artifacts: "client_bundle.tgz" + removeArtifacts: true + artifactErrorsFailBuild: true + generateReleaseNotes: true From 3a8adeff0e4e1d041b5a832e21d62e91d00f310b Mon Sep 17 00:00:00 2001 From: mksanger Date: Thu, 18 Jan 2024 17:32:03 +0000 Subject: [PATCH 4/6] Update step names to match name convention Make bundle name more descriptive Add some documentation for how the bundle is used --- .github/workflows/create-release.yml | 15 +++++++++------ README.md | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d4aec77..bbf5798 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -5,6 +5,9 @@ on: tags: - "*" +env: + BUNDLE_NAME: bundle-ub-16.04-irods-clients-4.2.7.tgz + jobs: release_variables: @@ -90,21 +93,21 @@ jobs: if: always() steps: - - name: install exodus + - name: "Install exodus" run: | apt-get update apt-get install -q -y python3-pip pip3 install exodus-bundler - - name: bundle clients + - name: "Bundle clients" - run: exodus --tarball --add /usr/lib/irods/plugins/ --add /lib/x86_64-linux-gnu/ --output client_bundle.tgz /usr/local/bin/baton-* /usr/bin/ils /usr/bin/iinit /usr/bin/imeta + run: exodus --tarball --add /usr/lib/irods/plugins/ --add /lib/x86_64-linux-gnu/ --output $BUNDLE_NAME /usr/local/bin/baton-* /usr/bin/ils /usr/bin/iinit /usr/bin/imeta - - name: upload bundle + - name: "Upload bundle" uses: actions/upload-artifact@v3 with: name: client_bundle - path: "client_bundle.tgz" + path: $BUNDLE_NAME release: runs-on: ubuntu-latest @@ -141,7 +144,7 @@ jobs: with: name: ${{ env.RELEASE_VERSION }} prerelease: ${{ !(github.sha == env.MASTER_SHA) }} - artifacts: "client_bundle.tgz" + artifacts: BUNDLE_NAME removeArtifacts: true artifactErrorsFailBuild: true generateReleaseNotes: true diff --git a/README.md b/README.md index 7d48ad8..acbec93 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,22 @@ e.g. Install wrappers to $PREFIX/bin: ... -rwxr-xr-x 1 kdj staff 409 Apr 12 15:47 samtools +# iRODS Client Bundle + +The release contains irods 4.2.7 clients bundled from +`ub-16.04-irods-clients-4.2.7` to be used on ONT machines, where we +cannot run containers. Given the complexity of the iRODS clients' +dependency chain, the location of the plugins must be provided in the +iRODS environment file using the `irods_plugins_home` key. Some +dependencies for these plugins must also be preloaded to avoid local +system libraries from being pulled in, e.g.: + + $ LD_PRELOAD=path/libarchive.so.16:path/libcrypto.so.1.0.0:path/libssl.so.1.0.0:path/libxml2.so.2:path/libicuuc.so.55:path/libicudata.so.55 \ + ./exodus/bin/iinit + +A script to do this is set up by the ansible used to set up the instruments +(https://gitlab.internal.sanger.ac.uk/npg/oxford_nanopore_instruments). + ## Author From ea0e78d19505e74dde7b941c2640ebbaf1998d95 Mon Sep 17 00:00:00 2001 From: mksanger Date: Thu, 18 Jan 2024 19:10:14 +0000 Subject: [PATCH 5/6] Allow name and prerelease determining variables to be picked up by create release step --- .github/workflows/create-release.yml | 43 +++++++++++++++++----------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index bbf5798..2c09553 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -13,7 +13,24 @@ jobs: release_variables: runs-on: ubuntu-latest + defaults: + run: + shell: bash -l -e -o pipefail {0} + steps: + - name: "Checkout code" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Fetch Tags" + # Workaround for https://github.com/actions/checkout/issues/290 + run: | + # Avoid git exiting when Actions runs + git config --global --add safe.directory "$PWD" + + git fetch --tags --force + - name: "Get release variables" run: | echo 'RELEASE_VERSION='$(git describe --always --tags) >> $GITHUB_ENV @@ -21,6 +38,7 @@ jobs: outputs: isRelease: ${{ github.sha == env.MASTER_SHA }} + releaseVersion: ${{ env.RELEASE_VERSION }} deploy: runs-on: ubuntu-latest @@ -107,12 +125,12 @@ jobs: uses: actions/upload-artifact@v3 with: name: client_bundle - path: $BUNDLE_NAME + path: ${{ env.BUNDLE_NAME }} release: runs-on: ubuntu-latest - needs: bundle + needs: [release_variables, bundle] if: always() @@ -121,18 +139,6 @@ jobs: shell: bash -l -e -o pipefail {0} steps: - - name: "Checkout code" - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: "Fetch Tags" - # Workaround for https://github.com/actions/checkout/issues/290 - run: | - # Avoid git exiting when Actions runs - git config --global --add safe.directory "$PWD" - - git fetch --tags --force - name: "Download artifact" uses: actions/download-artifact@v3 @@ -142,9 +148,12 @@ jobs: - name: "Create Release" uses: ncipollo/release-action@v1.12.0 with: - name: ${{ env.RELEASE_VERSION }} - prerelease: ${{ !(github.sha == env.MASTER_SHA) }} - artifacts: BUNDLE_NAME + name: ${{ env.NAME }} + prerelease: ${{ env.PRERELEASE }} + artifacts: ${{ env.BUNDLE_NAME }} removeArtifacts: true artifactErrorsFailBuild: true generateReleaseNotes: true + env: + NAME: ${{ needs.release_variables.outputs.releaseVersion }} + PRERELEASE: ${{ !needs.release_variables.outputs.isRelease }} From 2328f7f7e3fac1be8e7930919c550858a7b5b1e7 Mon Sep 17 00:00:00 2001 From: mksanger Date: Fri, 19 Jan 2024 10:18:22 +0000 Subject: [PATCH 6/6] Add separate `preRelease` output from `release_variable` step because it can't be negated later --- .github/workflows/create-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 2c09553..be89c3a 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -38,6 +38,7 @@ jobs: outputs: isRelease: ${{ github.sha == env.MASTER_SHA }} + preRelease: ${{ !(github.sha == env.MASTER_SHA) }} releaseVersion: ${{ env.RELEASE_VERSION }} deploy: @@ -156,4 +157,4 @@ jobs: generateReleaseNotes: true env: NAME: ${{ needs.release_variables.outputs.releaseVersion }} - PRERELEASE: ${{ !needs.release_variables.outputs.isRelease }} + PRERELEASE: ${{ needs.release_variables.outputs.preRelease }}