- OpenSearch Continous Integration
- Getting Started
- Deployment
- Contributing
- Getting Help
- Code of Conduct
- Security
- License
- Copyright
OpenSearch Continuous Integration is an open source CI system for OpenSearch and its plugins.
- Requires NPM to be installed
- Install project dependencies using
npm install
from this project directory - Configure aws credentials
- Deploy stacks with
npm run cdk deploy
-
Setup your local machine to credentials to deploy to the AWS Account
-
Deploy the bootstrap stack by running following command that sets up required resources to create the stacks. More info
npm run cdk bootstrap -- -c useSsl=false -c runWithOidc=false
-
Deploy the ci-config-stack using the with one of the following (takes ~1 minute to deploy) -
npm run cdk deploy CI-Config-Dev -- -c useSsl=false -c runWithOidc=false
-
Optional Configure the elements of the config stack for SSL configuration
-
Optional Configure the elements setting up oidc via federate
-
Deploy the ci-stack, takes ~10 minutes to deploy (parameter values depend on step 2 and step 3)
npm run cdk deploy CI-Dev -- -c useSsl=false -c runWithOidc=false
-
Log onto the AWS Console of the account, navigate to cloud watch, open log groups, looking for
JenkinsMainNode/var/log/jenkins/jenkins.log
-
Search the logs for
Jenkins initial setup is required. An admin user has been created and a password generated.
After that entry the password for the jenkins instance will be in the cloudwatch logs. -
Go to the
CI-Dev.JenkinsExternalLoadBalancerDns
url returned by CDK output to access the jenkins host. -
If you want to destroy the stack make sure you delete the agent nodes manually (via jenkins UI or AWS console) so that shared resources (like vpc, security groups, etc) can be deleted.
- Locate the secret manager arns in the ci-config-stack outputs
- Update the secret value (see docs) for the
certContentsSecret
with the certificate contents
$aws secretsmanager put-secret-value \
--secret-id MyTestDatabaseSecret_or_ARN \
--secret-string file://mycreds.json_or_value
- Update the secret value (see docs) for the
privateKeySecret
with the certificate private key - Upload the certificate to IAM see docs
- Update the secret value for the
certificateArnSecret
with the certificate arn generated by IAM - Run with parameter using one of the following (refer this for value of
runWithOidc
)npm run cdk deploy CI-Dev -- -c useSsl=true -c runWithOidc=true
or,cdk deploy CI-Dev -c useSsl=true -c runWithOidc=true
- Continue with next steps
- Locate the secret manager arns in the ci-config-stack outputs
- Update the secret value (see docs) for the
OIDCClientIdSecret
with the credentials as json as follows:- JSON format
{ "clientId": "example_id", "clientPassword": "example_password", "wellKnownOpenIDConfigurationUrl": "https://www.example.com", "tokenServerUrl": "https://example.com/token", "authorizationServerUrl": "https://example.com/authorize", "userInfoServerUrl": "https://example.com/userinfo" }
- Command Eg: see docs
$aws secretsmanager put-secret-value \ --secret-id MyTestDatabaseSecret_or_ARN \ --secret-string file://mycreds.json_or_value
- Run with parameter with one of the following (refer this for value of
useSsL
) -npm run cdk deploy CI-Dev -- -c runWithOidc=false -c useSsl=true
or,cdk deploy CI-Dev -c runWithOidc=false -c useSsl=true
- Continue with next steps
Useful links
- Log are found in Cloud Watch Logs
- Need to access the host, ssh via Session Manager in EC2 Console
- Instance instance isn't coming up, get the system log in EC2 Console
npm run build
compile typescript to js, run lint, run testsnpm run watch
watch for changes and compilenpm run cdk deploy
deploy this stack to your default AWS account/regionnpm run cdk diff
compare deployed stack with current statenpm run cdk synth
emits the synthesized CloudFormation template
Built using AWS Cloud Development Kit the configuration of the CI systems will be available for replication in your own accounts. The Jenkins instance will be hardened and publically visible, connected to GitHub to make build notifications easy for everyone to see.
See developer guide and how to contribute to this project.
If you find a bug, or have a feature request, please don't hesitate to open an issue in this repository.
For more information, see project website and documentation. If you need help and are unsure where to open an issue, try forums.
This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ, or contact opensource-codeofconduct@amazon.com with any additional questions or comments.
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public GitHub issue.
This project is licensed under the Apache v2.0 License.
Copyright OpenSearch Contributors. See NOTICE for details.