A continuous integration system built in Fortran
Levitating is an overly simple continuous integration system designed entirely in Fortran to, basically, replace Python's buildbot package (circa version 0.8). The system is comprised of a captain, which acts as the control server, and a collection of players, each of which can be assigned jobs to perform. Build results are generally captured and returned to the captain after a task is complete.
The system is drastically simpler than the system it aims to replace. The captain has no knowledge of the details of jobs themselves. The players will report results from each task in a job back to the captain. The captain does store these results and display them when requested, but the tasks are only referred to numerically.
To build Levitating, you'll need:
- GNU Fortran or another compiler that supports a handful of extensions used
- json-fortran (version 7 series, untested with 8)
Instructions are the list of tasks that a player needs to perform to complete a job. The instructions are entirely written in JSON, which the players then interpret. Currently, 5 types of actions are supported:
- shell - Execute a shell command on the host operating system's default shell
- git - Either clone or pull, whichever is appropriate, from a git repo
- download - Download a particular file from the captain
- upload - Upload a file or files (globbing supported) to the captain
- delete_tree - Delete a directory tree
The above steps encompass what I needed to replace in buildbot personally. If someone has a suggestion, write in!
It should be noted that players have absolutely no restrictions on functions like download or delete_tree, and they will happily try to download system files or delete a root directory.
The player processes will communicate with the captain via the Gemini protocol, a quasi-standard that is meant as a simpler alternative to HTTP. The players will upload files to the server via the Titan protocol, a system for uploading files meant to pair with the Gemini protocol.
Currently, the only way to access the portal for starting jobs, adding players, or viewing results is also via the Gemini protocol. You'll need to keep port 1965 open for the captain, which must be run via xinetd or inetd.
A CGI gateway (that's not a typo) for a compatible HTTP server is planned but non-existent.
The current configuration has literally no security features. Anyone who can connect to the captain's interface can start jobs, download releases (the products of what the players build, ostensibly), or manage players. Additionally, players are also not authenticated, so any process claiming to be an approved player can just proceed with downloading/uploading files.
The plan is to change this complete lack of authentication at some point. It's probably not a great idea to leave an instance of Levitating up in a public-facing manner.
Levitating is subject to the following license:
Copyright (c) 2021 Approximatrix, LLC email@example.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.