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

[Jenkins] Add Solutions CFN Create VPC Test #1159

Merged
merged 10 commits into from
Nov 23, 2024

Conversation

lewijacn
Copy link
Collaborator

@lewijacn lewijacn commented Nov 21, 2024

Description

This change introduces a new Jenkins pipeline that synthesizes the Solutions Create VPC CFN template from this repository and deploys it to the test account. It will then perform the initBootstrap and ensure it exits properly as well as verifies that CLI tools such as cdk, docker, java, and python are now available on the box.

Issues Resolved

https://opensearch.atlassian.net/browse/MIGRATIONS-2228

Is this a backport? If so, please add backport PR # and/or commits #

Testing

Jenkins AWS testing

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.76%. Comparing base (d5b401c) to head (ac16249).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1159   +/-   ##
=========================================
  Coverage     80.76%   80.76%           
  Complexity     2948     2948           
=========================================
  Files           400      400           
  Lines         15104    15104           
  Branches       1021     1021           
=========================================
  Hits          12199    12199           
  Misses         2288     2288           
  Partials        617      617           
Flag Coverage Δ
unittests 80.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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


🚨 Try these New Features:

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

I really like that we can have some tests for this code, amazing! However, I'm a little concerned about building up shell script when we could lean on higher level languages, what do you think?

deployment/migration-assistant-solution/bin/app.ts Outdated Show resolved Hide resolved
sh "sudo npm install"
withCredentials([string(credentialsId: 'migrations-test-account-id', variable: 'MIGRATIONS_TEST_ACCOUNT_ID')]) {
withAWS(role: 'JenkinsDeploymentRole', roleAccount: "${MIGRATIONS_TEST_ACCOUNT_ID}", region: "us-east-1", duration: 3600, roleSessionName: 'jenkins-session') {
sh "sudo --preserve-env cdk deploy 'Migration-Assistant-Infra-Create-VPC' --parameters Stage=${stage} --require-approval never --concurrency 3"
Copy link
Member

Choose a reason for hiding this comment

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

use npm deploy to reduce extra parameters like --require-approval and CDK doesn't need to be installed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This only saves me not having to provide the --require-approval flag I believe and CDK CLI will already be on the box. My preference is to keep the same, but open if others want to change it.

Copy link
Member

Choose a reason for hiding this comment

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

I'd really prefer we didn't have to run npm install -g cdk as part of the env setup, by using npm run it ensures everything is correctly version locked. 🧂

test/awsRunInitBootstrap.sh Show resolved Hide resolved
test/awsRunInitBootstrap.sh Show resolved Hide resolved
Signed-off-by: Tanner Lewis <[email protected]>
@lewijacn
Copy link
Collaborator Author

I really like that we can have some tests for this code, amazing! However, I'm a little concerned about building up shell script when we could lean on higher level languages, what do you think?

Create JIRA to handle this: https://opensearch.atlassian.net/browse/MIGRATIONS-2231

@lewijacn lewijacn merged commit 6217e1c into opensearch-project:main Nov 23, 2024
21 of 22 checks passed
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.

2 participants