You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Feature] Provide multi-arch images for apiserver and security proxy (#4131)
* [Feature] Provide multi-arch image build and push for apiserver and security proxy
Signed-off-by: wei-chenglai <[email protected]>
* build on test and push only on master branch
* fix lint
---------
Signed-off-by: wei-chenglai <[email protected]>
Copy file name to clipboardExpand all lines: apiserver/DEVELOPMENT.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,6 +156,46 @@ Access the service at `localhost:8888` for http, and `localhost:8887` for the RP
156
156
make docker-image
157
157
```
158
158
159
+
#### Build Multi-Architecture Image
160
+
161
+
The API server supports building multi-architecture images for `linux/amd64` and `linux/arm64` platforms. This is useful for deploying on ARM-based systems like Apple Silicon.
162
+
163
+
**Prerequisites:**
164
+
165
+
* Docker Buildx installed and configured
166
+
167
+
**Build Process:**
168
+
169
+
The multi-arch build follows a similar pattern to the ray-operator:
170
+
171
+
**Build binaries for each architecture:**
172
+
173
+
```bash
174
+
# Build for amd64
175
+
cd apiserver
176
+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o kuberay-apiserver-amd64 cmd/main.go
177
+
178
+
# Build for arm64
179
+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o kuberay-apiserver-arm64 cmd/main.go
180
+
```
181
+
182
+
**Build and push multi-arch image using Dockerfile.buildx:**
* The multi-arch image uses `apiserver/Dockerfile.buildx` which is optimized for copying pre-built binaries.
195
+
* Since the API server is built with `CGO_ENABLED=0`, no cross-compilation tools (like gcc-aarch64-linux-gnu) are needed, making the build process simpler than the operator.
196
+
* The build context must be the project root directory (`.`) because the `proto/` directory needs to be copied for serving swagger files at runtime.
197
+
* Multi-arch images are automatically built and pushed to `quay.io/kuberay/apiserver:nightly` on merges to the `master` branch via the GitHub Actions workflow.
198
+
159
199
#### Start Kubernetes Deployment
160
200
161
201
Note that you should make your KubeRay API server image available by either pushing it to an image registry, such as DockerHub or Quay, or by loading the image into the Kubernetes cluster. If you are using a Kind cluster for development, you can run `make load-image` to load the newly built API server image into the Kind cluster. The operator image will also be needed to be loaded on your cluster. If you want run secure API server, you can build security proxy using `make security-proxy-image` and load it to the cluster using `make load-security-proxy-image`
0 commit comments