Skip to content

Multi-image architecture and Go 1.25 upgrade#170

Merged
pricem14pc merged 19 commits intomainfrom
corpmac-poc-arm64-image-build
Jan 26, 2026
Merged

Multi-image architecture and Go 1.25 upgrade#170
pricem14pc merged 19 commits intomainfrom
corpmac-poc-arm64-image-build

Conversation

@pricem14pc
Copy link
Contributor

@pricem14pc pricem14pc commented Oct 4, 2025

What and why?

Upgrades to Go 1.25 and Introduces a multi architecture image build to support arm64 corporate Mac book, but maintain amd64 GCP run time.

How to test?

  • check the existing image size and architecture (manifest) to confirm its only amd64 and bloated at > 500MB
  • ensure multiple image architectures are built and pushed by this PR, and are listed in the manifest when GHA main.yaml runs
  • ensure the amd64 application image pulled and deployed to GCP and off-network Mac books starts and functions as expected
  • ensure the arm64 application image pulled and deployed on a corporate Mac book starts and functions as expected
  • test the /db-migrations are correctly referenced, found on the system, and applied (i.e. creating the schema/tables initially and then subsequent deployments show "Database schema unchanged")
  • manually test survey service features

Jira

https://officefornationalstatistics.atlassian.net/browse/RAS-1794

Useful info for testing

  • when pulling the image to an arm64 development environment, ensure a pull of this PR image no longer shows the following warning
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
  • deploy your GCP env and exec into the container with the following (you can also do similar in a local Docker network with docker exec)
kubectl exec --namespace=$NAMESPACE --stdin --tty $POD_NAME --container=$CONTAINER_NAME -- /bin/sh
  • notice the bloated image contains all the repo source code and the application binary is running as root
/src # ls -ltra
total 10580
-rwxr-xr-x    1 root     root           337 Nov 14 14:27 wait_for_startup_integration_tests.sh
drwxr-xr-x    2 root     root          4096 Nov 14 14:27 sql
drwxr-xr-x    2 root     root          4096 Nov 14 14:27 models
-rw-r--r--    1 root     root           460 Nov 14 14:27 manifest.yml
-rw-r--r--    1 root     root           616 Nov 14 14:27 manifest-template.yml
-rw-r--r--    1 root     root           465 Nov 14 14:27 manifest-prod.yml
-rw-r--r--    1 root     root           468 Nov 14 14:27 manifest-preprod.yml
-rw-r--r--    1 root     root          3865 Nov 14 14:27 main.go
-rw-r--r--    1 root     root        187452 Nov 14 14:27 go.sum
-rw-r--r--    1 root     root          1446 Nov 14 14:27 go.mod
-rw-r--r--    1 root     root           550 Nov 14 14:27 docker-compose.yml
drwxr-xr-x    2 root     root          4096 Nov 14 14:27 db-migrations
-rw-r--r--    1 root     root           544 Nov 14 14:27 compose-integration-tests.yml
drwxr-xr-x    3 root     root          4096 Nov 14 14:27 _infra
-rw-r--r--    1 root     root          4662 Nov 14 14:27 SECURITY.md
-rw-r--r--    1 root     root           152 Nov 14 14:27 RELEASE_NOTES.md
-rw-r--r--    1 root     root          4236 Nov 14 14:27 README.md
-rw-r--r--    1 root     root          3008 Nov 14 14:27 Makefile
-rw-r--r--    1 root     root          1104 Nov 14 14:27 LICENSE
-rw-r--r--    1 root     root           217 Nov 14 14:27 Dockerfile
-rw-r--r--    1 root     root          7476 Nov 14 14:27 API.md
-rw-r--r--    1 root     root           516 Nov 14 14:27 .gitignore
drwxr-xr-x    3 root     root          4096 Nov 14 14:27 .github
drwxr-xr-x    4 root     root          4096 Nov 14 14:28 build
-rw-r--r--    1 root     root         21937 Nov 14 14:29 coverage.txt
-rw-r-----    1 root     root          2305 Nov 14 14:29 gha-creds-84d4040d63b7a722.json
-rw-r--r--    1 root     root          2246 Nov 14 14:29 survey-11.0.66.tgz
drwxr-xr-x    7 root     root          4096 Nov 14 14:29 .git
-rwxr-xr-x    1 root     root      10490409 Nov 14 14:29 rm-survey-service
drwxr-xr-x    1 root     root          4096 Nov 14 14:29 .
drwxr-xr-x    1 root     root          4096 Jan  9 10:58 ..
  • deploy this PR image to your env and exec into the container
kubectl exec --namespace=$NAMESPACE --stdin --tty $POD_NAME --container=$CONTAINER_NAME -- /bin/sh
  • notice the image no longer contains all the repo source code and the application binary is running with a dedicated user account
/opt/survey $ ls -ltra
total 12316
drwxr-xr-x    1 root     root          4096 Jan  9 10:47 ..
-r-xr-x---    1 survey-user survey-group  12600215 Jan  9 10:47 main
drwxr-xr-x    1 survey-user survey-group      4096 Jan  9 10:47 .

/opt/survey $ ls -ltra /
drwxr-xr-x    1 survey-user survey-group      4096 Jan  9 11:42 db-migrations

@pricem14pc pricem14pc requested a review from a team as a code owner October 4, 2025 15:09
@pricem14pc pricem14pc changed the title Corpmac poc arm64 image build Multi-image architecture and Go 1.25 upgrade Jan 9, 2026
Copy link
Contributor

@matthew-robinson-ons matthew-robinson-ons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested migrations and application function. All working and looking good just one question around the commenting out rather than removal of links in the docker-compose file

@pricem14pc pricem14pc merged commit d04a5f7 into main Jan 26, 2026
5 checks passed
@pricem14pc pricem14pc deleted the corpmac-poc-arm64-image-build branch January 26, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants