Wave CLI
Command line tool for Wave containers provisioning service.
Summary
Wave allows augmenting existing containers and building containers on demand so that it can be used in your Docker (replace-with-your-own-fav-container-engine) workflow.
Features
- Build container images on-demand for a given container file (aka Dockerfile);
- Build container images on-demand based on one or more Conda packages;
- Build container images on-demand based on one or more Spack packages;
- Build container images for a specified target platform (currently linux/amd64 and linux/arm64);
- Push and cache built containers to a user-provided container repository;
- Build Singularity native containers both using a Singularity spec file, Conda package(s) and Spack package(s);
- Push Singularity native container images to OCI-compliant registries;
Get started
-
Create a basic Dockerfile file (or use an existing one)
cat << EOF > ./Dockerfile FROM alpine RUN apk update && apk add bash cowsay \ --update-cache \ --repository https://alpine.global.ssl.fastly.net/alpine/edge/community \ --repository https://alpine.global.ssl.fastly.net/alpine/edge/main \ --repository https://dl-3.alpinelinux.org/alpine/edge/testing EOF
-
Run it provisioning the container on-the-fly
docker run --rm $(wave -f ./Dockerfile) cowsay "Hello world"
Examples
Augment a container image
-
Create a directory holding the files to be added to your container:
mkdir -p new-layer/usr/local/bin printf 'echo Hello world!' > new-layer/usr/local/bin/hello.sh chmod +x new-layer/usr/local/bin/hello.sh
-
Run the container via Wave
container=$(wave -i alpine --layer new-layer) docker run $container sh -c hello.sh
Build a container with Dockerfile
-
Create a Dockerfile for your container image:
cat << EOF > ./Dockerfile FROM alpine ADD hello.sh /usr/local/bin/ EOF
-
Create the build context directory:
mkdir -p build-context/ printf 'echo Hello world!' > build-context/hello.sh chmod +x build-context/hello.sh
-
Build and run the container on the fly:
container=$(wave -f Dockerfile --context build-context) docker run $container sh -c hello.sh
Build a Conda multi-packages container
container=$(wave --conda-package bamtools=2.5.2 --conda-package samtools=1.17)
docker run $container sh -c 'bamtools --version && samtools --version'
Build a container by using a Conda environment file
-
Create the Conda environment file:
cat << EOF > ./conda.yaml name: my-conda channels: - defaults - bioconda - conda-forge dependencies: - bamtools=2.5.2 - samtools=1.17 EOF
-
Build and run the container using the Conda environment:
container=$(wave --conda-file ./conda.yaml) docker run $container sh -c 'bamtools --version'
Build a container by using a Conda lock file
container=$(wave --conda-package https://prefix.dev/envs/pditommaso/wave/6x60arx3od13/conda-lock.yml)
docker run $container cowpy 'Hello, world!'
Build a Conda package container arm64 architecture
container=$(wave --conda-package fastp --platform linux/arm64)
docker run --platform linux/arm64 $container sh -c 'fastp --version'
Build a Spack package container
container=$(wave --spack-package cowsay)
docker run $container sh -c 'cowsay Hello world!'
Build a Singularity container using a Conda package and pushing to a OCI registry
container=$(wave --singularity --conda-package bamtools=2.5.2 --build-repo docker.io/user/repo --freeze --await)
singularity exec $container bamtools --version
Development
-
Install GraalVM-Java 20.0.2
sdk install java 20.0.2-graal
or if it's already installed
sdk use java 20.0.2-graal
-
Compile & run tests
./gradlew check
-
Native compile
./gradlew app:nativeCompile
-
Run the native binary
./app/build/native/nativeCompile/wave --version