Enable multi architecture compatibility between Tentacle and Script pods #1141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Are you a customer of Octopus Deploy? Please contact our support team so we can triage your PR, so that we can make sure it's handled appropriately.
Background
The boostrapRunner executable is a Go binary that is built as part of the Tentacle image, and copied over to the script pod at runtime. It is used to wrap the script execution so the pod streams logs in a format that Tentacle can parse. It is not built as part of the worker-tools image because customers are free to specify their own worker-tools image, and we need to ensure the logs are in the correct format.
Problem
The current bootstrapRunner exe is tightly coupled with the architecture of the Tentacle container. The limitation exists because we only build the bootstrapRunner exe for the arch that the tentacle image is built on.
RUN go build -ldflags "-s -w" -o "bin/bootstrapRunner"
This becomes a problem when the Tentacle and script pods are running on different platform architectures - i.e. when the script pod is spun up on a different node. In such a scenario the script pod would receive a bootstrapRunner exe that it cannot execute.
Results
Testing the Architecture builds
For testing, I created a simple Dockerfile that was able to check if all of the architectures were able to build correctly. The simple Dockerfile is as below:
When collecting the testing evidence, I was able to verify that all of the architectures were built correctly and were all executable:
Binary Verification Results
Architecture Support Verification
Testing the dynamic selection of architecture
Testing using the following script:
Results are:
How to review this PR
Quality ✔️
Pre-requisites