Review apps are deployed using the start-review-app-pipeline
job which triggers a child pipeline containing a series of jobs to perform the various tasks needed to deploy a review app.
To start a review-app, add the pipeline:run-review-app
label on your merge request, and trigger a new CI/CD pipeline.
master
fix
Maintainers can elect to use the process for merging during broken master
if a customer-critical merge request is blocked by pipelines failing due to review app deployment failures.
On every Review App child pipeline in the qa
stage, the browser_performance
job is automatically started: this job does basic browser performance testing using a Sitespeed.io Container.
Upon deployment of a review app, project data is created from the sample-gitlab-project
template project. This aims to provide projects with prepopulated resources to facilitate manual and exploratory testing.
The sample projects will be created in the root
user namespace and can be accessed from the personal projects list for that user.
To reset review app and redeploy from a clean slate, do the following:
review-stop
job.review-deploy
job.Doing this will remove all existing data from a previously deployed review app.
Get access to the GCP review apps clusterYou need to open an access request (internal link) for the gcp-review-apps-dev
GCP group and role.
This grants you the following permissions for:
roles/viewer
).roles/container.pods.exec
).For GitLab Team Members only. If you want to sign in to the review app, review the GitLab handbook information for the shared 1Password account.
root
.GitLab EE Review App
.review-deploy
job.** Deploying review-*
.** Deploying review-1234-abc-defg... **
, your review app slug would be review-1234-abc-defg
in this case.container.pods.exec
permission first.review-qa-raise-e-12chm0
.toolbox
Deployment. For example, review-qa-raise-e-12chm0-toolbox
.review-qa-raise-e-12chm0-toolbox-d5455cc8-2lsvz
.KUBECTL
dropdown list, then Exec
-> toolbox
.-c toolbox -- ls
with -it -- gitlab-rails console
from the default command or
kubectl exec --namespace review-qa-raise-e-12chm0 review-qa-raise-e-12chm0-toolbox-d5455cc8-2lsvz -it -- gitlab-rails console
and
review-qa-raise-e-12chm0-toolbox-d5455cc8-2lsvz
with your Pod’s name.container.pods.getLogs
permission first.review-qa-raise-e-12chm0
.migrations
Deployment. For example, review-qa-raise-e-12chm0-migrations.1
.review-qa-raise-e-12chm0-migrations.1-nqwtx
.Container logs
.Alternatively, you could use the Logs Explorer which provides more utility to search logs. An example query for a pod name is as follows:
resource.labels.pod_name:"review-qa-raise-e-12chm0-migrations"
How does it work? CI/CD architecture diagram
graph TD A["build-qa-image, compile-production-assets<br/>(canonical default refs only)"]; B1[start-review-app-pipeline]; B[review-build-cng]; C["review-deploy<br><br>Helm deploys the review app using the Cloud<br/>Native images built by the CNG-mirror pipeline.<br><br>Cloud Native images are deployed to the #96;review-apps#96;<br>Kubernetes (GKE) cluster, in the GCP #96;gitlab-review-apps#96; project."]; D[CNG-mirror]; A --> B1 B1 --> B B -.->|triggers a CNG-mirror pipeline| D D -.->|depends on the multi-project pipeline| B B --> C subgraph "1#46; gitlab-org/gitlab parent pipeline" A B1 end subgraph "2#46; gitlab-org/gitlab child pipeline" B C end subgraph "CNG-mirror pipeline" D>Cloud Native images are built]; endDetailed explanation
prepare
stage, the compile-production-assets
job is automatically started.
review-build-cng
job starts since the CNG-mirror
pipeline triggered in the following step depends on it.compile-production-assets
is done, the review-build-cng
job triggers a pipeline in the CNG-mirror
project.
review-build-cng
job automatically starts only if your MR includes CI or frontend changes. In other cases, the job is manual.CNG-mirror
pipeline creates the Docker images of each component (for example, gitlab-rails-ee
, gitlab-shell
, gitaly
etc.) based on the commit from the GitLab pipeline and stores them in its registry.CNG-mirror
project so that the CNG
, (Cloud Native GitLab), project’s registry is not overloaded with a lot of transient Docker images.review-build-cng
is done, the review-deploy
job deploys the review app using the official GitLab Helm chart to the review-apps
Kubernetes cluster on GCP.
scripts/review_apps/review-apps.sh
.CNG-mirror
project’s registry.review-deploy
job succeeds, you should be able to use your review app thanks to the direct link to it from the MR widget. To log into the review app, see “Sign in to my review app?” below.Additional notes:
review-deploy
job keeps failing (and a manual retry didn’t help), post a message in the #g_qe_engineering_productivity
channel and/or create a ~"Engineering Productivity"
~"dx::review apps"
~"type::bug"
issue with a link to your merge request. The deployment failure can reveal an actual problem introduced in your merge request (that is, this isn’t necessarily a transient failure)!review-stop
can be used to stop a review app manually, and is also started by GitLab once a merge request’s branch is deleted after being merged.gitlab
projects using the GitLab Kubernetes integration. This basically allows to have a link to the review app directly from the merge request widget.Review apps are automatically stopped 2 days after the last deployment thanks to the Environment auto-stop feature.
If you need your review app to stay up for a longer time, you can pin its environment or retry the review-deploy
job to update the “latest deployed at” time.
The review-cleanup
job that automatically runs in scheduled pipelines stops stale review apps after 5 days, deletes their environment after 6 days, and cleans up any dangling Helm releases and Kubernetes resources after 7 days.
The cluster is configured via Terraform in the engineering-productivity-infrastructure
project.
Node pool image type must be Container-Optimized OS (cos)
, not Container-Optimized OS with Containerd (cos_containerd)
, due to this known issue on the Kubernetes executor for GitLab Runner
The Helm version used is defined in the registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-helm3.5-kubectl1.17
image used by the review-deploy
and review-stop
jobs.
If review app stability dips this may be a signal that the review-apps
cluster is unhealthy. Leading indicators may be health check failures leading to restarts or majority failure for review app deployments.
The review apps Overview dashboard aids in identifying load spikes on the cluster, and if nodes are problematic or the entire cluster is trending towards unhealthy.
See the review apps page of the Engineering Productivity Runbook for troubleshooting review app releases.
Frequently Asked QuestionsIsn’t it too much to trigger CNG image builds on every test run? This creates thousands of unused Docker images.
We have to start somewhere and improve later. Also, we’re using the CNG-mirror project to store these Docker images so that we can just wipe out the registry at some point, and use a new fresh, empty one.
How do we secure this from abuse? Apps are open to the world so we need to find a way to limit it to only us.
Other resources Helpful command-line toolsThis isn’t enabled for forks.
Return to Testing documentation
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4