Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IWC showcase #562

Merged
merged 74 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a644f89
Basic dockstore manifest creation
dannon Sep 10, 2024
faa95aa
Minor clarifications, refactoring
dannon Sep 10, 2024
264337a
include readme contents
dannon Sep 10, 2024
493a372
Regenerate manifest, formatting
dannon Sep 10, 2024
dcceeff
Basic manifest for tinkering
dannon Sep 10, 2024
a47187d
basic astro
dannon Sep 10, 2024
e32cbfc
Incremental work, rebase flat
dannon Sep 10, 2024
4f20bc4
More data loading
dannon Sep 10, 2024
87fda6b
Show description on listing, fix title
dannon Sep 10, 2024
7ef9699
Add astro/tailwind
dannon Sep 10, 2024
59f3a55
Basic astro working, try nuxt now
dannon Sep 10, 2024
8f4553d
Stage to astro
dannon Sep 10, 2024
ddafa84
Init nuxt
dannon Sep 10, 2024
8d1c8ec
nuxtui
dannon Sep 10, 2024
bfcb380
Basic nuxt version
dannon Sep 10, 2024
b4d79f3
Astro lock
dannon Sep 10, 2024
fe5a861
Regnerate workflow_manifest.
dannon Sep 10, 2024
1ca1e43
Drop astro
dannon Sep 10, 2024
bea16af
Incremental work adding typing for workflow manifest
dannon Sep 10, 2024
1d37c00
relocate showcase_nuxt, leaving astro behind
dannon Sep 10, 2024
202c933
Simpler styling for card outline
dannon Sep 10, 2024
c12adac
Tweak theme to 'cool'
dannon Sep 10, 2024
d0d298a
Adjust workflowList to have a searchable list on the left, display on…
dannon Sep 10, 2024
51edb06
Show all workflows, fast-filtering. Click to scroll-to.
dannon Sep 10, 2024
b90d7d9
Fix individiual page access.
dannon Sep 10, 2024
c194a44
Adjust list display
dannon Sep 10, 2024
cfd2d5e
More fields declared in workflow model
dannon Sep 10, 2024
d23faa8
Workflow detail display
dannon Sep 10, 2024
8bc716e
Add marked for markdown processing, handling of README/CHANGELOG
dannon Sep 10, 2024
efca5af
use marked, parse markdown, render readme/changelog
dannon Sep 10, 2024
b6bc859
Add toplevel loading indicator
dannon Sep 10, 2024
addb392
Factor out header component, tweak displays and navigation
dannon Sep 10, 2024
227ead5
Add prettier
dannon Sep 10, 2024
f1bc324
Add prettier config
dannon Sep 10, 2024
8ed1795
Avoid yarn usage
dannon Sep 10, 2024
a5002b3
incremental styling, trying nuxt-ui
dannon Sep 10, 2024
16a940b
Add prettierignore, apply formatting
dannon Sep 10, 2024
fd4325e
Fix prettier invocation
dannon Sep 10, 2024
3069096
Add authorline
dannon Sep 10, 2024
cda3484
Navigation improvements
dannon Sep 10, 2024
18e1e3a
Add a pre-composed TRS id to workflow information
dannon Sep 10, 2024
20d771c
Note we need a fancy header
dannon Sep 10, 2024
d2288bb
Tweak list padding, 'go to' button
dannon Sep 10, 2024
0eb22ec
Use trsID instead of trs_id, add to ts model
dannon Sep 10, 2024
cce29be
Add launchWorkflow button that imports using TRS id
dannon Sep 10, 2024
8bf4e28
Drop 'details' tag on left
dannon Sep 10, 2024
5c0b40c
Tabbed view, add placeholder for workflow preview
dannon Sep 10, 2024
014ae84
Select TRS version and bring users to run form
mvdbeek Sep 10, 2024
a0d5147
Tabbed view, add placeholder for workflow preview
dannon Sep 10, 2024
0c9ce65
Add placeholder for 'tools used in workflow'
dannon Sep 10, 2024
d4b7e95
temporary logo...
dannon Sep 10, 2024
f5eb5ab
Placeholders for about/docs/help
dannon Sep 10, 2024
ee824e2
Add tags display to main list -- eventually searchable, filterable
dannon Sep 10, 2024
7cdab24
Add basic author component linking to orcid when available
dannon Sep 10, 2024
a9c73a8
Apply some suggested tab name tweaks, less technical
dannon Sep 10, 2024
1e090d1
Add iwc logo static file
dannon Sep 11, 2024
ca90682
Header tweaks, use logo -- not sure if it's bold enough?
dannon Sep 11, 2024
d79acd5
format.
dannon Oct 7, 2024
8bfafef
Quick hack instance selector
dannon Oct 7, 2024
1176edf
WIP: create workflow landing page with test parameters
mvdbeek Oct 8, 2024
68d31a1
Use selected instance in workflow landing request
mvdbeek Oct 9, 2024
6b3c86d
Add gh-pages publishing workflow
dannon Oct 10, 2024
23d58ac
Drop workflow manifest
dannon Oct 11, 2024
98e6fd5
Ignore workflow manifest
dannon Oct 11, 2024
c145cb7
Fix SSR generation of target urls -- this can be unset
dannon Oct 11, 2024
83b219f
Fix 'about' page not found by dumping it for now -- todo: content
dannon Oct 11, 2024
0e2d82a
Use https for usegalaxy.org
dannon Oct 11, 2024
5f72a08
Fix publishing location
dannon Oct 11, 2024
d46ae8f
Attempt to fix manifest generation
dannon Oct 11, 2024
7079f73
Fix action to use correct name for manifest generation script... fac…
dannon Oct 11, 2024
a78c1bb
fix app base url for github page deploy
dannon Oct 11, 2024
6acc2f4
Swap to building off main branch in action
dannon Oct 11, 2024
ccd25bb
Use trs_url instead of trs_id trs_version combination
mvdbeek Oct 11, 2024
a685877
Add manifest build instructions
mvdbeek Oct 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/gh-page-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Deploy IWC Website

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Python Dependencies
run: |
pip install -r requirements.txt

