From a7cd9961b77c4d4d9cbbd53bc46e6d4f17bd84b3 Mon Sep 17 00:00:00 2001 From: Johan Dahlberg Date: Wed, 21 Sep 2016 14:15:31 +0200 Subject: [PATCH 1/4] Adding new values to config --- config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.yaml b/config.yaml index 82c5a5f..b59c325 100644 --- a/config.yaml +++ b/config.yaml @@ -8,6 +8,7 @@ summary_host: testuppmax summary_user: arteria summary_host_key: /path/to/ssh/key summary_destination: /tmp/summaries/ +summary_ngi_pipeline_reports_destination: /tmp/summaries/ngi_reports remote_host: testuppmax remote_user: arteria @@ -19,6 +20,7 @@ ngi_pipeline_url: https://irma1.uppmax.uu.se:4444/ngi_pipeline_upps irma_api_key: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa irma_remote_path: ./staging/ +irma_reports_remote_path: ./staging/reports/ irma_checksum_base_url: https://irma1.uppmax.uu.se:4444/arteria_checksum_staging/api/1.0 irma_siswrap_base_url: https://irma1.uppmax.uu.se:4444/arteria_siswrap_staging/api/1.0 From 9fd491ed3b0b7fc4dc3658457c64b2bec54824b3 Mon Sep 17 00:00:00 2001 From: Johan Dahlberg Date: Wed, 21 Sep 2016 14:19:56 +0200 Subject: [PATCH 2/4] Actions/rules for getting ngi_pipeline reports --- actions/gather_ngi_pipeline_reports.yaml | 16 +++++++++ .../gather_ngi_pipeline_reports.yaml | 36 +++++++++++++++++++ rules/gather_ngi_pipeline_reports.yaml | 16 +++++++++ 3 files changed, 68 insertions(+) create mode 100644 actions/gather_ngi_pipeline_reports.yaml create mode 100644 actions/workflows/gather_ngi_pipeline_reports.yaml create mode 100644 rules/gather_ngi_pipeline_reports.yaml diff --git a/actions/gather_ngi_pipeline_reports.yaml b/actions/gather_ngi_pipeline_reports.yaml new file mode 100644 index 0000000..13c34e5 --- /dev/null +++ b/actions/gather_ngi_pipeline_reports.yaml @@ -0,0 +1,16 @@ +--- +name: gather_ngi_pipeline_reports +description: Downloads the ngi pipeline reports to the summary host +enabled: true +runner_type: mistral-v2 +entry_point: workflows/gather_ngi_pipeline_reports.yaml +pack: arteria-packs +parameters: + context: + default: {} + immutable: true + type: object + workflow: + default: arteria-packs.gather_ngi_pipeline_reports + immutable: true + type: string diff --git a/actions/workflows/gather_ngi_pipeline_reports.yaml b/actions/workflows/gather_ngi_pipeline_reports.yaml new file mode 100644 index 0000000..bb07c77 --- /dev/null +++ b/actions/workflows/gather_ngi_pipeline_reports.yaml @@ -0,0 +1,36 @@ +version: "2.0" # mistral version +name: arteria-packs.gather_ngi_pipeline_reports +description: Downloads ngi pipeline reports from e.g. irma to our summary host. + +workflows: + main: + type: direct + + tasks: + note_workflow_version: + action: core.local + input: + cmd: git rev-parse HEAD + cwd: /opt/stackstorm/packs/arteria-packs/ + on-success: + - get_config + + get_config: + action: arteria-packs.get_pack_config + publish: + summary_host: <% task(get_config).result.result.summary_host %> + summary_user: <% task(get_config).result.result.summary_user %> + summary_destination: <% task(get_config).result.result.summary_destination %> + irma_reports_remote_path: <% task(get_config).result.result.irma_reports_remote_path %> + summary_host_key: <% task(get_config).result.result.summary_host_key %> + on-success: + - rsync_from_irma + + rsync_from_irma: + action: core.remote + input: + cmd: rsync -e "ssh -i /home/seqsum/.ssh/mm-xlas002" -r funk_901@irma1.uppmax.uu.se:<% $.irma_reports_remote_path %>/ <% $.summary_destination %>/ + hosts: <% $.summary_host %> + username: <% $.summary_user %> + private_key: <% $.summary_host_key %> + diff --git a/rules/gather_ngi_pipeline_reports.yaml b/rules/gather_ngi_pipeline_reports.yaml new file mode 100644 index 0000000..55cc2b9 --- /dev/null +++ b/rules/gather_ngi_pipeline_reports.yaml @@ -0,0 +1,16 @@ +--- +name: "arteria-packs.gather_ngi_pipeline_reports" +pack: "arteria-packs" +description: "Attempts to synchronize project reports from the ngi_pipeline at the set intervals." +enabled: true + +trigger: + type: "core.st2.IntervalTimer" + parameters: + unit: hours + delta: 2 + +action: + ref: "arteria-packs.gather_ngi_pipeline_reports" + + From 07e45026513678fb80275b78d909bc53540b21e6 Mon Sep 17 00:00:00 2001 From: Johan Dahlberg Date: Wed, 21 Sep 2016 14:49:24 +0200 Subject: [PATCH 3/4] Specify separate report location --- actions/workflows/gather_ngi_pipeline_reports.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/workflows/gather_ngi_pipeline_reports.yaml b/actions/workflows/gather_ngi_pipeline_reports.yaml index bb07c77..d46cc41 100644 --- a/actions/workflows/gather_ngi_pipeline_reports.yaml +++ b/actions/workflows/gather_ngi_pipeline_reports.yaml @@ -20,7 +20,7 @@ workflows: publish: summary_host: <% task(get_config).result.result.summary_host %> summary_user: <% task(get_config).result.result.summary_user %> - summary_destination: <% task(get_config).result.result.summary_destination %> + summary_ngi_pipeline_reports_destination: <% task(get_config).result.result.summary_ngi_pipeline_reports_destination %> irma_reports_remote_path: <% task(get_config).result.result.irma_reports_remote_path %> summary_host_key: <% task(get_config).result.result.summary_host_key %> on-success: @@ -29,7 +29,7 @@ workflows: rsync_from_irma: action: core.remote input: - cmd: rsync -e "ssh -i /home/seqsum/.ssh/mm-xlas002" -r funk_901@irma1.uppmax.uu.se:<% $.irma_reports_remote_path %>/ <% $.summary_destination %>/ + cmd: rsync -e "ssh -i /home/seqsum/.ssh/mm-xlas002" -r funk_901@irma1.uppmax.uu.se:<% $.irma_reports_remote_path %>/ <% $.summary_ngi_pipeline_reports_destination %>/ hosts: <% $.summary_host %> username: <% $.summary_user %> private_key: <% $.summary_host_key %> From 30014b4d5b927e300c369c91d0557a8d4fe613e5 Mon Sep 17 00:00:00 2001 From: Johan Dahlberg Date: Thu, 22 Sep 2016 10:28:06 +0200 Subject: [PATCH 4/4] Gather the reports every 6 h --- rules/gather_ngi_pipeline_reports.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/gather_ngi_pipeline_reports.yaml b/rules/gather_ngi_pipeline_reports.yaml index 55cc2b9..3a8aa9d 100644 --- a/rules/gather_ngi_pipeline_reports.yaml +++ b/rules/gather_ngi_pipeline_reports.yaml @@ -8,7 +8,7 @@ trigger: type: "core.st2.IntervalTimer" parameters: unit: hours - delta: 2 + delta: 6 action: ref: "arteria-packs.gather_ngi_pipeline_reports"