-
Notifications
You must be signed in to change notification settings - Fork 1
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
Michele Berselli
authored and
Michele Berselli
committed
Oct 22, 2021
1 parent
0318a92
commit 0a9174b
Showing
7 changed files
with
126 additions
and
28 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,10 @@ | ||
__pycache__ | ||
*egg-info* | ||
.DS_Store | ||
.coverage | ||
build | ||
dist | ||
.eggs | ||
_build | ||
_static | ||
_templates |
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 @@ | ||
1.0 |
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,94 @@ | ||
#!/usr/bin/env python3 | ||
|
||
################################################ | ||
# | ||
# __main__ | ||
# this is the entry point for command line | ||
# | ||
# Michele Berselli - [email protected] | ||
# Phil Grayson - [email protected] | ||
# | ||
################################################ | ||
|
||
################################################ | ||
# Libraries | ||
################################################ | ||
import sys, os | ||
import argparse | ||
|
||
# Commands | ||
from pipeline_utils import deploy_pipeline | ||
|
||
################################################ | ||
# Functions | ||
################################################ | ||
################################################ | ||
# main | ||
################################################ | ||
def main(args=None): | ||
''' | ||
command line wrapper around available commands | ||
''' | ||
# Adding parser and subparsers | ||
parser = argparse.ArgumentParser(prog='pipeline_utils', description='Collection of utilities for cgap-pipeline') | ||
subparsers = parser.add_subparsers(dest='func', metavar="<command>") | ||
|
||
# Add deploy_pipeline to subparsers | ||
deploy_pipeline_parser = subparsers.add_parser('deploy_pipeline', description='Utility to automatically deploy a pipeline', | ||
help='Utility to automatically deploy a pipeline') | ||
|
||
# Required args | ||
deploy_pipeline_parser.add_argument('--ff-env', required=True) | ||
deploy_pipeline_parser.add_argument('--cwl-bucket', required=False) | ||
deploy_pipeline_parser.add_argument('--account', required=False) | ||
deploy_pipeline_parser.add_argument('--region', required=False) | ||
deploy_pipeline_parser.add_argument('--project-uuid', required=False) | ||
deploy_pipeline_parser.add_argument('--institution-uuid', required=False) | ||
|
||
# Optional args | ||
deploy_pipeline_parser.add_argument('--post-software', action='store_true') | ||
deploy_pipeline_parser.add_argument('--post-file-format', action='store_true') | ||
deploy_pipeline_parser.add_argument('--post-file-reference', action='store_true') | ||
deploy_pipeline_parser.add_argument('--post-workflow', action='store_true') | ||
deploy_pipeline_parser.add_argument('--post-metaworkflow', action='store_true') | ||
deploy_pipeline_parser.add_argument('--post-cwl', action='store_true') | ||
deploy_pipeline_parser.add_argument('--post-ecr', action='store_true') | ||
deploy_pipeline_parser.add_argument('--del-prev-version', action='store_true') | ||
|
||
# Subparsers map | ||
subparser_map = { | ||
'deploy_pipeline': deploy_pipeline_parser | ||
} | ||
|
||
# Checking arguments | ||
if len(sys.argv) == 1: | ||
parser.print_help(sys.stderr) | ||
sys.exit(1) | ||
elif len(sys.argv) == 2: | ||
if sys.argv[1] in subparser_map: | ||
subparser_map[sys.argv[1]].print_help(sys.stderr) | ||
sys.exit(1) | ||
else: | ||
parser.print_help(sys.stderr) | ||
sys.exit(1) | ||
#end if | ||
#end if | ||
args = vars(parser.parse_args()) | ||
|
||
print(args) | ||
sys.exit() | ||
|
||
# Call the right tool | ||
if args['func'] == 'deploy_pipeline': | ||
deploy_pipeline.main(args) | ||
|
||
################################################################# | ||
# | ||
# MAIN | ||
# | ||
################################################################# | ||
if __name__ == "__main__": | ||
|
||
main() | ||
|
||
#end if |
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
from setuptools import setup, find_packages | ||
|
||
# Description | ||
with open('README_utils.md') as fd: | ||
with open('README.md') as fd: | ||
long_description = fd.read() | ||
#end with | ||
|
||
|
@@ -20,13 +20,13 @@ | |
|
||
setup( | ||
name='cgap-pipeline-utils', | ||
version=open('VERSION').readlines()[-1].replace('v', '').strip() + '.0', # VERSION.release | ||
version=open('VERSION').readlines()[-1], | ||
description = 'Collection of utilities for cgap-pipeline', | ||
long_description = long_description, | ||
long_description_content_type = 'text/markdown', | ||
author = 'Michele Berselli, Soo Lee', | ||
author = 'Michele Berselli, Phil Grayson', | ||
author_email = '[email protected]', | ||
url='https://github.com/dbmi-bgm/cgap-pipeline', | ||
url='https://github.com/dbmi-bgm/cgap-pipeline-utils', | ||
include_package_data=True, | ||
packages=['pipeline_utils'], | ||
classifiers=[ | ||
|
@@ -35,6 +35,11 @@ | |
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3' | ||
], | ||
entry_points = { | ||
'console_scripts': [ | ||
'pipeline_utils = pipeline_utils.__main__:main', | ||
] | ||
}, | ||
install_requires=install_requires, | ||
setup_requires=install_requires, | ||
tests_require=tests_requires, | ||
|