Skip to content

Commit

Permalink
Merge pull request #2 from Sage-Bionetworks/simplify-output-binding
Browse files Browse the repository at this point in the history
bump synapse client to 1.6.2.dev; modify CWL output binding
  • Loading branch information
jaeddy authored Apr 24, 2017
2 parents 60161ec + 5a7e58e commit 937b239
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
datastore
*.synapseConfig
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM ubuntu:16.04
LABEL base.image="ubuntu:16.04"
LABEL version="1"
LABEL software="synapseclient"
LABEL software.version="1.6.1"
LABEL software.version="1.6.2.dev"
LABEL description="Programmatic interface to Synapse services for Python"
LABEL website="https://github.com/Sage-Bionetworks/synapsePythonClient"
LABEL documentation="https://github.com/Sage-Bionetworks/synapsePythonClient"
Expand All @@ -20,8 +20,9 @@ LABEL tags="General"
MAINTAINER James Eddy <[email protected]>

# set version here to minimize need for edits below
ENV VERSION=1.6.1
# ENV VERSION=v1.6.2
ENV BRANCH=develop
ENV VERSION=6ba6a3ebde81fe8ed4d0c231ab42c613aa03334f

# set up packages
USER root
Expand All @@ -33,9 +34,9 @@ RUN apt-get update && \

RUN git clone -b ${BRANCH} git://github.com/Sage-Bionetworks/synapsePythonClient.git && \
cd synapsePythonClient && \
#git checkout v${VERSION} && \
git checkout ${VERSION} && \
python setup.py develop

COPY bin/parse_config.py /usr/local/bin/
COPY bin/synapse_get /usr/local/bin/
RUN chmod a+x /usr/local/bin/synapse_get
Expand Down
5 changes: 2 additions & 3 deletions Dockstore.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ dct:creator:

requirements:
- class: DockerRequirement
#dockerPull: quay.io/jaeddy/dockstore-tool-synapse-get:1.6.1--1
dockerPull: thomasvyu/synget
dockerPull: quay.io/jaeddy/dockstore-tool-synapse-get:1.6.2.dev--1

inputs:
config_file:
Expand All @@ -45,6 +44,6 @@ outputs:
type: array
items: File
outputBinding:
glob: $(inputs.output_filename)
glob: "synapse_files/*"

baseCommand: ["bash", "/usr/local/bin/synapse_get"]
13 changes: 11 additions & 2 deletions bin/synapse_get
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euf -o pipefail

# parse inputs and build command args
CMD_ARGS=('synapse' 'get')
while getopts "c:i:q:h" ARG; do
case "$ARG" in
Expand All @@ -15,9 +16,17 @@ shift $(($OPTIND - 1))

# parse credentials from config file
CREDENTIALS=($(python /usr/local/bin/parse_config.py ${CONFIG}))
# get file from Synapse

# create temp folder to store files; add to command args
SYN_DIR="synapse_files"
mkdir $SYN_DIR
CMD_ARGS=("${CMD_ARGS[@]}" '--downloadLocation' $SYN_DIR)

# log in to Synapse
synapse login -u ${CREDENTIALS[0]} -p ${CREDENTIALS[1]} --rememberMe

# get file from Synapse
COMMAND=$( IFS=' '; echo "${CMD_ARGS[*]}" );
echo $COMMAND
eval $COMMAND
eval $COMMAND
echo "Downloaded files: $(find ${SYN_DIR} -mindepth 1 -maxdepth 1)"
5 changes: 1 addition & 4 deletions test.json → test_id.cwl.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
"class": "File",
"path": "test.synapseConfig"
},
"synapse_id": "syn8556063",
"output_filename": [
"test.txt"
]
"synapse_id": "syn8556063"
}
6 changes: 1 addition & 5 deletions test.query.json → test_query.cwl.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@
"class": "File",
"path": "test.synapseConfig"
},
"query": "select id from file where parentId == 'syn8507134'",
"output_filename": [
"test.txt",
"testingquery.txt"
]
"query": "select id from file where parentId == 'syn8507134'"
}
Empty file added test_tablequery.cwl.json
Empty file.

0 comments on commit 937b239

Please sign in to comment.