New Domain Setup - department-of-veterans-affairs/abd-vro GitHub Wiki
To set up a new domain folder and deployment configuration for a Partner Team, this page enumerates the tasks, which are organized into the following stages:
- Gradle domain subproject for all domain code
- Docker configurations to containerize applications
- Helm configuration for LHDI Deployment
- Miscellaneous Setup
Unless otherwise stated, any team member (including those in the Partner Team) can perform the described tasks.
These tasks set up and configure the resources needed for eventual deployment. For deployment to LHDI, see Partner Team Deploy Process.
References
PRs that add a new domain:
- domain-cc Feature - run contention classification api in docker #1646
- Setup a deployment process/plan for domain-ee in nonprod #1922
- By 8/21: Setup a deployment process/plan for domain-ee in nonprod #1932
PRs that add a new VRO microservices:
1. Gradle subproject for all domain code
Create a new domain-XYZ folder (replacing XYZ with a name or acronym associated with the Partner Team).
In that folder, add build.gradle and README.md with build and test instructions for the domain. Refer to other domain-* folders.
Add a domain application project
In the domain-XYZ folder, create Gradle subproject(s) for your application. The subprojects depend on your application.
- Populate the subprojects with code -- refer to Software Conventions and other
domain-*folders; for example:- For Java projects, refer to
domain-xample. - For non-Java projects, the
XYZ-appsubproject should havebuild.gradleandgradle.propertiesfiles in thedomain-XYZ/XYZ-appfolder. There can be multiple*-appsubprojects in the domain folder.
- For Java projects, refer to
- Add each subproject to
settings.gradlein the project root folder. - Add unit tests to the subprojects and ensure
./gradlew :domain-XYZ:testexecutes those tests. Then in.github/workflows/test-code.yml, update and add job steps to run unit tests in the domain by running./gradlew :domain-XYZ:test.
2. Docker configurations to containerize applications
-
For end-to-end and integration tests, add a
docker-compose.ymlin thedomain-XYZfolder (see Docker Compose). It should set up any new containers added in thedomain-XYZfolder. Not all subprojects are manifested as Docker container, i.e., some subprojects are used as libraries -- those projects don't need to be added todocker-compose.yml. -
Add container to
scripts/image-names.shthe list ofIMAGESenvironment variable. Run./scripts/image-names.shto updatescripts/image_vars.src, which is used by GH Action workflows (e.g., to build and publish the Docker image to GHCR). Commit both files.
Add container healthcheck
- For each new container, add a healthcheck.
- Add a job step to
.github/workflows/container-healthchecks.ymlthat exercises the healthcheck.
Add integration tests
- Add end-to-end and/or integration tests for the domain.
- Add a new GitHub Action workflow that runs those tests. For examples, refer to
*-integration-test.ymland*-end2end-test.yml. - Add the new workflow as a job in
.github/workflows/continuous-integration.yml.
Add mock service
If a new mock service is needed, add it to the mocks/ folder. Note that mocks/ is a Gradle composite build (not a Gradle subproject) to isolate it from the typical VRO codebase because the mocks are not built for LHDI deployment. See PR Gradle: refactor mocks into composite build #1704 for details.
Update CI/CD GitHub Action workflows
- For each Python subproject, add the
requirements.txtfiles to.github/actions/setup-vro/action.ymland.github/secrel/config.yml. - If the domain application is ready for daily deployments to LHDI
devas part of [our CI/CD](CI CD Workflows), then add a job to.github/workflows/continuous-delivery.yml.
3. Helm configuration for LHDI Deployment
- Add a new
helm/domain-XYZ/folder and populate it. Refer to Helm Charts andhelm/domain-*/.- Ensure that
helm/domain-XYZ/templates/named_templatesis a symbolic link.
- Ensure that
- Add an entry to
helmChartAppVersionsinbuild.gradlein the project root folder so that Helm chart version number are updated when a release is created.
Update Deployment GitHub Action workflows
- Add the new helm chart folder as a
helm_chartoption in.github/workflows/update-deployment.yml. - Optionally, create
.github/workflows/update-deployment-XYZ.ymlthat deploys to all LHDI environments exceptprodfor Partner Teams to use. Tip: copy and modify existing workflows, e.g.update-deployment-cc.ymlandupdate-deployment-ee.yml. - In the rare situation where different versions of containers in the same helm chart needs to be deployed, create a new workflow (refer to
update-deployment-app.yml) and updatedeploy.sh(to pass the version numbers to thehelmcommand).
4. Miscellaneous Setup
Optional: domain-XYZ branch
If the Partner Team wants to work on a separate git branch (see ):
- Ask the VRO Team to create a
domain-XYZbranch in the repo. It will be a protected branch and is configurable by repo admins at https://github.com/department-of-veterans-affairs/abd-vro/settings/branches. - Add the branch as a
domain_branchoption to.github/workflows/fast-forward-develop.yml.
Add entry to API Gateway
To have the OpenAPI spec available via Swagger UI, update configurations for the API Gateway -- refer to which:
- configures the
VirtualService - updates Swagger UI configuration