Skip to content

Commit af474f5

Browse files
authored
Merge pull request #262 from ranimandepudi/my-new-proposal-arm64
Proposal: Arm64 Support and Multi-Architecture Image Publishing for Harbor
2 parents 697cdd4 + dddd685 commit af474f5

File tree

2 files changed

+185
-0
lines changed

2 files changed

+185
-0
lines changed

proposals/arm64-support-harbor.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Proposal: Arm64 Support and Multi-Architecture Image Publishing for Harbor
2+
3+
Author: Rani Chowdary Mandepudi, Arm (@ranimandepudi)
4+
5+
Discussion: https://github.com/goharbor/harbor/pull/22229/files
6+
7+
## Abstract
8+
9+
This proposal introduces native Arm64 support and multi-architecture image publishing for all Harbor components. The goal is to enable Harbor to run natively on Arm64 hardware, align with CNCF best practices, and enhance Harbor's portability across modern infrastructure environments.
10+
11+
## Background
12+
13+
Harbor is a popular cloud-native container registry. While it provides full-featured registry services, its official builds and Docker images target only the Amd64 architecture. The growing adoption of Arm64 in cloud-native and edge computing environments has created demand for native Arm64 support.
14+
15+
Currently, deploying Harbor on Arm64 requires emulation or custom builds, reducing performance and maintainability.
16+
17+
## Proposal
18+
19+
Note: This proposal introduces no changes to Harbor’s core functionality. It adds support for additional architectures while keeping existing behavior unchanged.
20+
21+
All Harbor component images have been built and tagged for the Arm64 architecture. These images have been pushed to my DockerHub repository under the namespace ranichowdary/ (replacing the original goharbor/ namespace) for testing and validation purposes. Once the review is complete, the image names can be reverted to the original naming convention.
22+
23+
Additionally, the Dockerfile paths and image naming conventions have been modified to support multi-architecture builds. This ensures compatibility and seamless operation on both x86 and Arm64 platforms using the same codebase and Docker images.
24+
25+
These changes allow Harbor to be built, packaged, and installed cleanly on Arm64 hosts such as AWS Graviton and also on x86 as images are multi arch.
26+
27+
This proposal introduces native Arm64 builds for Harbor components using `Docker Build` and multi-architecture manifests. Each image is tested and published in a way that maintains compatibility with existing Amd64-based deployments.
28+
29+
This proposal does not alter Harbor’s functionality. It extends the build and release process so every Harbor component is published as a multi-architecture image (amd64 + arm64) under the official goharbor/* namespace.
30+
31+
During development and testing, prototype images were published under ranichowdary/* for validation. For upstream adoption, all images will use the official goharbor/* repositories.
32+
33+
## Design Goals
34+
35+
Build Harbor component images (core, jobservice, registryctl, etc.) for both Arm64 and Amd64 using native compilation per architecture and multi-arch manifest merging.
36+
37+
Published multi-arch images to Docker Hub using unified manifest lists, enabling transparent arch-specific pulls without impacting existing deployments.
38+
39+
Supported native and cross-platform builds via docker buildx and architecture-specific runners.
40+
41+
Ensure deterministic and repeatable builds across architectures using consistent Makefile targets and validated build.
42+
43+
Provide documentation for Arm64 validation, and plan to publish a learning path on learn.arm.com post-upstreaming.
44+
45+
Integrate Arm64 builds into Harbor’s CI and release workflows using GitHub Actions. This will require coordination with Harbor maintainers—I’m happy to assist or contribute directly as needed.
46+
47+
## Development Phases
48+
49+
To reduce risk and ensure stability, we propose a phased approach:
50+
51+
Phase 1 – Code Implementation & CI Enablement
52+
• Add ARCH support to Makefiles, builder scripts, and Dockerfiles.
53+
• Enable GitHub Actions matrix to build/test on both amd64 and arm64 runners.
54+
• Validate that unit tests, API tests, and UI tests pass consistently on both platforms.
55+
• Deliverable: CI green for both architectures; no user-facing image changes yet.
56+
57+
Phase 2 – Image Publishing & Installers
58+
• Publish official Harbor component images to Docker Hub under goharbor/* with multi-arch manifests.
59+
- Offline installers may be published either per-arch bundles or a single combined bundle depending on community size and storage considerations
60+
• Ensure the unified tag (e.g. goharbor/harbor-core:vX.Y.Z) automatically resolves to the correct variant.
61+
• Update online installer (docker-compose) and offline installer packages to use these multi-arch tags.
62+
• Deliverable: Users can docker pull goharbor/harbor-core:vX.Y.Z on amd64 or arm64 and get a native image.
63+
64+
Phase 3 – Helm Chart Validation
65+
• Validate Harbor Helm chart installs and upgrades correctly on both amd64 and arm64 Kubernetes clusters.
66+
• Confirm that all hooks, jobs, and init containers reference multi-arch images.
67+
• Publish chart updates if needed.
68+
• Deliverable: helm install harbor works seamlessly across architectures.
69+
70+
## Architecture Parameter:
71+
72+
![Harbor Multi-Arch Design](images/arm64/harbor-multiarch-arm64-amd64.png)
73+
74+
For Go components (core,jobservice, registryctl): ARCH - GOARCH - compile - image build.
75+
For binary-only components(Trivy, Trivy Adapter): ARCH - Dockerfile.binary - fetch correct binary
76+
77+
ARCH(amd64| arm64) >> make build -e ARCH = arm64/amd64 >> _build_trivy >> builder.sh(receives ARCH >> docker build (ARG TARGETARCH=arm64 >> Dockerfile.binary (downloads the correct binary)))
78+
79+
This ensures a unified codebase, with arch-specific logic only where strictly required.
80+
81+
## Binary Dependencies:
82+
As part of this work, we identified Harbor’s external binary dependencies and confirmed Arm64 support:
83+
• Trivy: arm64 releases available upstream.
84+
• Trivy Adapter: requires both Trivy (downloaded upstream) and the adapter binary (built from source with GOARCH).
85+
• Helm (migrate-chart tool): must dynamically fetch the correct arch binary (current Dockerfile hardcodes linux-amd64).
86+
• Spectral: already provides amd64/arm64 binaries.
87+
• Node.js, Python deps: validated during e2e runs; no arch-specific blockers found.
88+
89+
This inventory ensures all required binaries are reproducible on both architectures.
90+
91+
## CI changes:
92+
93+
• CI matrix: Every PR runs unit, API, and UI tests on both amd64 and arm64 runners.
94+
• Build pipeline:
95+
• Per-arch images pushed as goharbor/<component>:<tag>-amd64 / -arm64.
96+
• Final multi-arch tag created only after both builds succeed (docker buildx or docker manifest create).
97+
• Installers: Online/offline installers reference unified tags (:<tag>), so users don’t need to specify an arch suffix.
98+
• Release sequencing: CI ensures manifests are published only once both builds complete (job dependencies).
99+
100+
Multi Arch CI integration on Harbor:
101+
102+
Objective:
103+
To ensure Harbor's CI system validates code changes across both amd64 and arm64 architectures for pull requests. This enhancement guarantees feature compatibility and stability on both platforms.
104+
105+
Changes:
106+
* CI.yml (example)
107+
108+
This file defines main test matrix for harbor on pull requests and pushes. Ensure that Harbor's CI pipeline executed on both arm64 and amd64 architectures for every PR or push
109+
* Enabled Matrix strategy for Architecture: Before jobs like UTTEST, APITEST_DB ran only on `ubuntu-latest` (default amd64). With this each job uses:
110+
111+
strategy:
112+
matrix:
113+
include:
114+
- arch:amd64
115+
runner: ubuntu-22.04
116+
- arch:arm64
117+
runner: ubuntu-24.04-arm
118+
119+
Job names updated for architecture clarity.
120+
Unit, API, and UI test logic unchanged, but now dynamically detects platform via `uname -m`.
121+
122+
123+
## Testing
124+
125+
Validation performed across amd64 and arm64 hosts:
126+
• UI: Harbor portal accessible, login and navigation functional.
127+
• API: /api/v2.0/ping, /projects, /repositories verified.
128+
• Registry: Image push/pull works; multi-arch manifests resolve correctly per host.
129+
• Services: All containers (core, jobservice, registry, portal, etc.) start healthy with the right linux/amd64 or linux/arm64 images.
130+
131+
To validate that our custom-built Harbor instance with Arm64 support works correctly across components and architectures, I performed the following levels of testing:
132+
133+
- tools/spectral/Dockerfile - Uses arch-specific spectral binary; dynamically selects amd64/arm64
134+
135+
- tools/migrate_chart/migrate_chart.sh- this script is architecture-neutral and works on both amd64 and arm64 as long as a compatible `helm` binary is available.
136+
137+
- tools/migrate_chart/Dockerfile - It currently hardcodes the Helm binary for `linux-amd64` so it is not architecture-neutral and must be updated to support Arm64 by dynamically resolving the appropriate Helm binary for the target architecture.
138+
Made this docker image multi-architecture (`docker pull ranichowdary/migrate-chart:latest`)
139+
140+
tools/notary-migration-fix.sh - No changes
141+
tools/swagger/Dockerfile - No changes
142+
143+
- tools/release/release_utils.sh: In getAssets() function adding `arch` parameter because builds are now organized under subfolder like `amd64/` and `arm64/`. Updated GCS `gsutil cp` paths to ensure it looks under the correct architecture folder. Used `mkdir -p` to prevent errors if assetsPath already exists. Also updated `publish_release.yml` where it calls `getAssets`.
144+
I can work on this but this need maintainers to work as we need to deal with few enhancements.
145+
146+
Container Health Validation:
147+
148+
- Ensuring auxiliary tools handled for both `amd64` and `arm64` architectures when building Harbor via the Makefile:
149+
150+
- Verified all Harbor services (core, registry, jobservice, portal, proxy, etc.) were up and marked as healthy via docker ps.
151+
- Ensured correct images were used with linux/arm64 platform and linux/amd64.
152+
153+
Web UI Access:
154+
155+
- Loaded the Harbor UI successfully at http://<host>/harbor.
156+
- Confirmed login, project navigation, and artifact listing worked from the browser.
157+
158+
API-Level Testing:
159+
- Used Harbor’s REST API to validate backend services:
160+
- GET /api/v2.0/ping → responded with pong confirming core service health.
161+
- GET /api/v2.0/projects → confirmed API access and project metadata retrieval.
162+
- POST /api/v2.0/projects → tested project creation via API.
163+
- GET /api/v2.0/repositories and /artifacts → verified image metadata retrieval.
164+
165+
166+
- Image Push and Pull Tests (Registry Validation)
167+
- Multi-Architecture Image Validation
168+
169+
These tests confirm that Harbor can function fully on Arm64 & amd64, including UI, API, registry, and multi-architecture artifact handling. The environment is now ready for use in cloud-native, edge, or hybrid deployments.
170+
171+
## RoadMap:
172+
173+
• Short term (v1): Enable CI, publish multi-arch images, support both installer types. Validate Helm charts, refine Dockerfiles, improve cross-arch consistency.
174+
• Long term: Maintain Harbor parity across architectures as a first-class CNCF project.
175+
176+
177+
Thanks for reviewing this work! Since I'm the author of this contribution from Arm, I believe this is a high-priority topic within the Harbor community and it could be introduced as a new feature soon. A formal proposal like this document will help align on the design and technical implementation.
178+
179+
I welcome feedback, collaboration, or questions from the Harbor community.
180+
181+
## References:
182+
183+
- www.arm.com/migrate
184+
- https://learn.arm.com/
185+
- https://hub.docker.com/u/ranichowdary
263 KB
Loading

0 commit comments

Comments
 (0)