-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
273 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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,23 @@ | ||
|
||
name: mkdocs | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- uses: actions/cache@v2 | ||
with: | ||
key: ${{ github.ref }} | ||
path: .cache | ||
- run: pip install "mkdocstrings==0.22.0" "mkdocstrings-python==1.3.*" "mkdocs-material" | ||
- run: mkdocs gh-deploy --force |
This file contains 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
# snk-cli | ||
|
||
The dynamic CLI from [snk](https://snk.wytamma.com/). |
This file contains 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,109 @@ | ||
--- | ||
title: Environments | ||
--- | ||
|
||
# The CLI env command | ||
|
||
The `env` subcommand in the `workflow` tool allows you to access and manage the conda environments used within the workflow. This guide provides an overview of the available options and commands for working with workflow environments. | ||
|
||
## Options | ||
|
||
- `--help`, `-h`: Show the help message and exit. | ||
|
||
## Commands | ||
|
||
The `env` subcommand provides several commands to manage the workflows conda environments. | ||
|
||
### `list` | ||
|
||
List the environments in the workflow. | ||
|
||
```bash | ||
workflow env list [OPTIONS] | ||
``` | ||
|
||
### `activate` | ||
|
||
Activate a workflow conda environment. | ||
|
||
```bash | ||
workflow env activate [OPTIONS] ENV_NAME | ||
``` | ||
|
||
- `ENV_NAME`: Name of the environment to activate. | ||
|
||
This command activates the specified conda environment within the workflow. | ||
|
||
### `create` | ||
|
||
This command creates all the conda environments specified in the `envs` dir. | ||
|
||
A Snakemake workflow that uses a lot of conda envs can take a long time to install as each env is created sequentially. Running `workflow env create` will create all the conda envs in parallel (up to `--workers` at a time, defaults to number of cores). | ||
|
||
```bash | ||
workflow env create [OPTIONS] [NAME] | ||
``` | ||
|
||
Individual conda envs can be create with `workflow env create ENV_NAME`. | ||
|
||
|
||
### `remove` | ||
|
||
Delete all conda environments. | ||
|
||
```bash | ||
workflow env remove [OPTIONS] | ||
``` | ||
|
||
This command deletes all the conda environments in the workflow. | ||
|
||
### `run` | ||
|
||
The `env run` command in the `workflow` tool allows you to run a command within one of the workflow environments. | ||
|
||
#### Arguments | ||
|
||
- `cmd`: The command to run in the environment. This argument is required. | ||
|
||
#### Options | ||
|
||
- `--env`, `-e`: The name of the environment in which to run the command. | ||
- `--help`, `-h`: Show the help message and exit. | ||
|
||
#### Usage | ||
|
||
To run a command in one of the workflow environments, use the following command format: | ||
|
||
```bash | ||
workflow env run --env ENV_NAME CMD... | ||
``` | ||
|
||
- `CMD...`: The command and its arguments to execute within the specified environment. | ||
|
||
Make sure to replace `ENV_NAME` with the actual name of the desired environment, and `CMD...` with the command you want to run. | ||
|
||
#### Example | ||
|
||
Here's an example command that demonstrates the usage of `workflow env run`: | ||
|
||
```bash | ||
workflow env run -e my_environment "python script.py --input input_file.txt --output output_file.txt" | ||
``` | ||
|
||
This command runs the `python script.py --input input_file.txt --output output_file.txt` command within the `my_environment` environment in the workflow. Adjust the command and environment name according to your specific use case. | ||
|
||
|
||
- `ENV_NAME`: Name of the environment in which to run the command. | ||
- `COMMAND [ARGS]...`: The command and its arguments to execute within the specified environment. | ||
|
||
This command runs the provided command within the specified conda environment in the workflow. | ||
|
||
### `show` | ||
|
||
Show the environments config file contents. | ||
|
||
```bash | ||
workflow env show [OPTIONS] | ||
``` | ||
|
||
This command displays the contents of the environments configuration file used in the workflow. |
This file contains 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,19 @@ | ||
--- | ||
title: Home | ||
--- | ||
# snk-cli | ||
|
||
The dynamic CLI from [snk](https://snk.wytamma.com/). | ||
|
||
# The Dynamically Generated Snk CLI | ||
|
||
The primary feature of Snk is dynamic CLI generation. Many aspects of this CLI can be configure though the [Snk config file](/snk_config_file/). | ||
|
||
The CLI provides several commands for interacting with the workflow including | ||
|
||
- config - Access the workflow configuration. | ||
- [env](/CLI/env/) - Access the workflow conda environments. | ||
- [script](/CLI/script/) - Access the workflow scripts. | ||
- info - Display information about the workflow. | ||
- profile - Access the workflow profiles. | ||
- run - Run the Snakemake workflow. |
This file contains 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,2 @@ | ||
::: src.snk_cli.cli | ||
|
This file contains 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,4 @@ | ||
::: src.snk_cli.config.config | ||
|
||
::: src.snk_cli.config.utils | ||
|
This file contains 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,2 @@ | ||
::: src.snk_cli.dynamic_typer | ||
|
This file contains 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,4 @@ | ||
::: src.snk_cli.options.option | ||
|
||
::: src.snk_cli.options.utils | ||
|
This file contains 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,12 @@ | ||
::: src.snk_cli.subcommands.run | ||
|
||
::: src.snk_cli.subcommands.config | ||
|
||
::: src.snk_cli.subcommands.env | ||
|
||
::: src.snk_cli.subcommands.profile | ||
|
||
::: src.snk_cli.subcommands.utils | ||
|
||
::: src.snk_cli.subcommands.script | ||
|
This file contains 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,2 @@ | ||
::: src.snk_cli.testing | ||
|
This file contains 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,2 @@ | ||
::: src.snk_cli.utils | ||
|
This file contains 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,2 @@ | ||
::: src.snk_cli.validate | ||
|
This file contains 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,2 @@ | ||
::: src.snk_cli.workflow | ||
|
This file contains 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,41 @@ | ||
--- | ||
title: Scripts | ||
--- | ||
|
||
# Script Commands | ||
|
||
The `script` commands allow you to interact with the workflow scripts. Scripts must be located in the `scripts` directory of the workflow. | ||
|
||
## List | ||
|
||
The list command will list all scripts in the workflow. | ||
|
||
```bash | ||
snk script list | ||
``` | ||
|
||
## Show | ||
|
||
The show command will display the contents of a script. | ||
|
||
```bash | ||
snk script show hello.py | ||
``` | ||
|
||
## Run | ||
|
||
The run command will run a script. | ||
|
||
```bash | ||
snk script run hello.py | ||
``` | ||
|
||
!!! note | ||
The executor used to run the script is determined by the suffix of the script file. For example, a script named `hello.py` will be run using the `python` executor. | ||
|
||
Use the `--env` option to specify the environment to run the script in. | ||
|
||
```bash | ||
snk script run --env python hello.py | ||
``` | ||
|
This file contains 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,44 @@ | ||
|
||
site_name: snk_cli | ||
# repo_url: https://github.com/wytamma/write-the | ||
|
||
theme: | ||
name: "material" | ||
# homepage: https://write-the.wytamma.com | ||
# logo: assets/logo.png | ||
# favicon: images/favicon.png | ||
palette: | ||
- scheme: default | ||
toggle: | ||
icon: material/brightness-7 | ||
name: Switch to dark mode | ||
- scheme: slate | ||
toggle: | ||
icon: material/brightness-4 | ||
name: Switch to light mode | ||
features: | ||
- toc.follow | ||
- content.action.edit | ||
|
||
extra: | ||
social: | ||
- icon: fontawesome/solid/robot | ||
link: https://github.com/Wytamma/write-the | ||
name: Generated with write-the | ||
|
||
plugins: | ||
- search | ||
- mkdocstrings: | ||
handlers: | ||
python: | ||
options: | ||
docstring_style: "google" | ||
|
||
markdown_extensions: | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
line_spans: __span | ||
pygments_lang_class: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.snippets | ||
- pymdownx.superfences |
This file contains 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