-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing running kb-sdk kb_quast module with JAWS
- Loading branch information
1 parent
14a8810
commit 9d564c2
Showing
7 changed files
with
255 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Docker | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main", "master", "develop" ] | ||
# Publish semver tags as releases. | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
- '[0-9]+.[0-9]+.[0-9]+-*' | ||
pull_request: | ||
branches: [ "main", "master", "develop", "jaws" ] | ||
release: | ||
types: [published] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
version 1.0 | ||
|
||
workflow sdk_quast_test { | ||
input { | ||
Array[File] files | ||
} | ||
|
||
call quast { | ||
input: | ||
files = files | ||
} | ||
} | ||
|
||
task quast { | ||
input { | ||
Array[File] files | ||
} | ||
|
||
command { | ||
# Not calling any services so no config file needed | ||
export KBASE_ENDPOINT="http://fakeendpointthatdoesntexist.com" | ||
|
||
# Hack to make the code not write in /kb/module/work, mounting output to work would work here | ||
mkdir work | ||
export WD=$(pwd) | ||
echo "WD=$WD" | ||
|
||
# make a directory for output. Ideally we'd mount this to /kb/module/work | ||
mkdir __output__ | ||
|
||
# This is an insane hack to make the quast input JSON. It's as minimal as possible here, | ||
# but this isn't workable in general - we need input/output mounting so we can predict the file | ||
# paths and create the JSON serverside at submit time | ||
echo "{\"files\": [" > input.json | ||
echo " {\"path\": \"${files[0]}", \"label\": \"$(basename ${files[0]})}\"" >> input.json | ||
for file in ${input_files[1:]}; do | ||
echo ",\n {"\path\": \"$file\", \"label\": \"$(basename $file)}\"" >> input.json | ||
|
||
echo " ],\n \"quast_path\": \"$(pwd)/__output__\"" >> input.json | ||
echo "}" >> input.json | ||
|
||
/kb/module/scripts/entrypoint.sh async | ||
EC=$? | ||
|
||
echo "Entrypoint exit code: $EC" | ||
|
||
find __output__ -type f > ./output_files.txt | ||
|
||
if [ $EC -ne 0 ]; then | ||
exit $EC | ||
fi | ||
} | ||
|
||
output { | ||
Array[File] output_files = read_lines("output_files.txt") | ||
File stdout = "stdout" | ||
File stderr = "stderr" | ||
} | ||
|
||
runtime { | ||
docker: "ghcr.io/kbaseapps/kb_quast:pr-35" | ||
runtime_minutes: 20 | ||
memory: "100 GB" | ||
cpu: 4 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
script_dir=$(dirname "$(readlink -f "$0")") | ||
export KB_DEPLOYMENT_CONFIG=$script_dir/../deploy.cfg | ||
WD=/kb/module/work | ||
# Would need input mounting to make this work in JAWS, allowing setting it for now | ||
# WD=/kb/module/work | ||
if [ -f $WD/token ]; then | ||
cat $WD/token | xargs sh $script_dir/../bin/run_kb_quast_async_job.sh $WD/input.json $WD/output.json | ||
else | ||
echo "File $WD/token doesn't exist, aborting." | ||
exit 1 | ||
sh $script_dir/../bin/run_kb_quast_async_job.sh $WD/input.json $WD/output.json | ||
# Another option would be to require the token but set up an auth endpoint, either in the | ||
# service or nginx, that just returned a fake username and provide a fake token | ||
# echo "File $WD/token doesn't exist, aborting." | ||
# exit 1 | ||
fi |