seqeralabs/tower-cli

Option to restrict dumping of unique fields to JSON

Opened this issue · 1 comments

When exporting pipelines and compute environments via the CLI we currently have to use jq to "clean" the JSON output so it doesn't contain potentially unique entries. This is particularly important when you then want to import these JSON files in another Workspace. Be good to have a single option either to dump non-unique entries or an option to select which fields you would like to exclude.

tw pipelines export --workspace=community/showcase --name=nf-core-rnaseq | jq 'del(.launch["id", "computeEnvId", "workDir", "dateCreated"])' > pipeline.json
tw compute-envs export --workspace=community/showcase --name=AWS_Batch_Ireland | jq 'del(.["executionRole"])' > ce.json

About the pipeline export:
Is it necessary to remove the id, workDir, and dateCreated ?
I'm saying this because, when I tried, the only parameter I needed to remove was the CE ID, which should be overridden by using the -c parameter when importing.

  • My goal was to have a new pipeline in a workspace, not a guarantee that it would work if I hit launch.
$ tw pipelines export -i 276491893267359 -w 40230138858677 test.json
  Pipeline exported into 'test.json' 

$ tw pipelines import  -n 2dragen   -w  TestOrd/test_workspace  -c 26wJxo9CxN2vJldYCebYtC test.json 
  New pipeline '2dragen' added at [TestOrd / test_workspace] workspace