Skip to content

Commit

Permalink
Merge pull request #5080 from galaxyproject/coydog-powan
Browse files Browse the repository at this point in the history
Moving towards prod workflowhub (not there yet.)
  • Loading branch information
hexylena authored Jul 17, 2024
2 parents 47c9742 + f2b490b commit 2ad57e7
Show file tree
Hide file tree
Showing 12 changed files with 445 additions and 134 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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://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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/monthly-release-backfill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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://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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/monthly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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://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
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/workflowhub.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
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
# We'll run this daily at noon.
- cron: '59 12 * * *'
- cron: '55 12 * * 1'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -53,7 +55,11 @@ jobs:
run: |
python bin/wfh-upload.py
env:
DEV_WFH_TOKEN: ${{ secrets.DEV_WFH_TOKEN }}
WFH_TOKEN: ${{ secrets.DEV_WFH_TOKEN }}

- name: Any changes?
run: |
git diff
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
Expand Down
46 changes: 43 additions & 3 deletions _layouts/by_tool.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,64 @@
layout: base
---

<h1>Tutorials using {{ page.short_tool }}</h1>
{% assign tool_id_path = page.observed_tool_ids[0][0] %}

<hgroup>
<h1>
{{ site.data['tool-meta'][tool_id_path].name }}:
{{ site.data['tool-meta'][tool_id_path].desc }}
</h1>
<pre>{{ page.observed_tool_ids[0] }}</pre>
</hgroup>

<section>
<div class="stats">
<div class="row">
<div class="col-md-3">
<h2>Servers Offering this Tool</h2>
<h2>Metadata</h2>
<h3>Servers Offering this Tool</h3>
<a href="https://usegalaxy.eu/?tool_id={{ page.observed_tool_ids[0][0] }}">UseGalaxy.eu ({{ page.observed_tool_ids[0][1] }})</a>
<p class="text-muted">This is a guess, we are not currently checking if that is actually present.</p>

<h2>Observed Tool Versions</h2>
<hgroup>
<h3>Observed Tool Versions</h3>
<p>Within GTN tutorials</p>
</hgroup>
<ul>
{% for tool in page.observed_tool_ids %}
<li>{{ tool[1] }}</li>
{% endfor %}
</ul>

{% if site.data['tool-meta'][tool_id_path].edam_operations %}
<h3>EDAM Operations</h3>
<ul>
{% for topic in site.data['tool-meta'][tool_id_path].edam_operations %}
<li>
<a href="https://www.ebi.ac.uk/ols4/ontologies/edam/classes/http%253A%252F%252Fedamontology.org%252F{{ topic }}">
{{ topic }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}

{% if site.data['tool-meta'][tool_id_path].edam_topics%}
<h3>EDAM Topics</h3>
<ul>
{% for topic in site.data['tool-meta'][tool_id_path].edam_topics %}
<li>
<a href="https://www.ebi.ac.uk/ols4/ontologies/edam/classes/http%253A%252F%252Fedamontology.org%252F{{ topic }}">
{{ topic }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>

<div class="col-md-9">
<h2>Relevant Tutorials</h2>
<ul>
{% for tutorial in page.tutorial_list %}
<li>
Expand Down
67 changes: 66 additions & 1 deletion _layouts/workflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ <h1 data-toc-skip>{{ workflow.title }}</h1>
<br/>

{% if jekyll.environment == "production" %}
<a style="margin-bottom: 0.2rem" href="{{ site.baseurl }}/api/workflows/{{ material.topic_id }}/{{ material.tutorial_id }}/{{ workflow.wfid }}/rocrate.zip" class="btn btn-secondary"><img src="{% link assets/images/ro-crate.png %}" style="height: 32px" alt="RO-Crate logo with flask"/> Download Workflow RO-Crate</a>
<a style="margin-bottom: 0.2rem" href="{{ site.baseurl }}/api/workflows/{{ material.topic_name }}/{{ material.tutorial_name }}/{{ workflow.wfname }}/rocrate.zip" class="btn btn-secondary"><img src="{% link assets/images/ro-crate.png %}" style="height: 32px" alt="RO-Crate logo with flask"/> Download Workflow RO-Crate</a>
{% endif %}

{% if workflow.workflowhub_id %}
<a style="margin-bottom: 0.2rem" href="https://workflowhub.eu/workflows/{{ workflow.workflowhub_id }}" class="btn btn-secondary"><img src="{% link assets/images/workflowhub-icon.svg %}" style="height: 32px" alt="Workflowhub cloud with gears logo"/> View on WorkflowHub</a>
{% endif %}
Expand Down Expand Up @@ -148,6 +149,70 @@ <h1 data-toc-skip>{{ workflow.title }}</h1>
Download
</a>
<pre class="mermaid">{{ workflow.mermaid }}</pre>
<h2>Inputs</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Input</th>
<th>Label</th>
</tr>
</thead>
<tbody>
{% for input in workflow.inputs %}
<tr>
<td>{{ input.name }}</td>
<td>{{ input.label }}</td>
</tr>
{% endfor %}
</tbody>
</table>

<h2>Outputs</h2>
<table class="table table-striped">
<thead>
<tr>
<th>From</th>
<th>Output</th>
<th>Label</th>
</tr>
</thead>
<tbody>
{% for output in workflow.outputs %}
<tr>
<td>{{ output.tool_id }}</td>
<td>{{ output.name }}</td>
<td>{{ output.label }}</td>
</tr>
{% endfor %}
</tbody>
</table>


<h2>Tools</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Tool</th>
<th>Links</th>
</tr>
</thead>
<tbody>
{% for tool in workflow.workflow_tools %}
<tr>
<td><a href="https://my.galaxy.training/?path=?tool_id={{ tool }}">{{ tool }}</a></td>
<td>
{% if site.data['toolshed-revisions'][tool] %}
{% assign tsdata = site.data['toolshed-revisions'][tool] %}
<a href="https://toolshed.g2.bx.psu.edu/view/{{tsdata[0]}}/{{tsdata[1]}}/{{tsdata[2]}}">
View in ToolShed
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>


<p>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.</p>

Expand Down
7 changes: 3 additions & 4 deletions _plugins/gtn/ro-crate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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? }

Expand All @@ -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?}
Expand All @@ -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'],
Expand Down
4 changes: 3 additions & 1 deletion _plugins/jekyll-topic-filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added assets/images/ro-crate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2ad57e7

Please sign in to comment.