Speeding Up Kubernetes Controller Integration Tests with Ginkgo Parallelism
TL;DR Kubernetes controller integration tests can be painfully slow when run sequentially, especially as your suite grows. In this post, you’ll learn how to: Run integration tests in parallel using the Ginkgo testing framework. Share cluster configuration between parallel test processes. Reduce test times significantly. In our case, the time dropped from around 11 minutes to just 1 minute and 40 seconds. This guide uses real examples from the Kuadrant Limitador Operator project. ...
Accelerating Docker Builds with Cross Compilation on GitHub Runners
Motivation Building Docker images for multiple architectures on GitHub runners, which currently support only the amd64 architecture, can be a time-consuming process. Utilizing QEMU for emulation allows for multi-architecture builds, but it significantly increases build times. In this post, we will explore how cross-compilation can dramatically decrease Docker build times, based on an example from the Kuadrant Limitador project where I implemented these changes. Introduction Docker multi-architecture images are essential for ensuring that applications run smoothly on various hardware platforms, from x86_64 servers to ARM-based devices. However, building these images efficiently is a challenge, particularly when working within the constraints of GitHub runners without using your own self-hosted runner. By leveraging cross-compilation, developers can bypass the slow emulation process provided by QEMU, leading to faster builds and more efficient CI/CD pipelines. ...
Managing HTTP Connections in Go: Preventing Go Routine Leaks
Motivation While working on a Go service, I encountered an intriguing problem: a goroutine leak caused by unclosed HTTP connections. This issue was challenging to reproduce as it only occurred when a specific service utilized Resty and custom HTTP transport options while interacting with our service. Delving deeper into the intricacies of managing HTTP connections, I realized the criticality of diligently checking and managing these connections. This blog post aims to shed light on this problem and emphasize the importance of managing HTTP connections to prevent goroutine leaks. By understanding the underlying mechanisms and implementing appropriate strategies, developers can ensure optimal performance and stability in their Go applications. ...
Javalin & Flyway
Motivation Some time ago, while working on a college assignment using Javalin, I encountered some labs that required running SQL statements manually on the database before deploying the application to Heroku. This was a tedious task that had to be repeated every time there were changes or additions to the tables. Although I knew about Flyway and its ability to automate database migrations, I couldn’t find any tutorial on the Javalin site that explained how to use it. Therefore, I decided to write a short blog post that could be helpful to anyone facing a similar situation. ...