If you are are developing or testing the distributed system for automated grading, you may want to set up one or more worker machines in addition to your primary vagrant virtual machine.
Automated Worker Installation
-
First set up your main/primary machine by following the normal VM Install using Vagrant instructions.
- Ensure you have Python 3 installed on your machine, run:
python3 --version - To generate configuration for a worker machine, run:
vagrant workers generateIf instead you need multiple workers, append the
-nflag, ex. for 3 machines:vagrant workers generate -n 3NOTE: This will create the vagrant configuration file:
.vagrant/workers.json. - If you are on MacOS running QEMU, restart the network socket in public mode:
vagrant workers socket restart --publicNOTE: Using the
--publicflag will make your worker VMs accessible to anyone on your local network, which may be a modest security concern. We suggest this to minimize possibility of errors while creating the worker machines and will revert this in a later step.NOTE: Running a socket command while a worker machine is running can detach the process, making the VM inaccessible to vagrant. If this happens and you are unable to
vagrant workers halt, then you may runpkill -15 -f qemu-system-to kill all virtual machines running on your computer (including the main Submitty VM). - Now you can create the worker machine(s) with:
vagrant workers upNOTE: Do not use the –provider flag with this command, since it will conflict with the provider of the main virtual machine.
When this is finished, you should see the Submitty duck ASCII art for each new worker machine.
- You can verify that all the worker machines are running with:
vagrant workers status vagrant sshinto the main virtual machine and run:refresh_vagrant_workers # (runs python3 /usr/local/submitty/GIT_CHECKOUT/Submitty/.setup/bin/refresh_vagrant_workers.py) submitty_install- To stop the worker machines, you can run:
vagrant workers halt vagrant workers socket stopFor MacOS QEMU users: Once the virtual machine(s) are halted, if you would like to restart under private networking, you may do so by omitting the
--publicflag from thevagrant workers socket startcommand.
Connecting to the Worker Machine
If you would like to ensure the worker is functioning properly, or enter the worker machine for managing it directly, you can follow these steps.
To connect to a worker machine through SSH, run:
vagrant workers ssh <worker-name>
If you want to test the connection between the primary VM and a worker, you can first vagrant ssh into the primary machine and then run this command to SSH into the worker from there:
su submitty_daemon -c ssh <worker-name>
The list of worker names can be displayed with vagrant workers status.
NOTE: Depending on the performance of your computer and the size of the autograding queue passed to the worker, the SSH command may hang for some time.
Manual Worker Installation (VirtualBox)
-
Open the Virtual Box application.
-
Click
Newto create a new machine. Give it a useful name: e.g.,worker_machine_aSpecify the type:LinuxAnd the version:Ubuntu 64 -
Specify the amount of memory: 2048 = 2GB should be sufficient.
-
Create the disk as a
new virtual disk. Specify RAM memory: 2048 (2GB) Create new virtual disk. ChooseVDIChooseDynamically allocatedSpecify size: e.g., 20GB -
Download the Ubuntu 22.04 installer 64 bit .iso. Save this somewhere on your host computer.
-
Click on
Startto power on. Browse your files to find the Ubuntu installer .iso we downloaded earlier. PressStart. -
Follow the Ubuntu installation menu… Click
Install Ubuntu. SelectEnglishkeyboard. Selectnormalinstallation. Agree toErase disk & Install Ubuntu. Specify your timezone. Then specify your username, computer name, password. Then click through various menus, and wait a while installing system. Then restart the VM to finish installation. -
At some point, it will suggest that you install updates for Ubuntu 22.04, go ahead and do that. You’ll probably have to reboot.
-
Allow ssh connections to the worker VM from outside (e.g., from your primary machine): from virtual box, select the VM, click on
Settings, thenNetwork,Enable Network Adaptershould be checked, then set Attached to:Bridged Adapter -
From the VM, open a terminal and install a bunch of additional packages:
sudo apt update sudo apt install net-tools sudo apt install openssh-server sudo apt install git -
Install Guest Additions (Improves screen resolution, copy paste to/from the VM, etc.)
While the VM is running, focus on the VM window. Then from the menu, select
Devices->Insert guest additions CD imageOpen a terminal in the VM Go to the guest additions CD directory, and run the guest additions installer:mount cd /media/<USERNAME>/VBox_GAs_<VERSION>/ sudo ./VBoxLinuxAdditions.run -
Get a permanent IP address for your machine Go to your router, assign a fix ip address for your mac address E.g., in a browser, go to
192.168.0.1and log in… Helpful command to find your mac address & current IP address:ifconfig -
Prevent worker VM from going to sleep (so you can send autograding jobs to it at any time).
Settings->privacy->screen lock->turn off screen lockSettings->power->suspend & power button->automatic suspend== offSettings->power->blank screen==never -
Follow the worker installation instructions