This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
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 #159 from aws-samples/master
April updates
- Loading branch information
Showing
59 changed files
with
10,628 additions
and
25 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,68 @@ | ||
# Building Custom Resources | ||
|
||
This section describes how to build and upload templates and artifacts to use in a customized deployment. Once uploaded, the locations of the templates and artifacts are used when deploying the Nextflow on AWS Batch solution (see [Customized Deployment](custom-deploy.md)) | ||
|
||
## Building a Custom Distribution | ||
|
||
This step involves building a distribution of templates and artifacts from the solution's source code. | ||
|
||
First, create a local clone of the [Genomics Workflows on AWS](https://github.com/aws-samples/aws-genomics-workflows) source code. The code base contains several directories: | ||
|
||
* `_scripts/`: Shell scripts for building and uploading the customized distribution of templates and artifacts | ||
* `docs/`: Source code for the documentation, written in [MarkDown](https://markdownguide.org) for the [MkDocs](https://mkdocs.org) publishing platform. This documentation may be modified, expanded, and contributed in the same way as source code. | ||
* `src/`: Source code for the components of the solution: | ||
* `containers/`: CodeBuild buildspec files for building AWS-specific container images and pushing them to ECR | ||
* `_common/` | ||
* `build.sh`: A generic build script that first builds a base image for a container, then builds an AWS specific image | ||
* `entrypoint.aws.sh`: A generic entrypoint script that wraps a call to a binary tool in the container with handlers data staging from/to S3 | ||
* `nextflow/` | ||
* `Dockerfile` | ||
* `nextflow.aws.sh`: Docker entrypoint script to execute the Nextflow workflow on AWS Batch | ||
* `ebs-autoscale/` | ||
* `get-amazon-ebs-autoscale.sh`: Script to retrieve and install [Amazon EBS Autoscale](https://github.com/awslabs/amazon-ebs-autoscale) | ||
* `ecs-additions/`: Scripts to be installed on ECS host instances to support the distribution | ||
* `awscli-shim.sh`: Installed as `/opt/aws-cli/bin/aws` and mounted onto the container, allows container images without full glibc to use the AWS CLI v2 through supplied shared libraries (especially libz) and `LD_LIBRARY_PATH`. | ||
* `ecs-additions-common.sh`: Utility script to install `fetch_and_run.sh`, Nextflow and Cromwell shims, and swap space | ||
* `ecs-additions-cromwell-linux2-worker.sh`: | ||
* `ecs-additions-cromwell.sh`: | ||
* `ecs-additions-nextflow.sh`: | ||
* `ecs-additions-step-functions.sh`: | ||
* `fetch_and_run.sh`: Uses AWS CLI to download and run scripts and zip files from S3 | ||
* `provision.sh`: Appended to the userdata in the launch template created by [gwfcore-launch-template](custom-deploy.md): Starts SSM Agent, ECS Agent, Docker; runs `get-amazon-ebs-autoscale.sh`, `ecs-additions-common.sh` and orchestrator-specific `ecs-additions-` scripts. | ||
* `lambda/`: Lambda functions to create, modify or delete ECR registries or CodeBuild jobs | ||
* `templates/`: CloudFormation templates for the solution stack, as described in [Customized Deployment](custom-deploy.md) | ||
|
||
## Deploying a Custom Distribution | ||
|
||
The script `_scripts/deploy.sh` will create a custom distribution of artifacts and templates from files in the source tree, then upload this distribution to an S3 bucket. It will optionally also build and deploy a static documentation site from the Markdown documentation files. Its usage is: | ||
|
||
```sh | ||
deploy.sh [--site-bucket BUCKET] [--asset-bucket BUCKET] | ||
[--asset-profile PROFILE] [--deploy-region REGION] | ||
[--public] [--verbose] | ||
STAGE | ||
|
||
--site-bucket BUCKET Deploy documentation site to BUCKET | ||
--asset-bucket BUCKET Deploy assets to BUCKET | ||
--asset-profile PROFILE Use PROFILE for AWS CLI commands | ||
--deploy-region REGION Deploy in region REGION | ||
--public Deploy to public bucket with '--acl public-read' (Default false) | ||
--verbose Display more output | ||
STAGE 'test' or 'production' | ||
``` | ||
|
||
When running this script from the command line, use the value `test` for the stage. This will deploy the templates and artifacts into a directory `test` in your deployment bucket: | ||
|
||
``` | ||
$ aws s3 ls s3://my-deployment-bucket/test/ | ||
PRE artifacts/ | ||
PRE templates/ | ||
``` | ||
|
||
Use these values when deploying a customized installation, as described in [Customized Deployment](custom-deploy.md), sections 'Artifacts and Nested Stacks' and 'Nextflow'. In the example from above, the values to use would be: | ||
|
||
* Artifact S3 Bucket Name: `my-deployment-bucket` | ||
* Artifact S3 Prefix: `test/artifacts` | ||
* Template Root URL: `https://my-deployment-bucket.s3.amazonaws.com/test/templates` | ||
|
||
The use of `production` for stage is reserved for deployments from a Travis CI/CD environment; this usage will deploy into a subdirectory named after the current release tag. |
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,58 @@ | ||
# Customized Deployment | ||
|
||
Deployments of the 'Nextflow on AWS Batch' solution are based on nested CloudFormation templates, and on artifacts comprising scripts, software packages, and configuration files. The templates and artifacts are stored in S3 buckets, and their S3 URLs are used when launching the top-level template and as parameters to that template's deployment. | ||
|
||
## VPC | ||
The quick start link deploys the [AWS VPC Quickstart](https://aws.amazon.com/quickstart/architecture/vpc/), which creates a VPC with up to 4 Availability Zones, each with a public subnet and a private subnet with NAT Gateway access to the Internet. | ||
|
||
## Genomics Workflow Core | ||
This quick start link deploys the CloudFormation template `gwfcore-root.template.yaml` for the Genomics Workflow Core (GWFCore) from the [Genomics Workflows on AWS](https://github.com/aws-samples/aws-genomics-workflows) solution. This template launches a number of nested templates, as shown below: | ||
|
||
* Root Stack __gwfcore-root__ - Top level template for Genomics Workflow Core | ||
* S3 Stack __gwfcore-s3__ - S3 bucket (new or existing) for storing analysis results | ||
* IAM Stack __gwfcore-iam__ - Creates IAM roles to use with AWS Batch scalable genomics workflow environment | ||
* Code Stack __gwfcore-code__ - Creates AWS CodeCommit repos and CodeBuild projects for Genomics Workflows Core assets and artifacts | ||
* Launch Template Stack __gwfcore-launch-template__ - Creates an EC2 Launch Template for AWS Batch based genomics workflows | ||
* Batch Stack __gwfcore-batch__ - Deploys resource for a AWS Batch environment that is suitable for genomics, including default and high-priority JobQueues | ||
|
||
### Root Stack | ||
The quick start solution links to the CloudFormation console, where the 'Amazon S3 URL' field is prefilled with the S3 URL of a copy of the root stack template, hosted in the public S3 bucket __aws-genomics-workflows__. | ||
|
||
<img src="https://dpkk088kye7gn.cloudfront.net/aws-genomics-workflows/docs/images/custom-deploy-0.png" | ||
alt="custom-deploy-0" | ||
width="100%" height="100%" | ||
class="screenshot" /> | ||
|
||
To use a customized root stack, upload your modified stack template to an S3 bucket (see [Building a Custom Distribution](build-custom-distribution.md)), and specify that template's URL in 'Amazon S3 URL'. | ||
|
||
### Artifacts and Nested Stacks | ||
The subsequent screen, 'Specify Stack Details', allows for customization of the deployed resources in the 'Distribution Configuration' section. | ||
|
||
<img src="https://dpkk088kye7gn.cloudfront.net/aws-genomics-workflows/docs/images/custom-deploy-1.png" | ||
alt="custom-deploy-1" | ||
width="70%" height="70%" | ||
class="screenshot" /> | ||
|
||
* __Artifact S3 Bucket Name__ and __Artifact S3 Prefix__ define the location of the artifacts uploaded prior to this deployment. By default, pre-prepared artifacts are stored in the __aws-genomics-workflows__ bucket. | ||
* __Template Root URL__ defines the bucket and prefix used to store nested templates, called by the root template. | ||
|
||
To use your own modified artifacts or nested templates, build and upload as described in [Building a Custom Distribution](build-custom-distribution.md), and specify the bucket and prefix in the fields above. | ||
|
||
## Workflow Orchestrators | ||
### Nextflow | ||
This quick start deploys the Nextflow template `nextflow-resources.template.yaml`, which launches one nested stack: | ||
|
||
* Root Stack __nextflow-resources__ - Creates resources specific to running Nextflow on AWS | ||
* Container Build Stack __container-build__ - Creates resources for building a Docker container image using CodeBuild, storing the image in ECR, and optionally creating a corresponding Batch Job Definition | ||
|
||
The nextflow root stack is specified in the same way as the GWFCore root stack, above, and a location for a modified root stack may be specified as with the Core stack. | ||
|
||
The subsequent 'Specify Stack Details' screen has fields allowing the customization of the Nextflow deployment. | ||
|
||
<img src="https://dpkk088kye7gn.cloudfront.net/aws-genomics-workflows/docs/images/nextflow-0.png" | ||
alt="nextflow-0" | ||
width="70%" height="70%" | ||
class="screenshot" /> | ||
|
||
* __S3NextflowPrefix__, __S3LogsDirPrefix__, and __S3WorkDirPrefix__ specify the path within the GWFCore bucket in which to store per-run data and log files. | ||
* __TemplateRootUrl__ specifies the path to the nested templates called by the Nextflow root template, as with the GWFCore root stack. |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,9 @@ | ||
*.js | ||
!jest.config.js | ||
*.d.ts | ||
node_modules | ||
|
||
# CDK asset staging directory | ||
.cdk.staging | ||
cdk.out | ||
cdk.context.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,6 @@ | ||
*.ts | ||
!*.d.ts | ||
|
||
# CDK asset staging directory | ||
.cdk.staging | ||
cdk.out |
Oops, something went wrong.