Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seqerakit docs port #296

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
17fea83
1st commit
llewellyn-sl Sep 16, 2024
e16db95
Create overview, install, commands pages
llewellyn-sl Oct 21, 2024
70d9dcf
Add quickstart and YML pages
llewellyn-sl Oct 22, 2024
9782642
Merge branch 'master' into seqerakit-docs-port
llewellyn-sl Nov 11, 2024
8ccc850
Updates WIP
llewellyn-sl Nov 12, 2024
0af8b1e
Merge branch 'seqerakit-docs-port' of https://github.com/seqeralabs/d…
llewellyn-sl Nov 14, 2024
4ad8624
Templates updates
llewellyn-sl Nov 15, 2024
192122a
Merge branch 'master' into seqerakit-docs-port
llewellyn-sl Nov 15, 2024
71965f9
Clean YAML page, add e2e template
llewellyn-sl Nov 17, 2024
199f110
Update yaml-configuration.mdx
llewellyn-sl Nov 17, 2024
31523f2
Merge branch 'master' into seqerakit-docs-port
llewellyn-sl Nov 17, 2024
26a4b2f
Remove old pages
llewellyn-sl Nov 18, 2024
8f8da47
Merge branch 'master' into seqerakit-docs-port
llewellyn-sl Nov 20, 2024
be69c8d
Update platform_versioned_docs/version-24.1/seqerakit/yaml-configurat…
llewellyn-sl Nov 20, 2024
8fd5458
Seqerakit vs `seqerakit`
llewellyn-sl Nov 21, 2024
99dacc7
Merge branch 'master' into seqerakit-docs-port
llewellyn-sl Nov 25, 2024
e765c9b
Merge branch 'master' into seqerakit-docs-port
llewellyn-sl Nov 25, 2024
bfbf602
Formatting, review suggestions
llewellyn-sl Nov 25, 2024
e6a5c1c
Merge branch 'seqerakit-docs-port' of https://github.com/seqeralabs/d…
llewellyn-sl Nov 25, 2024
c798662
Merge branch 'master' into seqerakit-docs-port
llewellyn-sl Nov 27, 2024
c462d56
Update platform_versioned_docs/version-24.1/seqerakit/commands.mdx
llewellyn-sl Nov 28, 2024
3ff8439
Update platform_versioned_docs/version-24.1/seqerakit/templates.mdx
llewellyn-sl Nov 28, 2024
8752874
Tech review suggestions
llewellyn-sl Nov 28, 2024
2c761c9
Merge branch 'seqerakit-docs-port' of https://github.com/seqeralabs/d…
llewellyn-sl Nov 28, 2024
e3c3b73
Add resource names list
llewellyn-sl Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions platform_versioned_docs/version-24.1/seqerakit/commands.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
title: "Commands"
description: "seqerakit command options"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "seqerakit command options"
description: "Seqerakit command options"

Thoughts?

date: "21 Oct 2024"
tags: [seqerakit, cli, automation, commands]
---

Use the `--help` or `-h` parameter to list available commands and options:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use the `--help` or `-h` parameter to list available commands and options:
Use the `--help` or `-h` option to list available commands and options:

Seqerakit: Python wrapper for the Seqera Platform CLI
options:
-h, --help show this help message and exit


```shell-session
seqerakit --help
```

### Input

Seqerakit supports input through paths to YAML configuration files or directly from standard input (stdin).

- Using file path:

```shell-session
seqerakit /path/to/file.yaml
llewellyn-sl marked this conversation as resolved.
Show resolved Hide resolved
```

- Using stdin:

```shell-session
cat /path/to/file.yaml | seqerakit -
```

