Deploying a new version of the DCS
Deploying a new version of the DCS usually consists of two steps:
- Preparing the DCS image.
- Updating the deployed version.
Preparing the DCS image
The DCS is deployed through several docker images. Each image is built and versioned separately.
DCS Docker Images. :::
Whenever a change is pushed to the main branch of the DCS repository, the CI pipeline will automatically build and push the docker images to the Azure Container Registry.
It is also possible to build and push an image from a custom branch by manually running the relevant CI pipeline.
The pipelines and their current status can be seen here: DCS CI pipelines.
Updating the Deployed Version
The deployed version of each DCS docker image is written in files stored in the deployment repository. Argo CD monitors this repository for changes and will automatically deploy the new version of the DCS when a change is detected.
The old version will not be shut down before the new version is running, so there will effectively be no downtime, but new features might take a while to become available.
the backends first. This means that you should start by updating just the backend version, and then wait until the backend is up and running, before updating the api version.
Failure to do so might lead to failed requests for a few minutes, while the api-server can send unsupported requests to the backend.
If you are in doubt whether the SPC version has been updated, ask the Developers.
If they are in doubt whether the SPC version has been updated, it hasn't. :::
Each region and environment combination has its own folder in the deployment
repository. The version of the DCS to deploy is stored in the
globaldcc-values.yaml
file in the manifests/overlays
folder.
- Development
- Staging
- Europe:
manifests/overlays/stg/eu-stg/globaldcc-values.yaml
. - North America:
manifests/overlays/stg/na-stg/globaldcc-values.yaml
. - Australia:
manifests/overlays/stg/au-stg/globaldcc-values.yaml
.
- Europe:
- Production
- Europe:
manifests/overlays/prd/eu-prd/globaldcc-values.yaml
. - North America:
manifests/overlays/prd/na-prd/globaldcc-values.yaml
. - Australia:
manifests/overlays/prd/au-prd/globaldcc-values.yaml
.
- Europe:
All components of the DCS are deployed to the same container repository, but
given different tags. The tag for each component is configured for each image in
the yaml file. For the documentation site, this could look like below, where the
tag is set to docs-1.0.102
:
docs:
sso:
enabled: false
authorizationPolicyProvider: oauth2-proxy
useXForwardedHost: true
image:
registry: amcsmainprdcr.azurecr.io
repository: globaldcc
tag: docs-1.0.102
To determine the version to deploy, check the output of the relevant pipeline in the DCS CI pipelines. The version will be the build number of the pipeline prepended by the component name.
To summarize:
- Api Server:
- Location in yaml:
api.image.tag
- Pipeline: gdcc-api_ci
- Tag:
api-x.y.z
- Location in yaml:
- Backend Server:
- Location in yaml:
backend.image.tag
- Pipeline: gdcc-backend_ci
- Tag:
backend-x.y.z
- Location in yaml:
- Roadnet Manager:
- Location in yaml:
roadnetManager.image.tag
- Pipeline: gdcc-roadnet_manager_ci
- Tag:
roadnet-manager-x.y.z
- Location in yaml:
- Documentation Site:
- Location in yaml:
docs.image.tag
- Pipeline: gdcc-docs_ci
- Tag:
docs-x.y.z
- Location in yaml:
- Database Update:
- Location in yaml:
dbup.image.tag
- Pipeline: gdcc-dbup_ci
- Tag:
dbup-x.y.z
- Location in yaml:
Testing a Deployment
Once the updated globaldcc-values.yaml
file is pulled to the main branch, Argo
CD will automatically synchronize the new versions after a few minutes.
It is also possible to initiate a manual synchronization by clicking the Sync
button in the Argo CD UI.
The status of the deployment can be monitored in the Argo CD UI for the relevant environment, but this will only show that the component is running, and not necessarily that it is working. To do this go to the Argo CD app for the region and environment, and look for red errors/events, or inspect pod's logs.
- More info on Argo CD UI: Argo CD.
For testing the functionality a user can either test the swagger endpoints or run the post-deployment tests.
- More info on Swagger Endpoints: See Introduction.
- More info on post deployment tests: GlobalDccPostDeployTests repository.
Rolling back a Deployment
Argo CD will not shut down the old version until the new version is running. If
a deployment succeeds in starting, but is corrupted somehow, or if we need to
downgrade it for other reasons, we can roll-back by just resetting the version
in the globaldcc-values.yaml
.
Usually there will be no loss of data during an upgrade or downgrade of the DCS component images.