From 6a96521252c10b6acabf133a08fa08747bf08f11 Mon Sep 17 00:00:00 2001 From: vector Date: Thu, 28 Mar 2024 22:01:55 +0800 Subject: [PATCH] chore: add 1.5 image (#42) --- .circleci/config.yml | 22 ++++++++++++---- docker/app/Dockerfile.dev | 55 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 docker/app/Dockerfile.dev diff --git a/.circleci/config.yml b/.circleci/config.yml index 417cc4f..4fbf7ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,9 @@ jobs: tag: type: string default: latest + file: + type: string + default: docker/app/Dockerfile steps: - checkout @@ -29,7 +32,7 @@ jobs: docker buildx build \ --platform=<< parameters.platform >> \ - -f docker/app/Dockerfile \ + -f << parameters.file >> \ -t ${IMAGE_NAME} \ --progress=plain \ . @@ -49,13 +52,22 @@ workflows: - main platform: linux/amd64 tag: unstable-amd64 - - devcontainer-publish-arm64: + devcontainer-publish-dev-1.5: jobs: - devcontainer-publish: filters: branches: only: - main - platform: linux/arm64 - tag: unstable-arm64 + platform: linux/amd64 + tag: 1.5.0.dev + file: docker/app/Dockerfile.dev + # devcontainer-publish-arm64: + # jobs: + # - devcontainer-publish: + # filters: + # branches: + # only: + # - main + # platform: linux/arm64 + # tag: unstable-arm64 diff --git a/docker/app/Dockerfile.dev b/docker/app/Dockerfile.dev new file mode 100644 index 0000000..4e8d01c --- /dev/null +++ b/docker/app/Dockerfile.dev @@ -0,0 +1,55 @@ +# doesn't support linux/arm64 + +FROM alpine:3.14 as source-tree + +RUN apk add --no-cache git +COPY . /repo +RUN git init \ + && git clean -fX . \ + && rm -rf .git \ + && rm -r /repo/docker + +FROM secretflow/devcontainer-web:latest as build + +ENV CI=true + +USER root +WORKDIR /repo + +COPY --from=source-tree /repo/pnpm-lock.yaml /repo/.npmrc /repo/ + +RUN pnpm fetch + +COPY --from=source-tree /repo /repo + +RUN pnpm install --frozen-lockfile --offline +# RUN rye sync --no-dev --no-lock --all-features + +RUN pnpm exec nx run-many -t build:js -t build:py + +RUN apt-get update && apt-get install -y rsync +RUN rsync -avm --include='pyprojects/**/dist/*.whl' -f 'hide,! */' /repo/./ /dist + +FROM secretflow/secretflow-anolis8:1.5.0.dev20240321 + +COPY --from=build /dist /dist + +RUN pip install /dist/pyprojects/secretnote/dist/*.whl + +WORKDIR /root + +RUN curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - +RUN yum install -y nodejs +RUN npm install @difizen/libro-analyzer + +COPY ./docker/app/root/scripts /root/scripts +COPY ./docker/app/root/.jupyter /root/.jupyter + +RUN mkdir workspace + +ENV SELF_PARTY=alice +ENV ALL_PARTIES=alice + +EXPOSE 8888 + +ENTRYPOINT [ "/root/scripts/start.sh" ]