Skip to content

Support for openEuler #2088

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

zhihangdeng
Copy link

@zhihangdeng zhihangdeng commented Jun 23, 2025

Description

Add some Dockerfile(s) for openEuler container image.
This update enables building and running OPEA components in an openEuler-based environment, improving compatibility and deployment options for users on openEuler systems.

Issues

n/a

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)
  • Others (enhancement, documentation, validation, etc.)

Dependencies

No new 3rd party runtime dependencies introduced.
Docker build will utilize openEuler base image and standard package sources.

Tests

  • Built the openEuler-based Docker image successfully.
  • Verified that all OPEA core services start and run correctly in the new container.
  • Basic integration tests passed inside the openEuler container.

@Copilot Copilot AI review requested due to automatic review settings June 23, 2025 09:17
Copy link

github-actions bot commented Jun 23, 2025

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Dockerfiles to enable building and running the ChatQnA application and its UI components on openEuler-based containers.

  • Introduced a multi-stage Dockerfile for the React UI using openEuler node and nginx images
  • Added a single-stage Dockerfile for the Svelte UI with openEuler node
  • Provided a base Dockerfile for the ChatQnA Python service on an openEuler-based image

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 6 comments.

File Description
ChatQnA/ui/docker/Dockerfile.react.openeuler Multi-stage build for React UI on openEuler
ChatQnA/ui/docker/Dockerfile.openeuler Build and preview Svelte UI on openEuler
ChatQnA/Dockerfile.openeuler Base container for ChatQnA Python service on openEuler

# SPDX-License-Identifier: Apache-2.0

# Use node 20.11.1 as the base image
FROM openeuler/node:latest as vite-app
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

Pin the Node.js base image to a specific version instead of using 'latest' to ensure reproducible and stable builds.

Suggested change
FROM openeuler/node:latest as vite-app
FROM openeuler/node:20.11.1 as vite-app

Copilot uses AI. Check for mistakes.

RUN ["npm", "run", "build"]


FROM openeuler/nginx:latest
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

Pin the nginx base image to a specific version rather than 'latest' to avoid unexpected upstream changes breaking deployments.

Suggested change
FROM openeuler/nginx:latest
FROM openeuler/nginx:1.21.6

Copilot uses AI. Check for mistakes.

Comment on lines +11 to +12
RUN ["npm", "install"]
RUN ["npm", "run", "build"]
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Combine install and build steps into a single RUN instruction (e.g., npm install && npm run build) to reduce layers and image size.

Suggested change
RUN ["npm", "install"]
RUN ["npm", "run", "build"]
RUN npm install && npm run build

Copilot uses AI. Check for mistakes.


ARG IMAGE_REPO=openeuler
ARG BASE_TAG=latest
FROM $IMAGE_REPO/comps-base:$BASE_TAG
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

The environment variable $HOME may not be set during build, causing files to land in an unintended location. Define ENV HOME=/root (or another directory) or use an explicit absolute path.

Suggested change
FROM $IMAGE_REPO/comps-base:$BASE_TAG
FROM $IMAGE_REPO/comps-base:$BASE_TAG
ENV HOME=/root

Copilot uses AI. Check for mistakes.


COPY ./chatqna.py $HOME/chatqna.py
COPY ./entrypoint.sh $HOME/entrypoint.sh

Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

Without a WORKDIR or absolute path, bash entrypoint.sh may not locate the script. Either set WORKDIR to the script's folder or invoke it with its full path (e.g., /root/entrypoint.sh).

Suggested change
WORKDIR $HOME

Copilot uses AI. Check for mistakes.

FROM $IMAGE_REPO/comps-base:$BASE_TAG

COPY ./chatqna.py $HOME/chatqna.py
COPY ./entrypoint.sh $HOME/entrypoint.sh
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

Ensure entrypoint.sh has execute permissions inside the image (e.g., add RUN chmod +x $HOME/entrypoint.sh) to avoid runtime permission errors.

Suggested change
COPY ./entrypoint.sh $HOME/entrypoint.sh
COPY ./entrypoint.sh $HOME/entrypoint.sh
RUN chmod +x $HOME/entrypoint.sh

Copilot uses AI. Check for mistakes.

Signed-off-by: zhihang <zhihangdeng@link.cuhk.edu.cn>
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.

1 participant