Merge branch '22224-clean-java-sdk'
[arvados.git] / tools / compute-images / arvados-images-azure.json
1 {
2   "variables": {
3     "account_file": "",
4     "arvados_cluster": "",
5     "build_environment": "azure-arm",
6     "client_id": "{{env `ARM_CLIENT_ID`}}",
7     "client_secret": "{{env `ARM_CLIENT_SECRET`}}",
8     "cloud_environment_name": "Public",
9     "image_sku": "",
10     "location": "centralus",
11     "project_id": "",
12     "public_key_file": "",
13     "mksquashfs_mem": "",
14     "nvidia_gpu_support": "",
15     "reposuffix": "",
16     "pin_packages": "true",
17     "resolver": "",
18     "resource_group": null,
19     "ssh_private_key_file": "{{env `PACKERPRIVKEY`}}",
20     "ssh_user": "packer",
21     "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
22     "tenant_id": "{{env `ARM_TENANT_ID`}}",
23     "workdir": "/tmp"
24   },
25   "builders": [
26     {
27       "type": "azure-arm",
28       "cloud_environment_name": "{{user `cloud_environment_name`}}",
29
30       "client_id": "{{user `client_id`}}",
31       "client_secret": "{{user `client_secret`}}",
32       "subscription_id": "{{user `subscription_id`}}",
33       "tenant_id": "{{user `tenant_id`}}",
34
35       "managed_image_resource_group_name": "{{user `resource_group`}}",
36       "managed_image_name": "{{user `arvados_cluster`}}-compute-v{{ timestamp }}",
37
38       "ssh_username": "{{user `ssh_user`}}",
39       "ssh_private_key_file": "{{user `ssh_private_key_file`}}",
40
41       "image_publisher": "Canonical",
42       "image_offer": "UbuntuServer",
43       "image_sku": "{{user `image_sku`}}",
44
45       "os_type": "Linux",
46
47       "location": "{{user `location`}}",
48       "vm_size": "Standard_D1_v2"
49     }
50   ],
51
52   "provisioners": [{
53     "type": "file",
54     "source": "1078ECD7.asc",
55     "destination": "/{{user `workdir`}}/1078ECD7.asc"
56   },{
57     "type": "file",
58     "source": "scripts/etc-apt-preferences.d-arvados.pref",
59     "destination": "{{user `workdir`}}/etc-apt-preferences.d-arvados.pref"
60   },{
61     "type": "file",
62     "source": "scripts/etc-cloud-cloud.cfg.d-07_compute_arvados_dispatch_cloud.cfg",
63     "destination": "/{{user `workdir`}}/etc-cloud-cloud.cfg.d-07_compute_arvados_dispatch_cloud.cfg"
64   },{
65     "type": "file",
66     "source": "scripts/etc-systemd-system-systemd-modules-load.service.d-detect-gpu.conf",
67     "destination": "{{user `workdir`}}/etc-systemd-system-systemd-modules-load.service.d-detect-gpu.conf"
68   },{
69     "type": "file",
70     "source": "scripts/usr-local-bin-detect-gpu.sh",
71     "destination": "{{user `workdir`}}/usr-local-bin-detect-gpu.sh"
72   },{
73     "type": "file",
74     "source": "scripts/usr-local-bin-ensure-encrypted-partitions.sh",
75     "destination": "/{{user `workdir`}}/usr-local-bin-ensure-encrypted-partitions.sh"
76   },{
77     "type": "file",
78     "source": "{{user `public_key_file`}}",
79     "destination": "/{{user `workdir`}}/crunch-authorized_keys"
80   },{
81     "type": "shell",
82     "execute_command": "sudo -S env {{ .Vars }} /bin/bash '{{ .Path }}'",
83     "script": "scripts/base.sh",
84     "environment_vars": [
85         "RESOLVER={{user `resolver`}}",
86         "REPOSUFFIX={{user `reposuffix`}}",
87         "MKSQUASHFS_MEM={{user `mksquashfs_mem`}}",
88         "NVIDIA_GPU_SUPPORT={{user `nvidia_gpu_support`}}",
89         "CLOUD=azure",
90         "GOVERSION={{user `goversion`}}",
91         "WORKDIR={{user `workdir`}}"
92     ]
93   }]
94 }