Build a Docker container
Seeing as Nextflow is all about containerisation, it would be nice to have this cli readily available in a container 😉
Could build and host via the GitHub container registry etc. Or wherever really.
Yup, or just GitHub actions
The Dockerfile I just wrote for myself is pretty simple and seems to work well:
FROM alpine
ARG TOWER_CLI_VERSION="0.4"
# Install Tower CLI
RUN apk add --no-cache curl ca-certificates
RUN curl -L https://github.com/seqeralabs/tower-cli/releases/download/v${TOWER_CLI_VERSION}/tw-${TOWER_CLI_VERSION}-linux-x86_64 > tw
RUN chmod +x ./tw
RUN mv tw /usr/local/bin/
But of course for automation here you don't want to be downloading releases etc, so yeah might make sense to use jreleaser. I'm just not familiar with it.
Now that the Tower CLI has been added to Bioconda, we just have to stay on top of bumping versions there and we will get Biocontainers for free: https://quay.io/repository/biocontainers/tower-cli?tag=latest&tab=tags
x:ref: https://github.com/seqeralabs/tower-cli/issues/293
I very much appreciate whoever set this up, but would it be possible to get the conventional latest and 0.8.0 semantic version tag there as well? As of now, the only tag is 0.8.0--h9ee0642_0. This makes the container harder to initially find and updates need to be looked up manually, including the build tag info on the end.
$ skopeo inspect docker://quay.io/biocontainers/tower-cli
FATA[0001] Error parsing image name "docker://quay.io/biocontainers/tower-cli": reading manifest latest in quay.io/biocontainers/tower-cli: manifest unknown
$ skopeo inspect docker://quay.io/biocontainers/tower-cli:0.8.0--h9ee0642_0
{
"Name": "quay.io/biocontainers/tower-cli",
"Digest": "sha256:98825f778dd02b2803950474dbe80ffb3d0da267d98f65153ff2c2019c995eec",
"RepoTags": [
"0.8.0--h9ee0642_0"
],
Here's a workaround to get the most recent tag without latest being available and without looking it up, if anyone needs it, but it's not pretty:
podman run docker://quay.io/biocontainers/tower-cli:$(skopeo list-tags docker://quay.io/biocontainers/tower-cli | jq -r '.Tags[0]')
The biocontainers image is outside of our control, that's managed via the BioConda + BioContainers communities.
But we could definitely build our own docker images to use as an alternative, using whatever tags we want.
I think it would relatively easy to do. The releases are already going out via GitHub actions. We could use JReleaser to do this directly as suggested above.
- config file
- Updated JReleaser docs link (link above is now broken)
Looks like JReleaser has support for pushing the images to GitHub Packages, which would probably be the easiest (jreleaser.github.username, jreleaser.gitlab.username etc).