Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit 4322380

Browse files
wleepangpaulu-awsjaywang144
authored
release update (#91)
* add code repo options, and custom resource for ecr repos * handle existing ecr repos on create * allow retaining repos on update/replace and delete * add codecommit and bitbucket options for build source * allow user specified buildspec files * fix image lifecycle policy puts * use awslabs/amazon-ebs-autoscale * use new amazon-ebs-autoscale repo * update ebs-autoscale README * remove ebs-autoscale code from this repo * remove deprecated custom ami template * Add s3:GetObject permission to EC2 instance role Add s3:GetObject permission to EC2 instance role for retrieving objects from S3 buckets and open datasets. * Add S3 open datasets parameter Add a new S3 open data bucket ARNs parameter and instance profile permission for using shared datasets. * use common container build template * move container build template to templates/_common * make batch job definition optional for container builds * require specification of buildspec.yml for container builds * create workflow-tool container buildspec file * use container build template for nextflow * create nextflow container buildspec file * remove deprecated ami build * use container name variable for nextflow image * propagate TemplateRootUrl to nextflow resources * fix job def output value * scope down nextflow permissions * scratch mount no longer needed * fix sfn example url resolve #90 Co-authored-by: paulu-aws <[email protected]> Co-authored-by: Jay Wang <[email protected]>
1 parent 708e176 commit 4322380

20 files changed

+706
-1002
lines changed

docs/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Below are the stand-alone CloudFormation templates for each of the sub-stacks. T
6060

6161
| Name | Description | Source | Launch Stack |
6262
| -- | -- | :--: | :--: |
63-
{{ cfn_stack_row("AWS Step Functions Example", "SfnExample", "step-functions/sfn-example.template.yaml", "Create a Step Functions State Machine, Batch Job Definitions, and container images to run an example genomics workflow") }}
63+
{{ cfn_stack_row("AWS Step Functions Example", "SfnExample", "step-functions/sfn-workflow.template.yaml", "Create a Step Functions State Machine, Batch Job Definitions, and container images to run an example genomics workflow") }}
6464
{{ cfn_stack_row("Cromwell Server", "CromwellServer", "cromwell/cromwell-server.template.yaml", "Create an EC2 instance and an IAM instance profile to run Cromwell") }}
6565
{{ cfn_stack_row("Nextflow Resources", "NextflowResources", "nextflow/nextflow-resources.template.yaml", "Create Nextflow specific resources needed to run on AWS: an S3 Bucket for nextflow config and workflows, AWS Batch Job Definition for a Nextflow head node, and an IAM role for the nextflow head node job") }}
6666

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# CodeBuild buildspec file for creating container image for nextflow
2+
# assumes the following environment variables:
3+
# - PROJECT_BRANCH: git branch / tag / commit-id to build
4+
# - PROJECT_PATH: path in the source to navigate to prior to build
5+
# - REGISTRY: docker image registry (e.g. ECR) to push the container image to
6+
# - CONTAINER_NAME: name of the container
7+
# - AWS_REGION: (Provided by CodeBuild) region to use for ECR
8+
version: 0.2
9+
phases:
10+
pre_build:
11+
commands:
12+
- git checkout $PROJECT_BRANCH
13+
- cd $PROJECT_PATH
14+
build:
15+
commands:
16+
- echo "Building container"
17+
- docker build -t ${CONTAINER_NAME} .
18+
post_build:
19+
commands:
20+
- echo "Tagging container image for ECR"
21+
- docker tag ${CONTAINER_NAME} ${REGISTRY}/${CONTAINER_NAME}
22+
- echo "Docker Login to ECR"
23+
- $(aws ecr get-login --no-include-email --region ${AWS_REGION})
24+
- echo "Pushing container images to ECR"
25+
- docker push ${REGISTRY}/${CONTAINER_NAME}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# CodeBuild buildspec file for creating container images for a workflow tool
2+
# assumes the following environment variables:
3+
# - PROJECT_BRANCH: git branch / tag / commit-id to build
4+
# - PROJECT_PATH: path in the source to navigate to prior to build
5+
# - REGISTRY: docker image registry (e.g. ECR) to push the container image to
6+
# - CONTAINER_NAME: name of the container
7+
# - AWS_REGION: (Provided by CodeBuild) region to use for ECR
8+
version: 0.2
9+
phases:
10+
pre_build:
11+
commands:
12+
- git checkout $PROJECT_BRANCH
13+
- cd $PROJECT_PATH
14+
- cp -R ../_common .
15+
build:
16+
commands:
17+
- echo "Building container"
18+
- chmod +x _common/build.sh
19+
- _common/build.sh ${CONTAINER_NAME}
20+
post_build:
21+
commands:
22+
- echo "Tagging container image for ECR"
23+
- docker tag ${CONTAINER_NAME} ${REGISTRY}/${CONTAINER_NAME}
24+
- echo "Docker Login to ECR"
25+
- $(aws ecr get-login --no-include-email --region ${AWS_REGION})
26+
- echo "Pushing container images to ECR"
27+
- docker push ${REGISTRY}/${CONTAINER_NAME}

src/ebs-autoscale/.gitignore

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/ebs-autoscale/README.md

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,6 @@
11
# Amazon Elastic Block Store Autoscale
22

3-
This is an example of a small daemon process that monitors a BTRFS filesystem mountpoint and automatically expands it when free space falls below a configured threshold. New [Amazon EBS](https://aws.amazon.com/ebs/) volumes are added to the instance as necessary and the underlying [BTRFS filesystem](http://btrfs.wiki.kernel.org) expands while still mounted. As new devices are added, the BTRFS metadata blocks are rebalanced to mitigate the risk that space for metadata will not run out.
3+
## RELOCATION NOTICE
44

5-
## Assumptions:
6-
7-
1. That this code is running on a AWS EC2 instance
8-
2. The instance has a IAM Instance Profile with appropriate permissions to create and attache new EBS volumes. Ssee the [IAM Instance Profile](#iam_instance_profile) section below for more details
9-
3. That prerequisites are installed on the instance.
10-
11-
Provided in this repo are:
12-
13-
1. A python [script](bin/create-ebs-volume.py) that creates and attaches new EBS volumes to the current instance
14-
2. The daemon [script](bin/ebs-autoscale) that monitors disk space and expands the BTRFS filesystem by leveraging the above script to add EBS volumes, expand the filesystem, and rebalance the metadata blocks
15-
2. A template for an [upstart configuration file](templates/ebs-autoscale.conf.template)
16-
2. A [logrotate configuration file](templates/ebs-autoscale.logrotate) which should not be needed but may as well be in place for long-running instances.
17-
5. A [initialization script](bin/init-ebs-autoscale.sh) to configure and install all of the above
18-
6. A [cloud-init](templates/cloud-init-userdata.yaml) file for user-data that installs required packages and runs the initialization script. By default this creates a mount point of `/scratch` on a encrypted 20GB EBS volume. To change the mount point, edit the file.
19-
20-
## Installation
21-
22-
The easiest way to set up an instance is to provide a launch call with the userdata [cloud-init script](templates/cloud-init-userdata.yaml). Here is an example of launching the [Amazon ECS-Optimized AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in us-east-1 using this file:
23-
24-
```bash
25-
aws ec2 run-instances --image-id ami-5253c32d \
26-
--key-name MyKeyPair \
27-
--user-data file://./templates/cloud-init-userdata.yaml \
28-
--count 1 \
29-
--security-group-ids sg-123abc123 \
30-
--instance-type t2.micro \
31-
--iam-instance-profile Name=MyInstanceProfileWithProperPermissions
32-
```
33-
34-
35-
## A note on IAM Instance Profile
36-
37-
In the above, we assume that the `MyInstanceProfileWithProperPermissions` EC2 Instance Profile exists and has the following permissions:
38-
39-
```json
40-
{
41-
"Version": "2012-10-17",
42-
"Statement": [
43-
{
44-
"Effect": "Allow",
45-
"Action": [
46-
"ec2:AttachVolume",
47-
"ec2:DescribeVolumeStatus",
48-
"ec2:DescribeVolumes",
49-
"ec2:ModifyInstanceAttribute",
50-
"ec2:DescribeVolumeAttribute",
51-
"ec2:CreateVolume",
52-
"ec2:DeleteVolume"
53-
],
54-
"Resource": "*"
55-
}
56-
]
57-
}
58-
```
5+
The code for this daemon has been moved to the following repoository:
6+
[awslabs/amazon-ebs-autoscale](https://github.com/awslabs/amazon-ebs-autoscale)

src/ebs-autoscale/bin/create-ebs-volume.py

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)