|
| 1 | +## 1. Use Seqera Platform to capture and monitor Nextflow jobs launched from the CLI |
| 2 | + |
1 | 3 | We'll start by using the Nextflow CLI to launch a pipeline and monitor it in Seqera Platform.
|
2 | 4 | Start by logging into the [Seqera Platform](https://cloud.seqera.io/).
|
3 | 5 |
|
4 | 6 | !!! info "Nextflow Tower"
|
5 |
| -Seqera Platform was previously known as Nextflow Tower. |
6 |
| -You'll still see references to the previous name in environment variable and cli option names. |
| 7 | + |
| 8 | + Seqera Platform was previously known as Nextflow Tower. |
| 9 | + You'll still see references to the previous name in environment variable and cli option names. |
7 | 10 |
|
8 | 11 | ### 1.1. Set up your Seqera Platform token by exporting it to your environment
|
9 | 12 |
|
10 | 13 | Follow these steps to set up your token:
|
11 | 14 |
|
12 | 15 | 1. Create a new token by clicking on the **Settings** drop-down menu:
|
13 | 16 |
|
14 |
| -  |
| 17 | +  |
15 | 18 |
|
16 | 19 | 2. Name your token:
|
17 | 20 |
|
18 |
| -  |
| 21 | +  |
19 | 22 |
|
20 | 23 | 3. Save your token safely:
|
21 | 24 |
|
22 |
| -  |
| 25 | +  |
23 | 26 |
|
24 | 27 | !!! note
|
25 | 28 |
|
@@ -66,6 +69,94 @@ Hello world!
|
66 | 69 | Use ++ctrl+click++ or ++cmd+click++ on the link to open it in your browser.
|
67 | 70 | You'll see the Seqera Platform interface with the job finished and the logs captured.
|
68 | 71 |
|
69 |
| - |
| 72 | + |
70 | 73 |
|
71 | 74 | You will see and be able to monitor your **Nextflow jobs** in Seqera Platform.
|
| 75 | +
|
| 76 | +### 1.3. Set up Seqera Platform logging by default |
| 77 | +
|
| 78 | +To set up Seqera Platform logging by default, we first want to store our token more securely as a [Nextflow secret](https://www.nextflow.io/docs/latest/secrets.html). |
| 79 | +
|
| 80 | +```bash |
| 81 | +nextflow secrets set tower_access_token "eyxxxxxxxxxxxxxxxQ1ZTE=" |
| 82 | +``` |
| 83 | +
|
| 84 | +You can set up Seqera Platform logging by default by adding the following line to your `nextflow.config` file. |
| 85 | +
|
| 86 | +```groovy title="nextflow.config" |
| 87 | +tower { |
| 88 | + enabled = true |
| 89 | + endpoint = "https://api.cloud.seqera.io" |
| 90 | + accessToken = secrets.tower_access_token |
| 91 | +} |
| 92 | +``` |
| 93 | +
|
| 94 | +Instead of putting this in the `nextflow.config` file of a specific project, you can also put it in the global file located at `$HOME/.nextflow/config`. |
| 95 | +
|
| 96 | +```bash |
| 97 | +cat <<EOF >> $HOME/.nextflow/config |
| 98 | +tower { |
| 99 | + enabled = true |
| 100 | + endpoint = "https://api.cloud.seqera.io" |
| 101 | + accessToken = secrets.tower_access_token |
| 102 | +} |
| 103 | +EOF |
| 104 | +``` |
| 105 | +
|
| 106 | +Run your Nextflow workflows as usual: |
| 107 | +
|
| 108 | +```bash |
| 109 | +nextflow run nextflow-io/hello |
| 110 | +``` |
| 111 | +
|
| 112 | +You will see the following output: |
| 113 | +
|
| 114 | +```console title="Output" |
| 115 | + N E X T F L O W ~ version 24.04.4 |
| 116 | +
|
| 117 | +Launching `https://github.com/nextflow-io/hello` [fabulous_euclid] DSL2 - revision: afff16a9b4 [master] |
| 118 | +
|
| 119 | +Monitor the execution with Seqera Platform using this URL: https://cloud.seqera.io/user/kenbrewer/watch/KYjRktIlOuxrh |
| 120 | +executor > local (4) |
| 121 | +[71/eaa915] process > sayHello (3) [100%] 4 of 4 ✔ |
| 122 | +Ciao world! |
| 123 | +
|
| 124 | +Bonjour world! |
| 125 | +
|
| 126 | +Hola world! |
| 127 | +
|
| 128 | +Hello world! |
| 129 | +``` |
| 130 | +
|
| 131 | +Note that we are logging to Seqera Platform even though we did not use the `-with-tower` command! |
| 132 | +
|
| 133 | +### 1.4. Use Seqera Platform to explore the resolved configuration of a Nextflow pipeline |
| 134 | +
|
| 135 | +Click on the link provided in the output to open the Seqera Platform for your run, then click on the `Configuration` tab. |
| 136 | +If you ran your pipeline from the `hello_nextflow` directory, you'll see something like this: |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | +Notice that configuration for our pipeline run is being run pulled from three separate files: |
| 141 | + |
| 142 | +- `/home/gitpod/.nextflow/config` - This is the global configuration file we just added. |
| 143 | +- `/home/gitpod/.nextflow/assets/nextflow-io/hello/nextflow.config` - This is the `nextflow.config` file from the `nextflow-io/hello` repository. |
| 144 | +- `/workspace/gitpod/nf-training/hello-nextflow/nextflow.config` - This is the `nextflow.config` file from our current working directory. |
| 145 | + |
| 146 | +Nextflow resolves these configurations at runtime with a [specific order of precedence](https://www.nextflow.io/docs/latest/config.html#configuration-file). |
| 147 | +The general rule, however, is that more specific configurations override less specific ones, and config/params specified on the CLI will override defaults in the config files. |
| 148 | + |
| 149 | +Helpfully, Seqera Platform shows us the final output of this configuration resolution process which can be very useful for debugging! |
| 150 | + |
| 151 | +### Takeaway |
| 152 | + |
| 153 | +You have learned how to: |
| 154 | + |
| 155 | +- Set up your Seqera Platform token by exporting it to your environment. |
| 156 | +- Run Nextflow CLI with Seqera Platform visualizing and capturing logs. |
| 157 | +- Set up Seqera Platform logging by default. |
| 158 | +- Use Seqera Platform to explore the resolved configuration of a Nextflow pipeline. |
| 159 | + |
| 160 | +### What's next? |
| 161 | + |
| 162 | +Learn how to launch Nextflow pipelines from Seqera Platform using the Launchpad feature. |
0 commit comments