Skip to content

Commit

Permalink
refactored sections
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahle committed Sep 6, 2022
1 parent 6e9ce28 commit 99dd34e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
Binary file added docs/source/assets/executions-tui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 3 additions & 21 deletions docs/source/basics/local_development.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
# Local Development

Executing workflows on the LatchBio platform is heavily encouraged for
consistent behavior.
Executing workflows on the LatchBio platform is heavily encouraged for consistent behavior.

Workflows often deal with enormous files that are too large for local
development environments and sometimes require computing resources that cannot
be accommodated by local machines or are just unavailable (eg. GPUs). Thus,
there are many cases when local executions with smaller files or reduced
resources may behave differently than on properly configured cloud
infrastructure. Local execution should never be a substitute for testing
workflow logic on the platform itself.
Workflows often deal with enormous files that are too large for local development environments and sometimes require computing resources that cannot be accommodated by local machines or are just unavailable (eg. GPUs). Thus, there are many cases when local executions with smaller files or reduced resources may behave differently than on properly configured cloud infrastructure. Local execution should never be a substitute for testing workflow logic on the platform itself.

However, the ability to quickly iterate and debug task logic locally is
certainly useful for teasing out many types of bugs.

Using a `if __name__ == "__main__":` clause is a useful way to tag local
function calls with sample values. Running `python3 wf/__init__.py` will become
an entrypoint for quick debugging.

To run the same entrypoint _within_ the latest registered container, one can run
`latch local-execute <PATH_TO_WORKFLOW_DIR>`. This gives the same confidence in
reproducible behavior one would usually receive post registration but with the
benefits of fast local development. Note that workflow code is
mounted inside the latest container build so that rebuilds are not consistently
made with rapid changes.

More information [here](https://docs.latch.bio/subcommands.html#latch-local-execute).
Using a `if __name__ == "__main__":` clause is a useful way to tag local function calls with sample values. Running `python3 wf/__init__.py` will become an entrypoint for quick debugging.

Here is an example of a minimal `wf/__init__.py` file that demonstrates local
execution:
Expand Down
18 changes: 17 additions & 1 deletion docs/source/getting_started/authoring_your_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,19 @@ To test your first workflow on Console, select the **Test Data** and click Launc
![Interface UI](../assets/interface.png)

### Using Latch CLI
To launch the workflow on Latch Console from the CLI, first generate a parameters file:
Using `latch get-wf`, you can view the names of all workflows available in your workspace:
```shell-session
$ latch get-wf
ID Name Version
65047 wf.deseqf.deseq2_wf 0.0.1r
67056 wf.__init__.aggregate_bulk_rna_seq_counts 0.0.2-eb5e84
67649 wf.__init__.align_with_salmon 0.0.0-4cd8db
67628 wf.__init__.alphafold_wf v2.2.3+46
67617 wf.__init__.assemble_and_sort 0.0.1
```

To launch the workflow on Latch Console from the CLI, first generate a parameters file by using `latch get-params` and passing in the name of your workflow like so:
```shell-session
$ latch get-params wf.__init__.assemble_and_sort
```
Expand Down Expand Up @@ -332,6 +344,10 @@ You can view execution statuses from the CLI, run:
$ latch get-executions
```

![Executions TUI](../assets/executions-tui.png)

The command will open up a Terminal UI with the same capabilities on the Executions page on the Latch Platform, where you will see a list of executions, tasks, and logs for easy debugging.

---
# Next Steps
* Read the [Concepts](../basics/what_is_a_workflow.md) page
Expand Down
12 changes: 12 additions & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,20 @@ basics/defining_cloud_resources
basics/customizing_interface
basics/caching
basics/conditional_and_map_tasks
```

```{toctree}
:hidden:
:maxdepth: 2
:caption: Testing and Debugging a Workflow
basics/local_development
basics/remote_execution
```

```{toctree}
:hidden:
:maxdepth: 2
:caption: Publishing a Workflow
basics/uploading_test_data
```

Expand Down

0 comments on commit 99dd34e

Please sign in to comment.