Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit bad1f70

Browse files
ghawk1nsIllyaYalovyynbraidtneelywleepang
committed
Initial Code Commit
Co-authored-by: IllyaYalovyy <[email protected]> Co-authored-by: nbraid <[email protected]> Co-authored-by: tneely <[email protected]> Co-authored-by: wleepang <[email protected]> Co-authored-by: markjschreiber <[email protected]> Co-authored-by: AndreyDovydenko <[email protected]> Co-authored-by: elliot-smith <[email protected]> Co-authored-by: AhmadBassyiouni <[email protected]> Co-authored-by: mlin <[email protected]>
1 parent 8a04021 commit bad1f70

File tree

454 files changed

+105154
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

454 files changed

+105154
-44
lines changed

.gitignore

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1+
/.idea/
2+
/output/
3+
codebuild_build.sh
14
.DS_Store
2-
5+
venv
6+
.venv
7+
*.iml
8+
coverage.out
9+
/packages/common/bin/
10+
vendor
11+
/docs/
12+
/site/content/en/docs/Reference/agc*

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "site/themes/docsy"]
2+
path = site/themes/docsy
3+
url = https://github.com/google/docsy.git

.go-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.16.0

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## Code of Conduct
22
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
33
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4-
[email protected] with any additional questions or comments.
4+
[email protected] with any additional questions or comments.

CONTRIBUTING.md

+34-9
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,27 @@ information to effectively respond to your bug report or contribution.
1111

1212
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1313

14-
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
14+
When filing an issue, please check [existing open](https://github.com/aws/amazon-genomics-cli/issues),
15+
or [recently closed](https://github.com/aws/amazon-genomics-cli/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20),
16+
issues to make sure somebody else hasn't already
1517
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1618

17-
* A reproducible test case or series of steps
18-
* The version of our code being used
19-
* Any modifications you've made relevant to the bug
20-
* Anything unusual about your environment or deployment
19+
* Environment
20+
* AGC version
21+
* OS version
22+
* Node version
23+
* Shell (bash/zsh) and shell version
24+
* Steps to reproduce the error
25+
* Sequence of commands used
26+
* Demonstration workflow or inputs if applicable
27+
* Expected result
28+
* Actual result
29+
* Is if the issue reproducible on the latest version of AGC?
30+
* A copy of the `agc-project.yaml`
31+
* Workflow, engine, adapter, and access logs
32+
* AWS region(s) where the issue was observed
33+
* Was a custom S3 bucket or custom VPC used? If so what differences are there from the standard deployed by the CDK code of AGC
34+
2135

2236

2337
## Contributing via Pull Requests
@@ -31,17 +45,22 @@ To send us a pull request, please:
3145

3246
1. Fork the repository.
3347
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34-
3. Ensure local tests pass.
48+
3. Run `make` to ensure local tests pass and to automate standard formatting and linting.
3549
4. Commit to your fork using clear commit messages.
3650
5. Send us a pull request, answering any default questions in the pull request interface.
3751
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3852

53+
If your contribution requires custom container images for components such as engines or WES adapters please ensure these
54+
are also made available via an appropriate mechanism.
55+
3956
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4057
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4158

4259

4360
## Finding contributions to work on
44-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
61+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the
62+
default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix),
63+
looking at any ['help wanted'](https://github.com/aws/amazon-genomics-cli/labels/help%20wanted) issues is a great place to start.
4564

4665

4766
## Code of Conduct
@@ -51,9 +70,15 @@ [email protected] with any additional questions or comments.
5170

5271

5372
## Security issue notifications
54-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
73+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via
74+
our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/).
75+
Please do **not** create a public github issue.
5576

5677

5778
## Licensing
5879

59-
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
80+
See the [LICENSE](https://github.com/https://github.com/aws/amazon-genomics-cli/blob/main/LICENSE) file for our
81+
project's licensing. We will ask you to confirm the licensing of your contribution.
82+
83+
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement)
84+
for larger changes.

Makefile

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
VERSION := $(shell git describe --always --tags)
2+
PACKAGES := $(shell ls -d ${PWD}/packages/*/ | grep -v -E "(vendor|api)")
3+
4+
.PHONY: test build build-cli release release-cli release-cdk $(PACKAGES)
5+
6+
all: format test build
7+
8+
format:
9+
target=format $(MAKE) $(PACKAGES)
10+
11+
test:
12+
target=test $(MAKE) $(PACKAGES)
13+
14+
$(PACKAGES):
15+
(cd $@; $(MAKE) $(target))
16+
17+
build: build-cli
18+
19+
build-cli:
20+
(cd packages/cli; $(MAKE) build)
21+
22+
release: release-cli release-cdk
23+
24+
release-cli:
25+
(cd packages/cli; $(MAKE) release)
26+
27+
release-cdk:
28+
(cd packages/cdk; $(MAKE) release)
29+
30+
init:
31+
go env -w GOPROXY=direct
32+
goenv install --skip-existing
33+
target=init $(MAKE) $(PACKAGES)
34+
35+
docs: build-cli
36+
packages/cli/bin/local/agc --docs site/content/en/docs/Reference/
37+
git submodule update --init --recursive
38+
cd site && npm install && hugo
39+
40+
clean-docs:
41+
rm -f site/content/en/docs/Reference/agc*.md
42+
rm -rf docs
43+
44+
start-docs: build-cli
45+
packages/cli/bin/local/agc --docs site/content/en/docs/Reference/
46+
git submodule update --init --recursive
47+
cd site && npm install && hugo server -D

README.md

+175-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,184 @@
1-
## My Project
1+
# Amazon Genomics CLI
22

3-
TODO: Fill this README out!
3+
## Overview
44

5-
Be sure to:
5+
The AWS Genomics Command Line Interface (AGC) is a tool to simplify the processes of deploying the AWS infrastructure required to
6+
run genomics workflows in the cloud, to submit those workflows to run, and to monitor the logs and outputs of those workflows.
67

7-
* Change the title in this README
8-
* Edit your repository description on GitHub
8+
## Quick Start
9+
10+
To get an introduction to AGC refer to the [Quick Start Guide](https://github.com/aws/amazon-genomics-cli/wiki/Quick-Start-Guide)
11+
in our wiki.
12+
13+
## Further Reading
14+
15+
For full documentation, please refer to our [wiki](https://github.com/aws/amazon-genomics-cli/wiki).
16+
17+
## Releases
18+
19+
All releases can be accessed on our releases [page](https://github.com/aws/amazon-genomics-cli/releases).
20+
21+
## Development
22+
23+
To build from source you will need to ensure the following prerequisites are met.
24+
25+
### One-time setup
26+
27+
There are a few prerequisites you'll need to install on your machine before you can start developing.
28+
29+
Once you've installed all the dependencies listed here, run `make init` to install the rest.
30+
31+
32+
#### Go
33+
34+
The Amazon Genomics CLI is written in Go.
35+
36+
To manage and install Go versions, we use [goenv](https://github.com/syndbg/goenv). Follow the installation
37+
instructions [here](https://github.com/syndbg/goenv/blob/master/INSTALL.md).
38+
39+
#### Node
40+
41+
AGC makes use of the AWS CDK to deploy infrastructure into an AWS account. Our CDK code is written in TypeScript.
42+
You'll need Node to ensure the appropriate dependencies are installed at build time.
43+
44+
To manage and install Node versions, we use [nvm](https://github.com/nvm-sh/nvm).
45+
46+
```bash
47+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
48+
echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"' >> ~/.bashrc
49+
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc
50+
source ~/.bashrc
51+
```
52+
53+
Note: If you are using Zsh, replace `~/.bashrc` with `~/.zshrc`.
54+
55+
#### Sed (OSX)
56+
57+
OSX uses an outdated version of [sed](https://www.gnu.org/software/sed/manual/sed.html). If you are on a Mac, you will
58+
need to use a newer version of sed to ensure script compatibility.
59+
60+
```bash
61+
brew install gnu-sed
62+
echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc
63+
source ~/.bashrc
64+
```
65+
66+
Note: If you are using Zsh, replace `~/.bashrc` with `~/.zshrc`.
67+
68+
#### One time setup
69+
70+
Once you've installed all the dependencies listed here, run `make init` to automatically install all remaining dependencies.
71+
72+
73+
#### Make
74+
75+
We use `make` to build, test and deploy artifacts. To build and test issue the `make` command from the project root.
76+
77+
### Running Development Code
78+
79+
To run against a development version of AGC, first build your relevant changes and then run `./scripts/run-dev.sh`. This will
80+
set the required environment variables and then enter into an AGC command shell.
81+
82+
If you want to run from development code manually, ensure you have the following environment variables set.
83+
84+
```shell
85+
export ECR_CROMWELL_ACCOUNT_ID=<some-value>
86+
export ECR_CROMWELL_REGION=<some-value>
87+
export ECR_CROMWELL_TAG=<some-value>
88+
export ECR_WES_ACCOUNT_ID=<some-value>
89+
export ECR_WES_REGION=<some-value>
90+
export ECR_WES_TAG=<some-value>
91+
```
92+
93+
These environment variables point to the ECR account, region, and tags of the Cromwell engine and WES adaptor containers respectively
94+
that will be deployed for your contexts. They are written as Systems Manager Parameter Store variables when you activate
95+
your AGC account region (`agc account activate`). The `./scripts/run-dev.sh` contains logic to determine the current
96+
dev versions of the images which you would typically use. You may also use production images, the current values of which will
97+
be written when you activate an account with the production version of AGC. If you have customized containers that you
98+
want to develop against you can specify these however you will need to make these available if you wish to make pull requests
99+
with code that depends on them.
100+
101+
### Building locally with CodeBuild
102+
103+
This package is buildable with AWS CodeBuild. You can use the AWS CodeBuild agent to run CodeBuild builds on a local
104+
machine.
105+
106+
You only need to set up the build image the first time you run the agent, or when the image has changed. To set up the
107+
build image, use the following commands:
108+
109+
```bash
110+
git clone https://github.com/aws/aws-codebuild-docker-images.git
111+
cd aws-codebuild-docker-images/ubuntu/standard/5.0
112+
docker build -t aws/codebuild/standard:5.0 .
113+
docker pull amazon/aws-codebuild-local:latest --disable-content-trust=false
114+
```
115+
116+
Create an environment file (e.g. `env.txt`) with the appropriate entries depending on which image tags you want to use.
117+
118+
```shell
119+
CROMWELL_ECR_TAG=2021-06-17T23-48-54Z
120+
WES_ECR_TAG=2021-06-17T23-48-54Z
121+
```
122+
123+
In the root directory for this package, download and run the CodeBuild build script:
124+
125+
```bash
126+
wget https://raw.githubusercontent.com/aws/aws-codebuild-docker-images/master/local_builds/codebuild_build.sh
127+
chmod +x codebuild_build.sh
128+
./codebuild_build.sh -i aws/codebuild/standard:5.0 -a ./output -c -e env.txt
129+
```
130+
131+
### Configuring docker image location
132+
133+
The default values for all variables are placeholders (e.g. 'WES_ECR_TAG_PLACEHOLDER'). It is replaces by the actual
134+
value during a build process.
135+
136+
#### WES adapter for Cromwell
137+
138+
Local environment variables:
139+
140+
- `ECR_WES_ACCOUNT_ID`
141+
- `ECR_WES_REGION`
142+
- `ECR_WES_TAG`
143+
144+
The corresponding AWS Systems Manager Parameter Store property names:
145+
146+
- /agc/_common/wes/ecr-repo/account
147+
- /agc/_common/wes/ecr-repo/region
148+
- /agc/_common/wes/ecr-repo/tag
149+
150+
#### Cromwell engine
151+
152+
Local environment variables:
153+
154+
- `ECR_CROMWELL_ACCOUNT_ID`
155+
- `ECR_CROMWELL_REGION`
156+
- `ECR_CROMWELL_TAG`
157+
158+
The corresponding AWS Systems Manager Parameter Store property names:
159+
160+
- /agc/_common/cromwell/ecr-repo/account
161+
- /agc/_common/cromwell/ecr-repo/region
162+
- /agc/_common/cromwell/ecr-repo/tag
163+
164+
## Contributing
165+
166+
### Issues
167+
168+
See [Reporting Bugs/Feature Requests](CONTRIBUTING.md#reporting-bugsfeature-requests) for more information. For a list of
169+
open bugs and feature requests, please refer to our [issues](https://github.com/aws/amazon-genomics-cli/issues?q=is%3Aopen+is%3Aissue) page.
170+
171+
### Pull Requests
172+
173+
See [Contributing via Pull Requests](CONTRIBUTING.md#contributing-via-pull-requests)
9174

10175
## Security
11176

12-
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
177+
See [Security Issue Notification](CONTRIBUTING.md#security-issue-notifications) for more information.
178+
179+
## Attributions
180+
181+
TODO, link to attribution docs
13182

14183
## License
15184

buildspec.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: 0.2
2+
3+
env:
4+
shell: bash
5+
variables:
6+
# These variables should be over-ridden as appropriate by the CI/CD pipeline
7+
BUCKET_NAME: "healthai-public-assets-us-east-1"
8+
WES_ECR_TAG: ""
9+
CROMWELL_ECR_TAG: ""
10+
NEXTFLOW_ECR_TAG: ""
11+
12+
phases:
13+
install:
14+
commands:
15+
- goenv install
16+
- go env -w GOPROXY=direct
17+
- make init
18+
pre_build:
19+
commands:
20+
- make test
21+
- SEMANTIC_VERSION=$(./scripts/version.sh "$BUCKET_NAME")
22+
- echo "Using semantic version '${SEMANTIC_VERSION}'"
23+
- ./scripts/update-tags.sh
24+
build:
25+
on-failure: ABORT
26+
commands:
27+
- make release
28+
post_build:
29+
commands:
30+
# Package Amazon Genomics CLI
31+
- mkdir -p tmp
32+
- cp -a scripts/cli/. tmp
33+
- cp -a examples tmp
34+
- cp -a packages/cli/bin/local/. tmp
35+
- cp packages/cdk/cdk.tgz tmp
36+
- mkdir -p amazon-genomics-cli amazon-genomics-cli/$SEMANTIC_VERSION
37+
- (cd tmp && zip -r ../amazon-genomics-cli/$SEMANTIC_VERSION/amazon-genomics-cli.zip ./*)
38+
39+
artifacts:
40+
files:
41+
- "amazon-genomics-cli/**/*"

0 commit comments

Comments
 (0)