-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8bfe51
commit 24f40b5
Showing
10 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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,51 @@ | ||
#!/usr/bin/env cwl-runner | ||
|
||
class: CommandLineTool | ||
id: Md5sum | ||
label: Simple md5sum tool | ||
cwlVersion: v1.0 | ||
|
||
$namespaces: | ||
dct: http://purl.org/dc/terms/ | ||
foaf: http://xmlns.com/foaf/0.1/ | ||
|
||
doc: | | ||
[![Docker Repository on Quay.io](https://quay.io/repository/briandoconnor/dockstore-tool-md5sum/status "Docker Repository on Quay.io")](https://quay.io/repository/briandoconnor/dockstore-tool-md5sum) | ||
[![Build Status](https://travis-ci.org/briandoconnor/dockstore-tool-md5sum.svg)](https://travis-ci.org/briandoconnor/dockstore-tool-md5sum) | ||
A very, very simple Docker container for the md5sum command. See the [README](https://github.com/briandoconnor/dockstore-tool-md5sum/blob/master/README.md) for more information. | ||
|
||
|
||
#dct:creator: | ||
# '@id': http://orcid.org/0000-0002-7681-6415 | ||
# foaf:name: Brian O'Connor | ||
# foaf:mbox: briandoconnor@gmail.com | ||
|
||
requirements: | ||
- class: DockerRequirement | ||
dockerPull: quay.io/briandoconnor/dockstore-tool-md5sum:1.0.4 | ||
- class: InlineJavascriptRequirement | ||
|
||
hints: | ||
- class: ResourceRequirement | ||
# The command really requires very little resources. | ||
coresMin: 1 | ||
ramMin: 1024 | ||
outdirMin: 512 | ||
|
||
inputs: | ||
input_file: | ||
type: File | ||
inputBinding: | ||
position: 1 | ||
doc: The file that will have its md5sum calculated. | ||
|
||
outputs: | ||
output_file: | ||
type: File | ||
format: http://edamontology.org/data_3671 | ||
outputBinding: | ||
glob: md5sum.txt | ||
doc: A text file that contains a single line that is the md5sum of the input file. | ||
|
||
baseCommand: [/bin/my_md5sum] | ||
|
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,18 @@ | ||
cwlVersion: v1.0 | ||
class: Workflow | ||
|
||
inputs: | ||
input_file: File | ||
|
||
outputs: | ||
output_file: | ||
type: File | ||
outputSource: md5sum/output_file | ||
|
||
steps: | ||
md5sum: | ||
run: dockstore-tool-md5sum.cwl | ||
in: | ||
input_file: input_file | ||
out: [output_file] | ||
|
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 @@ | ||
hello |
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,2 @@ | ||
{"output_file": {"path": "/tmp/md5sum.txt", "class": "File"}, | ||
"input_file": {"path": "md5sum.input", "class": "File"}} |
Empty file.
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,13 @@ | ||
from unittest import TestCase | ||
from pathlib import Path | ||
from cwl_utils.cite_extract import traverse_workflow | ||
import cwl_utils.parser_v1_0 as parser | ||
|
||
HERE = Path(__file__).resolve().parent | ||
TEST_CWL = HERE / "../testdata/md5sum.cwl" | ||
|
||
|
||
class TestCiteExtract(TestCase): | ||
def test_traverse_workflow(self): | ||
loaded = parser.load_document(str(TEST_CWL.resolve())) | ||
traverse_workflow(loaded) |
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,19 @@ | ||
from unittest import TestCase | ||
from pathlib import Path | ||
from tempfile import TemporaryDirectory | ||
from cwl_utils.docker_extract import traverse, get_image_name, save_docker_image, load_docker_image | ||
import cwl_utils.parser_v1_0 as parser | ||
|
||
HERE = Path(__file__).resolve().parent | ||
TEST_CWL = HERE / "../testdata/md5sum.cwl" | ||
|
||
|
||
class TestDockerExtract(TestCase): | ||
def test_traverse_workflow(self): | ||
loaded = parser.load_document(str(TEST_CWL.resolve())) | ||
|
||
with TemporaryDirectory() as tmpdir: | ||
for req in set(traverse(loaded)): | ||
image_name = get_image_name(req) | ||
save_docker_image(req, image_name, tmpdir) | ||
_ = load_docker_image(image_name) |