Skip to content

Commit

Permalink
Added aws_region_name parameter to wgs_qc_wf_tools v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ngaddis committed Sep 25, 2024
1 parent 9838159 commit f8c9e1d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions wgs_qc_wf_tools/v1.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ RUN chmod 755 /opt/start_run.py

# Set the entry point command
ENTRYPOINT [ "/opt/entrypoint.sh" ]

8 changes: 7 additions & 1 deletion wgs_qc_wf_tools/v1.0/create_step_2_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
type = str,
required = True
)
parser.add_argument(
'--aws_region_name',
help='AWS region in which step 1 of the workflow was run',
type = str,
required = True
)
parser.add_argument(
'--step_1_outputs_json',
help = 'S3 path to JSON file containing outputs from Step 1',
Expand Down Expand Up @@ -51,7 +57,7 @@
step_1_output_bucket = result.group(1)
step_1_output_json = result.group(2)
local_step_1_output_json = '{}step_1_outputs.json'.format(output_dir)
session = boto3.Session(aws_access_key_id=args.aws_access_key_id, aws_secret_access_key=args.aws_secret_access_key)
session = boto3.Session(aws_access_key_id=args.aws_access_key_id, aws_secret_access_key=args.aws_secret_access_key, region_name=args.aws_region_name)
s3 = session.resource('s3')
my_bucket = s3.Bucket(step_1_output_bucket)
my_bucket.download_file(step_1_output_json, local_step_1_output_json)
Expand Down
7 changes: 7 additions & 0 deletions wgs_qc_wf_tools/v1.0/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ if [ -z "$aws_secret_access_key" ]; then
echo "aws_secret_access_key not provided, exiting!"
exit
fi
if [ -z "$aws_region_name" ]; then
echo "aws_region_name not provided, exiting!"
exit
fi
# Assign default values if parameters not provided
if [ -z "$role_arn" ]; then
role_arn="arn:aws:iam::515876044319:role/service-role/OmicsWorkflow-20240601210363"
Expand Down Expand Up @@ -49,6 +53,7 @@ if [[ "$task" == "launch_step_1" ]]; then
--run_metadata_output_dir $run_metadata_output_dir \
--aws_access_key_id $aws_access_key_id \
--aws_secret_access_key $aws_secret_access_key \
--aws_region_name $aws_region_name \
--workflowId $workflow_id \
--parameters $parameters \
--name $name \
Expand Down Expand Up @@ -78,6 +83,7 @@ if [[ "$task" == "launch_step_2" ]]; then
python3 /opt/create_step_2_config.py \
--aws_access_key_id $aws_access_key_id \
--aws_secret_access_key $aws_secret_access_key \
--aws_region_name $aws_region_name \
--step_1_output_json $step_1_output_json \
--output_dir $step_2_config_output_dir \
--minimum_ancestry_sample_count $minimum_ancestry_sample_count
Expand All @@ -90,6 +96,7 @@ if [[ "$task" == "launch_step_2" ]]; then
--run_metadata_output_dir $run_metadata_output_dir \
--aws_access_key_id $aws_access_key_id \
--aws_secret_access_key $aws_secret_access_key \
--aws_region_name $aws_region_name \
--workflowId $workflow_id \
--parameters $step_2_config \
--name $name \
Expand Down
8 changes: 7 additions & 1 deletion wgs_qc_wf_tools/v1.0/start_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
type = str,
required = True
)
parser.add_argument(
'--aws_region_name',
help='AWS region in which to run workflow',
type = str,
required = True
)
parser.add_argument(
'--workflowId',
help='Healthomics ID of workflow',
Expand Down Expand Up @@ -106,7 +112,7 @@
os.system("mkdir -p {}".format(run_metadata_output_dir))

# Open AWS Healthomics session
session = boto3.Session(aws_access_key_id=args.aws_access_key_id, aws_secret_access_key=args.aws_secret_access_key)
session = boto3.Session(aws_access_key_id=args.aws_access_key_id, aws_secret_access_key=args.aws_secret_access_key, region_name=args.aws_region_name)
omics = session.client('omics')

# Read wf arguments
Expand Down

0 comments on commit f8c9e1d

Please sign in to comment.