lots of documentation updates

This commit is contained in:
2023-04-12 08:01:57 +00:00
parent 81e70556db
commit 792dd139ca
12 changed files with 221 additions and 49 deletions

View File

@@ -14,6 +14,9 @@ help:
.PHONY: help Makefile
install-dependencies:
/usr/bin/env python3 -m pip install -r requirements.txt
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile

View File

@@ -11,6 +11,8 @@ There are some assumptions made:
build system here will assume this. It may work on non-Ubuntu apt-based
systems. For non-Debian systems, I've also been working on including
container builds that may work.
2. The primary target for this setup is Ubuntu 22.04. This needs to be
validated still.
There are three types of systems:
@@ -57,10 +59,34 @@ Below is a diagram of the planned system.
}
The hardware isn't slated to arrive until September at the earliest.
Hardware
--------
Blades:
The hardware isn't slated to arrive until September at the earliest. I am
leaning towards having the 1TB NVMe drives go with the AI modules, and use
the gateway system as the storage machine if needed.
+----------------------------+----------+----------------------------------------+
| Item | Quantity | Notes |
+----------------------------+----------+----------------------------------------+
| TPM blade | 5 | TPM 2.0 |
+----------------------------+----------+----------------------------------------+
| DEV blade | 6 | TPM 2.0, µSD, nRPIBOOT |
+----------------------------+----------+----------------------------------------+
| CM4 | 10 | 8GB RAM, no eMMC/WiFi/BT |
+----------------------------+----------+----------------------------------------+
| CM4 | 2 | 8 GB RAM, eMMC/WiFi/BT (gw, dev blade) |
+----------------------------+----------+----------------------------------------+
| SAMSUNG 970 EVO Plus 500GB | 4/7 | 2280 |
+----------------------------+----------+----------------------------------------+
| SAMSUNG 970 EVO Plus 1 TB | 2/4 | 2280 (1 allocated to gw) |
+----------------------------+----------+----------------------------------------+
| RTC module | 10 | DS3231 |
+----------------------------+----------+----------------------------------------+
| AI module | 3 | 2x Coral TPU |
+----------------------------+----------+----------------------------------------+
| CM4 carrier board | 1 | Dual-homed, NVMe slot, Zymbit 4i |
+----------------------------+----------+----------------------------------------+
| Netgear GS316PP | 1 | 16-port PoE+ (183W) |
+----------------------------+----------+----------------------------------------+

View File

@@ -12,6 +12,9 @@ the workflow looks like:
1. ``install-packer.sh``
2. ``build-image.sh``
Alternatively, you can run ``run-docker.sh`` to optionally build a container
from the provided Dockerfile and then run it.
``install-packer.sh``
^^^^^^^^^^^^^^^^^^^^^^
@@ -34,6 +37,75 @@ The dependencies required to build images with ``packer`` are:
Go will also need to be installed; there is a script provided in the :doc:`tools`
directory.
If the ``FORCE_DEPENDENCY_INSTALL`` environment variable is set to ``"yes"``, it
will attempt to install the dependencies even if ``git`` is installed.
``build-image.sh``
^^^^^^^^^^^^^^^^^^
``build-image.sh`` will attempt to build a packer image. It requires that
``packer`` and ``packer-builder-arm`` have been installed, e.g. via
``install-packer.sh``. It will use a board file (see below) to build this
image. If the board file contains both a remote file URL and a local file path,
it will attempt to download the remote file to the local path to cache it. If
the environment variable ``SKIP_LOCAL_CACHE=yes``, it will skip doing this. It
will also skip caching if the local file exists, though it will print a command
to remove the file to force redownloading.
Board files
------------
A board file is a JSON [#]_ file describing the image that packer should build.
There are a lot of examples in the packer-builder-arm boards_ directory.
.. [#] Hashicorp would like you to use their HCL, but I haven't switched
over yet.
``ubuntu-board-gen``
--------------------
A Go program is provided to generate an Ubuntu-based Packer board file from a
YAML file description. It is a single-minded tool to solve an exact problem;
for more control, or to handle edge case, the board JSON file may be
handwritten or another generator written.
The YAML board specification has the following format:
.. yaml ::
boards:
- version: 22.04.2
size: 32G
name: cm4-cluster-ubuntu-22.04.2.img
scripts:
- scripts/install-base.sh
It will set up a board file pointing to the preinstalled Ubuntu server image.
The size parameter should be one of "4G", "8G", "16G", "32G", or "64G". The
example above is only using a shell provisioner, but there are many different
provisioners available. A longer example would look like
.. yaml ::
boards:
- version: 22.04.2
size: 4G
name: cm4-cluster-ubuntu-22.04.2.img
local-scripts:
- scripts/generate-auth-keys
- scripts/template-that-one-file
files:
- source: build/privkey.pem
destination: /etc/myservice/privkey.pem
- source: build/cert.pem
destination: /etc/myservice/cert.pem
- source: build/that-one-file
destination: /etc/that-one-file
scripts:
- scripts/set-auth-key-permissions.sh
- scripts/install-base-platform.sh
The order of precedence for provisioners is local scripts (which might be used
to generate files), files, and then scripts.
.. _boards: https://github.com/mkaczanowski/packer-builder-arm/tree/master/boards

View File

@@ -1,4 +1,39 @@
tools
=====
The ``tools`` directory contains various helper scripts.
The ``tools`` directory contains various helper scripts for building systems.
- ``install.sh`` will run all of the scripts in the expected order.
- ``install-dependencies.sh`` installs all of the dependencies required by the
various parts of the build system.
- ``install-go.sh`` attempts to install Go using godeb_. It requires some of
the dependencies that would be installed by ``install-dependencies.sh``.
- ``install-bazel.sh`` installs bazelisk_ and buildifier_. It requires Go in
addition to some of the dependencies that would be installed by
``install-depdencies.sh``.
Dependencies
------------
Optional dependencies are marked with a *?*.
+-----------------------------+----------------------+------------------------------------------------+
| Script | Dependencies | Solved by |
+-----------------------------+----------------------+------------------------------------------------+
| ``install-dependencies.sh`` | apt, sudo? | |
+-----------------------------+----------------------+------------------------------------------------+
| ``install-go.sh`` | curl, sudo, tar | ``install-dependencies.sh`` |
+-----------------------------+----------------------+------------------------------------------------+
| ``install-bazel.sh`` | curl, git, go, sudo? | ``install-dependencies.sh``, ``install-go.sh`` |
+-----------------------------+----------------------+------------------------------------------------+
Dockerfile
----------
The Dockerfile sets up an Ubuntu container and runs the install scripts. Its
entrypoint is ``bash``.
.. _bazelisk: https://github.com/bazelbuild/bazelisk
.. _buildifier: https://github.com/bazelbuild/buildtools
.. _godeb: https://github.com/niemeyer/godeb