Commit 29e5cd5f authored by Rémy Coutable's avatar Rémy Coutable

Improve Review Apps documentation

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 8ae38ca2
...@@ -4,41 +4,79 @@ Review Apps are automatically deployed by each pipeline, both in ...@@ -4,41 +4,79 @@ Review Apps are automatically deployed by each pipeline, both in
[CE](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22010) and [CE](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22010) and
[EE](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6665). [EE](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6665).
CAUTION: **Warning:**
There's currently [an issue when using `/` in branch names][charts-1068] where
Review Apps fail to be deployed.
## How does it work? ## How does it work?
### CD/CD architecture diagram
![Review Apps CI/CD architecture](img/review_apps_cicd_architecture.png)
<details>
<summary>Show mermaid source</summary>
<pre>
graph TD
B1 -.->|2. once gitlab:assets:compile is done,<br />triggers a CNG-mirror pipeline and wait for it to be done| A2
C1 -.->|2. once review-build-cng is done,<br />Helm deploys the Review App using the Cloud<br/>Native images built by the CNG-mirror pipeline| A3
subgraph gitlab-ce/ee `test` stage
A1[gitlab:assets:compile]
B1[review-build-cng] -->|1. wait for| A1
C1[review-deploy] -->|1. wait for| B1
D1[review-qa-smoke] -->|1. wait for| C1
D1[review-qa-smoke] -.->|2. once review-deploy is done| E1>gitlab-qa runs the smoke<br/>suite against the Review App]
end
subgraph CNG-mirror pipeline
A2>Cloud Native images are built];
end
subgraph GCP `gitlab-review-apps` project
A3>"Cloud Native images are deployed to the<br />`review-apps-ce` or `review-apps-ee` Kubernetes (GKE) cluster"];
end
</pre>
</details>
### Detailed explanation
1. On every [pipeline][gitlab-pipeline] during the `test` stage, the 1. On every [pipeline][gitlab-pipeline] during the `test` stage, the
[`review-deploy`][review-deploy-job] job is automatically started. [`review-build-cng`][review-build-cng] and
1. The `review-deploy` job: [`review-deploy`][review-deploy] jobs are automatically started.
1. Waits for the `gitlab:assets:compile` job to finish since the - The [`review-deploy`][review-deploy] job waits for the
[`CNG-mirror`][cng-mirror] pipeline triggerred in the following step [`review-build-cng`][review-build-cng] job to finish.
depends on it. - The [`review-build-cng`][review-build-cng] job waits for the
1. [Triggers a pipeline][cng-pipeline] in the [`CNG-mirror`][cng-mirror] [`gitlab:assets:compile`][gitlab:assets:compile] job to finish since the
project. [`CNG-mirror`][cng-mirror] pipeline triggered in the following step depends on it.
- We use the `CNG-mirror` project so that the `CNG`, (**C**loud 1. Once the [`gitlab:assets:compile`][gitlab:assets:compile] job is done,
**N**ative **G**itLab), project's registry is not overloaded with a [`review-build-cng`][review-build-cng] [triggers a pipeline][cng-pipeline]
lot of transient Docker images. in the [`CNG-mirror`][cng-mirror] project.
- The `CNG-mirror` pipeline creates the Docker images of each component - The [`CNG-mirror`][cng-pipeline] pipeline creates the Docker images of
(e.g. `gitlab-rails-ee`, `gitlab-shell`, `gitaly` etc.) based on the each component (e.g. `gitlab-rails-ee`, `gitlab-shell`, `gitaly` etc.)
commit from the [GitLab pipeline][gitlab-pipeline] and store them in based on the commit from the [GitLab pipeline][gitlab-pipeline] and store
its [registry][cng-mirror-registry]. them in its [registry][cng-mirror-registry].
1. Once all images are built by [`CNG-mirror`][cng-mirror], the Review App - We use the [`CNG-mirror`][cng-mirror] project so that the `CNG`, (**C**loud
is deployed using [the official GitLab Helm chart][helm-chart] to the **N**ative **G**itLab), project's registry is not overloaded with a
[`review-apps-ce`][review-apps-ce] / [`review-apps-ee`][review-apps-ee] lot of transient Docker images.
Kubernetes cluster on GCP. 1. Once the [`review-build-cng`][review-build-cng] job is done, the
- The actual scripts used to deploy the Review App can be found at [`review-deploy`][review-deploy] job deploys the Review App using
[`scripts/review_apps/review-apps.sh`][review-apps.sh]. [the official GitLab Helm chart][helm-chart] to the
- These scripts are basically [`review-apps-ce`][review-apps-ce] / [`review-apps-ee`][review-apps-ee]
[our official Auto DevOps scripts][Auto-DevOps.gitlab-ci.yml] where the Kubernetes cluster on GCP.
default CNG images are overridden with the images built and stored in the - The actual scripts used to deploy the Review App can be found at
[`CNG-mirror` project's registry][cng-mirror-registry]. [`scripts/review_apps/review-apps.sh`][review-apps.sh].
- Since we're using [the official GitLab Helm chart][helm-chart], this means - These scripts are basically
you get a dedicated environment for your branch that's very close to what [our official Auto DevOps scripts][Auto-DevOps.gitlab-ci.yml] where the
it would look in production. default CNG images are overridden with the images built and stored in the
1. Once the `review-deploy` job succeeds, you should be able to use your Review [`CNG-mirror` project's registry][cng-mirror-registry].
App thanks to the direct link to it from the MR widget. The default username - Since we're using [the official GitLab Helm chart][helm-chart], this means
is `root` and its password can be found in the 1Password secure note named you get a dedicated environment for your branch that's very close to what
**gitlab-{ce,ee} Review App's root password** (note that there's currently it would look in production.
[a bug where the default password seems to be overridden][password-bug]). 1. Once the [`review-deploy`][review-deploy] job succeeds, you should be able to
use your Review App thanks to the direct link to it from the MR widget. The
default username is `root` and its password can be found in the 1Password
secure note named **gitlab-{ce,ee} Review App's root password**.
**Additional notes:** **Additional notes:**
...@@ -120,10 +158,13 @@ find a way to limit it to only us.** ...@@ -120,10 +158,13 @@ find a way to limit it to only us.**
> This isn't enabled for forks. > This isn't enabled for forks.
[gitlab-pipeline]: https://gitlab.com/gitlab-org/gitlab-ce/pipelines/35850709 [charts-1068]: https://gitlab.com/charts/gitlab/issues/1068
[review-deploy-job]: https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/118076368 [gitlab-pipeline]: https://gitlab.com/gitlab-org/gitlab-ce/pipelines/44362587
[gitlab:assets:compile]: https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/149511610
[review-build-cng]: https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/149511623
[review-deploy]: https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/149511624
[cng-mirror]: https://gitlab.com/gitlab-org/build/CNG-mirror [cng-mirror]: https://gitlab.com/gitlab-org/build/CNG-mirror
[cng-pipeline]: https://gitlab.com/gitlab-org/build/CNG-mirror/pipelines/35883435 [cng-pipeline]: https://gitlab.com/gitlab-org/build/CNG-mirror/pipelines/44364657
[cng-mirror-registry]: https://gitlab.com/gitlab-org/build/CNG-mirror/container_registry [cng-mirror-registry]: https://gitlab.com/gitlab-org/build/CNG-mirror/container_registry
[helm-chart]: https://gitlab.com/charts/gitlab/ [helm-chart]: https://gitlab.com/charts/gitlab/
[review-apps-ce]: https://console.cloud.google.com/kubernetes/clusters/details/us-central1-a/review-apps-ce?project=gitlab-review-apps [review-apps-ce]: https://console.cloud.google.com/kubernetes/clusters/details/us-central1-a/review-apps-ce?project=gitlab-review-apps
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment