Skip to content
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

CMR-10282: Migrating from serverless framework to CDK #388

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eudoroolivares2016
Copy link
Contributor

@eudoroolivares2016 eudoroolivares2016 commented Jan 23, 2025

Overview

What is the feature?

Migrate away from serverless framework to instead using aws-cdk this also bumps node to node 22

What is the Solution?

Replaces serverless with aws-cdk

What areas of the application does this impact?

Infrastructure of the application

Testing

Reproduction steps

  • **Environment for testing:SIT
  • Collection to test with:
  1. Regression test the application to ensure that contains to function in the same way
  2. Ensure that we are still able to reach the documentation page in the s3 bucket

Attachments

Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.57%. Comparing base (3d5d1bb) to head (f8e9053).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #388      +/-   ##
==========================================
+ Coverage   88.42%   88.57%   +0.15%     
==========================================
  Files          24       24              
  Lines        1218     1217       -1     
  Branches      269      258      -11     
==========================================
+ Hits         1077     1078       +1     
+ Misses        141      139       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

cdk/cmr-stac-dev/bin/cmr-stac-dev.ts Outdated Show resolved Hide resolved
cdk/cmr-stac/lib/cmr-stac-stack.ts Show resolved Hide resolved
cdk/cmr-stac/lib/cmr-stac-stack.ts Outdated Show resolved Hide resolved
docker build -t $dockerTag .

# Convenience function to invoke `docker run` with appropriate env vars instead of baking them into image
dockerRun() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently deployments are done via bamboo-specs on CMR stac will need to update that repo to put these new variables or otherwise remove cmr-stac from the bamboo specs deployment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated bamboo specs so different env deployments are decoupled that way as this makes it through envs we can just push an update to the bamboo build plan

@eudoroolivares2016 eudoroolivares2016 marked this pull request as ready for review January 27, 2025 14:57
.dockerignore Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
cdk/cmr-stac-dev/bin/cmr-stac-dev.ts Outdated Show resolved Hide resolved
cdk/cmr-stac-dev/lib/cmr-stac-dev-stack.ts Outdated Show resolved Hide resolved
cdk/cmr-stac-dev/migrate.json Outdated Show resolved Hide resolved
cdk/cmr-stac-dev/package.json Outdated Show resolved Hide resolved
cdk/cmr-stac/lib/cmr-stac-stack.ts Outdated Show resolved Hide resolved
cdk/cmr-stac/lib/cmr-stac-stack.ts Outdated Show resolved Hide resolved
cdk/cmr-stac/bin/cmr-stac.ts Show resolved Hide resolved
cdk/cmr-stac/lib/cmr-stac-stack.ts Outdated Show resolved Hide resolved
@eudoroolivares2016
Copy link
Contributor Author

Needing to fix a content-encoding issue where passing the gzip, deflate, br as browsers do, is causing errors (Locally)

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
"watch": "onchange 'src/**' -- npm run run-synth-dev",
"start:api": "sam local start-api -t ./cdk/cmr-stac/cdk.out/cmr-stac-dev.template.json --warm-containers LAZY --port 3000 --docker-network host",
"prestart": "npm run run-synth-dev ",
"start": "node start.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command doesn't work for me.

➜ npm start

> [email protected] prestart
> npm run run-synth-dev


> [email protected] run-synth-dev
> cd cdk/cmr-stac-dev && npm run cdk synth -- --quiet


> [email protected] cdk
> cdk synth --quiet

sh: cdk: command not found

The preinstall script runs on cdk/cmr-stac, not cdk/cmr-stac-dev

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now

.eslintrc.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
.github/workflows/lint.yaml Outdated Show resolved Hide resolved
.github/workflows/run_tests.yaml Outdated Show resolved Hide resolved
cdk/cmr-stac/lib/cmr-stac-stack.ts Outdated Show resolved Hide resolved
CMR-10282: Fix install up gh actions

CMR-10282: Fix tests and prettier

CMR-10282: Fix prettier

CMR-10282: Move ajv-formats to dev deps; use linter consistently

CMR-10282: Fix encoding issue from compression; more consistent env variables

CMR-10282: Update dep remove comment

CMR-10282: PR comments

CMR-10282: Make these const values since they don't need to be updated for dev stack

CMR-10282: Flip back the suffix

CMR-10282: Remove log suffix from docs bucket

CMR-10282: Removing names

CMR-10282: Add bucket policy to s3

CMR-10282: Fix spacing; run prettier

CMR-10282: Migrating from serverless framework to CDK

CMR-10282: stac is at least running

CMR-10282: Local env and compiled prod cdk working

CMR-10282: Working deployment

CMR-10282: Obfuscate destination arn, add bucket deployment for the documentation upload

CMR-10282: Remove serverless its deploying on top of the serverless deployment successfully

EDSC-10282: Update the names of the path to try to get it working in SIT

CMR-10282: Cleaning up

CMR-10282: Working cleaning up more serverless things

CMR-10282: Fixing non-null linter warnings by ignoring cdk files

CMR-10282: Fix the tsconfig issues and get tests running

CMR-10282: More cleanup

CMR-10282: Remove unused env var remove expresswrapper.js

CMR-10282: Cleaning up more

CMR-10282: use cdk lib

CMR-10282: Remove debugging lines

CMR-10282: Simplify dev stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants