Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8 from flywheel-apps/python-run
Browse files Browse the repository at this point in the history
Use python to parse configs
  • Loading branch information
hkethi002 authored Jun 25, 2018
2 parents 797c2b4 + bf52e2d commit 45bc544
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 61 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# curate-bids

FROM flywheel/bids-client:0.6.2
FROM flywheel/bids-client:0.6.3
MAINTAINER Flywheel <[email protected]>

# Install JQ to parse config file
Expand All @@ -9,7 +9,7 @@ RUN apk add --no-cache jq
# Make directory for flywheel spec (v0)
ENV FLYWHEEL /flywheel/v0
RUN mkdir -p ${FLYWHEEL}
COPY run ${FLYWHEEL}/run
COPY run.py ${FLYWHEEL}/run.py
COPY manifest.json ${FLYWHEEL}/manifest.json

# Set the entrypoint
Expand Down
7 changes: 4 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"maintainer": "Flywheel <[email protected]>",
"source": "https://github.com/flywheel-apps/curate-bids",
"url": "http://bids.neuroimaging.io/",
"version": "0.6.2",
"version": "0.6.3",
"custom": {
"docker-image": "flywheel/curate-bids:v0.6.2"
"docker-image": "flywheel/curate-bids:v0.6.3"
},
"license": "BSD-3-Clause",
"inputs": {
Expand All @@ -22,5 +22,6 @@
"type": "boolean",
"default": false
}
}
},
"command": "python run.py"
}
56 changes: 0 additions & 56 deletions run

This file was deleted.

15 changes: 15 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import json
from flywheel_bids.curate_bids import main_with_args

if __name__ == '__main__':

# Grab Config
CONFIG_FILE_PATH = '/flywheel/v0/config.json'
with open(CONFIG_FILE_PATH) as config_file:
config = json.load(CONFIG_FILE)

api_key = config['inputs']['api_key']['key']
session_id = config['destination']['id']
reset = config['config']['reset']

main_with_args(api_key, session_id, reset)

0 comments on commit 45bc544

Please sign in to comment.