Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle irods clients #92

Merged
merged 6 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 67 additions & 12 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ on:
tags:
- "*"

env:
BUNDLE_NAME: bundle-ub-16.04-irods-clients-4.2.7.tgz

jobs:
release:

release_variables:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l -e -o pipefail {0}
Expand All @@ -24,32 +28,27 @@ jobs:
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 }}
preRelease: ${{ !(github.sha == env.MASTER_SHA) }}
releaseVersion: ${{ env.RELEASE_VERSION }}

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"
Expand Down Expand Up @@ -103,3 +102,59 @@ 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

if: always()

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/ --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"
uses: actions/upload-artifact@v3
with:
name: client_bundle
path: ${{ env.BUNDLE_NAME }}

release:
runs-on: ubuntu-latest

needs: [release_variables, bundle]

if: always()
kjsanger marked this conversation as resolved.
Show resolved Hide resolved

defaults:
run:
shell: bash -l -e -o pipefail {0}

steps:

- 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.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.preRelease }}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down