substitutions: '_IMAGE_NAME': '' '_IMAGE_PROJECT': '' '_CLEANUP': 'true' '_VM_NAME_PREFIX': 'cs-debug-test' '_ZONE': 'us-central1-a' '_CC': '' '_WORKLOAD_IMAGE': 'us-west1-docker.pkg.dev/confidential-space-images-dev/cs-integ-test-images/basic-test:latest,tee-cmd=["newCmd"],tee-env-ALLOWED_OVERRIDE=overridden' steps: - name: 'gcr.io/cloud-builders/gcloud' id: CreateVM entrypoint: 'bash' env: - 'BUILD_ID=$BUILD_ID' args: ['create_vm.sh','-i', '${_IMAGE_NAME}', '-p', '${_IMAGE_PROJECT}', '-m', 'tee-image-reference=${_WORKLOAD_IMAGE},tee-container-log-redirect=true', '-n', '${_VM_NAME_PREFIX}-${BUILD_ID}', '-z', '${_ZONE}', '-c', '${_CC}', ] - name: 'gcr.io/cloud-builders/gcloud' id: BasicWorkloadTest entrypoint: 'bash' args: ['scripts/test_launcher_workload.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] - name: 'gcr.io/cloud-builders/gcloud' id: BasicWorkloadTestCloudLogging entrypoint: 'bash' env: - 'PROJECT_ID=$PROJECT_ID' args: ['scripts/test_launcher_workload_cloudlogging.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}'] - name: 'gcr.io/cloud-builders/gcloud' id: ChangeMDSVariables entrypoint: 'bash' args: ['util/change_metadata_vars.sh', '-n', '${_VM_NAME_PREFIX}-${BUILD_ID}', '-z', '${_ZONE}', '-m', 'tee-image-reference=gcr.io/cloudrun/hello:latest', ] - name: 'gcr.io/cloud-builders/gcloud' id: ChangeMDSVariablesTest entrypoint: 'bash' args: ['scripts/test_mds_var_change.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] - name: 'gcr.io/cloud-builders/gcloud' id: CheckDebugVMAliveAfterLauncherExits script: | #!/usr/bin/env bash set -euo pipefail # Waiting for 2.5 mins, after the workload is finished. # If using a debug image, the VM should still be accessible after # the workload exit normally. # Check the script: launcher/image/exit_script.sh for detail logic. sleep 150 result=$(gcloud compute instances list --filter="name=(${_VM_NAME_PREFIX}-${BUILD_ID})" --zones=${_ZONE} --format="value(STATUS)") if [[ "${result}" == "RUNNING" ]]; then echo "verified debug VM is still running after 2.5 mins" else echo "FAILED: expect debug VM to be still running" echo "TEST FAILED. Expect debug VM to be still running" > /workspace/status.txt fi automapSubstitutions: true - name: 'gcr.io/cloud-builders/gcloud' id: CleanUp entrypoint: 'bash' env: - 'CLEANUP=$_CLEANUP' args: ['cleanup.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] # Must come after cleanup. - name: 'gcr.io/cloud-builders/gcloud' id: CheckFailure entrypoint: 'bash' env: - 'BUILD_ID=$BUILD_ID' args: ['check_failure.sh'] options: pool: name: 'projects/confidential-space-images-dev/locations/us-west1/workerPools/cs-image-build-vpc'