Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
vggonzal authored and vggonzal committed Aug 2, 2023
1 parent 73ceb2e commit 806fed4
Show file tree
Hide file tree
Showing 28 changed files with 1,644 additions and 999 deletions.
1 change: 0 additions & 1 deletion docker/.dockerignore

This file was deleted.

16 changes: 0 additions & 16 deletions docker/Dockerfile

This file was deleted.

74 changes: 0 additions & 74 deletions docker/build-docker.sh

This file was deleted.

27 changes: 0 additions & 27 deletions docker/docker-start-command

This file was deleted.

66 changes: 0 additions & 66 deletions docker/push-docker-artifactory.sh

This file was deleted.

78 changes: 0 additions & 78 deletions docker/push-docker-ecr.sh

This file was deleted.

55 changes: 28 additions & 27 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions terraform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

# Deploying the HYDROCRON


## Dependencies
There are a handful of dependencies needed to deploy the entire Feature Translation Service

* Terraform - deployment technology. >= Terraform v0.12.7
* AWS CLI - Amazon Web Service command line interface. >= aws-cli/1.11.120
* python3 environment - tested with python 3.7, needed for packaging the lambda functions.

## Soft dependencies
These are dependencies for deploying the entire Feature Translation Service that exist outside of this build.

* access key for NGAP environment
* Terraform variables defined below

## Terraform Variables

| variable | Defined In | Example | Description |
| --------------- | ------------ | ------------------------------------------------------- | ----------- |
| stage | tf_vars | sit | staging environment to which we are deploying |
| app_name | tf_vars | HYDROCRON | Name of the application being deployed - same for all environments|
| credentials | command line | ~/.aws/credentials | AWS credential file to use for authentication |
| profile | command line | ngap-services-sit | AWS Profile to use for authentication |
| docker_tag | command line | podaac/podaac-cloud/podaac-hydrocron:1.0.0-alpha.3 | Name of docker image and tag as returned from `docker/build-docker.sh`. |
| vpc_id | tf_vars | vpc-04d8fc64e8ce5cca8 | VPC Id for use. This is predefined by NGAP. |
| private_subnets | tf_vars | ["subnet-0d15606f25bd4047b","subnet-0adee3417fedb7f05"] | private subnets for use within VPC. This is defined by NGAP |


## Building the lambda images
The lambda code needs to be built into a deployable image and uploaded to ECR before running terraform. Normally CI/CD handles this task but if you are trying to run terraform locally it needs to be done manually.

Follow the instructions in the [docker README](../docker/README.md) to build the image


## Build and deploy the application
We use a pre-built docker container to do the deployment (Please do not use local terraform!)

From the project root directory:
```
export tf_venue=sit
docker run -v ~/.aws:/home/dockeruser/.aws:ro -v ${PWD}:/home/dockeruser -w /home/dockeruser/terraform cae-artifactory.jpl.nasa.gov:16003/podaac/service/deploy-terraform-1.0.3:latest bash bin/deploy.sh -v ${tf_venue} -t ${docker_tag}
```

## Destroying the Application
Similarly, use the pre-built docker container to do the destroy (Please do not use local terraform!)

From the project root directory:
```
docker run -v ~/.aws:/home/dockeruser/.aws:ro -v ${PWD}:/home/dockeruser cae-artifactory.jpl.nasa.gov:16003/podaac/service/deploy-terraform-1.0.3:latest bash bin/destroy.sh -v ${tf_venue} -t ${docker_tag}
```
This will take anywhere from 3-10 minutes.
Loading

0 comments on commit 806fed4

Please sign in to comment.