-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from 4dn-dcic/ecr
Ecr
- Loading branch information
Showing
16 changed files
with
339 additions
and
60 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
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ flake8==2.4.1 | |
pytest==3.0.5 | ||
pytest-cov==2.3.1 | ||
pytest-runner | ||
pytest-parallel | ||
mock |
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,31 @@ | ||
{ | ||
"args": { | ||
"app_name": "shell-test", | ||
"input_parameters": {}, | ||
"language": "shell", | ||
"command": "\\$ECHO_COMMAND \"haha\" > /data1/out/shell-test-output; ls -l somefile >> /data1/out/shell-test-output", | ||
"container_image": "643366669028.dkr.ecr.us-east-1.amazonaws.com/ubuntu16.04-python35-pip19:v1", | ||
"output_target": { | ||
"file:///data1/out/shell-test-output": "s3://tibanna-output/shell-test-output" | ||
}, | ||
"secondary_output_target": {}, | ||
"secondary_files": {}, | ||
"output_S3_bucket": "soos-4dn-bucket", | ||
"app_version": "5", | ||
"input_files": { | ||
"file:///data1/shell/somefile": "s3://soos-4dn-bucket/4DNFIITTJYNR.mcool.bins.juicerformat.gz" | ||
}, | ||
"input_parameters": { | ||
}, | ||
"input_env": { | ||
"ECHO_COMMAND": "echo" | ||
} | ||
}, | ||
"config": { | ||
"mem": 2, | ||
"cpu": 1, | ||
"ebs_size": 10, | ||
"EBS_optimized": false, | ||
"log_bucket": "tibanna-output" | ||
} | ||
} |
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,60 @@ | ||
import os | ||
from tibanna.core import API | ||
|
||
REGION1 = 'us-east-1' | ||
REGION2 = 'us-west-1' | ||
|
||
DEV_SUFFIX = 'pre' | ||
DEV_GROUP_SUFFIX = 'testgroup' | ||
DEV_SFN_REGION1 = 'tibanna_unicorn_' + DEV_GROUP_SUFFIX + '1' + '_' + DEV_SUFFIX # deployed to us-east-1 | ||
DEV_SFN_REGION2 = 'tibanna_unicorn_' + DEV_GROUP_SUFFIX + '1' + '_' + DEV_SUFFIX # deployed to us-west-1 | ||
DEV_SFN2_REGION2 = 'tibanna_unicorn_' + DEV_GROUP_SUFFIX + '2' + '_' + DEV_SUFFIX # deployed to us-west-1 | ||
|
||
|
||
def get_test_json(file_name): | ||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
event_file_name = os.path.join(dir_path, 'test_json', file_name) | ||
return event_file_name | ||
|
||
|
||
def deploy_sfn1_to_region1(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION1 | ||
API().deploy_unicorn(suffix=DEV_SUFFIX, buckets='tibanna-output,soos-4dn-bucket', usergroup=DEV_GROUP_SUFFIX + '1') | ||
|
||
|
||
def deploy_sfn1_to_region2(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION2 | ||
API().deploy_unicorn(suffix=DEV_SUFFIX, buckets='tibanna-output,soos-4dn-bucket', usergroup=DEV_GROUP_SUFFIX + '1') | ||
|
||
|
||
def deploy_sfn2_to_region2(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION2 | ||
buckets = 'tibanna-output,elasticbeanstalk-fourfront-webdev-files,4dn-tool-evaluation-files' | ||
API().deploy_unicorn(suffix=DEV_SUFFIX, buckets=buckets, usergroup=DEV_GROUP_SUFFIX + '2') | ||
|
||
|
||
def cleanup_sfn1_region1(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION1 | ||
API().cleanup(user_group_name=DEV_GROUP_SUFFIX + '1', suffix=DEV_SUFFIX) | ||
|
||
|
||
def cleanup_sfn1_region2(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION2 | ||
API().cleanup(user_group_name=DEV_GROUP_SUFFIX + '1', suffix=DEV_SUFFIX) | ||
|
||
|
||
def cleanup_sfn2_region2(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION2 | ||
API().cleanup(user_group_name=DEV_GROUP_SUFFIX + '2', suffix=DEV_SUFFIX) | ||
|
||
|
||
def pytest_sessionstart(session): | ||
deploy_sfn1_to_region1() | ||
deploy_sfn1_to_region2() | ||
deploy_sfn2_to_region2() | ||
|
||
|
||
def pytest_sessionfinish(session, exitstatus): | ||
cleanup_sfn1_region1() | ||
cleanup_sfn1_region2() | ||
cleanup_sfn2_region2() |
45 changes: 45 additions & 0 deletions
45
tests/tibanna/post_deployment/test_json/4dn_bwa.runonly.v1.json
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,45 @@ | ||
{ | ||
"_tibanna": { | ||
"env": "fourfront-webdev", | ||
"run_type": "bwa-mem" | ||
}, | ||
"args": { | ||
"app_name": "bwa-mem", | ||
"input_parameters": {}, | ||
"cwl_child_filenames": [], | ||
"output_target": { | ||
"out_bam": "lalala/out.bam" | ||
}, | ||
"secondary_output_target": {}, | ||
"cwl_main_filename": "bwa-mem.cwl", | ||
"secondary_files": {}, | ||
"output_S3_bucket": "tibanna-output", | ||
"app_version": "5", | ||
"cwl_directory_url": "https://raw.githubusercontent.com/4dn-dcic/pipelines-cwl/master/cwl_awsem_v1/", | ||
"cwl_version": "v1", | ||
"input_files": { | ||
"fastq1": { | ||
"bucket_name": "4dn-tool-evaluation-files", | ||
"object_key": "GM12878_SRR1658581_1pc_1_R1.fastq.h10000" | ||
}, | ||
"fastq2": { | ||
"bucket_name": "4dn-tool-evaluation-files", | ||
"object_key": "GM12878_SRR1658581_1pc_1_R2.fastq.h10000" | ||
}, | ||
"bwa_index": { | ||
"bucket_name": "elasticbeanstalk-fourfront-webdev-files", | ||
"object_key": "1f53df95-4cf3-41cc-971d-81bb16c486dd/4DNFIZQZ39L9.bwaIndex.tgz" | ||
} | ||
}, | ||
"input_parameters": { | ||
"nThreads": 2 | ||
} | ||
}, | ||
"config": { | ||
"ebs_size": 30, | ||
"root_ebs_size": 20, | ||
"EBS_optimized": true, | ||
"instance_type": "t3.large", | ||
"log_bucket": "tibanna-output" | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
tests/tibanna/post_deployment/test_json/shelltest-ecr.json
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,31 @@ | ||
{ | ||
"args": { | ||
"app_name": "shell-test", | ||
"input_parameters": {}, | ||
"language": "shell", | ||
"command": "\\$ECHO_COMMAND \"haha\" > /data1/out/shell-test-output; ls -l somefile >> /data1/out/shell-test-output", | ||
"container_image": "643366669028.dkr.ecr.us-east-1.amazonaws.com/ubuntu16.04-python35-pip19:v1", | ||
"output_target": { | ||
"file:///data1/out/shell-test-output": "s3://tibanna-output/shell-test-output" | ||
}, | ||
"secondary_output_target": {}, | ||
"secondary_files": {}, | ||
"output_S3_bucket": "soos-4dn-bucket", | ||
"app_version": "5", | ||
"input_files": { | ||
"file:///data1/shell/somefile": "s3://soos-4dn-bucket/4DNFIITTJYNR.mcool.bins.juicerformat.gz" | ||
}, | ||
"input_parameters": { | ||
}, | ||
"input_env": { | ||
"ECHO_COMMAND": "echo" | ||
} | ||
}, | ||
"config": { | ||
"mem": 2, | ||
"cpu": 1, | ||
"ebs_size": 10, | ||
"EBS_optimized": false, | ||
"log_bucket": "tibanna-output" | ||
} | ||
} |
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,34 @@ | ||
{ | ||
"args": { | ||
"app_name": "shell-test", | ||
"input_parameters": {}, | ||
"language": "shell", | ||
"command": "\\$ECHO_COMMAND \"haha\" > /data1/out/shell-test-output; ls -l somefile >> /data1/out/shell-test-output", | ||
"container_image": "ubuntu:16.04", | ||
"output_target": { | ||
"file:///data1/out/shell-test-output": "s3://tibanna-output/shell-test-output" | ||
}, | ||
"secondary_output_target": {}, | ||
"secondary_files": {}, | ||
"output_S3_bucket": "soos-4dn-bucket", | ||
"app_version": "5", | ||
"input_files": { | ||
"file:///data1/shell/somefile": "s3://soos-4dn-bucket/4DNFIITTJYNR.mcool.bins.juicerformat.gz" | ||
}, | ||
"input_parameters": { | ||
}, | ||
"input_env": { | ||
"ECHO_COMMAND": "echo" | ||
} | ||
}, | ||
"config": { | ||
"mem": 2, | ||
"cpu": 1, | ||
"ebs_size": 10, | ||
"EBS_optimized": false, | ||
"log_bucket": "tibanna-output", | ||
"key_name": "4dn-encode", | ||
"cloudwatch_dashboard": false, | ||
"subnet": "subnet-efb1b3c4" | ||
} | ||
} |
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 @@ | ||
import json | ||
import os | ||
import time | ||
from tibanna.core import API | ||
from tests.tibanna.post_deployment.conftest import ( | ||
REGION1, | ||
REGION2, | ||
DEV_SFN_REGION1, | ||
DEV_SFN_REGION2, | ||
DEV_SFN2_REGION2, | ||
get_test_json, | ||
) | ||
|
||
|
||
def test_shell(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION1 | ||
res = API().run_workflow(input_json=get_test_json('shelltest4.json'), sfn=DEV_SFN_REGION1) | ||
jobid = res['jobid'] | ||
time.sleep(300) | ||
status = API().check_status(job_id=jobid) | ||
assert status == 'SUCCEEDED' | ||
|
||
|
||
def test_ecr(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION1 | ||
res = API().run_workflow(input_json=get_test_json('shelltest-ecr.json'), sfn=DEV_SFN_REGION1) | ||
jobid = res['jobid'] | ||
time.sleep(300) | ||
status = API().check_status(job_id=jobid) | ||
assert status == 'SUCCEEDED' | ||
|
||
|
||
def test_shell_region2(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION2 | ||
res = API().run_workflow(input_json=get_test_json('shelltest4.json'), sfn=DEV_SFN_REGION2) | ||
jobid = res['jobid'] | ||
time.sleep(300) | ||
status = API().check_status(job_id=jobid) | ||
assert status == 'SUCCEEDED' | ||
|
||
|
||
def test_cw_metrics_region2(): | ||
os.environ['AWS_DEFAULT_REGION'] = REGION2 | ||
res = API().run_workflow(input_json=get_test_json('4dn_bwa.runonly.v1.json'), sfn=DEV_SFN2_REGION2) | ||
jobid = res['jobid'] | ||
time.sleep(60 * 20) | ||
status = API().check_status(job_id=jobid) | ||
assert status == 'SUCCEEDED' | ||
prj = json.loads(API().log(job_id=jobid, postrunjson=True)) | ||
assert prj['metrics']['max_mem_utilization_percent'] | ||
assert prj['metrics']['max_cpu_utilization_percent'] |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Version information.""" | ||
|
||
# The following line *must* be the last in the module, exactly as formatted: | ||
__version__ = "0.17.3" | ||
__version__ = "0.18.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
Oops, something went wrong.