File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed
Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build GCP A3 Mega VM image
2+
3+ on :
4+ - workflow_dispatch
5+ - push
6+
7+ env :
8+ PACKER_VERSION : " 1.9.2"
9+ IMAGE_VERSION : ${{ github.run_number }}
10+ jobs :
11+ build-gcp-images :
12+ defaults :
13+ run :
14+ working-directory : scripts/packer
15+ runs-on : ubuntu-latest
16+ permissions :
17+ contents : ' read'
18+ id-token : ' write'
19+ steps :
20+ - uses : actions/checkout@v4
21+ - name : Authenticate to Google Cloud
22+ uses : google-github-actions/auth@v2
23+ with :
24+ workload_identity_provider : ' projects/531508670106/locations/global/workloadIdentityPools/github-identity-pool/providers/github-id-provider'
25+ service_account :
' [email protected] ' 26+ create_credentials_file : true
27+ - name : Set up Cloud SDK
28+ uses : google-github-actions/setup-gcloud@v2
29+ - name : Download packer
30+ run : |
31+ wget https://releases.hashicorp.com/packer/${{ env.PACKER_VERSION }}/packer_${{ env.PACKER_VERSION }}_linux_amd64.zip
32+ unzip packer_${{ env.PACKER_VERSION }}_linux_amd64.zip
33+ chmod +x packer
34+ - name : Run packer
35+ run : |
36+ ./packer build -var image_version=${{ env.IMAGE_VERSION }} -var gcp-a3mega-image.json
37+ - name : Publish image
38+ run : |
39+ gcloud compute images add-iam-policy-binding dstack-a3mega-${{ env.IMAGE_VERSION }} --member='allAuthenticatedUsers' --role='roles/compute.imageUser'
Original file line number Diff line number Diff line change 1+ {
2+ "variables" : {
3+ "image_version" : " "
4+ },
5+ "builders" : [
6+ {
7+ "type" : " googlecompute" ,
8+ "project_id" : " dstack" ,
9+ "source_image" : " dstack-a3mega-20250401t065024z" ,
10+ "image_name" : " dstack-a3mega-{{user `image_version`}}" ,
11+ "instance_name" : " dstack-a3mega-{{user `image_version`}}" ,
12+ "image_description" : " dstack VM image for A3 Mega instances with pre-pulled Docker images. The source image is based on https://cloud.google.com/cluster-toolkit/docs/deploy/deploy-a3-mega-cluster." ,
13+ "ssh_username" : " ubuntu" ,
14+ "zone" : " us-central1-a" ,
15+ "disk_size" : 100
16+ }
17+ ],
18+ "provisioners" : [
19+ {
20+ "type" : " shell" ,
21+ "inline" : [
22+ " gcloud -q auth configure-docker us-docker.pkg.dev" ,
23+ " docker pull us-docker.pkg.dev/gce-ai-infra/gpudirect-tcpxo/tcpgpudmarxd-dev:v1.0.14" ,
24+ " docker pull us-docker.pkg.dev/gce-ai-infra/gpudirect-tcpxo/nccl-plugin-gpudirecttcpx-dev:v1.0.8-1"
25+ ]
26+ }
27+ ]
28+ }
You can’t perform that action at this time.
0 commit comments