Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
Reword and expand both the reasoning and the process documented.
  • Loading branch information
ConsoleCatzirl committed Jan 2, 2025
1 parent b1c005b commit e012dc2
Showing 1 changed file with 46 additions and 23 deletions.
69 changes: 46 additions & 23 deletions sceptre/scipool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ to build out the service catalog.
# sceptre launch-stack prod <stack_name>
```

The above should setup resources for the AWS account. Once the infrastructure
The above should setup resources for the AWS account. Once the infrastructure
for the account has been setup you can access and view the account using the
[AWS console](https://AWS-account-ID-or-alias.signin.aws.amazon.com/console).

Expand All @@ -42,32 +42,55 @@ execute the validations by running `pre-commit run --all-files`.
Please install pre-commit, once installed the file validations will
automatically run on every commit.

### Functional Testing
The process to test the functionality of an AMI and it's integration with our
Service Catalog products is to first create a test AMI, upload a modified
product template to S3, and create a new Service Catalog product in the
scipool dev account to verify manually from https://sc-dev.sageit.org/

The deploy pipelines for both our packer repos and our service catalog library
will create artifacts for branches that begin with `test/` in the sandbox
account, allowing anyone with write access to the packer repos to create test
AMIs, and anyone with write access to service-catalog-library to upload test
templates for service catalog to S3.

1. Commit changes to the packer repo to update or modify the AMI on a branch
that starts with `test/`, and push directly to the origin repo.
1. Manually create an EC2 instance in the `itsandbox` account from the test AMI
for any initial system validation, then terminate it.
### Pre-Merge Integration Testing

To validate the integration of AMI changes with Service Catalog products several
resources need to be created in AWS including a test AMI, a test CFN template
(uploaded to S3), and a test product in Service Catalog. Finally, the test
product can be provisioned from https://sc-dev.sageit.org/ for user-acceptance
testing of the changes to the AMI and/or CFN template.

This process has been automated by using standard deploy pipelines on test
branches. Automating the process improves test consistency and accuracy and
reduces the impact of human error.

Anyone with write access to the upstream repos can automate creating AMIs and
uploading CFN templates to S3 by pushing `test/*` branches directly to the
uptsream repo. For example, pushing a branch named `test/foo` directly to
`Sage-Bionetworks-IT/packer-rstudio` will create an AMI named
`packer-rstudio-test/foo` in `imagecentral`, and pushing a branch named
`test/bar` directly to `Sage-Bionetworks/service-catalog-library` will upload
the templates to `service-catalog-library/test/bar/` in the bootstrap bucket in
`admincentral`.

The standard PR development process is used to create a test product in Service
Catalog in this `scipool` sceptre project, such as in [this PR](https://github.com/Sage-Bionetworks-IT/organizations-infra/pull/1109).

The full process with automation is:

1. Commit changes to the target packer repo to modify the AMI on a branch that
starts with `test/`, and push it directly to the upstream repo to create a
test AMI.
- Initial manual testing of the AMI can be performed by using it to boot an
EC2 instance.
1. Commit changes to `service-catalog-library` on a branch that starts with
`test/` to update the desired template, and push directly to the origin repo.
`test/` to update the relevant template with the new AMI, and push directly
to the origin repo to uplead the templates to S3.
1. Create a pull request for `organizations-infra` to add a new Service Catalog
product to `scipool-dev` with 'test' in the name for the test template.
1. Provision the test product from http://sc-dev.sageit.org to validate AMI
integration with the product template
product to `scipool-dev` with `test` in the name for the test template.
1. Provision the test product from http://sc-dev.sageit.org to manually validate
AMI integration with the product template.
1. Create a pull request for the packer repo to modify the AMI.
1. Create a pull request for `service-catalog-library` to reference the new AMI.
1. Create a pull request for `organizations-infra` to remove the test product and
update the target product with the new template version.
1. Create a pull request for `organizations-infra` to update the target product
with the new template version and remove the test product.

The list of active packer repos that are used by service catalog products:

1. `Sage-Bionetworks-IT/packer-amazonlinux-docker`
1. `Sage-Bionetworks-IT/packer-base-ubuntu-jammy`
1. `Sage-Bionetworks-IT/packer-docker-server`
1. `Sage-Bionetworks-IT/packer-winserver-2022`

## Issues
* https://sagebionetworks.jira.com/projects/IT
Expand Down

0 comments on commit e012dc2

Please sign in to comment.