summaryrefslogtreecommitdiff
path: root/Urbit/Harbor.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-05-24 18:21:20 -0400
committerBen Sima <ben@bsima.me>2022-07-05 19:02:07 -0400
commitb72f6ba9f7a6987f184ac510491e452c3ea855b1 (patch)
tree201e1bd8d533f99fffceba6ba7310b29308160d5 /Urbit/Harbor.hs
parent98963d27e5d6ed7327846471d791bcdcb9eb58b4 (diff)
Init urbit harbor
This is mostly stubbed out and needs some work to be functional... the idea is to run urbit ships as systemd services, and provide a simple interface for managing them.
Diffstat (limited to 'Urbit/Harbor.hs')
-rw-r--r--Urbit/Harbor.hs39
1 files changed, 39 insertions, 0 deletions
diff --git a/Urbit/Harbor.hs b/Urbit/Harbor.hs
new file mode 100644
index 0000000..d95f1a0
--- /dev/null
+++ b/Urbit/Harbor.hs
@@ -0,0 +1,39 @@
+{-
+
+Urbit Harbor is a supervisor for Urbit ships on the local machine. It does no
+orchestration, it just manages systemd services.
+
+Plan:
+ - make this run 10 fake galaxies
+ - make this run 100 fake ships
+
+- Requirements:
+ - setup new ship
+
+Setup process:
+
+ <running as user "urbit-harbor">
+ dir=/var/urbit/harbor
+ urbit -c $dir/zod -k $dir/zod.key -x # one-time setup
+ <create $dir/zod.service from some template>
+ systemctl --user enable $dir/zod.service # nees fullpath
+ systemctl --user start zod.service
+
+Service Template:
+
+ [Service]
+ ExecStart=urbit -tq /var/urbit/harbor/zod # maybe want -d?
+ ExecStartPre=mkdir -p /var/urbit/harbor/zod
+
+ [Unit]
+ Description=zod
+
+ [Install]
+ WantedBy=multi-user.target
+
+TODO:
+ - use systemd.resource-control to limit memory/CPU for ships
+ - Urbit.Cloud controller will set different limits by reading/editing the
+ ini file, and change price to customer
+ - figure out what firewall stuff i need to do
+-}