See [Define your YAML file using CLI options](#define-your-yaml-file-using-cli-options) for guidance on formatting your input YAML files.

### Dryrun

Confirm that your configuration and command are correct before creating resources in your Seqera account, particularly when automating the end-to-end creation of multiple entities at once. To print the commands that would be executed with Platform CLI when using a YAML file, run your `seqerakit` command with the `--dryrun` flag:

```shell-session
seqerakit file.yaml --dryrun
```

### Specify targets

When using a YAML file as input that defines multiple resources, use the `--targets` flag to specify which resources to create. This flag accepts a comma-separated list of resource names.
llewellyn-sl marked this conversation as resolved.
Show resolved Hide resolved

For example, given a `test.yml` file that defines the following resources:

```yaml
workspaces:
- name: 'workspace-1'
organization: 'seqerakit'
...
compute-envs:
- name: 'compute-env'
type: 'aws-batch forge'
workspace: 'seqerakit/workspace-1'
...
pipelines:
- name: "hello-world"
url: "https://github.com/nextflow-io/hello"
workspace: 'seqerakit/workspace-1'
compute-env: "compute-env"
...
Comment on lines +72 to +77

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single vs double quotes. I'm not sure if this is important.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say we should go with single to match all the values in the templates.

```

You can target the creation of `pipelines` only by running:

```shell-session
seqerakit test.yml --targets pipelines
```

This will process only the pipelines block from the YAML file and ignore `workspaces` and `compute-envs`.
llewellyn-sl marked this conversation as resolved.
Show resolved Hide resolved

To create both workspaces and pipelines, run:

```shell-session
seqerakit test.yml --targets workspaces,pipelines
llewellyn-sl marked this conversation as resolved.
Show resolved Hide resolved
```

### Delete resources

Instead of adding or creating resources, specify the `--delete` flag to recursively delete resources in your YAML file:

```shell-session
seqerakit file.yml --delete
```

For example, if you have a `file.yml` that defines an organization, workspace, team, credentials, and compute environment that have already been created, run `seqerakit file.yml --delete` to recursively delete the same resources.

### Use `tw`-specific CLI options

Specify `tw`-specific CLI options with the `--cli=` flag:

```shell-session
seqerakit file.yaml --cli="--arg1 --arg2"
```

See [CLI commands](../cli/commands.mdx) or run `tw -h` for the full list of options.

:::note
The `--verbose` option for `tw` CLI is currently not supported in `seqerakit` commands.
:::

#### Example: HTTP-only connections

The Platform CLI expects to connect to a Seqera instance that is secured by a TLS certificate. If your Seqera Enterprise instance does not present a certificate, you must run your `tw` commands with the `--insecure` flag.

To use `tw`-specific CLI options such as `--insecure`, use the `--cli=` flag, followed by the options to use enclosed in double quotes:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To use `tw`-specific CLI options such as `--insecure`, use the `--cli=` flag, followed by the options to use enclosed in double quotes:
To use `tw`-specific CLI options such as `--insecure`, use the `--cli=` option, followed by the options to use enclosed in double quotes:

For me, flag is a type of option that is reserved for booleans.


```shell-session
seqerakit file.yaml --cli="--insecure"
```
117 changes: 117 additions & 0 deletions platform_versioned_docs/version-24.1/seqerakit/installation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: "Installation"
description: "seqerakit installation options"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "seqerakit installation options"
description: "Seqerakit installation options"

date: "21 Oct 2024"
tags: [seqerakit, cli, automation, installation]
---


Seqerakit is a Python wrapper that sets [Platform CLI](../cli/overview.mdx) command options using YAML configuration files. Individual commands and configuration parameters can be chained together to automate the end-to-end creation of all Seqera Platform entities.

As an extension of the Platform CLI, Seqerakit enables:

- **Infrastructure as code**: Users manage and provision their infrastructure from the command line.
- **Simple configuration**: All Platform CLI command-line options can be defined in simple YAML format.
- **Automation**: End-to-end creation of Seqera entities, from adding an organization to launching pipelines.

### Installation

Seqerakit has three dependencies:

1. [Seqera Platform CLI (`>=0.9.2`)](https://github.com/seqeralabs/tower-cli/releases)
llewellyn-sl marked this conversation as resolved.
Show resolved Hide resolved
2. [Python (`>=3.8`)](https://www.python.org/downloads/)
3. [PyYAML](https://pypi.org/project/PyYAML/)

#### Pip

If you already have [Seqera Platform CLI](../cli/installation.mdx) and Python installed on your system, install Seqerakit directly from [PyPI](https://pypi.org/project/seqerakit/):

```console
pip install seqerakit
```

Overwrite an existing installation to use the latest version:

```console
pip install --upgrade --force-reinstall seqerakit
```

#### Conda

To install `seqerakit` and its dependencies via Conda, first configure the correct channels:

```console
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict
```

Then create a conda environment with `seqerakit` installed:

```console
conda env create -n seqerakit seqerakit
conda activate seqerakit
```

#### Local development installation

Install the development branch of `seqerakit` on your local machine to test the latest features and updates:
llewellyn-sl marked this conversation as resolved.
Show resolved Hide resolved

1. You must have [Python](https://www.python.org/downloads/) and [Git](https://git-scm.com/downloads) installed on your system.
1. To install directly from pip:
```shell-session
pip install git+https://github.com/seqeralabs/seqera-kit.git@dev
```
1. Alternatively, clone the repository locally and install manually:
```shell-session
git clone https://github.com/seqeralabs/seqera-kit.git
cd seqera-kit
git checkout dev
pip install .
```
1. Verify your installation:
```shell-session
pip show seqerakit
```

### Configuration

Create a [Seqera](https://cloud.seqera.io/) access token via **Your Tokens** in the user menu.
llewellyn-sl marked this conversation as resolved.
Show resolved Hide resolved

Seqerakit reads your access token from the `TOWER_ACCESS_TOKEN` environment variable:

```shell-session
export TOWER_ACCESS_TOKEN=<Your Seqera access token>
```

For Enterprise installations, specify the custom API endpoint used to connect to Seqera. Export the API endpoint environment variable:

```shell-session
export TOWER_API_ENDPOINT=<Seqera Enterprise API URL>
```

By default, this is set to `https://api.cloud.seqera.io` to connect to Seqera Cloud.

### Usage

To confirm the installation of `seqerakit`, configuration of the Platform CLI, and connection to Seqera is working as expected, run this command:

```shell-session
seqerakit --info
```

This runs the `tw info` command under the hood.

Use `--version` or `-v` to retrieve the current version of your `seqerakit` installation:

```shell-session
seqerakit --version
```

Use the `--help` or `-h` parameter to list the available commands and their associated options:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use the `--help` or `-h` parameter to list the available commands and their associated options:
Use the `--help` or `-h` option to list the available commands and their associated options:


```shell-session
seqerakit --help
```

See [Commands](./commands.mdx) for detailed instructions to use Seqerakit.
Loading