vinitd

module
v0.0.0-...-7547c2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2022 License: Apache-2.0

README


vinitd

vinitd - vorteil.io init

vorteil.io init


Build Status Go Report Card Discord

Vinitd is the init process for vorteil.io micro virtual machines. It manages the configuration of the environment and the applications on the instance. For more information:

Architecture

Vinitd is a small but feature-complete init for small virtual machines which can be found at /vorteil/vinitd on vorteil images. It is a purpose-built and and requires a specific disk-layout build by vorteil's tools.

Stages

Vinitd runs through four stages starting with low level tasks like setting up stdout, network and logging. In the last stage the configured applications are getting launched. Should an error occur during one of the stages vinitd stops the virtual machine.

vinitd phases

Pre-Setup
  • Basic vtty setup
  • Creates /tmp if it does not exist
  • Mount /proc, /sys, /dev/pts
  • Init /proc/self/fd
Setup
  • Read VCFG configuration from disk
  • Setup vtty based on VCFG
  • Setup signals for poweroff, reboot
  • Configure power button
  • DHCP / static IP
  • Configure routes
  • Setup shared memory
  • Run sysctls and defaults
  • Setup fake users
  • Create /etc files if required
Post Setup
  • Start DNS cache
  • Mount NFS
  • Enable fluentbit logging
  • Add cloud environment variables (EXT_IP etc.)
  • Start chronyd if NTP provided
Launch
  • Launch applications
  • Launch strace if configured
  • Start application listener

Building

To build and test changes in vinitd it needs to be part of a bundle. To make this process easier there is a dedicated make target available to build a bundle with the newly build vinitd.

make BUNDLE=20.9.8 VERSION=88.88.1 TARGET=~/.vorteil/kernels/watch bundle
vorteil run /path/to/my/app --vm.kernel=88.88.1

The variables to provide are:

  • BUNDLE: Base used for the new bundle. Can be any bundle from vbundler releases page.
  • VERSION: Version of the new bundle. Needs to have the following format XX.XX.X
  • TARGET: The target directory for the new bundle. After a successful build there will be a file kernel-$VERSION in that directory. The easiest way is to choose vorteil's watch directory so the version is immediatley available for vorteil tools.

Running tests

Tests in vinitd covering network and operating system settings. Therefore they need to run in a virtual machine. There are two make targets available to run tests within a virtual machine (qemu installation required).

make test: Runs tests in two steps. The first steps converts an ubuntu docker image and installs all required dependencies for running and testing vinitd. This runs only the first time. To re-run this step delete the test/dl directory. In a second step the VM starts and runs the tests only. The test results are stored in c.out in the root directory of the project.

make fulltest: Runs the above steps in one step. This is for travis CI where the two step process is not necessary.

Code of Conduct

We have adopted the Contributor Covenant code of conduct.

Contributing

Any feedback and contributions are welcome. Read our contributing guidelines for details.

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Acknowledgements

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL