X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0f537bcaa60b8a1496010bc9d4a943484e69081c..14088c5bd88ede15698ba8f5b8efbf08e18374ce:/sdk/python/tests/fed-migrate/fed-migrate.cwl?ds=sidebyside diff --git a/sdk/python/tests/fed-migrate/fed-migrate.cwl b/sdk/python/tests/fed-migrate/fed-migrate.cwl index a94dfb5b68..bb11f0a6e6 100644 --- a/sdk/python/tests/fed-migrate/fed-migrate.cwl +++ b/sdk/python/tests/fed-migrate/fed-migrate.cwl @@ -16,8 +16,8 @@ $graph: id: fed_migrate type: string outputs: - - id: report - outputSource: main_2/report + - id: report3 + outputSource: main_2/report3 type: File requirements: InlineJavascriptRequirement: {} @@ -89,23 +89,22 @@ $graph: valueFrom: '$(inputs.superuser_tokens[0])' out: - report + - report2 + - report3 + - r run: - arguments: - - $(inputs.fed_migrate) - - '--report' - - report.csv - class: CommandLineTool + class: Workflow id: main_2_embed inputs: - - id: arvados_api_hosts + - id: ar type: items: string type: array - - id: superuser_tokens + - id: arvados_api_hosts type: items: string type: array - - id: ar + - id: superuser_tokens type: items: string type: array @@ -117,18 +116,184 @@ $graph: type: Any outputs: - id: report - outputBinding: - glob: report.csv + outputSource: main_2_embed_1/report + type: File + - id: report2 + outputSource: main_2_embed_2/report2 + type: File + - id: report3 + outputSource: main_2_embed_3/report3 + type: File + - id: r + outputSource: main_2_embed_4/r type: File requirements: - class: EnvVarRequirement envDef: ARVADOS_API_HOST: $(inputs.host) + ARVADOS_API_HOST_INSECURE: '1' ARVADOS_API_TOKEN: $(inputs.token) + steps: + - id: main_2_embed_1 + in: + fed_migrate: + source: fed_migrate + host: + source: host + token: + source: token + out: + - report + run: + arguments: + - $(inputs.fed_migrate) + - '--report' + - report.csv + class: CommandLineTool + id: main_2_embed_1_embed + inputs: + - id: fed_migrate + type: string + - id: host + type: Any + - id: token + type: Any + outputs: + - id: report + outputBinding: + glob: report.csv + type: File + requirements: + InlineJavascriptRequirement: {} + - id: main_2_embed_2 + in: + host: + source: host + report: + source: main_2_embed_1/report + token: + source: token + out: + - report2 + run: + arguments: + - sed + - '-E' + - 's/,(case[1-8])2?,/,\1,/g' + class: CommandLineTool + id: main_2_embed_2_embed + inputs: + - id: report + type: File + - id: host + type: Any + - id: token + type: Any + outputs: + - id: report2 + outputBinding: + glob: report.csv + type: File + requirements: + InlineJavascriptRequirement: {} + stdin: $(inputs.report.path) + stdout: report.csv + - id: main_2_embed_3 + in: + fed_migrate: + source: fed_migrate + host: + source: host + report2: + source: main_2_embed_2/report2 + token: + source: token + out: + - report3 + run: + arguments: + - $(inputs.fed_migrate) + - '--migrate' + - $(inputs.report2) + class: CommandLineTool + id: main_2_embed_3_embed + inputs: + - id: report2 + type: File + - id: fed_migrate + type: string + - id: host + type: Any + - id: token + type: Any + outputs: + - id: report3 + outputBinding: + outputEval: $(inputs.report2) + type: File + requirements: + InlineJavascriptRequirement: {} + - id: main_2_embed_4 + in: + arvados_api_hosts: + source: arvados_api_hosts + check: + default: + class: File + location: check.py + host: + source: host + report3: + source: main_2_embed_3/report3 + superuser_tokens: + source: superuser_tokens + token: + source: token + out: + - r + run: + arguments: + - python + - $(inputs.check) + - _script + class: CommandLineTool + id: main_2_embed_4_embed + inputs: + - id: report3 + type: File + - id: host + type: Any + - id: token + type: Any + - id: arvados_api_hosts + type: + items: string + type: array + - id: superuser_tokens + type: + items: string + type: array + - id: check + type: File + outputs: + - id: r + outputBinding: + outputEval: $(inputs.report3) + type: File + requirements: + InitialWorkDirRequirement: + listing: + - entry: | + { + "arvados_api_hosts": $(inputs.arvados_api_hosts), + "superuser_tokens": $(inputs.superuser_tokens) + } + entryname: _script + InlineJavascriptRequirement: {} - arguments: - arvbox - cat - - /var/lib/arvados/superuser_token + - /var/lib/arvados-arvbox/superuser_token class: CommandLineTool cwlVersion: v1.0 id: '#superuser_tok' @@ -170,6 +335,11 @@ $graph: - default: arv-federation-migrate id: fed_migrate type: string + - id: arvbox_bin + type: File + - default: master + id: refspec + type: string outputs: - id: supertok outputSource: main_2/supertok @@ -177,7 +347,7 @@ $graph: items: string type: array - id: report - outputSource: run_test_3/report + outputSource: run_test_3/report3 type: File requirements: InlineJavascriptRequirement: {} @@ -205,6 +375,8 @@ $graph: type: string - id: main_2 in: + arvbox_bin: + source: arvbox_bin cluster_id: source: arvados_cluster_ids container: @@ -213,6 +385,8 @@ $graph: source: arvados_api_hosts logincluster: source: main_1/logincluster + refspec: + source: refspec out: - supertok run: @@ -227,29 +401,29 @@ $graph: type: string - id: logincluster type: string + - id: arvbox_bin + type: File + - id: refspec + type: string outputs: - id: supertok - outputSource: superuser_tok_3/superuser_token + outputSource: superuser_tok_2/superuser_token type: string requirements: - - class: EnvVarRequirement - envDef: - ARVBOX_CONTAINER: $(inputs.container) + InlineJavascriptRequirement: {} steps: - id: main_2_embed_1 in: - cluster_id: - source: cluster_id + arvbox_bin: + source: arvbox_bin container: source: container - logincluster: - source: logincluster - set_login: - default: - class: File - location: set_login.py + host: + source: host + refspec: + source: refspec out: - - c + - d run: arguments: - sh @@ -259,98 +433,67 @@ $graph: inputs: - id: container type: string - - id: cluster_id - type: string - - id: logincluster + - id: host type: string - - id: set_login + - id: arvbox_bin type: File + - id: refspec + type: string outputs: - - id: c + - id: d outputBinding: outputEval: $(inputs.container) type: string requirements: InitialWorkDirRequirement: listing: - - entry: > - set -x + - entry: >+ + set -xe - docker cp - $(inputs.container):/var/lib/arvados/cluster_config.yml.override - . + export ARVBOX_CONTAINER="$(inputs.container)" - chmod +w cluster_config.yml.override + $(inputs.arvbox_bin.path) pipe < - set -x + git fetch + + git checkout -f $(inputs.refspec) + + git pull + + chown arvbox:arvbox -R . + + EOF + + + $(inputs.arvbox_bin.path) hotreset - arvbox hotreset while ! curl --fail --insecure --silent https://$(inputs.host)/discovery/v1/apis/arvados/v1/rest >/dev/null ; do sleep 3 ; done - export ARVADOS_API_HOST=$(inputs.host) - export ARVADOS_API_TOKEN=\$(arvbox cat - /var/lib/arvados/superuser_token) + ARVADOS_VIRTUAL_MACHINE_UUID=\$($(inputs.arvbox_bin.path) + cat /var/lib/arvados-arvbox/vm-uuid) - export ARVADOS_API_HOST_INSECURE=1 + ARVADOS_API_TOKEN=\$($(inputs.arvbox_bin.path) cat + /var/lib/arvados-arvbox/superuser_token) - ARVADOS_VIRTUAL_MACHINE_UUID=\$(arvbox cat - /var/lib/arvados/vm-uuid) + while ! curl --fail --insecure --silent -H + "Authorization: Bearer $ARVADOS_API_TOKEN" + https://$(inputs.host)/arvados/v1/virtual_machines/$ARVADOS_VIRTUAL_MACHINE_UUID + >/dev/null ; do sleep 3 ; done - while ! python -c "import arvados ; - arvados.api().virtual_machines().get(uuid='$ARVADOS_VIRTUAL_MACHINE_UUID').execute()" - 2>/dev/null ; do sleep 3; done entryname: _script InlineJavascriptRequirement: {} - - id: superuser_tok_3 + - id: superuser_tok_2 in: container: source: container d: - source: main_2_embed_2/d + source: main_2_embed_1/d out: - superuser_token run: '#superuser_tok' @@ -368,7 +511,7 @@ $graph: superuser_tokens: source: main_2/supertok out: - - report + - report3 run: '#run_test' cwlVersion: v1.0