Skip to content

Commit

Permalink
Fix macos based build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
meetrajvala committed Sep 27, 2024
1 parent 1544f30 commit e9588fb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
28 changes: 14 additions & 14 deletions launcher/image/test/test_gpu_driver_installation_cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ substitutions:
'_IMAGE_NAME': ''
'_IMAGE_PROJECT': ''
'_CLEANUP': 'true'
'_VM_NAME_PREFIX': 'cs-gpu-hardened-test'
'_VM_NAME_PREFIX': 'cs-gpu-test'
'_ZONE': 'us-central1-a'
'_WORKLOAD_IMAGE': 'us-west1-docker.pkg.dev/confidential-space-images-dev/cs-integ-test-images/gpu/cuda-vector-add:latest'
steps:
Expand All @@ -17,7 +17,7 @@ steps:
'-n', '${_VM_NAME_PREFIX}-${BUILD_ID}',
'-z', '${_ZONE}',
'-v', 'n1-standard-4',
'-g', 'nvidia-tesla-t4',
'-g', 'nvidia-l4',
'-c', '1'
]
- name: 'gcr.io/cloud-builders/gcloud'
Expand All @@ -28,10 +28,10 @@ steps:
args: ['create_gpu_vm.sh','-i', '${_IMAGE_NAME}',
'-p', '${_IMAGE_PROJECT}',
'-m', 'tee-image-reference=${_WORKLOAD_IMAGE},tee-container-log-redirect=true,tee-install-gpu-drivers=true',
'-n', '${_VM_NAME_PREFIX}-${BUILD_ID}-unsupported',
'-n', '${_VM_NAME_PREFIX}-${BUILD_ID}-unsup',
'-z', '${_ZONE}',
'-v', 'n1-standard-4',
'-g', 'nvidia-tesla-p4',
'-g', 'nvidia-tesla-p100',
'-c', '1'
]
- name: 'gcr.io/cloud-builders/gcloud'
Expand All @@ -46,38 +46,38 @@ steps:
'-z', '${_ZONE}',
]
- name: 'gcr.io/cloud-builders/gcloud'
id: BasicWorkloadTest
id: GpuWorkloadTest
entrypoint: 'bash'
args: ['scripts/test_launcher_gpu_workload.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}']
args: ['scripts/test_gpu_workload.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}']
- name: 'gcr.io/cloud-builders/gcloud'
id: BasicWorkloadTest
id: UnsupportedGpuWorkloadTest
entrypoint: 'bash'
args: ['scripts/test_launcher_gpu_workload.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}-unsupported', '${_ZONE}']
args: ['scripts/test_gpu_unsupported_gputype.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}-unsup', '${_ZONE}']
- name: 'gcr.io/cloud-builders/gcloud'
id: BasicWorkloadTest
id: NoGpuWorkloadTest
entrypoint: 'bash'
args: ['scripts/test_launcher_gpu_workload.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}-nogpu', '${_ZONE}']
args: ['scripts/test_gpu_nogpu.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}-nogpu', '${_ZONE}']
- name: 'gcr.io/cloud-builders/gcloud'
id: CleanUp
entrypoint: 'bash'
env:
- 'CLEANUP=$_CLEANUP'
args: ['cleanup.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}']
- name: 'gcr.io/cloud-builders/gcloud'
id: CleanUp
id: GpuVmCleanUp
entrypoint: 'bash'
env:
- 'CLEANUP=$_CLEANUP'
args: ['cleanup.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}-unsupported', '${_ZONE}']
args: ['cleanup.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}-unsup', '${_ZONE}']
- name: 'gcr.io/cloud-builders/gcloud'
id: CleanUp
id: UnsupportedGpuVmCleanUp
entrypoint: 'bash'
env:
- 'CLEANUP=$_CLEANUP'
args: ['cleanup.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}-nogpu', '${_ZONE}']
# Must come after cleanup.
- name: 'gcr.io/cloud-builders/gcloud'
id: CheckFailure
id: NoGpuVmCheckFailure
entrypoint: 'bash'
env:
- 'BUILD_ID=$BUILD_ID'
Expand Down
6 changes: 5 additions & 1 deletion launcher/image/testworkloads/gpu/cuda-vector-add/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# From current directory:
# gcloud builds submit --tag us-west1-docker.pkg.dev/confidential-space-images-dev/cs-integ-test-images/gpu/cuda-vector-add:latest --project confidential-space-images-dev
FROM gcr.io/google_containers/cuda-vector-add:v0.1
FROM gcr.io/google_containers/cuda-vector-add:v0.1

LABEL "tee.launch_policy.allow_env_override"="ALLOWED_OVERRIDE"
LABEL "tee.launch_policy.allow_cmd_override"="true"
LABEL "tee.launch_policy.log_redirect"="always"
5 changes: 2 additions & 3 deletions launcher/launcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"os/exec"
"regexp"
"strings"
"syscall"

"cloud.google.com/go/compute/metadata"
"github.com/containerd/containerd"
Expand Down Expand Up @@ -323,10 +322,10 @@ func remountAsExecutable(dir string) error {
if err := os.MkdirAll(dir, 0755); err != nil {
return fmt.Errorf("failed to create dir %q: %v", dir, err)
}
if err := syscall.Mount(dir, dir, "", syscall.MS_BIND, ""); err != nil {
if err := exec.Command("mount", "--bind", dir, dir).Run(); err != nil {
return fmt.Errorf("failed to create bind mount at %q: %v", dir, err)
}
if err := syscall.Mount("", dir, "", syscall.MS_REMOUNT|syscall.MS_NOSUID|syscall.MS_NODEV|syscall.MS_RELATIME, ""); err != nil {
if err := exec.Command("mount", "-o", "remount,exec", dir).Run(); err != nil {
return fmt.Errorf("failed to remount %q: %v", dir, err)
}
return nil
Expand Down

0 comments on commit e9588fb

Please sign in to comment.