Skip to content

Commit

Permalink
Merge branch 'premaster'
Browse files Browse the repository at this point in the history
  • Loading branch information
mfthomps committed Nov 22, 2024
2 parents 464de07 + 72d0fdc commit c96e88b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 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.

November 22, 2024
- Replaced google cloud VM, this time due to a failure of systemd within containers.

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

Expand Down
2 changes: 1 addition & 1 deletion google/cloud_init.template
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ runcmd:
- docker pull labtainers/labtainer.wireshark2
- docker pull labtainers/labtainer.network.ssh2
- docker pull labtainers/labtainer.grader
- sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0 systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub.d/50-cloudimg-settings.cfg
- sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200"/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200 systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub.d/50-cloudimg-settings.cfg
- update-grub
power_state:
mode: reboot
2 changes: 1 addition & 1 deletion google/create_vm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $ErrorActionPreference = "Stop"
$user_id=$args[0]
$vm_name=$user_id+"-labtainervm"
$zone=./findzone.ps1
gcloud compute instances create $vm_name --image=https://www.googleapis.com/compute/v1/projects/labtainers/global/images/labtainervm5 --metadata-from-file=user-data=user_config.txt --zone=$zone
gcloud compute instances create $vm_name --image=https://www.googleapis.com/compute/v1/projects/labtainers/global/images/labtainervm1 --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/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/labtainervm8 \
gcloud compute instances create $vm_name --image=https://www.googleapis.com/compute/v1/projects/labtainers/global/images/labtainervm1 \
--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
8 changes: 4 additions & 4 deletions google/publishImage.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Create a base labtainer image.
# First:
# delete_vm.sh base22
# base_create22.sh base22
# stop_vm.sh base22
# delete_vm.sh base24
# base_create22.sh base24
# stop_vm.sh base24
#
# Then use
# gcloud compute instances describe base-labtainervm | grep disks
Expand All @@ -15,6 +15,6 @@
# Only then run this script
#
#
gcloud compute images add-iam-policy-binding labtainervm8 \
gcloud compute images add-iam-policy-binding labtainervm1 \
--member='allAuthenticatedUsers' \
--role='roles/compute.imageUser'
2 changes: 1 addition & 1 deletion scripts/labtainer-student/bin/ParseStartConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, fname, labname, labtainer_config, logger, skip_networks=True,
self.get_configs(fname)
self.multi_user = None
''' determine if running as a distributed Labtainers, or many clients on a single VM '''
if self.clone_count is not None and self.clone_count > 0:
if self.clone_count is not None and int(self.clone_count > 0):
self.multi_user = 'clones'
elif servers is not None:
self.multi_user = servers
Expand Down
2 changes: 1 addition & 1 deletion scripts/labtainer-student/bin/labutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def isValidLab(lab_path):
def getFirstUnassignedIface(n=1):
''' get the nth network iterface that lacks an assigned IP address '''
iflist = os.listdir('/sys/class/net')
count = 1
for iface in sorted(iflist):
count = 1
ip = get_ip_address(iface)
if ip is None and n == count:
return iface
Expand Down

0 comments on commit c96e88b

Please sign in to comment.