You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, Nextflow is using the `docker run` command to launch the task.
354
+
It also mounts the task's working directory into the container, sets the working directory inside the container to the task's working directory, and runs our templated bash script in the `.command.sh` file.
355
+
All the hard work we learned about in the previous sections is done for us by Nextflow!
356
+
315
357
### Takeaway
316
358
317
359
You know how to use containers in Nextflow to run processes.
@@ -320,19 +362,41 @@ You know how to use containers in Nextflow to run processes.
320
362
321
363
An optional exercise to fetch quotes on computer/biology pioneers using the `quote` container and output them using the `cowsay` container.
322
364
323
-
## 4. OPTIONAL EXERCISE: Connect the `quote` container with the `cowsay` container
324
-
325
-
As an optional exercise, you can add a locally-built or Seqera Containers-built `quote` container to a getQuote process in the `hello_containers.nf` script and connect the output to the `cowsay` container.
365
+
## 4. STRETCH EXERCISE: Connect the `quote` container with the `cowsay` container
366
+
367
+
This section contains some stretch exercises, to practice what you've learned so far.
368
+
Doing these exercises are _not required_ to understand later parts of the training, but provide a fun way to reinforce your learnings by figuring out how to connect the `quote` container with the `cowsay` container.
369
+
370
+
```console title="cowsay-output-Grace-Hopper.txt"
371
+
_________________________________________________
372
+
/ \
373
+
| Humans are allergic to change. They love to |
374
+
| say, 'We've always done it this way.' I try to fi |
375
+
| ght that. That's why I have a clock on my wall th |
376
+
| at runs counter-clockwise. |
377
+
| -Grace Hopper |
378
+
\ /
379
+
=================================================
380
+
\
381
+
\
382
+
^__^
383
+
(oo)\_______
384
+
(__)\ )\/\
385
+
||----w |
386
+
|| ||
387
+
```
326
388
327
389
### 4.1. Modify the `hello_containers.nf` script to use a getQuote process
328
390
329
391
We have a list of computer and biology pioneers in the `containers/data/pioneers.csv` file.
330
392
At a high level, to complete this exercise you will need to:
331
393
332
-
- modify the `params.input_file` to point to the `pioneers.csv` file.
394
+
- modify the default `params.input_file` to point to the `pioneers.csv` file.
333
395
- Create a `getQuote` process that uses the `quote` container to fetch a quote for each input.
334
396
- Connect the output of the `getQuote` process to the `cowsay` process to display the quote.
335
397
398
+
For the `quote` container image, you can either use the one you built yourself in the previous stretch exercise or use the one you got from Seqera Containers .
399
+
336
400
!!! Hint
337
401
338
402
A good choice for the `script` block of your getQuote process might be:
@@ -341,6 +405,7 @@ At a high level, to complete this exercise you will need to:
0 commit comments