Haiku Depot Server on Docker and Urls in Haiku
Docker
So far the HaikuDepotServer (HDS) system has been deployed into the production host using RPM packages. This has worked quite well as there is a Maven plugin for producing RPMs. The RPM has included the Jetty runner and all of the typical Linux start-up scripts and so on.
More recently the world has been moving to Docker images where the operating system and the software is bundled into an image and the image is deployed as a virtual machine. Haiku has also been moving its backend deployment environment from hosts over to a Docker-centric deployment and so HDS has also had to make this leap too. After some initial experiments, it was decided that the Dockerfile that describes the setup of a Docker image should be separated out of the HDS build process. Instead it is included as part of the HDS release process.
The build and release process is diagrammed below;
The coloured lines represent scripted or automated data flows and the black more manual flows or processes. There is a mix of automation and manual-intervention. Fully automating the process in the absence of an obvious fixed build-environment is tricky and the effort required is probably not worthwhile at this stage.
Haiku Vector Icon Rendering
The hvif2png
program is packaged as a tar-ball in the HDS source. It is build for the correct platform that the HDS Docker image will use as its base image. This tar-ball is then included in the HDS source.
Release Process
This process is driven by Python scripts in the HDS repository. Based on a template, it will render a Dockerfile
into the source. The Dockerfile
contains the correct, coordinated versions of;
- Haiku Depot Server (
.war
) - Postgres Driver (
.jar
) - Jetty Runner (
.jar
)
The new release is tagged in GitHub.
Build Process
Now the source is checked out by hand at the release tag. From this process, driven by the Maven build tool, a Java Servlet .war
file is generated. Once generated, the .war
file can be uploaded to the GitHub release page for HDS at the correct version. This last step is done by hand.
Docker Image
The source can again be checked out at the correct tag. This provides a Dockerfile
ready to go. The Docker tooling is used to create the image. This will use the files in the HDS source as well as resources from the internet to assemble a Docker image that can be run in Docker on a suitable virtual environment.
URL Handling in Haiku
Some older URL parsing and processing unit tests have recently been re-activated in the Haiku source. This has shown a few minor bugs in the Haiku parsing and processing of URL strings. I’ve been patching the BUrl
class to be able to correctly deal with the scenarios posed in the tests.