Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM64 support for Docker images #951

Closed
wants to merge 1 commit into from

Conversation

vishwamartur
Copy link

Related to #696

Add support for multi-architecture builds for Opik frontend and backend images.

  • Update apps/opik-backend/Dockerfile and apps/opik-frontend/Dockerfile to include --platform flag for multi-architecture builds.
  • Modify .github/workflows/build_and_push_docker.yaml to include --platform flag in the docker build and docker push commands.
  • Update deployment/docker-compose/docker-compose.yaml and deployment/docker-compose/docker-compose.override.yaml to specify platform: linux/amd64,linux/arm64 for backend and frontend services.
  • Update deployment/docker-compose/README.md to include instructions for multi-architecture builds.

Pending task build_apps.yaml
Docker push & build
Linux support arm AMD

Related to comet-ml#696

Add support for multi-architecture builds for Opik frontend and backend images.

* Update `apps/opik-backend/Dockerfile` and `apps/opik-frontend/Dockerfile` to include `--platform` flag for multi-architecture builds.
* Modify `.github/workflows/build_and_push_docker.yaml` to include `--platform` flag in the `docker build` and `docker push` commands.
* Update `deployment/docker-compose/docker-compose.yaml` and `deployment/docker-compose/docker-compose.override.yaml` to specify `platform: linux/amd64,linux/arm64` for `backend` and `frontend` services.
* Update `deployment/docker-compose/README.md` to include instructions for multi-architecture builds.

Pending task build_apps.yaml
Docker push & build 
Linux support arm AMD
@vishwamartur vishwamartur requested review from a team as code owners December 21, 2024 10:24
@jverre
Copy link
Collaborator

jverre commented Dec 21, 2024

@vishwamartur Thanks for the PR, @liyaka will take a look on Sunday

@liyaka
Copy link
Contributor

liyaka commented Dec 22, 2024

Hi @vishwamartur - it's not running on linux - please see one of the failed workflows:
https://github.com/comet-ml/opik/actions/runs/12444402901/job/34764647010?pr=951
It failed with error:
"amd64,linux" is an invalid component of "linux/amd64,linux/arm64": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument
we also need it to run on Mac and Windows.
In general, you can run it on any platform using --platform flag, and using
platform: linux/arm64
in docker-compose

Copy link
Collaborator

@Nimrod007 Nimrod007 left a comment

Choose a reason for hiding this comment

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

@vishwamartur thanks for taking the time to submit this pull request. we are working internally to achieve this and will submit a followup PR from our team. im closing this for now and will ping you soon once we open the new PR

@@ -113,6 +114,7 @@ services:
depends_on:
backend:
condition: service_started
platform: linux/amd64,linux/arm64
Copy link
Collaborator

Choose a reason for hiding this comment

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

we will add platform as optional in docker-compose-override only if needed
please remove

@@ -97,6 +97,7 @@ services:
condition: service_healthy
clickhouse:
condition: service_healthy
platform: linux/amd64,linux/arm64
Copy link
Collaborator

Choose a reason for hiding this comment

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

we will add platform as optional in docker-compose-override only if needed
please remove

@@ -16,7 +16,9 @@ services:
ports:
- "8080:8080" # Exposing backend HTTP port to host
- "3003:3003" # Exposing additional backend port to host
platform: linux/amd64,linux/arm64
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be optional, only adding an example in docker-compose/README.md file
please remove


frontend:
ports:
- "5173:5173" # Exposing frontend dev server port to host
platform: linux/amd64,linux/arm64
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be optional, only adding an example in docker-compose/README.md file
please remove

@@ -50,7 +50,14 @@ This will expose the following services to the host machine
- MySQL: Available on port 3306
- Backend: Available on ports 8080 and 3003

## Multi-Architecture Builds
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
## Multi-Architecture Builds
## Run locally on different architectures (arm/amd)


To build the Opik frontend and backend images for both `linux/amd64` and `linux/arm64` architectures, you can use the following command:

```bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

we will override in docker-compose please remove

@@ -1,5 +1,5 @@
# Build stage
FROM node:20.15.0-alpine3.20 as builder
FROM --platform=linux/amd64,linux/arm64 node:20.15.0-alpine3.20 as builder
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think multiple platforms are supported here.
we will add this to the build and push job. please remove

@@ -17,7 +17,7 @@ ARG BUILD_MODE=production
RUN npm run build -- --mode $BUILD_MODE

# Production stage
FROM nginx:1.27.3-alpine3.20
FROM --platform=linux/amd64,linux/arm64 nginx:1.27.3-alpine3.20
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think multiple platforms are supported here.
we will add this to the build and push job. please remove

@@ -12,7 +12,7 @@ RUN mvn versions:set -DnewVersion=${OPIK_VERSION} && \
mvn clean package -DskipTests

###############################
FROM amazoncorretto:21-al2023
FROM --platform=linux/amd64,linux/arm64 amazoncorretto:21-al2023
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think multiple platforms are supported here.
we will add this to the build and push job. please remove

@@ -1,4 +1,4 @@
FROM maven:3.9.9-amazoncorretto-21-al2023 AS build
FROM --platform=linux/amd64,linux/arm64 maven:3.9.9-amazoncorretto-21-al2023 AS build
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think multiple platforms are supported here.
we will add this to the build and push job. please remove

@Nimrod007 Nimrod007 closed this Dec 23, 2024
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