Note that you can also use the <Wave CLI> and do e...
# modules
p
Note that you can also use the Wave CLI and do everything via the terminal. The process to get the HTTPS part is a bit hacky, but it's possible (this is essentially what we will automate for #modules when we move to Seqera Containers). Details in ๐Ÿงต as it got a bit long ๐Ÿ‘‰๐Ÿป
Install the Wave CLI:
Copy code
brew install seqeralabs/tap/wave-cli
Create a Docker container based on your
environment.yml
file, use for the
main.nf
container
attribute
Copy code
โฏ wave --conda-file environment.yml --freeze --await
community.wave.seqera.io/library/multiqc:1.25.1--dc1968330462e945
Create a Singularity container:
Copy code
โฏ wave --conda-file environment.yml --freeze --await --singularity
oras://community.wave.seqera.io/library/multiqc:1.25.1--f0e743d16869c0bf
Inspect the generated Singularity image:
Copy code
$ wave --inspect --image oras://community.wave.seqera.io/library/multiqc:1.25.1--f0e743d16869c0bf -o yaml

container:
  config:
    config:
      cmd: &id001 []
      entrypoint: *id001
      env: *id001
    rootfs:
      diff_ids: *id001
  digest: sha256:11036a814c8817a34c87244f42bd5a96da66863af7682388990b02ffd11f3d41
  hostName: https://community.wave.seqera.io
  imageName: library/multiqc
  manifest:
    config:
      digest: sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
      mediaType: application/vnd.unknown.config.v1+json
      size: 2
    layers:
    - annotations:
        org.opencontainers.image.title: image.sif
      digest: sha256:645dd9ac0263e27773eca8c8d803e5b89e93d7d3ef0afbc0954cdb49303ac99c
      mediaType: application/vnd.sylabs.sif.layer.v1.sif
      size: 365629440
      uri: https://community.wave.seqera.io/v2/library/multiqc/blobs/sha256:645dd9ac0263e27773eca8c8d803e5b89e93d7d3ef0afbc0954cdb49303ac99c
    schemaVersion: 2
  reference: 1.25.1--f0e743d16869c0bf
  registry: community.wave.seqera.io
Copy the
digest
string under
manifest.layers[0]
and remove the
sha256:
prefix - in this case it's
645dd9ac0263e27773eca8c8d803e5b89e93d7d3ef0afbc0954cdb49303ac99c
(NB: not the
config
digest) Use this to build the following URL:
Copy code
https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/{digest[:2]}/{digest}/data
So for this example it's:
Copy code
https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/64/645dd9ac0263e27773eca8c8d803e5b89e93d7d3ef0afbc0954cdb49303ac99c/data
Check that you can download it locally and that it looks like a Singularity file locally (100s MB binary file). Use this URL in the
main.nf
Singularity container.
j
Ooof that is a bit more convoluted indeed ๐Ÿ˜…
p
It's actually easier up until the
https
part, as in this case we already have an
environment.yml
file and we can use that directly with the CLI
But yeah, because the logic for that final part is in the Seqera Containers web UI and not in the Wave API / CLI, the final step is a bit messy. It's the same process in both cases, it's just with the web UI it's done for you behind the scenes.
We'll automate the same thing for #modules when we switch over.
Part of the reason I wanted to write this out โ˜๐Ÿป is so that folks can understand what's going on behind the scenes ๐Ÿค“
j
Sorry yes, agree - up into the inspect and extracting stuff is straight foward, but parsing the inspect is the complciated bit
Would it not make sense to have
wave
just spit out the require URLs after creation and upload?
(valid URLs, basically as the web interface does with https checkbox)
p
I'm discussing some of this with @Jonathan Manning and Paolo right now actually: https://github.com/seqeralabs/wave-cli/issues/83
mask parrot 1
The Singularity https URL is more difficult though
It's kind of a hack to get it to work - it makes a bunch of assumptions which aren't generally applicable, so I don't think that this will be added to the CLI or API
j
sad
p
The following things have to be true: โ€ข Singularity image โ€ข Built by Wave โ€ข Created from Conda packages โ€ข Not modifying the base image โ€ข Seqera Containers registry
Then there should only be a single layer in the OCI manfest, and we can hack around a bit to directly access the blob URI
Docker isn't really meant to work like this ๐Ÿ˜… You're meant to go via requesting manifests and letting the container engines authenticate and return the blob URLs rather than accessing them directly
๐Ÿ‘ 1
j
Ah fair enough, you're description made it sound easier - just parsing a particular string from the inspect output
p
Yeah if you know it's Seqera Containers + Singularity then it is. Which is why we can automate it in the web UIs as they are more restricted than the CLI / API
๐Ÿ‘ 1
I will keep nudging the idea if I get a chance though, I think it's a philosophical / maintenance reason rather than technical.
๐Ÿ‘ 1
You can see the issue where it was discussed here, feel free to chime in. With an aborted PR here.
j
Maybe just a nf-core/tools wrapper around wave would get around that
p
Yup, that also works ๐Ÿ‘๐Ÿป
j
(that does the parsing)
p
But hopefully no need when we are using Seqera Containers properly in #modules
As it should be fully automated there
๐Ÿ‘ 1
j
LEt's just go with that, I guess we want this for a specific context ๐Ÿ‘
Might be good to have though if we have do to do something manual for whatever reason
Anyway, enough procrastiantion for me -I should get back to my summit talk ๐Ÿ˜†
p
True. We'll want to write scripts to use in the automation, so we can probably just add them to the #tools CLI and then they can be reused by whoever for whatever.
We've used that approach in a bunch of places already, eg. pipeline template sync etc.
s
sorry for my naiveness, but why do we need this url, is the original
oras://community.wave.seqera.io/library/multiqc:1.25.1--f0e743d16869c0bf
not useful directly?
p
Long thread, not entirely sure which bit you're referring to?
But maybe these blog posts answer your question? Part 1, Part 2
๐Ÿ‘ 1