Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature' into personal/yfei/es-h…
Browse files Browse the repository at this point in the history
…ybrid
  • Loading branch information
moria97 committed Jun 3, 2024
2 parents af1f477 + 447f014 commit c922241
Show file tree
Hide file tree
Showing 13 changed files with 631 additions and 244 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
branches: ["feature"]

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: registry.cn-beijing.aliyuncs.com

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- uses: aliyun/acr-login@v1
with:
login-server: "https://${{ env.REGISTRY }}"
username: ${{ secrets.ACR_USER }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Build and push image
env:
IMAGE_TAG: pairag_0.0.1
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/aigc_apps:$IMAGE_TAG .
docker push ${{ env.REGISTRY }}/mybigpai/aigc_apps:$IMAGE_TAG
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM python:3.10-slim AS builder

RUN pip3 install poetry

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

WORKDIR /app
COPY . .

RUN poetry install && rm -rf $POETRY_CACHE_DIR

FROM python:3.10-slim AS prod
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"

RUN apt-get update && apt-get install -y libgl1 libglib2.0-0

WORKDIR /app
COPY . .
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENTRYPOINT ["pai_rag", "run"]
35 changes: 0 additions & 35 deletions docker/Dockerfile

This file was deleted.

48 changes: 0 additions & 48 deletions docker/README.md

This file was deleted.

Empty file removed docker/data_loader/Dockerfile
Empty file.
Loading

0 comments on commit c922241

Please sign in to comment.