You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

OpenSearch UI (https://OpenSearch UI.earthdata.nasa.gov/api) is a modern web API built on top of Apollo (OpenSearch UI) Server that provides access to the CMR API using OpenSearch UI standards and syntax. It's goal is allow querying CMR data with more specificity and depth as it pertains to relational data. Given the standards based approach it lends itself well to existing and future client libraries which eases the burden on client applications and users.

Environment

Architecture 

Components

  • OpenSearch UI is built using JRuby, and Ruby on Rails

Deploying

Generally, building and deploying will be done from Bamboo. Bamboo's deployment mechanisms give the option of a script defined within the UI or a script within the repository alongside the code. OpenSearch UI uses a script that is defined within the repository located at `scripts/deploy_bamboo.sh`. The script is simply a list of commands so if Bamboo isn't an option, the commands can be ran manually via the command line. The overall process looks like this:

  1. Build a Docker image from the Dockerfile
    1. Installs JRuby
    2. Installs PhantomJS
    3. Installs Ruby Gems
  2. Push the Docker image to AWS ECR
  3. Execute Terraform deployment to AWS

In order to run the deployment script locally, the following prerequisites must be met:

  • Install AWS CLI
  • Install dos2unix

Required Environment Variables For Deployments

  • AWS_ACCESS_KEY_ID AWS Access Key created in CloudTamer.
  • AWS_SECRET_ACCESS_KEY Access Token created in CloudTamer.
  • cpu Task level CPU allocation.
  • desired_task_count How many instantiations of the task to replicate.
  • environment_name What label to apply to the deployment, helps separate multiple deployments within a single account. GraphQL uses the standard EED environments `sit`, `uat` and `prod`.
  • image Name of the image to pull from ECR.
  • memory Container level memory configuration.
  • permissions_boundary_arn AWS Permissions Boundary provided by NGAP.
  • rack_env Environment to provide to Rack (["development", "production"]).
  • remote_state_bucket AWS S3 bucket to store Terraform remote state in.
  • subnet_ids AWS Subnet IDs provided by NGAP in array form (["subnet-a", "subnet-b"]).
  • vpc_id AWS VPC ID provided by NGAP.

Destroying

This can be done from within the AWS console by deleting the stack from CloudFormation. Running the commands require valid access tokens, see the Terraform documentation for methods of providing these values.

Using AWS Access Tokens (Terraform)https://registry.terraform.io/providers/hashicorp/aws/latest/docs#authentication

// Destroy Application
terraform destroy

Configuration

OpenSearch UI is deployed to NGAP 2.0, aka AWS using Terraform. The application utilizes ECS behind an Elastic Load Balancer.

Backup

Code Backup

OpenSearch UI's code base and static assets are backed up in BitBucket. BitBucket is backed up on-premise as part of EED-2 infrastructure management.

Bitbuckethttps://git.earthdata.nasa.gov/projects/OPENSEARCH/repos/opensearch-ui/browse

Restoring (Deployments from Scratch)

Should OpenSearch UI need to be completely recovered, that process takes around 30 minutes and requires a ticket that requires additional resources (NGAP).

Ticket depending on other teams:

  • AWS CloudFront endpoint for API Gateway

Once these tickets are completed:

  • Output from the ticket (API Gateway endpoint) need to be set within Bamboo.

Steps:

  1. Deploy full application
  2. Create the ticket above, the output from the deployment should be provided in the ticket (API Gateway ID)
  3. When the ticket is completed, the value will need to be saved in Bamboo.
  4. Deploy again so that the ENV variable is provided to the lambda used to process requests.

Release Cycle

OpenSearch UI follows the SAFe process as implemented by EED. Typically, that means we plan priorities in 3 month increments and release code every 2 weeks. If needed, OpenSearch UI can release on-demand with appropriate notice to stakeholders.

Patching and Remediation

OpenSearch UI has a blocking step in our deployment process that audits our libraries and dependencies. Once a vulnerability is found, steps are taken to patch and update and resolve the vulnerability immediately.

In the case of a vulnerability discovered for a resource currently deployed, a ticket is filed once the issue is identified. OpenSearch UI devops consults with the security team to prioritize the remediation of the vulnerability found. Once a ticket is created, approved, and prioritized, EDSC dev team works the issue until all vulnerabilities are resolved and deploy the updated app to all operational environments.

Diagnostics

OpenSearch UI logs to AWS CloudWatch on a per Lambda basis; this allows you for easy access to specific Lambda logging in the event that you know which Lambda is responsible for the logs you're looking for. If a wider search needs to occur, OpenSearch UI forwards logs to Splunk which accommodates a wider array of search abilities.

Splunkhttps://logs.earthdata.nasa.gov/

Planned Maintenance

Deployments are handled via Bamboo.

Bamboohttps://ci.earthdata.nasa.gov/deploy/viewDeploymentProjectEnvironments.action?id=287375363

  • No labels