Move component test scripts to development
What does this MR do?
Moves the developer files for the compose environment into development/ and adds make targets for each image variant.
- Moves the component test scripts to
development/tests/with their test plans and ignore rules. - Removes the Cells dev environment.
- Moves the compose files,
.env, and mounted fixtures todevelopment/compose/. - Adds a
Makefilewithup,down, andcleantargets for the debian, ubi, fips, and nix stacks. Each target accepts an image tag. The targets adddocker-compose.override.ymlas the last compose file when it exists. The nix stack keepsgitaly-init-cgroupson the tag without-nixbecause that image has no nix build.
Rationale
Currently compose and test files live in the same directory path. This easily confuses new contributors and makes it difficult to understand what to maintain and where to maintain it.
Additionally, we learned in Discovery: Cells Docker Compose Maintenance Req... (#2395) • Unassigned that the Cells team will not be keeping our highly scripted Cells test updated due to migraiton to Caproni.
There are also a good number of commands required to test the various CNG variants, remove old images, and generally maintain hygiene on the developer system.
The fourth commit of the stack adds a Makefile with well documented targets to stand up, tear down, and clean up images for each of the current variants of Cloud Native GitLab.
This should reduce friction when we test Cloud Native GitLab containers.
Commit 1 of 4:
Move component test scripts to development
- Places the component test scripts under `development/tests/` with
the test plans and ignore rules that reference them.
Closes https://gitlab.com/gitlab-org/build/CNG/-/work_items/2398
Signed-off-by: Robert Marshall <rmarshall@gitlab.com>Commit 2 of 4:
Remove the Cells dev environment
- Removes the Cells setup script and its README.
- Removes the HTTP Router build context.
- Removes the Topology Service test scripts.
- Removes the README section and ignore rules related to Cells.
Related https://gitlab.com/gitlab-org/build/CNG/-/work_items/2395
Signed-off-by: Robert Marshall <rmarshall@gitlab.com>Commit 3 of 4:
Move compose files and fixtures to development
- Places the compose files and the environment file under
`development/compose/`.
- Places the mounted fixtures under `development/compose/mnt/shared/`.
- Updates the compose mounts, ignore rules, pre-commit excludes, and
README instructions that name the new paths.
Signed-off-by: Robert Marshall <rmarshall@gitlab.com>Commit 4 of 4:
Add make targets for the dev compose stacks
- Adds a Makefile that starts, stops, and cleans the debian, ubi, fips,
and nix compose stacks with an optional image tag.
- Loads `docker-compose.override.yml` as the last compose file when it
exists.
- Keeps the `gitaly-init-cgroups` image of the nix stack on the tag
without the nix suffix.
- Documents the targets in the README.
Signed-off-by: Robert Marshall <rmarshall@gitlab.com>Test plan
- From
development/compose,docker compose config -qexits 0 with no unset-variable warning fordocker-compose.yml,docker-compose.fips.yml, anddocker-compose.ymlplusdocker-compose.nix.yml. Every bind source in the output exists on disk. docker compose confignames the projectcompose. With that name normalized it renders the same services asmaster.git ls-files devprints nothing.git grep -iE 'dev/cells|dev/http-router|dev/topology-service|docker-compose\.cells|GitLab Cells'finds only a comment ingitlab-rails/scripts/lib/checks/topology_service.rb.make compose up nix my-branchstarts the stack with-nixtags on every CNG image exceptgitaly-init-cgroups:my-branch. Adocker-compose.override.ymlindevelopment/composejoins the command as the last file.make compose clean nix my-branchrunsdown -vand then removes the ninemy-branch-niximages.make compose up nix bad/tagexits 2 withinvalid image tag.
Related issues
Related Discovery: Cells Docker Compose Maintenance Req... (#2395) • Unassigned
Closes Spike: Organize developer tests and harnesses (#2398 - closed) • Robert Marshall
Closes Discovery: Scope automation requirements and in... (#2399 - closed) • Unassigned
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
- Merge Request Title, and Description are up to date, accurate, and descriptive
- MR targeting the appropriate branch
- MR has a green pipeline on GitLab.com
- When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow
Expected (please provide an explanation if not completing)
- Test plan indicating conditions for success has been posted and passes
- Documentation created/updated
- Integration tests added to GitLab QA
- The impact any change in container size has should be evaluated
- New dependencies are managed with GitLab forked renovatebot