-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Towards automation of deployment creation/teardown #926
Conversation
scripts/dss_deployer.py
Outdated
resp = input('Proceed (y/N)').lower() or 'n' | ||
|
||
if 'y' != resp: | ||
sys.exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of writing this yourself, consider using http://click.pocoo.org/5/prompts/
scripts/dss_deployer.py
Outdated
|
||
|
||
aws = Command(find('aws')) | ||
gcloud = Command(find('gcloud')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure about gcloud, but for aws I would consider using boto3 directly instead. It makes things less painful down the road when you inevitably accrue more logic for handling errors and other conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kislyuk My original intent was the avoidance of tools unavailable on the command line. Todays discussion with @hannes-ucsc will cause some refactoring, however, and I may head down the boto path.
3acf44e
to
8a309c3
Compare
dss.tf
Outdated
@@ -0,0 +1,119 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend using HCL not JSON, as it is much more human readable + editable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few general comments–
- you should really use terraform remote state files. otherwise there's no good way to collaborate
- this stuff should be human readable, use HCL rather than JSON for the terraform configs
- rather than switching on variables files, I find it cleaner to put your code in a module than have multiple invocations of that module. This makes it easier to get a high-level view of the architecture.
Also, we have a bunch of tools at CZI to make using this stuff easier. We'd like to open source them, but until we do we could look at sharing the source. |
b39e15e
to
47d1e5d
Compare
b4fc5bf
to
860c6bc
Compare
9963f92
to
05de38d
Compare
990f24a
to
80cba9b
Compare
Makefile
Outdated
for comp in $(components); do \ | ||
$(MAKE) -C deployment apply COMPONENT=$$comp; \ | ||
done | ||
curl https://dss.dev.data.humancellatlas.org/internal/application_secrets > application_secrets.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I accidentally saved a draft review note as a single comment:
Just a quick note in case you're not tracking this: The deployment should not depend on a deployed component, and separate deployments should not depend on each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracked! Although it seems reasonable that infrastructure such as route53 zone and certificates may be shared among deployments.
Unfortunately the creation of application_secrets.json
requires a visit to the GCP console.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- consider adding aws cli to the requirements and automating the installation.
pip install awscli —upgrade
- Add some instructions on things that need to be setup prior to running config, example certificates, route 53, environment file, terraform state bucket
- if the resource already exists ask if they would like to create another, overwrite, or use existing.
ignore deployment files.
README.md
Outdated
7. Enable required APIs: `gcloud service-management enable cloudfunctions.googleapis.com`; `gcloud service-management | ||
enable runtimeconfig.googleapis.com` | ||
Now you may deploy the cloud assets with | ||
make deploy-infra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to make deploy-infra
1. Copy `environment.local.example` to `environment.local` | ||
2. Edit `environment.local` to add custom entries that override the default values in `environment` | ||
|
||
Run `source environment` now and whenever these environment files are modified. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some instructions on things that need to be setup prior to running config. For example certificates or route 53.
70f117c
to
988dc37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add documentation to the suggested areas.
I don't understand why we have deployment/dev and deployment/staging committed to this repo. We can suggested users create multiple stages, but I don't see the benefit in committing them to the repo when users will create their own anyways. What are they used for?
README.md
Outdated
Now you may deploy the cloud assets with | ||
make deploy-infra | ||
|
||
##### GCP Application Secrets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When do we deal with gcp-credentials.json?
README.md
Outdated
|
||
8. Generate OAuth application secrets to be used for your instance: | ||
Now you may deploy the cloud assets with | ||
make deploy-infra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make deploy-infra
|
||
Hint: To create GCS buckets from the command line, use `gsutil mb -c regional -l REGION gs://BUCKET_NAME/`. | ||
Run `source environment` now and whenever `configure.py` is executed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this how you change deployments?
@@ -0,0 +1,46 @@ | |||
#!/usr/bin/env python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are users supposed to run these, if so when , otherwise we should make them private.
@@ -0,0 +1,22 @@ | |||
#!/bin/bash -x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document what steps from the readme this is for.
@@ -0,0 +1,15 @@ | |||
#!/bin/bash -x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document what steps from the readme this is for.
@@ -0,0 +1,10 @@ | |||
#!/bin/bash -x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document what steps from the readme this is for.
scripts/deployment_toolbox.py
Outdated
@@ -0,0 +1,248 @@ | |||
#!/usr/bin/env python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document what this tool is for.
resolve all references to Line 36 in 9d1580f
|
running into this error when creating elasticsearch logs. here is the short version
Here is the full version:
|
Why isn't DSS_TEST_ES_PATH is set anywhere? I think we should continue to source |
Import new deployment changes into current deployment. |
0d948c6
to
9b6d7c4
Compare
Standalone script that semi-automates deployment, and completely automates teardown.
Connects to #856
Test plan
Deploy and teardown a lot.