generated from HYP3R00T/CelestialDocs
-
Notifications
You must be signed in to change notification settings - Fork 7
[WIP] Guidelines for pipelines #58
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
Open
AlexVCaron
wants to merge
4
commits into
nf-neuro:main
Choose a base branch
from
AlexVCaron:feat/pipeline_install
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| --- | ||
| title: Offline environments | ||
| description: Running pipelines in offline environments | ||
| --- | ||
|
|
||
| import { Steps } from '@astrojs/starlight/components'; | ||
|
|
||
| Pipelines backed by the nf-neuro (and [nf-core](https://nf-co.re)) framework are designed to run with internet access. This makes them | ||
| easier to install and use. **They can also run completely offline**, with the help of a few commands to download everything required | ||
| prior to execution. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ||| | ||
| |-|-| | ||
| |**[Nextflow](https://www.nextflow.io/docs/latest/install.html) ≥ 23.10.0** | The download procedure uses [nextflow inspect](https://www.nextflow.io/docs/latest/reference/cli.html#inspect) to compute the **list of containers to download**. | | ||
| | **Container engine** | **The container engine you will use to execute the pipeline needs to be installed**. The download procedure will populate its caches with the downloaded containers. We recommend [Docker](https://docs.docker.com/get-started/get-docker/) for local usage (where you have administrative rights), and [apptainer](https://apptainer.org/docs/admin/main/installation.html) anywhere else (computing clusters in the cloud or HPC infrastructures are typical use-cases). | | ||
|
|
||
|
|
||
| ## Setup using the `nf-core` command | ||
|
|
||
| :::caution | ||
| The `nf-core` framework is still being heavily developed, so is the `nf-neuro` ecosystem. If you experience problems setuping using the | ||
| `nf-core` command, we recommend you instead use `nf-neuro` custom scripts through the procedure described [further down](#setup-using-nf-neuro-custom-scripts). | ||
| ::: | ||
|
|
||
| <Steps> | ||
|
|
||
| 1. Install the `nf-core` command. We give an example below using `pip`, refer to the [official documentation](https://nf-co.re/docs/nf-core-tools/installation) | ||
| for detailled instructions. | ||
|
|
||
| ```bash | ||
| python -m venv nf-core-env | ||
| source nf-core-env/bin/activate | ||
| python -m pip install nf_core==3.5.2 | ||
| ``` | ||
|
|
||
| :::caution[Installation on HPC] | ||
| Most HPC facilities distribute custom builds of python packages, which might conflict with `nf-core`. Refer to its administrators if you have problems | ||
| with installation, or defer to the custom scripts below. | ||
| ::: | ||
|
|
||
| :::caution[Alliance Canada users] | ||
| As of today, the [documentation for nf-core](https://docs.alliancecan.ca/wiki/Nextflow) given by Alliance Canada is **outdated**. We've had success | ||
| installing latest versions with the commands [below](#setup-using-nf-neuro-custom-scripts) : | ||
|
|
||
| ```bash | ||
| module purge | ||
| module load nextflow/23.1.0 # Refer to the pipeline you are running for its minimal nextflow version | ||
| module load apptainer/3.5.2 # Refer to the pipeline you are running for its minimal apptainer version | ||
| module load python/3.12 | ||
| module load rust | ||
| module load postgresql | ||
| module load python-build-bundle | ||
| module load scipy-stack | ||
| python -m venv nf-core-env | ||
| source nf-core-env/bin/activate | ||
| python -m pip install nf_core==3.5.2 | ||
| ``` | ||
| ::: | ||
|
|
||
| 2. Run the pipeline download command, replacing the `<variables>` following your configuration : | ||
|
|
||
| :::caution[Apptainer/Singularity users] | ||
| If the `NXF_APPTAINER_CACHEDIR` or `NXF_SINGULARITY_CACHEDIR` environment variable is found in the environment, containers will first be downloaded to its | ||
| location before **being copied to the specified download location** under the `singularity-containers` directory. This can be good for sharing cache between | ||
| users or pipelines. However, pipelines with **large containers or a large number of them** could fill up your system. **Refer to your pipeline's documentation | ||
| for the recommended procedure**. In doubt, **unset those variables**. | ||
| ::: | ||
|
|
||
| ```bash | ||
| nf-core pipelines download <pipeline> \ | ||
| --revision <git revision> \ | ||
| --outdir <download location> \ | ||
| --container-system <container engine> \ | ||
| --parallel-downloads <parallel tasks> | ||
| ``` | ||
|
|
||
| :::danger[HPC users] | ||
| You **must guarantee all download locations** used are accessible to compute nodes ! It is also **highly recommended to download all configurations** by adding | ||
| the argument `--download-configuration yes` to the command above. | ||
| ::: | ||
|
|
||
| ||| | ||
| |-|-| | ||
| | **`<pipeline>`** | Name of the pipeline to download. It must be a **repository name hosting it on Github** (for example, `scilus/sf-tractomics` refers to the `sf-tractomics` pipeline from the `scilus` organisation). | | ||
| | **`<git revision>`** | Can be the **tag** of a release, a **branch** name or a **commit SHA**. | | ||
| | **`<download location>`** | The directory where to store the output pipeline, configurations and containers. | | ||
| | **`<container engine>`** | Either **singularity** (also stands for **apptainer**) or **docker**. It must align with the container engine you selected above. **If using apptainer or singularity, refer to the tip below for detailled configuration**. | | ||
| | **`<parallel tasks>`** | Number of parallel downloads allowed. | | ||
|
|
||
| :::tip[Configuration for Apptainer/Singularity] | ||
| Finer configuration is available for **apptainer** and **singularity** : | ||
|
|
||
| ||| | ||
| |-|-| | ||
| | **`--container-library`** | Remote library (registry) where to pull containers. When in doubt, use `docker.io` | | ||
| | **`--container-cache-utilisation`** | Set to `copy` by default, which copies containers to a `singularity-containers` directory placed aside the downloaded pipeline. Set to `amend` to disable the copy, **in which case ensure you have set valid cache locations for apptainer (`NXF_APPTAINER_CACHEDIR`) or singularity (`NXF_SINGULARITY_CACHEDIR`) in your environment before download**. | | ||
| ::: | ||
|
|
||
| </Steps> | ||
|
|
||
| ## Setup using `nf-neuro` custom scripts | ||
|
|
||
| :::caution | ||
| This setup procedure requires that you use the **Apptainer** or **Singularity** container engine ! | ||
| ::: | ||
|
|
||
| Only two additional prerequisites are necessary to run the script : `jq` and `curl` or `wget`. On **debian** systems (such as Ubuntu), they all can be installed easily | ||
| with `apt-get`. Once installed, use the command below to run the script, replacing every `<variable>` following your setup : | ||
|
|
||
| ```bash | ||
| curl -fsSL https://nf-neuro.github.io/pipelines/download | bash -s -- \ | ||
| -p <pipeline> \ | ||
| -r <git revision> \ | ||
| -o <containers location> \ | ||
| -c <containers cache> \ | ||
| -d <parallel tasks> | ||
| ``` | ||
|
|
||
| ||| | ||
| |-|-| | ||
| | **`<pipeline>`** | Name of the pipeline to download. It must be a **repository name hosting it on Github** (for example, `scilus/sf-tractomics` refers to the `sf-tractomics` pipeline from the `scilus` organisation). | | ||
| | **`<git revision>`** | Can be the **tag** of a release, a **branch** name or a **commit SHA**. | | ||
| | **`<containers location>`** | The directory where to copy the output containers. | | ||
| | **`<containers cache>`** | The directory where to cache the containers before copy. | | ||
| | **`<parallel tasks>`** | Number of parallel downloads allowed. | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally put the custom download script as the first proposed solution, then the
nf-coreone.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom script was and will always remain a bugfix to me. So in my books, placing it first doesn't make sense. Happy to be proven wrong. But feel free to advertise otherwise in your pipeline documentation !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @gagnonanthony. Even thought it's more an ease-of-use script to circumvent some issues, I think the simpler solution should be the first one given to the user here. If I'm a user who has little knowledge about nextflow and its associated libraries, I don't really care about installing nf-core and all that stuff if there's a script that takes care of everything by running a single command.