seqeralabs / seqera-kit

Python implementation and field-tool for automated pipeline launching through Tower CLI (beta)
Apache License 2.0
25 stars 6 forks source link

Add targets flag to specify resources for creation in input YAML #158

Closed ejseqera closed 1 month ago

ejseqera commented 1 month ago

Adds a new flag, --targets, to the CLI interface to specify "targets" for creation in an omnibus YAML file with one or more resources defined. For example, with a YAML as such:

workspaces:
  - name: 'showcase'
    organization: 'seqerakit_automation'
    full-name: 'e2e_demo_showcase'
    overwrite: True
labels:
    - name: 'seqerakit'
      value: 'seqerakit'
      workspace: 'scidev/testing'
      overwrite: True
pipelines:
  - name: "hello-world-test-seqerakit"
    url: "https://github.com/nextflow-io/hello"
    workspace: "scidev/test"
    compute-env: "seqera_aws_london_fusion_nvme"
    revision: "master"
    overwrite: True

We can specify resources to create with:

$ seqerakit example.yml --targets pipelines

seqerakit example.yml --targets pipelines
INFO:root: Running command: tw -o json pipelines list -w scidev/testing
INFO:root: Checking if name hello-world-test-seqerakit exists in Seqera Platform...
INFO:root: Running command: tw pipelines add --name hello-world-test-seqerakit --workspace scidev/testing --compute-env seqera_aws_london_fusion_nvme --revision master https://github.com/nextflow-io/hello
INFO:root: Command output: New pipeline 'hello-world-test-seqerakit' added at [scidev / testing] workspace

Resources not specified or targeted for creation like organizations or workspaces will not be included. It also enforces ordering as expected:

seqerakit example.yml --targets pipelines,workspaces
INFO:root: Running command: tw -o json workspaces list -o seqerakit_automation
INFO:root: Checking if workspaceName showcase exists in Seqera Platform...
INFO:root: Running command: tw workspaces add --name showcase --organization seqerakit_automation --full-name e2e_demo_showcase
...