Skip to content

Commit

Permalink
Merge branch 'premaster'
Browse files Browse the repository at this point in the history
  • Loading branch information
mfthomps committed Sep 23, 2024
2 parents b96ba79 + 0aa1738 commit 2d2b0e7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ The installation script and the update-designer.sh script set environment variab
so you may want to logout/login, or start a new bash shell before using Labtainers the
first time.

September 23, 2024
- Replaced google cloud VM, which was using the wrong Docker version

September 10, 2024
- Typo in creation of imodule path

Expand Down
19 changes: 19 additions & 0 deletions google/base_create24.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "create_vm.sh <user ID>"
exit
fi
user_id=$1
vm_name=$user_id-labtainervm
cp cloud_init.template cloud_init.txt
gcloud compute instances create $vm_name --image-family=ubuntu-2204-lts \
--machine-type=e2-standard-2 \
--image-project=ubuntu-os-cloud \
--metadata-from-file=user-data=cloud_init.txt
echo "wait 40 seconds"
sleep 40
gcloud compute ssh labtainer@$vm_name --command='echo "VM created, wait for reboot"' || exit
cp ~/.ssh/google_compute_engine ~/.ssh/id_labtainers
cp ~/.ssh/google_compute_engine.pub ~/.ssh/id_labtainers.pub
echo "Now wait until up."
./waitdone.sh $user_id
2 changes: 1 addition & 1 deletion google/cloud_init.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ write_files:
runcmd:
- apt install -y apt-transport-https ca-certificates curl software-properties-common
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- apt update
- cache policy docker-ce
- apt install -y docker-ce
Expand Down
2 changes: 1 addition & 1 deletion google/create_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi
user_id=$1
vm_name=$user_id-labtainervm
zone=$(./findzone.sh)
gcloud compute instances create $vm_name --image=https://www.googleapis.com/compute/v1/projects/labtainers/global/images/labtainervm7 \
gcloud compute instances create $vm_name --image=https://www.googleapis.com/compute/v1/projects/labtainers/global/images/labtainervm8 \
--metadata-from-file=user-data=user_config.txt --zone=$zone
gcloud compute disks resize $vm_name --size 30G --zone=$zone -q
# instances fail ssh until settled
Expand Down
2 changes: 1 addition & 1 deletion google/publishImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# Only then run this script
#
#
gcloud compute images add-iam-policy-binding labtainervm7 \
gcloud compute images add-iam-policy-binding labtainervm8 \
--member='allAuthenticatedUsers' \
--role='roles/compute.imageUser'

0 comments on commit 2d2b0e7

Please sign in to comment.