From 3e572db998be0578f741f6deb65ac8231ded8dc3 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Tue, 25 Jun 2024 10:21:33 +0200 Subject: [PATCH 01/19] reorder, fix title --- _plugins/gtn/ro-crate.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_plugins/gtn/ro-crate.rb b/_plugins/gtn/ro-crate.rb index 8d38bb8769e7ae..e7fae63e857fde 100644 --- a/_plugins/gtn/ro-crate.rb +++ b/_plugins/gtn/ro-crate.rb @@ -79,9 +79,9 @@ def self.write(site, dir, associated_material, workflow, url, baseurl, time_base } mat_contribs = [ + ['Workflow Author(s)', workflow['creators'].map { |c| c['name'] }], ['Tutorial Author(s)', Gtn::Contributors.get_authors(associated_material).map { |n| name2md(site, n) }], ['Tutorial Contributor(s)', Gtn::Contributors.get_non_authors(associated_material).map { |n| name2md(site, n) }], - ['Workflow Author(s)', workflow['creators'].map { |c| c['name'] }], ['Funder(s)', Gtn::Contributors.get_funders(associated_material).map { |n| name2md(site, n) }], ].reject { |_, v| v.empty? } @@ -90,7 +90,7 @@ def self.write(site, dir, associated_material, workflow, url, baseurl, time_base ## Associated Tutorial -This workflows is part of the tutorial [#{workflow['name']}](#{url}#{baseurl}/topics/#{workflow['topic_id']}/tutorials/#{workflow['tutorial_id']}/tutorial.html), available in the [GTN](https://training.galaxyproject.org) +This workflows is part of the tutorial [#{associated_material['title']}](#{url}#{baseurl}/topics/#{workflow['topic_id']}/tutorials/#{workflow['tutorial_id']}/tutorial.html), available in the [GTN](https://training.galaxyproject.org) #{"## Features" if features.values.any?} From cf518607a301a8a353719ea5f239fb0774db93a9 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Tue, 25 Jun 2024 15:48:18 +0200 Subject: [PATCH 02/19] debug why no discussion channels --- bin/wfh-upload.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/wfh-upload.py b/bin/wfh-upload.py index bac496101d3c07..a09cda2f7c579d 100755 --- a/bin/wfh-upload.py +++ b/bin/wfh-upload.py @@ -72,6 +72,7 @@ def doUpload(crate_path): } } + print("Discussion links: ", response.json()['data']['attributes']['discussion_links']) if response.json()['data']['attributes']['discussion_links'] and not any( x['label'] == 'GTN Matrix' for x in response.json()['data']['attributes']['discussion_links'] ): From 5f4ccaa54c34553dff0a1dace2dfe5441ed1b984 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Tue, 25 Jun 2024 15:56:21 +0200 Subject: [PATCH 03/19] fix ro crate link --- _layouts/workflow.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_layouts/workflow.html b/_layouts/workflow.html index 11ead822106762..42b605b38737de 100644 --- a/_layouts/workflow.html +++ b/_layouts/workflow.html @@ -116,7 +116,7 @@

{{ workflow.title }}


{% if jekyll.environment == "production" %} - RO-Crate logo with flask Download Workflow RO-Crate + RO-Crate logo with flask Download Workflow RO-Crate {% endif %} {% if workflow.workflowhub_id %} Workflowhub cloud with gears logo View on WorkflowHub From 93cf1b4fb9830b9e741494115cc46794944fc958 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Tue, 25 Jun 2024 15:56:36 +0200 Subject: [PATCH 04/19] missing images --- assets/images/ro-crate.png | Bin 0 -> 5719 bytes assets/images/workflowhub-icon.svg | 123 ++++------------- assets/images/workflowhub.svg | 212 +++++++++++++++++++++++++++++ 3 files changed, 241 insertions(+), 94 deletions(-) create mode 100644 assets/images/ro-crate.png create mode 100644 assets/images/workflowhub.svg diff --git a/assets/images/ro-crate.png b/assets/images/ro-crate.png new file mode 100644 index 0000000000000000000000000000000000000000..64b00a9a09df11c2887f651468c98c54754cecac GIT binary patch literal 5719 zcmV-d7O3foP)2rk&cDC*_V()P z>X&$U^78UjRa5HYHOCe0$B!&47S^baiv- z^Ylocrr7H1f>~Lt(9?doyb_yQmSrYX!pXb>0xs!y z60(wYRBlJZ@awkUS~O~|Mcnx{5wJ?EAGEAmX*Kzh{nu}k-IqA@HJBh;@0z)Fb!e*gldl6!vz zHi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yWEQY5*P{h-9Bpx-ZJ1;> z82+&R4=K~R&B9$hlNx27b7Rr^G23q~8kA9-Ze4?Rp-j0nEvqrAPrh3vgp>NHVbbO? zE4EG`%CKS5r3Iaae_)@rV0GA6NV>1^w}r4nzRD@r<; z4@&^!Kf_yCZK6rZa3Rp_hmjGmq*tNuJ=AM|B?2{#HoNZrg$TG>ot9zE{L2t9YnqqP zZ&-g70-`fnWsG85h7G$zMXJ|MsENB002ov JPDHLkV1mL;ypsR` literal 0 HcmV?d00001 diff --git a/assets/images/workflowhub-icon.svg b/assets/images/workflowhub-icon.svg index 1c90ac0872b2f9..fc95a3e705a40f 100644 --- a/assets/images/workflowhub-icon.svg +++ b/assets/images/workflowhub-icon.svg @@ -2,23 +2,23 @@ + inkscape:export-ydpi="159.83502" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> WorkflowHub logo + inkscape:snap-bbox-edge-midpoints="true" + inkscape:showpageshadow="2" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" /> + transform="translate(-27.218581,-35.645213)" /> + transform="translate(-27.218581,-35.645213)" /> + transform="translate(-27.218581,75.604784)" /> - - - - - - - - - - - - - WorkflowHub + transform="translate(-27.218581,-4.3952111)"> diff --git a/assets/images/workflowhub.svg b/assets/images/workflowhub.svg new file mode 100644 index 00000000000000..1c90ac0872b2f9 --- /dev/null +++ b/assets/images/workflowhub.svg @@ -0,0 +1,212 @@ + + + + + WorkflowHub logo + + + + image/svg+xml + + WorkflowHub logo + 2020-09-23 + + + Finn Bacall, Stian Soiland-Reyes + + + + + The University of Manchester + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WorkflowHub + + + + + From aad16800d49f937ccbe29c3b6b4f3083abc5d0a2 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 26 Jun 2024 15:34:14 +0200 Subject: [PATCH 05/19] swap properly to prod --- bin/wfh-upload.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/wfh-upload.py b/bin/wfh-upload.py index a09cda2f7c579d..fff9674a8493ef 100755 --- a/bin/wfh-upload.py +++ b/bin/wfh-upload.py @@ -8,7 +8,10 @@ import time import multiprocessing -GTN_PROJECT_ID = 63 +# GTN_BOT_ID = https://workflowhub.eu/people/731 +GTN_PROJECT_ID = 12 +# WORKFLOWHUB = "https://dev.workflowhub.eu" +WORKFLOWHUB = "https://workflowhub.eu" if len(sys.argv) == 2: crates = [sys.argv[1]] @@ -34,12 +37,12 @@ def doUpload(crate_path): "workflow[project_ids][]": (None, GTN_PROJECT_ID), # GTN's ID. } headers = { - "authorization": "Token " + os.environ["DEV_WFH_TOKEN"], + "authorization": "Token " + os.environ["WFH_TOKEN"], 'User-Agent': 'GTN (github.com/galaxyproject/training-material@1.0)', } response = requests.post( - "https://dev.workflowhub.eu/workflows/submit", files=payload, headers=headers + f"{WORKFLOWHUB}/workflows/submit", files=payload, headers=headers ) code = response.status_code if code != 200: @@ -88,7 +91,7 @@ def doUpload(crate_path): 'Content-type': 'application/json', 'Accept': 'application/json', }) - response2 = requests.put(f"https://dev.workflowhub.eu/workflows/{wfid}", headers=headers, json=permissions_update) + response2 = requests.put(f"{WORKFLOWHUB}/workflows/{wfid}", headers=headers, json=permissions_update) if response2.status_code != 200: print(f"Error {response2.status_code} updating permissions for {wfid}: {response2.text}") From 41ceb264f858c0a558d6098ad8bdbda293e7321b Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 26 Jun 2024 15:35:17 +0200 Subject: [PATCH 06/19] swap to now merged logo --- _plugins/gtn/ro-crate.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/_plugins/gtn/ro-crate.rb b/_plugins/gtn/ro-crate.rb index e7fae63e857fde..0f6fd4b7475d8c 100644 --- a/_plugins/gtn/ro-crate.rb +++ b/_plugins/gtn/ro-crate.rb @@ -100,9 +100,8 @@ def self.write(site, dir, associated_material, workflow, url, baseurl, time_base #{mat_contribs.map { |k, v| "**#{k}**: #{v.join(', ')}" }.join("\n\n")} -[![gtn star logo followed by the word workflows](http://galaxy-training.s3-website.us-east-1.amazonaws.com/misc/gtn-workflows.png)](https://training.galaxyproject.org/training-material/) +[![gtn star logo followed by the word workflows](https://training.galaxyproject.org/training-material/assets/branding/gtn-workflows.png)](https://training.galaxyproject.org/training-material/) ).strip - # ![gtn star logo followed by the word workflows](https://training.galaxyproject.org/training-material/assets/branding/gtn-workflows.png) crate = { '@context' => ['https://w3id.org/ro/crate/1.1/context'], From f19d41b7f647ecc1dcbc6b2ae6a831318170f6f0 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 26 Jun 2024 15:42:57 +0200 Subject: [PATCH 07/19] concurrency --- .github/workflows/workflowhub.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/workflowhub.yml b/.github/workflows/workflowhub.yml index 93e792c34a5aa1..b1829cfe485d51 100644 --- a/.github/workflows/workflowhub.yml +++ b/.github/workflows/workflowhub.yml @@ -1,5 +1,9 @@ name: "[Cron] Upload workflows to (DEV)WorkflowHub" +concurrency: + group: wfh-${{ github.head_ref }} + cancel-in-progress: false # Not sure about this. + on: schedule: # * is a special character in YAML so you have to quote this string From 8c2de048bc506d56f2a6bf8193ae1bdd1773d9b5 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 26 Jun 2024 15:44:01 +0200 Subject: [PATCH 08/19] swap to prod --- .github/workflows/workflowhub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflowhub.yml b/.github/workflows/workflowhub.yml index b1829cfe485d51..622ecaca1b0a49 100644 --- a/.github/workflows/workflowhub.yml +++ b/.github/workflows/workflowhub.yml @@ -57,7 +57,7 @@ jobs: run: | python bin/wfh-upload.py env: - DEV_WFH_TOKEN: ${{ secrets.DEV_WFH_TOKEN }} + WFH_TOKEN: ${{ secrets.PROD_WFH_TOKEN }} - name: Create Pull Request uses: peter-evans/create-pull-request@v3 From f1558f4d3b830b25b41c6bd17c2441b6a0af6bd4 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 26 Jun 2024 15:56:41 +0200 Subject: [PATCH 09/19] fix some permissions settings --- bin/wfh-upload.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/bin/wfh-upload.py b/bin/wfh-upload.py index fff9674a8493ef..637a380e04ed13 100755 --- a/bin/wfh-upload.py +++ b/bin/wfh-upload.py @@ -39,6 +39,8 @@ def doUpload(crate_path): headers = { "authorization": "Token " + os.environ["WFH_TOKEN"], 'User-Agent': 'GTN (github.com/galaxyproject/training-material@1.0)', + # 'Content-type': 'application/json', + 'Accept': 'application/json', } response = requests.post( @@ -74,19 +76,21 @@ def doUpload(crate_path): } } } - - print("Discussion links: ", response.json()['data']['attributes']['discussion_links']) - if response.json()['data']['attributes']['discussion_links'] and not any( + + dls = response.json()['data']['attributes']['discussion_links'] + print("Discussion links: ", dls) + if dls is None or len(dls) == 0 or (not any( x['label'] == 'GTN Matrix' for x in response.json()['data']['attributes']['discussion_links'] - ): + )): permissions_update['data']['attributes']['discussion_links'] = [ { "label": "GTN Matrix", "url": "https://matrix.to/#/%23galaxyproject_admin:gitter.im" # Must encode the second # } ] - - + + + print(permissions_update) headers.update({ 'Content-type': 'application/json', 'Accept': 'application/json', @@ -94,7 +98,7 @@ def doUpload(crate_path): response2 = requests.put(f"{WORKFLOWHUB}/workflows/{wfid}", headers=headers, json=permissions_update) if response2.status_code != 200: print(f"Error {response2.status_code} updating permissions for {wfid}: {response2.text}") - + p = crate_path.split("/") windex = p.index("workflows") (topic, tutorial, workflow) = p[windex + 1:windex + 4] From 03bf1479e97cac4ebf85906b6f941650c6abcc1f Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 26 Jun 2024 15:57:32 +0200 Subject: [PATCH 10/19] fix ro crate link --- _layouts/workflow.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_layouts/workflow.html b/_layouts/workflow.html index 42b605b38737de..15803ad0de26be 100644 --- a/_layouts/workflow.html +++ b/_layouts/workflow.html @@ -116,8 +116,9 @@

{{ workflow.title }}


{% if jekyll.environment == "production" %} - RO-Crate logo with flask Download Workflow RO-Crate + RO-Crate logo with flask Download Workflow RO-Crate {% endif %} + {% if workflow.workflowhub_id %} Workflowhub cloud with gears logo View on WorkflowHub {% endif %} From e4a71cc4c5ceb49785ae4d077b37234679a57813 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 27 Jun 2024 11:31:33 +0200 Subject: [PATCH 11/19] Add tool listing in table --- _layouts/workflow.html | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/_layouts/workflow.html b/_layouts/workflow.html index 15803ad0de26be..fc1be6bf06d1f6 100644 --- a/_layouts/workflow.html +++ b/_layouts/workflow.html @@ -150,6 +150,41 @@

{{ workflow.title }}

{{ workflow.mermaid }}
+

Tools

+ + + + + + + + + + {% for tool in workflow.workflow_tools %} + + + + + {% endfor %} + +
ToolLinks
{{ tool }} + {% if site.data['toolshed-revisions'][tool] %} + {% assign tsdata = site.data['toolshed-revisions'][tool] %} + + View in ToolShed + + {% endif %} +
+ + + +

To use these workflows in Galaxy you can either click the links to download the workflows, or you can right-click and copy the link to the workflow which can be used in the Galaxy form to import workflows.

From fb4b2082815427fad019956025de4ce707d0fae1 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 27 Jun 2024 11:48:51 +0200 Subject: [PATCH 12/19] add inputs, outputs --- _layouts/workflow.html | 47 ++++++++++++++++++++++++++------- _plugins/jekyll-topic-filter.rb | 4 ++- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/_layouts/workflow.html b/_layouts/workflow.html index fc1be6bf06d1f6..dce3e843eab3fa 100644 --- a/_layouts/workflow.html +++ b/_layouts/workflow.html @@ -149,9 +149,46 @@

{{ workflow.title }}

Download
{{ workflow.mermaid }}
+

Inputs

+ + + + + + + + + {% for input in workflow.inputs %} + + + + + {% endfor %} + +
InputLabel
{{ input.name }}{{ input.label }}
-

Tools

+

Outputs

+ + + + + + + + + + {% for output in workflow.outputs %} + + + + + + {% endfor %} + +
FromOutputLabel
{{ output.tool_id }}{{ output.name }}{{ output.label }}
+ +

Tools

@@ -176,14 +213,6 @@

Tools

- -

To use these workflows in Galaxy you can either click the links to download the workflows, or you can right-click and copy the link to the workflow which can be used in the Galaxy form to import workflows.

diff --git a/_plugins/jekyll-topic-filter.rb b/_plugins/jekyll-topic-filter.rb index d6cc1e0bf368b7..c5b502d6c42ea3 100644 --- a/_plugins/jekyll-topic-filter.rb +++ b/_plugins/jekyll-topic-filter.rb @@ -699,7 +699,9 @@ def self.resolve_material(site, material) 'modified' => File.mtime(wf_path), 'mermaid' => mermaid(wf_json), 'graph_dot' => graph_dot(wf_json), - 'workflow_tools' => extract_workflow_tool_list(wf_json).uniq, + 'workflow_tools' => extract_workflow_tool_list(wf_json).flatten.uniq.sort, + 'inputs' => wf_json['steps'].select { |_k, v| ['data_input', 'data_collection_input', 'parameter_input'].include? v['type'] }.map{|_, v| v}, + 'outputs' => wf_json['steps'].select { |_k, v| v['workflow_outputs'] && v['workflow_outputs'].length.positive? }.map{|_, v| v}, } end end From 60e4286d9106b1bb1562c0ba296c161473066c8b Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 3 Jul 2024 10:10:06 +0200 Subject: [PATCH 13/19] improve tool display --- _layouts/by_tool.html | 46 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/_layouts/by_tool.html b/_layouts/by_tool.html index a27f06731a52e2..3c6837296ea004 100644 --- a/_layouts/by_tool.html +++ b/_layouts/by_tool.html @@ -2,24 +2,64 @@ layout: base --- -

Tutorials using {{ page.short_tool }}

+{% assign tool_id_path = page.observed_tool_ids[0][0] %} + +
+

+ {{ site.data['tool-meta'][tool_id_path].name }}: + {{ site.data['tool-meta'][tool_id_path].desc }} +

+
{{ page.observed_tool_ids[0] }}
+
+
-

Servers Offering this Tool

+

Metadata

+

Servers Offering this Tool

UseGalaxy.eu ({{ page.observed_tool_ids[0][1] }})

This is a guess, we are not currently checking if that is actually present.

-

Observed Tool Versions

+
+

Observed Tool Versions

+

Within GTN tutorials

+
    {% for tool in page.observed_tool_ids %}
  • {{ tool[1] }}
  • {% endfor %}
+ + {% if site.data['tool-meta'][tool_id_path].edam_operations %} +

EDAM Operations

+
    + {% for topic in site.data['tool-meta'][tool_id_path].edam_operations %} +
  • + + {{ topic }} + +
  • + {% endfor %} +
+ {% endif %} + + {% if site.data['tool-meta'][tool_id_path].edam_topics%} +

EDAM Topics

+
    + {% for topic in site.data['tool-meta'][tool_id_path].edam_topics %} +
  • + + {{ topic }} + +
  • + {% endfor %} +
+ {% endif %}
+

Relevant Tutorials

    {% for tutorial in page.tutorial_list %}
  • From abdf49781d2f65e9c74c79ef77fc2b814f15b7f2 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 3 Jul 2024 11:40:14 +0200 Subject: [PATCH 14/19] Add tool metadata download --- .github/workflows/deploy.yml | 1 + .github/workflows/monthly-release-backfill.yml | 1 + .github/workflows/monthly-release.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8e9d58776747f0..7a4f9dbd0bc012 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -67,6 +67,7 @@ jobs: export PATH=/home/runner/.local/bin:$PATH make annotate ACTIVATE_ENV=pwd curl -L https://docs.google.com/spreadsheets/d/1NfZhi5Jav7kl9zFCkeb7rIC2F8xW1isruv1TeO4WpNI/export\?format\=tsv | ruby bin/prepare_feedback.rb + curl -L https://github.com/hexylena/toolshed-version-database/raw/main/tool-meta.json > metadata/tool-meta.json npm install make rebuild-search-index ACTIVATE_ENV=pwd cat metadata/swagger.yaml | python bin/yaml2json.py > api/swagger.json diff --git a/.github/workflows/monthly-release-backfill.yml b/.github/workflows/monthly-release-backfill.yml index 001662dbefa256..60e5e53749a820 100644 --- a/.github/workflows/monthly-release-backfill.yml +++ b/.github/workflows/monthly-release-backfill.yml @@ -66,6 +66,7 @@ jobs: sed -i s"|^baseurl: .*|baseurl: '/archive/${SOURCE_TAG}'|g" _config.yml sed -i s"|^github_repository_branch: .*|github_repository_branch: '${SOURCE_TAG}'|g" _config.yml sed -i s"|^title: .*|title: 'GTN Archive ${SOURCE_TAG}'|g" _config.yml + curl -L https://github.com/hexylena/toolshed-version-database/raw/main/tool-meta.json > metadata/tool-meta.json npm install make rebuild-search-index ACTIVATE_ENV=pwd cat metadata/swagger.yaml | python bin/yaml2json.py > api/swagger.json diff --git a/.github/workflows/monthly-release.yml b/.github/workflows/monthly-release.yml index 54176d0a4e633e..daa345823b8803 100644 --- a/.github/workflows/monthly-release.yml +++ b/.github/workflows/monthly-release.yml @@ -68,6 +68,7 @@ jobs: sed -i s"|^baseurl: .*|baseurl: '/archive/${SOURCE_TAG}'|g" _config.yml sed -i s"|^github_repository_branch: .*|github_repository_branch: '${SOURCE_TAG}'|g" _config.yml sed -i s"|^title: .*|title: 'GTN Archive ${SOURCE_TAG}'|g" _config.yml + curl -L https://github.com/hexylena/toolshed-version-database/raw/main/tool-meta.json > metadata/tool-meta.json npm install make rebuild-search-index ACTIVATE_ENV=pwd cat metadata/swagger.yaml | ruby bin/yaml2json.rb > api/swagger.json From cb0ae4d66d79b967af90e68ffb7bd91482632286 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Mon, 8 Jul 2024 11:17:13 +0200 Subject: [PATCH 15/19] better more cached URL --- .github/workflows/deploy.yml | 2 +- .github/workflows/monthly-release-backfill.yml | 2 +- .github/workflows/monthly-release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7a4f9dbd0bc012..96cc207e8f5421 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -67,7 +67,7 @@ jobs: export PATH=/home/runner/.local/bin:$PATH make annotate ACTIVATE_ENV=pwd curl -L https://docs.google.com/spreadsheets/d/1NfZhi5Jav7kl9zFCkeb7rIC2F8xW1isruv1TeO4WpNI/export\?format\=tsv | ruby bin/prepare_feedback.rb - curl -L https://github.com/hexylena/toolshed-version-database/raw/main/tool-meta.json > metadata/tool-meta.json + curl -L https://hexylena.github.io/toolshed-version-database/tool-meta.json > metadata/tool-meta.json npm install make rebuild-search-index ACTIVATE_ENV=pwd cat metadata/swagger.yaml | python bin/yaml2json.py > api/swagger.json diff --git a/.github/workflows/monthly-release-backfill.yml b/.github/workflows/monthly-release-backfill.yml index 60e5e53749a820..6a3173ba65fdd4 100644 --- a/.github/workflows/monthly-release-backfill.yml +++ b/.github/workflows/monthly-release-backfill.yml @@ -66,7 +66,7 @@ jobs: sed -i s"|^baseurl: .*|baseurl: '/archive/${SOURCE_TAG}'|g" _config.yml sed -i s"|^github_repository_branch: .*|github_repository_branch: '${SOURCE_TAG}'|g" _config.yml sed -i s"|^title: .*|title: 'GTN Archive ${SOURCE_TAG}'|g" _config.yml - curl -L https://github.com/hexylena/toolshed-version-database/raw/main/tool-meta.json > metadata/tool-meta.json + curl -L https://hexylena.github.io/toolshed-version-database/tool-meta.json > metadata/tool-meta.json npm install make rebuild-search-index ACTIVATE_ENV=pwd cat metadata/swagger.yaml | python bin/yaml2json.py > api/swagger.json diff --git a/.github/workflows/monthly-release.yml b/.github/workflows/monthly-release.yml index daa345823b8803..bd983e23bc57dc 100644 --- a/.github/workflows/monthly-release.yml +++ b/.github/workflows/monthly-release.yml @@ -68,7 +68,7 @@ jobs: sed -i s"|^baseurl: .*|baseurl: '/archive/${SOURCE_TAG}'|g" _config.yml sed -i s"|^github_repository_branch: .*|github_repository_branch: '${SOURCE_TAG}'|g" _config.yml sed -i s"|^title: .*|title: 'GTN Archive ${SOURCE_TAG}'|g" _config.yml - curl -L https://github.com/hexylena/toolshed-version-database/raw/main/tool-meta.json > metadata/tool-meta.json + curl -L https://hexylena.github.io/toolshed-version-database/tool-meta.json > metadata/tool-meta.json npm install make rebuild-search-index ACTIVATE_ENV=pwd cat metadata/swagger.yaml | ruby bin/yaml2json.rb > api/swagger.json From 74da2c845a188cbaf0e7f87dd88a5a8917c4867f Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Mon, 8 Jul 2024 11:19:08 +0200 Subject: [PATCH 16/19] show changes more visibly --- .github/workflows/workflowhub.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/workflowhub.yml b/.github/workflows/workflowhub.yml index 622ecaca1b0a49..b9c9813db7359c 100644 --- a/.github/workflows/workflowhub.yml +++ b/.github/workflows/workflowhub.yml @@ -59,6 +59,10 @@ jobs: env: WFH_TOKEN: ${{ secrets.PROD_WFH_TOKEN }} + - name: Any changes? + run: | + git diff + - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: From 3b366c28ff87e1eeed762e95141213cc1eeaf88e Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 17 Jul 2024 11:54:02 +0200 Subject: [PATCH 17/19] more conservative permissions update xref https://github.com/seek4science/seek/issues/1957 --- bin/wfh-upload.py | 103 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 72 insertions(+), 31 deletions(-) diff --git a/bin/wfh-upload.py b/bin/wfh-upload.py index 637a380e04ed13..e1d212b95333bd 100755 --- a/bin/wfh-upload.py +++ b/bin/wfh-upload.py @@ -7,14 +7,24 @@ import glob import time import multiprocessing +import argparse # GTN_BOT_ID = https://workflowhub.eu/people/731 -GTN_PROJECT_ID = 12 -# WORKFLOWHUB = "https://dev.workflowhub.eu" -WORKFLOWHUB = "https://workflowhub.eu" -if len(sys.argv) == 2: - crates = [sys.argv[1]] +argparser = argparse.ArgumentParser() +argparser.add_argument("--prod", action="store_true", help="Upload to production") +argparser.add_argument("--crate", type=str, help="Upload a single crate (defaults to all)") +args = argparser.parse_args() + +if args.prod: + WORKFLOWHUB = "https://workflowhub.eu" + GTN_PROJECT_ID = 12 +else: + WORKFLOWHUB = "https://dev.workflowhub.eu" + GTN_PROJECT_ID = 63 + +if args.crate: + crates = [args.crate] else: crates = glob.glob( "_site/training-material/api/workflows/**/rocrate.zip", recursive=True @@ -37,7 +47,7 @@ def doUpload(crate_path): "workflow[project_ids][]": (None, GTN_PROJECT_ID), # GTN's ID. } headers = { - "authorization": "Token " + os.environ["WFH_TOKEN"], + "authorization": "Token " + os.environ["WFH_TOKEN"], 'User-Agent': 'GTN (github.com/galaxyproject/training-material@1.0)', # 'Content-type': 'application/json', 'Accept': 'application/json', @@ -61,44 +71,75 @@ def doUpload(crate_path): "id": wfid, "type": "workflows", "attributes": { - "policy": { - "access": "download", - "permissions": [ - { - "resource": { - "id": str(GTN_PROJECT_ID), - "type": "projects" - }, - "access": "manage" - } - ] - } } } } - + current_policy = response.json()['data']['attributes']['policy'] + + updated_policy = {} + if current_policy['access'] != 'download': + updated_policy['access'] = 'download' + + gtn_permission = [x for x in current_policy['permissions'] if x['resource']['id'] == str(GTN_PROJECT_ID)] + if len(gtn_permission) != 1: + updated_policy['permissions'] = current_policy['permissions'] + [ + { + "resource": { + "id": str(GTN_PROJECT_ID), + "type": "projects" + }, + "access": "manage" + } + ] + else: + if gtn_permission[0]['access'] != 'manage': + gtn_permission[0]['access'] = 'manage' + updated_policy['permissions'] = current_policy['permissions'] + + # "policy": { + # "access": "download", + # "permissions": [ + # { + # "resource": { + # "id": str(GTN_PROJECT_ID), + # "type": "projects" + # }, + # "access": "manage" + # } + # ] + # } + + # {'access': 'download', + # 'permissions': [{'access': 'manage', + # 'resource': {'id': '63', 'type': 'projects'}}]} + # + if updated_policy: + push = True + permissions_update['data']['attributes']['policy'] = updated_policy + dls = response.json()['data']['attributes']['discussion_links'] - print("Discussion links: ", dls) if dls is None or len(dls) == 0 or (not any( x['label'] == 'GTN Matrix' for x in response.json()['data']['attributes']['discussion_links'] )): + push = True permissions_update['data']['attributes']['discussion_links'] = [ { "label": "GTN Matrix", "url": "https://matrix.to/#/%23galaxyproject_admin:gitter.im" # Must encode the second # } ] - - - print(permissions_update) - headers.update({ - 'Content-type': 'application/json', - 'Accept': 'application/json', - }) - response2 = requests.put(f"{WORKFLOWHUB}/workflows/{wfid}", headers=headers, json=permissions_update) - if response2.status_code != 200: - print(f"Error {response2.status_code} updating permissions for {wfid}: {response2.text}") - + + # https://github.com/seek4science/seek/issues/1957 + if push: + print(f"Permissions update required for {wfid}: {permissions_update['data']['attributes']}") + headers.update({ + 'Content-type': 'application/json', + 'Accept': 'application/json', + }) + response2 = requests.put(f"{WORKFLOWHUB}/workflows/{wfid}", headers=headers, json=permissions_update) + if response2.status_code != 200: + print(f"Error {response2.status_code} updating permissions for {wfid}: {response2.text}") + p = crate_path.split("/") windex = p.index("workflows") (topic, tutorial, workflow) = p[windex + 1:windex + 4] From 0971b0bef2768671bf7d1c74f1b48ac68a6b5e1c Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 17 Jul 2024 11:55:53 +0200 Subject: [PATCH 18/19] back to dev --- .github/workflows/workflowhub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflowhub.yml b/.github/workflows/workflowhub.yml index b9c9813db7359c..2554952847dc65 100644 --- a/.github/workflows/workflowhub.yml +++ b/.github/workflows/workflowhub.yml @@ -57,7 +57,7 @@ jobs: run: | python bin/wfh-upload.py env: - WFH_TOKEN: ${{ secrets.PROD_WFH_TOKEN }} + WFH_TOKEN: ${{ secrets.DEV_WFH_TOKEN }} - name: Any changes? run: | From f2b490b9f00d166b8182a76808f8072b541dc286 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Wed, 17 Jul 2024 11:56:22 +0200 Subject: [PATCH 19/19] once a week is fine --- .github/workflows/workflowhub.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/workflowhub.yml b/.github/workflows/workflowhub.yml index 2554952847dc65..d304bb248c65ea 100644 --- a/.github/workflows/workflowhub.yml +++ b/.github/workflows/workflowhub.yml @@ -6,9 +6,7 @@ concurrency: on: schedule: - # * is a special character in YAML so you have to quote this string - # We'll run this daily at noon. - - cron: '59 12 * * *' + - cron: '55 12 * * 1' workflow_dispatch: jobs: