Run and debug workflow tasks before registration
latch >= 2.65.7
latch develop
command lets you build your workflow image and drop into an interactive shell within that container. From there, you can:
latch
version 2.65.7
or later.latch develop
interactive shell to validate your workflow.
Below is a sample test script for the nf-core/atac-seq
workflow. This script runs nf_nf_core_atacseq function with multiple input samples stored in public S3 buckets:
LatchFile("/root/path/to/local_test_file.fastq.gz")
latch develop
Sync Behaviorlatch develop
syncs files from your local workflow directory using rsync. Files outside this directory are not synced. If you need test data, place it in a subfolder inside your workflow directory.latch register --staging
to rebuild the image, then run latch develop
again to enter the updated environment.1. The `initialize` task will always fail in `latch develop`
initialize
task provisions a shared POSIX filesystem volume (OFS) and returns an identifier (usually passed as pvc_name
) so downstream Nextflow tasks can read and write to a common mount. This works because the task is running inside Latch’s execution environment, which has access to the internal dispatcher service that provisions storage and Kubernetes infrastructure to mount the volumeWhen you run latch develop
, none of those services exist — you’re just inside an interactive shell in the workflow container. As a result, any attempt to call initialize will fail.The solution is to either run the runtime_task
directly using ""
as the value of pvc_name
or adding a conditional if
check in the initialize
task as below:2. Update `latch.config` default executor
latch.config
, set the executor to local
in debug mode so tasks can run without k8s. This ensures you can still test task logic inside latch develop
without depending on infrastructure that only exists in production.3. Use a compatible Nextflow base image
latch-base-nextflow
versions >= v3.0.5
or >= v2.5.6
(See example)4. Use the Python environment with Latch installed
latch
package/usr/local/bin/python3
(default in Latch base images)5. Reduce resource requests
latch develop
’s instance.6. Optionally, lower Java CPU usage
-XX:ActiveProcessorCount
in your Nextflow command in the entrypoint.py
file to cap Java’s perceived cores.(See example here)latch
versions 2.59.0
and later.--instance-size
flag to run latch develop on a specific instance type. This is useful when debugging code that depends on certain hardware specs.
Example:
Instance Size | Cores | RAM | GPU |
---|---|---|---|
small_task | 2 | 4 GiB | – |
medium_task | 30 | 100 GiB | – |
small_gpu_task | 7 | 30 GiB | 1× NVIDIA T4 |
large_gpu_task | 63 | 245 GiB | 1× NVIDIA A10G |
v100_x1_task | 7 | 48 GiB | 1× NVIDIA V100 |
g6e_xlarge_task | 4 | 32 GiB | 1× NVIDIA L40S |