Tezt/Cloud: Add a --no-docker-push CLI option
What
Add a CLI option to not push the Docker image when it is not required.
Why
When a VM is already running, and the content of the updated Docker image is not required, pushing the Docker image is quite time-consuming despite being useless, hence we offer the possibility for the developer to avoid it.
How
It is up to the person launching the test to declare they do not want to push Docker image, via a CLI option.
Manually testing the MR
I was unable to obtain a setup illustrating the purpose of this MR. However, I have clue that it works:
- When running
dune exec tezt/tests/cloud/main.exe -- cloud health -v --tezt-cloud guillaumeg --dockerfile-alias debian >> _logs/logs_no_option.txtthe log contains those lines:
Compute the registry uri...
[terraform] terraform '-chdir=tezt/lib_cloud/terraform/docker-registry' output -json
[terraform] {
[terraform] "docker_registry": {
[terraform] "sensitive": false,
[terraform] "type": "string",
[terraform] "value": "europe-west1-docker.pkg.dev/nl-dal/guillaumeg-docker-registry"
[terraform] },
[terraform] "hostname": {
[terraform] "sensitive": false,
[terraform] "type": "string",
[terraform] "value": "europe-west1-docker.pkg.dev"
[terraform] },
[terraform] "zone": {
[terraform] "sensitive": false,
[terraform] "type": "string",
[terraform] "value": "europe-west1-c"
[terraform] }
[terraform] }
terraform exited with code 0.
Authenticate docker hostname...
[gcloud] gcloud auth configure-docker europe-west1-docker.pkg.dev
[gcloud] WARNING: Your config file at [/home/nomadic/.docker/config.json] contains these credential helper entries:
[gcloud] {
[gcloud] "credHelpers": {
[gcloud] "europe-west1-docker.pkg.dev": "gcloud"
[gcloud] }
[gcloud] }
[gcloud] Adding credentials for: europe-west1-docker.pkg.dev
[gcloud] gcloud credential helpers already registered correctly.
gcloud exited with code 0.
Tagging the image...
[docker] docker tag debian:latest europe-west1-docker.pkg.dev/nl-dal/guillaumeg-docker-registry/debian:latest
docker exited with code 0.
Push the image...
[docker] docker push europe-west1-docker.pkg.dev/nl-dal/guillaumeg-docker-registry/debian:latest
[docker] The push refers to repository [europe-west1-docker.pkg.dev/nl-dal/guillaumeg-docker-registry/debian]
[docker] cdb1a4a025d8: Preparing
[docker] 770d2895bee1: Preparing
[docker] b09e5281cfc3: Preparing
[docker] 6f31c7466baf: Preparing
[docker] f9dc9a79bb91: Preparing
[docker] c8120fcedb91: Preparing
[docker] c8120fcedb91: Waiting
[docker] 770d2895bee1: Layer already exists
[docker] f9dc9a79bb91: Layer already exists
[docker] 6f31c7466baf: Layer already exists
[docker] b09e5281cfc3: Layer already exists
[docker] cdb1a4a025d8: Layer already exists
[docker] c8120fcedb91: Layer already exists
[docker] latest: digest: sha256:b5950f5c82002e4231ecacc50a47958b2b8d6a7bb127b6d74de84bab429a6d42 size: 1587
docker exited with code 0.
which are absent when using the --no-docker-push newly introduced option.
dune exec tezt/tests/cloud/main.exe -- cloud health -v --tezt-cloud guillaumeg --dockerfile-alias debian --no-docker-push >> _logs/logs_with_option.txt
Please find enclosed both logs: logs_no_option.txt
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR