Skip to content

Commit e0e0bec

Browse files
committed
generalized the cloud init YAML files while allowing for local modifications
1 parent 0a0dd2a commit e0e0bec

File tree

3 files changed

+100
-4
lines changed

3 files changed

+100
-4
lines changed

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ start-invenio-server-vm.bash, invenio-server-init.yaml
2020

2121
The next set provide the ability to run as a full GUI environment on macOS or Windows using the Microsoft Remote Desktop viewer or Remmina on Linux. The are based on the previous terminal oriented VMs but add the "ubuntu-desktop" and "xrdp" package to handle the remote displays. For you to use the GUI versions your VM accounts need to have a password associated with them. You can use the `multipass shell` command to get a shell and then use `sudo passwd USERNAME` to set the password for "USERNAME" (e.g. ubuntu, rsdoiel).
2222

23-
On a M1 Mac running under Monterey you can then use a web browser from the remote displayed VM to test services inside the VM without exposing it to your host machine.
24-
23+
If you would like to have a Ubuntu Desktop available for use in your multipass VM Ihave provided several examples.
2524
start-dev-gui-vm.bash, dev-gui-init.yaml
2625
: A development GUI environment for Golang 1.18, uses 4 cores and 8G of RAM
2726

2827
start-invenio-gui-vm.bash, invenio-gui-init.yaml
2928
: A development GUI environment for Invenio-RDM, uses 4 cores and 8G of RAM
3029

3130

32-
3331
Multipass
3432
---------
3533

@@ -133,6 +131,28 @@ Like previous example access with the `multipass` shell command.
133131

134132
A more complete exploration of running InvenioRDM is found in the [InvenioRDM-Setup](InvenioRDM-Setup.html)
135133

134+
General purpose Bash scripts
135+
----------------------------
136+
137+
I have provided three Bash scripts for starting/launching, getting info and stopping your multipass VM.
138+
139+
1. start-vm.bash - starts an existing or launches a new virtual machine based on a related cloud init YAML file
140+
2. stats-vm.bash - will return information about the machine (i.e. it runs `multipass info $MACHINE`)
141+
3. stop-vm-.bash - will stop the machine
142+
143+
If you've devined a primary name for the machine the Bash scripts can be used without any additoinal parameters. If
144+
you provide a machine name as a parameter then the scripts will work with that machine name.
145+
146+
For creating new machines (aka multipass launch) the start-vm.bash script looks for a cloud init YAML file that
147+
defines the new machine. By default it first looks for the name `$MACHINE-local.yaml` and if that is not available
148+
it looks for `$MACHINE-init.yaml`. The `*-init.yaml` files provided in this repository are a good starting point but
149+
the cloud init support in multipass goes much further. The YAML file called `dev-server-local.yaml` is provided as an
150+
example of including full login setup for the developers in the DLD group of Caltech Library. This includes setting them
151+
up with sudo access, assigning them to additoinal groups and enabling login via SSH keys hosted on GitHub. By using the
152+
filename convension of `*-init.yaml` I can provide a general purpose machine definition while allowing for local modification
153+
via a version of the same file matching `*-local.yaml`.
154+
155+
136156
Trouble shooting
137157
----------------
138158

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dateCreated": "2022-04-25",
77
"issueTracker": "https://github.com/caltechlibrary/cloud-init-examples/issues",
88
"name": "cloud-init-examples",
9-
"version": "0.0.2",
9+
"version": "0.0.3",
1010
"description": "This is a collection of Bash scripts and cloud-init YAML files to be used with multipass for generating virtual machines useful for software development in libraries and archives.",
1111
"developmentStatus": "concept",
1212
"programmingLanguage": [

dev-server-local.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package_update: true
2+
package_upgrade: true
3+
fqdn: dev.local
4+
packages:
5+
- build-essential
6+
- git
7+
- snapcraft
8+
- autoconf
9+
- automake
10+
- curl
11+
- wget
12+
- tmux
13+
- tree
14+
- htop
15+
- lynx
16+
- python3-dev
17+
- python3-pip
18+
- rsync
19+
- libexpat1
20+
- apache2
21+
- apache2-utils
22+
- ssl-cert
23+
- libapache2-mod-wsgi
24+
groups:
25+
- docker
26+
- staff
27+
- www-data
28+
users:
29+
- default
30+
- name: rsdoiel
31+
shell: /bin/bash
32+
gecos: R. S. Doiel
33+
primary_group: staff
34+
groups: [ users, staff, adm, sudo, www-data ]
35+
ssh_import_id:
36+
- gh:rsdoiel
37+
sudo: ALL=(ALL) NOPASSWD:ALL
38+
- name: tmorrell
39+
shell: /bin/bash
40+
gecos: Tom Morrell
41+
primary_group: staff
42+
groups: [ users, staff, adm, sudo, www-data ]
43+
ssh_import_id:
44+
- gh:tmorrell
45+
- name: mhucka
46+
shell: /bin/bash
47+
gecos: Mike Hucka
48+
primary_group: staff
49+
groups: [ users, staff, adm, sudo, www-data ]
50+
ssh_import_id:
51+
- gh:mhucka
52+
sudo: ALL=(ALL) NOPASSWD:ALL
53+
- name: tkeswick
54+
shell: /bin/bash
55+
gecos: Tommy Keswick
56+
primary_group: staff
57+
groups: [ users, staff, adm, sudo, www-data ]
58+
ssh_import_id:
59+
- gh:t4k
60+
sudo: ALL=(ALL) NOPASSWD:ALL
61+
timezone: US/Pacific
62+
snap:
63+
commands:
64+
- [ install, docker ]
65+
- [ install, --classic, go ]
66+
- [ install, pandoc ]
67+
- [ install, datatools ]
68+
- [ install, mkpage ]
69+
- [ install, eprinttools ]
70+
- [ install, dataset ]
71+
runcmd:
72+
- adduser ubuntu docker
73+
- adduser rsdoiel docker
74+
- adduser tmorrell docker
75+
- adduser mhucka docker
76+
- adduser tkeswick docker

0 commit comments

Comments
 (0)