Skip to content

Commit b61655f

Browse files
skara9bmcutlerwilliamschen23
authored
[Documentation:Developer] New Vagrant Worker Instructions (#621)
Updated documentation of worker setup to reflect changes in Submitty/Submitty#10530. --------- Co-authored-by: Barb Cutler <[email protected]> Co-authored-by: Barb Cutler <Barb Cutler> Co-authored-by: Williams Chen <[email protected]>
1 parent c14d7a4 commit b61655f

File tree

1 file changed

+56
-21
lines changed

1 file changed

+56
-21
lines changed

_docs/developer/getting_started/worker_vm.md

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,70 @@ machines* in addition to your primary vagrant virtual machine.
1111

1212
## Automated Worker Installation
1313

14-
These steps will create a worker machine alongside the normal Submitty machine.
15-
1. Make sure to destroy any existing vagrant machines with
16-
```
17-
vagrant destroy
18-
```
14+
1. First set up your main/primary machine by following the normal
15+
[VM Install using Vagrant](/developer/getting_started/vm_install_using_vagrant) instructions.
16+
17+
2. Ensure you have [Python 3](https://www.python.org/downloads/) installed on your machine, run:
18+
```
19+
python3 --version
20+
```
21+
22+
3. To generate configuration for a worker machine, run:
23+
```
24+
vagrant workers generate
25+
```
26+
27+
If instead you need multiple workers, append the `-n` flag, ex. for 3 machines:
28+
```
29+
vagrant workers generate -n 3
30+
```
1931

20-
2. Ensure you have [Python 3](https://www.python.org/downloads/) installed on your machine
32+
_NOTE: This will create the vagrant configuration file: `.vagrant/workers.json`._
2133

22-
3. Generate configuration for the desired number of worker machines
34+
35+
4. If you are on MacOS running QEMU, restart the network socket in public mode:
2336
```
24-
python3 generate_workers.py [-n NUM] [--ip-range IP_RANGE] [--base-port PORT]
37+
vagrant workers socket restart --public
2538
```
26-
This will create or update a configuration file stored at `.vagrant/workers.json`.
27-
Now you can create the virtual machines with:
39+
_NOTE: Using the `--public` flag will make your worker VMs accessible to anyone
40+
on your local network, which may be a modest security concern.
41+
We suggest this to minimize possibility of errors while creating the
42+
worker machines and will revert this in a later step._
43+
44+
_NOTE: Running a socket command while a worker machine is running can detach the
45+
process, making the VM inaccessible to vagrant. If this happens and you are unable
46+
to `vagrant workers halt`, then you may run `pkill -15 -f qemu-system-` to kill
47+
all virtual machines running on your computer (including the main Submitty VM)._
48+
49+
6. Now you can create the worker machine(s) with:
2850
```
29-
vagrant up
51+
vagrant workers up
3052
```
53+
_NOTE: Do not use the --provider flag with this command, since it will conflict with the
54+
provider of the main virtual machine._
3155

32-
If you happen to encounter error messages regarding IP addresses or port conflicts, you can manually edit the `workers.json` file as needed.
56+
When this is finished, you should see the Submitty duck ASCII art for each new worker machine.
57+
58+
7. You can verify that all the worker machines are running with:
59+
```
60+
vagrant workers status
61+
```
3362

34-
__NOTE__: Do not edit the `workers.json` configuration file or run the aforementioned python script if there are any existing vagrant machines in your project. This can result in the existing VMs continuing to run in the background or storing their data with no clean way to remove them.
63+
8. `vagrant ssh` into the main virtual machine and run:
64+
```
65+
refresh_vagrant_workers # (runs python3 /usr/local/submitty/GIT_CHECKOUT/Submitty/.setup/bin/refresh_vagrant_workers.py)
66+
submitty_install
67+
```
3568

36-
4. To delete the worker machines and revert to a normal development setup, you can first run
69+
9. To stop the worker machines, you can run:
3770
```
38-
vagrant destroy
71+
vagrant workers halt
72+
vagrant workers socket stop
3973
```
40-
And confirm to delete all the existing virtual machines.
4174

42-
Next, you can delete the `workers.json` file, which will remove the worker configuration from your project.
43-
The next `vagrant up` should only create the primary development virtual machine without any workers.
75+
_For MacOS QEMU users: Once the virtual machine(s) are halted, if you would like to restart under
76+
private networking, you may do so by omitting the `--public` flag from the `vagrant workers socket start` command._
77+
4478

4579
---
4680

@@ -50,14 +84,15 @@ If you would like to ensure the worker is functioning properly, or enter the wor
5084

5185
To connect to a worker machine through SSH, run:
5286
```
53-
vagrant ssh <worker-name>
87+
vagrant workers ssh <worker-name>
5488
```
5589

5690
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:
5791
```
58-
su submitty_daemon -c ssh submitty@<ip-address>
92+
su submitty_daemon -c ssh <worker-name>
5993
```
60-
The IP address of the worker machine will be indicated in the `.vagrant/workers.json` file.
94+
95+
The list of worker names can be displayed with `vagrant workers status`.
6196

6297
__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.
6398

0 commit comments

Comments
 (0)