- name: Run generate_manifest.py
run: python ./scripts/workflow_manifest.py

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install NPM Dependencies
run: npm install
working-directory: ./website

- name: Build Nuxt 3 Static Site
run: npm run generate
working-directory: ./website
env:
NUXT_APP_BASE_URL: /iwc/

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/.output/public
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tool_test_output.html
tool_test_output.json
.DS_Store
workflow_manifest.json
7 changes: 7 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'astro/config';
import tailwind from "@astrojs/tailwind";

// https://astro.build/config
export default defineConfig({
integrations: [tailwind()]
});
112 changes: 112 additions & 0 deletions scripts/workflow_manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import os
import json
import yaml


def find_and_load_compliant_workflows(directory):
"""
Find all .dockstore.yml files in the given directory and its subdirectories.
Read the contents of these files and add the path of the file to the content.
Return a list of all collected data.

"""
workflow_data = []
for root, _, files in os.walk(directory):
if ".dockstore.yml" in files:
try:
dockstore_path = os.path.join(root, ".dockstore.yml")
with open(dockstore_path) as f:
workflow_details = yaml.safe_load(f)
workflow_details["path"] = root
workflow_data.append(workflow_details)

# Now inspect the details which are something like this:
# version: 1.2
# workflows:
# - name: Velocyto-on10X-from-bundled
# subclass: Galaxy
# publish: true
# primaryDescriptorPath: /Velocyto-on10X-from-bundled.ga
# testParameterFiles:
# - /Velocyto-on10X-from-bundled-tests.yml
# authors:
# - name: Lucille Delisle
# orcid: 0000-0002-1964-4960
# - name: Velocyto-on10X-filtered-barcodes
# subclass: Galaxy
# publish: true
# primaryDescriptorPath: /Velocyto-on10X-filtered-barcodes.ga
# testParameterFiles:
# - /Velocyto-on10X-filtered-barcodes-tests.yml
# authors:
# - name: Lucille Delisle
# orcid: 0000-0002-1964-4960

for workflow in workflow_details["workflows"]:
# For each listed workflow, load the primaryDescriptorPath
# file, which is the actual galaxy workflow.
# strip leading slash from primaryDescriptorPath if present -- these are relative.
workflow_path = os.path.join(
root, workflow["primaryDescriptorPath"].lstrip("/")
)
try:
with open(workflow_path) as f:
workflow["definition"] = json.load(f)
except Exception as e:
print(
f"No workflow file: {os.path.join(root, workflow['primaryDescriptorPath'])}: {e}"
)

