substitutions: '_IMAGE_NAME': '' '_IMAGE_PROJECT': '' '_CLEANUP': 'true' '_VM_NAME_PREFIX': 'memory-monitoring' '_ZONE': 'us-west1-a' '_WORKLOAD_IMAGE': 'us-west1-docker.pkg.dev/confidential-space-images-dev/cs-integ-test-images/memorymonitoring:latest' steps: - name: 'gcr.io/cloud-builders/gcloud' id: CreateVMMemoryMemonitorEnabled entrypoint: 'bash' env: - 'BUILD_ID=$BUILD_ID' args: ['create_vm.sh','-i', '${_IMAGE_NAME}', '-p', '${_IMAGE_PROJECT}', '-m', 'tee-image-reference=${_WORKLOAD_IMAGE},tee-monitoring-memory-enable=true', '-n', '${_VM_NAME_PREFIX}-enable-${BUILD_ID}', '-z', '${_ZONE}', ] waitFor: ['-'] # The '-' indicates that this step begins immediately. - name: 'gcr.io/cloud-builders/gcloud' id: CheckMemoryMonitoringEnabled entrypoint: 'bash' # Search a regex pattern that ensures memory monitoring is enabled and measured into COS event logs. args: ['scripts/test_memory_monitoring.sh', '${_VM_NAME_PREFIX}-enable-${BUILD_ID}', '${_ZONE}', 'node-problem-detector.service successfully started.*Successfully measured memory monitoring event'] waitFor: ['CreateVMMemoryMemonitorEnabled'] - name: 'gcr.io/cloud-builders/gcloud' id: CleanUpVMMemoryMonitorEnabled entrypoint: 'bash' env: - 'CLEANUP=$_CLEANUP' args: ['cleanup.sh', '${_VM_NAME_PREFIX}-enable-${BUILD_ID}', '${_ZONE}'] waitFor: ['CheckMemoryMonitoringEnabled'] - name: 'gcr.io/cloud-builders/gcloud' id: CreateVMMemoryMemonitorDisabled entrypoint: 'bash' env: - 'BUILD_ID=$BUILD_ID' args: ['create_vm.sh','-i', '${_IMAGE_NAME}', '-p', '${_IMAGE_PROJECT}', '-m', 'tee-image-reference=${_WORKLOAD_IMAGE},tee-monitoring-memory-enable=false', '-n', '${_VM_NAME_PREFIX}-disable-${BUILD_ID}', '-z', '${_ZONE}', ] waitFor: ['-'] # The '-' indicates that this step begins immediately. - name: 'gcr.io/cloud-builders/gcloud' id: CheckMemoryMonitoringDisabled entrypoint: 'bash' # Search a regex pattern that ensures memory monitoring is disabled and measured into COS event logs. args: ['scripts/test_memory_monitoring.sh', '${_VM_NAME_PREFIX}-disable-${BUILD_ID}', '${_ZONE}', 'Successfully measured memory monitoring event.*MemoryMonitoring is disabled by the VM operator'] waitFor: ['CreateVMMemoryMemonitorDisabled'] - name: 'gcr.io/cloud-builders/gcloud' id: CleanUpVMMemoryMonitorDisabled entrypoint: 'bash' env: - 'CLEANUP=$_CLEANUP' args: ['cleanup.sh', '${_VM_NAME_PREFIX}-disable-${BUILD_ID}', '${_ZONE}'] waitFor: ['CheckMemoryMonitoringDisabled'] # 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'