8000 Use python to parse configs by hkethi002 · Pull Request #8 · flywheel-apps/curate-bids · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Use python to parse configs #8

Merged
merged 2 commits into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 <support@flywheel.io>

# 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 <support@flywheel.io>",
"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