Urgent.News

What's breaking now, across thousands of outlets.

Tech

Deploy Is a Consequence of the Manifest

One path to production for every service. The pipelines don't know which service they're shipping - they read that off the manifest. What's left to a person is three decisions, and one check that a version string is really in the binary. ๐Ÿ‘‹ I'm Anton - a software engineer working mostly in PHP/Symfony and Go, currently carving a live PHP monolith into Go services. Earlier parts of this seriesโ€ฆ

Deploy is a consequence of the manifest. In the world of software development, a service's deployment process has become streamlined and automated. Instead of relying on per-service artifacts, there is now a single place that determines what constitutes a service. This change was necessitated by the fact that there exists only one location specifying the composition of a service.

The issue at hand began with the failure of a build system. Go, a programming language, embeds metadata into binaries using linker flags. These flags include the service version and commit details. However, when a linker flag points to a non-existent symbol, the build process remains green, obscuring the error. This oversight can lead to inaccurate version information being embedded within the binary, which subsequently affects various aspects of the application's behavior and monitoring.

The root cause of this problem was a dead target in the service generation template. This default setting applied an incorrect -X flag to a non-existent symbol across multiple services. To rectify this, changes were required in both the Makefile and the Dockerfile to ensure that the build process correctly stamps the version information.

To prevent similar issues from occurring in the future, a verification step was introduced. This step involves building binaries with a deliberately incorrect version string and then checking if the string exists in the produced binaries. If the string is not found, it indicates that the symbol issue needs to be addressed. This process ensures that any discrepancies in the build system are caught early, making the deployment process more reliable.

The deployment process itself comprises three pipelines, applied uniformly across all services within the system. These pipelines are as follows:

1. Build: Triggered by the creation of a new tag, this pipeline uses a single Dockerfile that can build either the server or worker binary. The version and commit details are incorporated into the build process using linker flags, ensuring consistency across all services.

2. Tests: This pipeline encompasses multiple stages, including automated tests on pull requests, push events, and nightly scheduled runs. Testing helps identify potential issues early in the development cycle.

3. Deploy: This final pipeline involves deploying the service to various environments, including specific containers for the server and worker components. The deployment is orchestrated using a unified script that applies to all services, ensuring a consistent and controlled release process.

Each of these pipelines is designed to operate with a consistent Dockerfile and a few build arguments, simplifying the development and deployment processes. The introduction of a verification step into the build process adds an additional layer of reliability, ensuring that any discrepancies in the build system are caught and addressed promptly. This comprehensive approach to deployment reflects a commitment to quality and efficiency in the development lifecycle.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in Tech

Metrics You Get Without Writing Any

67 records in the metrics snapshot. The service wrote 6 of them. ๐Ÿ‘‹ I'm Anton - a software engineer working mostly in PHP/Symfony and Go, currently carving a live PHP monolith into Go services.

  • Service emits 67 metrics by default
  • Nine metrics generated by platform library
  • Metrics include liveness, readiness, and runtime stats

More from Monday 14 September โ†’