# also try to load a README.md file for each workflow
try:
with open(os.path.join(root, "README.md")) as f:
workflow["readme"] = f.read()
# catch FileNotFound
except FileNotFoundError:
print(f"No README.md at {os.path.join(root, 'README.md')}")
except Exception as e:
print(
f"Error reading file {os.path.join(root, 'README.md')}: {e}"
)

# also try to load a CHANGELOG.md file for each workflow
try:
with open(os.path.join(root, "CHANGELOG.md")) as f:
workflow["changelog"] = f.read()
except FileNotFoundError:
print(f"No CHANGELOG.md at {os.path.join(root, 'CHANGELOG.md')}")
except Exception as e:
print(
f"Error reading file {os.path.join(root, 'CHANGELOG.md')}: {e}"
)
dirname = os.path.dirname(workflow_path).split("/")[-1]
workflow["trsID"] = f"#workflow/github.com/iwc-workflows/{dirname}/{workflow['name'] or 'main'}"

workflow_test_path = f"{workflow_path.rsplit('.ga', 1)[0]}-tests.yml"
if os.path.exists(workflow_test_path):
with open(workflow_test_path) as f:
tests = yaml.safe_load(f)
workflow["tests"] = tests
else:
print(f"no test for {workflow_test_path}")

except Exception as e:
print(f"Error reading file {os.path.join(root, '.dockstore.yml')}: {e}")

return workflow_data


def write_to_json(data, filename):
"""
Write the given data into a JSON file with the given filename.
"""
try:
with open(filename, "w") as f:
json.dump(data, f, indent=4)
except Exception as e:
print(f"Error writing to file {filename}: {e}")


if __name__ == "__main__":
workflow_data = find_and_load_compliant_workflows("./workflows")
write_to_json(workflow_data, "workflow_manifest.json")
24 changes: 24 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
10 changes: 10 additions & 0 deletions website/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Standard ignores
**/.git
**/.svn
**/.hg
**/node_modules
# Ignore the dist folder
**/dist
# Don't reformat .json or .yml files included in the project
*.json
*.yml
83 changes: 83 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## Build workflow manifest

Build the workflow manifest file with

```bash
python scripts/workflow_manifest.py
```

## Development Server

Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev
```

## Production

Build the application for production:

```bash
# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build
```

Locally preview production build:

```bash
# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
6 changes: 6 additions & 0 deletions website/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default defineAppConfig({
ui: {
primary: "amber",
gray: "neutral",
},
});
11 changes: 11 additions & 0 deletions website/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<div>
<NuxtLoadingIndicator />
<IWCHeader />
<main>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</main>
</div>
</template>
33 changes: 33 additions & 0 deletions website/components/Author.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<span class="author">
<a v-if="authorUrl !== '#'" :href="authorUrl" target="_blank" rel="noopener noreferrer" class="author-link">
{{ author.name }}
</a>
<span v-else>{{ author.name }}</span>
</span>
</template>

<script setup lang="ts">
interface Author {
name: string;
orcid?: string;
}

const props = defineProps<{
author: Author;
}>();

const authorUrl = computed(() => (props.author.orcid ? `https://orcid.org/${props.author.orcid}` : "#"));
</script>

<style scoped>
.author-link {
color: inherit;
text-decoration: none;
border-bottom: 1px dotted currentColor;
}

.author-link:hover {
border-bottom-style: solid;
}
</style>
20 changes: 20 additions & 0 deletions website/components/IWCHeader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<header class="shadow-md">
<UContainer class="py-4">
<div class="flex">
<div class="flex flex-grow space-x-2">
<NuxtLink to="/" class="flex items-center space-x-2">
<img src="/iwc_logo.png" alt="IWC Logo" width="64" height="64" />
<span class="text-xl font-semibold">Galaxy IWC - Workflow Library</span>
</NuxtLink>
</div>
<div class="flex items-center space-x-2">
<NuxtLink to="https://github.com/galaxyproject/iwc/">About</NuxtLink>
<NuxtLink to="https://planemo.readthedocs.io/en/latest/best_practices_workflows.html"
>Development</NuxtLink
>
</div>
</div>
</UContainer>
</header>
</template>
Loading