Skip to content

Commit c116c3b

Browse files
heschigopherbot
authored andcommitted
all: switch vmx-enabled Debian over to Bullseye
I basically just did a find-and-replace, and we'll see if it works? I've updated and built the new disk images so this should be ready to deploy. For golang/go#56414. Change-Id: Iaac41d6f7a1244c3682e624f7a4ee4fa7477dfa1 Reviewed-on: https://go-review.googlesource.com/c/build/+/445617 Run-TryBot: Heschi Kreinick <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Auto-Submit: Heschi Kreinick <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 32ae53c commit c116c3b

File tree

5 files changed

+32
-35
lines changed

5 files changed

+32
-35
lines changed

dashboard/builders.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@ var Hosts = map[string]*HostConfig{
281281
SSHUsername: "root",
282282
},
283283
"host-linux-amd64-androidemu": {
284-
Notes: "Debian Buster w/ Android SDK + emulator (use nested virt)",
284+
Notes: "Debian Bullseye w/ Android SDK + emulator (use nested virt)",
285285
ContainerImage: "android-amd64-emu:bff27c0c9263",
286-
KonletVMImage: "android-amd64-emu",
286+
KonletVMImage: "android-amd64-emu-bullseye",
287287
NestedVirt: true,
288288
SSHUsername: "root",
289289
},
@@ -292,6 +292,12 @@ var Hosts = map[string]*HostConfig{
292292
ContainerImage: "linux-x86-bullseye:latest",
293293
SSHUsername: "root",
294294
},
295+
"host-linux-amd64-bullseye-vmx": {
296+
Notes: "Debian Bullseye w/ Nested Virtualization (VMX CPU bit) enabled",
297+
ContainerImage: "linux-x86-bullseye:latest",
298+
NestedVirt: true,
299+
SSHUsername: "root",
300+
},
295301
"host-linux-amd64-buster": {
296302
Notes: "Debian Buster",
297303
ContainerImage: "linux-x86-buster:latest",
@@ -339,12 +345,6 @@ var Hosts = map[string]*HostConfig{
339345
ContainerImage: "linux-x86-stretch:latest",
340346
SSHUsername: "root",
341347
},
342-
"host-linux-amd64-stretch-vmx": {
343-
Notes: "Debian Stretch w/ Nested Virtualization (VMX CPU bit) enabled, for testing",
344-
ContainerImage: "linux-x86-stretch:latest",
345-
NestedVirt: true,
346-
SSHUsername: "root",
347-
},
348348
"host-linux-amd64-wsl": {
349349
Notes: "Windows 10 WSL2 Ubuntu",
350350
Owners: []*gophers.Person{gh("mengzhuo")},
@@ -1332,7 +1332,7 @@ func (c *HostConfig) ContainerVMImage() string {
13321332
return c.KonletVMImage
13331333
}
13341334
if c.NestedVirt {
1335-
return "debian-stretch-vmx"
1335+
return "debian-bullseye-vmx"
13361336
}
13371337
if c.isEC2 && c.ContainerImage != "" {
13381338
return fmt.Sprintf("gcr.io/%s/%s", buildenv.Production.ProjectName, c.ContainerImage)
@@ -1532,7 +1532,7 @@ func init() {
15321532
})
15331533
addBuilder(BuildConfig{
15341534
Name: "linux-amd64-vmx",
1535-
HostType: "host-linux-amd64-stretch-vmx",
1535+
HostType: "host-linux-amd64-bullseye-vmx",
15361536
buildsRepo: disabledBuilder,
15371537
})
15381538
addBuilder(BuildConfig{

env/android-amd64-emu/create-vm.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ set -e
77
set -x
88

99
ZONE=us-central1-f
10-
TARGET_IMAGE=android-amd64-emu
10+
DEBIAN=bullseye
11+
TARGET_IMAGE=android-amd64-emu-$DEBIAN
1112

1213
TMP_DISK=dev-android-amd64-emu-tmpdisk
1314
TMP_IMG=dev-android-amd64-emu-image
1415
TMP_VM=dev-android-amd64-emu
1516

16-
# Create disk, forking debian-vmx-stretch
17+
# Create disk, forking our vmx-enabled image
1718
gcloud compute disks delete $TMP_DISK --zone=$ZONE --quiet || true
1819
gcloud compute disks create $TMP_DISK \
1920
--zone=$ZONE \
2021
--size=40GB \
21-
--image=debian-stretch-vmx
22+
--image=debian-$DEBIAN-vmx
2223

2324
gcloud compute images delete $TMP_IMG --quiet || true
2425
gcloud compute images create \
@@ -35,20 +36,18 @@ gcloud compute instances create \
3536
$TMP_VM \
3637
--zone=$ZONE \
3738
--image=$TMP_IMG \
38-
--min-cpu-platform "Intel Haswell"
39+
--min-cpu-platform "Intel Haswell" \
40+
--network default-vpc \
41+
--no-service-account --no-scopes
3942

40-
INTERNAL_IP=$(gcloud --format="value(networkInterfaces[0].networkIP)" compute instances list --filter="name=('$TMP_VM')")
4143
echo "Waiting for SSH port to be available..."
42-
while ! nc -w 2 -z $INTERNAL_IP 22; do
44+
while ! gcloud compute ssh $TMP_VM --zone=$ZONE --tunnel-through-iap -- echo hi; do
4345
sleep 1
4446
done
4547

46-
VER=$(docker images "--format={{.ID}}" golang/android-amd64-emu:latest)
47-
CONTAINER=gcr.io/symbolic-datum-552/android-amd64-emu:$VER
48-
4948
echo "SSH is up. Pulling docker container $CONTAINER on VM..."
5049

51-
gcloud compute ssh $TMP_VM --zone=$ZONE --internal-ip -- sudo docker pull $CONTAINER
50+
gcloud compute ssh $TMP_VM --zone=$ZONE --tunnel-through-iap -- sudo docker pull gcr.io/symbolic-datum-552/android-amd64-emu:latest
5251

5352
echo "Done pulling; shutting down"
5453

env/linux-x86-vmx/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# linux-x86-vmx
22

33
These scripts create a GCE VM image that acts like Container-Optimized
4-
Linux but uses a Debian 9 (Stretch) kernel + userspace instead. We do
5-
this because Debian 9 includes CONFIG_KVM for nested virtualization,
4+
Linux but uses a Debian 11 (Bullseye) kernel + userspace instead. We do
5+
this because Debian 11 includes CONFIG_KVM for nested virtualization,
66
whereas that's not compiled in for Container-Optimized Linux.

env/linux-x86-vmx/create.sh

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
# Use of this source code is governed by a BSD-style
44
# license that can be found in the LICENSE file.
55

6-
# This creates the debian-stretch-vmx buildlet VM that's
7-
# like the Container-Optimized OS but using Debian Stretch
6+
# This creates the debian-bullseye-vmx buildlet VM that's
7+
# like the Container-Optimized OS but using Debian Bullseye
88
# instead of the Chromium OS, and with nested virtualization
99
# enabled.
1010

1111
set -e
1212
set -x
1313

1414
ZONE=us-central1-f
15-
TARGET_IMAGE=debian-stretch-vmx
15+
TARGET_IMAGE=debian-bullseye-vmx
1616

1717
TMP_DISK=dev-debian-vmx-tmpdisk
1818
TMP_IMG=dev-debian-vmx-image
@@ -24,7 +24,7 @@ gcloud compute disks create $TMP_DISK \
2424
--zone=$ZONE \
2525
--size=40GB \
2626
--image-project=debian-cloud \
27-
--image-family debian-9
27+
--image-family debian-11
2828

2929
# Create image based on that disk, with the nested virtualization
3030
# opt-in flag ("license").
@@ -44,25 +44,23 @@ gcloud compute instances create \
4444
$TMP_VM \
4545
--zone=$ZONE \
4646
--image=$TMP_IMG \
47-
--min-cpu-platform "Intel Haswell"
48-
49-
INTERNAL_IP=$(gcloud --format="value(networkInterfaces[0].networkIP)" compute instances list --filter="name=('$TMP_VM')")
50-
EXTERNAL_IP=$(gcloud --format="value(networkInterfaces[0].accessConfigs[0].natIP)" compute instances list --filter="name=('$TMP_VM')")
51-
echo "external IP: $EXTERNAL_IP, internal IP: $INTERNAL_IP"
47+
--min-cpu-platform "Intel Haswell" \
48+
--network default-vpc \
49+
--no-service-account --no-scopes
5250

5351
echo "Waiting for SSH port to be available..."
54-
while ! nc -w 2 -z $INTERNAL_IP 22; do
52+
while ! gcloud compute ssh $TMP_VM --zone=$ZONE --tunnel-through-iap -- echo hi; do
5553
sleep 1
5654
done
5755

5856
echo "SSH is up. Copying prep-vm.sh script to VM..."
5957

6058
# gcloud compute scp lacks an --internal-ip flag, even though gcloud
6159
# compute ssh has it. Annoying. Workaround:
62-
gcloud compute scp --dry-run --zone=$ZONE prep-vm.sh bradfitz@$TMP_VM: | perl -npe "s/$EXTERNAL_IP/$INTERNAL_IP/" | sh
60+
gcloud compute scp --zone=$ZONE --tunnel-through-iap prep-vm.sh $TMP_VM:
6361

6462
# And prep the machine.
65-
gcloud compute ssh $TMP_VM --zone=$ZONE --internal-ip -- sudo bash ./prep-vm.sh
63+
gcloud compute ssh $TMP_VM --zone=$ZONE --tunnel-through-iap -- sudo bash ./prep-vm.sh
6664

6765
echo "Done prepping machine; shutting down"
6866

env/linux-x86-vmx/prep-vm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ systemctl start konlet-startup
2929

3030
# Pre-pull some common images/layers to speed up future boots:
3131
gcloud auth configure-docker --quiet
32-
docker pull gcr.io/symbolic-datum-552/linux-x86-stretch:latest
32+
docker pull gcr.io/symbolic-datum-552/linux-x86-bullseye:latest
3333
docker pull gcr.io/gce-containers/konlet:v.0.9-latest
3434

3535
apt-get dist-upgrade --yes

0 commit comments

Comments
 (0)