Skip to content

Documentation, GZip compression & Debian docker image#25

Merged
ValentijnvdBeek merged 33 commits into
masterfrom
debian-stable
Nov 18, 2021
Merged

Documentation, GZip compression & Debian docker image#25
ValentijnvdBeek merged 33 commits into
masterfrom
debian-stable

Conversation

@ValentijnvdBeek
Copy link
Copy Markdown
Collaborator

@ValentijnvdBeek ValentijnvdBeek commented Nov 11, 2021

Summary

This is more of an exploratory branch with a motley of features with a similarly large range of practical usefulness. It mainly focuses on easing development of the BAAS project, documenting the setup procedure and fixing some small bugs.

Feature List

  • Uses Debian GNU/Linux stable instead of Arch Linux
  • Exports the Docker image rather than building a custom image
  • Implements the standard GZip compression in addition to ZSTD
  • Adds a configuration file to the management OS
  • Updates the README with detailed installation instructions
  • Restart the server in the new flashed OS on the next boot and revert to the management oS
  • Reboot after flashing image to disk
  • Store logging messages on the management OS as well

Known issues

  • Useless kernel image code is still there (removed in a later commit)
  • GZip implementation is slightly clunky
  • A configuration file should also be used on the control server
  • Implementation of the reboot features are done using external programs, which is not perfect but serviceable.

Why should it be merged?

By using the Debian stable image for Docker the stability of the program is vastly program, especially over time. Arch Linux is a rolling release distro which means you get a different each time you built it, especially over a longer period of time. It also obsoletes the need for the custom kernel, which again improves reproducibility and decreases built times. Image size are roughly the same, however the Dockerfile is a bit more complicated since the Debian image is more minimal than the Arch Linux one.

Rebooting automatically is very useful feature which reduces waiting time to check whether the flashing is done or not. This is not a major deal while developing, but when you are checking functionality you might just flash images repeatedly over a couple of hours.

Originally the implementation to boot into the right OS was based on reaching out to a management module in the chipset (detailed in #19), however this is not necessary for this particular feature. Since we are using modern systems running Debian GNU/Linux as the management OS we can use the standard Linux program efibootmgr to write to the BOOTNEXT parameter. This is a bit of quick and dirty solution, we may consider implementing a custom solution for this. However, keep in mind that EFI vars can be fragile and may brick the system completely.

The GZip is pretty meh and is mostly good as a first issue. It is nice to have in the sense that is standard tooling on GNU/Linux systems which makes it widely supported and easily accessed using different tools lately, however I am aware that is not the greatest argument in the world.

Victor Roest and others added 27 commits January 12, 2021 17:06
Co-authored-by: Jonathan Dönszelmann <jonabent@gmail.com>
Co-authored-by: Victor Roest <victor@xirion.net>
Co-authored-by: Victor Roest <victor@xirion.net>
Co-authored-by: Victor Roest <victor@xirion.net>
…he client OS

Rebooting into the client has been done using a simple pre-existing
commandline tool called efibootmgr. Given that we are using a Debian
GNU/Linux system as the management OS on non-ancient hardware, this
should work the target computer.

Using gzip serves two purposes: the first of which is that it is a
standard algorithm which gives broad architectural, operating system
and language. Secondly, it is used both during network transfer and
on disk whic means that we can avoid the complicated dependency on
file systems with transparent encryption like btrfs or ZFS. They can
still be used, of course, but it is no longer a hard requirement which
makes it easier to deploy on university networks.
# Conflicts:
#	.dockerignore
#	Makefile
#	control_server/api/boot.go
#	control_server/httpserver/routes.go
#	control_server/main.go
#	go.mod
#	go.sum
#	management_os/build/Dockerfile
#	management_os/entrypoint/api.go
#	management_os/entrypoint/download.go
#	management_os/entrypoint/main.go
#	management_os/entrypoint/upload.go
…sByUser

Extra documentation for the endpoints with request examples
Validates the inputs for a few functions to ensure that the endpoints are called correctly
Fixes a bug where it always returned the first item for any Read endpoint
Fixes a bug where it would not give an error for non-existing users, images or machines
Cleans up the image code by creating helper function which gets variables about the uri
Implements an endpoint which gets all the images associated with a user out of the database
Implements an endpoint which gets the first image with a given name for a specified user
Implements a function to get a user by id which is useful given the database is denormalized
…e not unique; Create an image file when an image is created
@ValentijnvdBeek ValentijnvdBeek merged commit 4ca41b3 into master Nov 18, 2021
@ValentijnvdBeek ValentijnvdBeek deleted the debian-stable branch November 21, 2021 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants