From be777c4cb5df5535be2f051ddbcda079c4ca99ed Mon Sep 17 00:00:00 2001 From: newbyvector Date: Wed, 26 Jun 2024 10:37:58 +0800 Subject: [PATCH] chore: optimize 1.6.1 image --- docker/app/Dockerfile | 9 +++------ docker/app/root/scripts/start.sh | 6 +++++- docker/sim/docker-compose.yml | 20 ++++++++++---------- package.json | 2 +- pyprojects/secretnote/pyproject.toml | 1 - 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docker/app/Dockerfile b/docker/app/Dockerfile index 1cc8c68..308efca 100644 --- a/docker/app/Dockerfile +++ b/docker/app/Dockerfile @@ -30,19 +30,16 @@ RUN apt-get update && apt-get install -y rsync RUN rsync -avm --include='pyprojects/**/dist/*.whl' -f 'hide,! */' /repo/./ /dist -FROM python:3.10-slim-bullseye +FROM secretflow/secretflow-anolis8:1.6.1b0 COPY --from=build /dist /dist -RUN apt update -RUN apt install -y build-essential - RUN pip install /dist/pyprojects/secretnote/dist/*.whl WORKDIR /root -RUN apt install -y nodejs -RUN apt install -y npm +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/ /root/ diff --git a/docker/app/root/scripts/start.sh b/docker/app/root/scripts/start.sh index 4ddd2e6..5e3f473 100755 --- a/docker/app/root/scripts/start.sh +++ b/docker/app/root/scripts/start.sh @@ -7,4 +7,8 @@ ray start \ --disable-usage-stats \ --resources="{\"$SELF_PARTY\": 4}" -secretnote --allow-root --no-browser +if [ -z "${PORT}" ]; then + PORT=8888 +fi + +secretnote --allow-root --no-browser --port $PORT diff --git a/docker/sim/docker-compose.yml b/docker/sim/docker-compose.yml index e5b8900..176fbcb 100644 --- a/docker/sim/docker-compose.yml +++ b/docker/sim/docker-compose.yml @@ -1,22 +1,22 @@ services: alice: - image: 'secretflow/secretnote:1.3.0-amd64' + image: 'secretflow/secretnote:1.6.1-amd64' platform: linux/amd64 environment: - SELF_PARTY=alice - - ALL_PARTIES=alice,bob + - PORT=8090 ports: - # SecretNote - - 8090:8888 - entrypoint: /root/scripts/start.sh + - 8090:8090 + volumes: + - ./alice:/root/workspace bob: - image: 'secretflow/secretnote:1.3.0-amd64' + image: 'secretflow/secretnote:1.6.1-amd64' platform: linux/amd64 environment: - SELF_PARTY=bob - - ALL_PARTIES=alice,bob + - PORT=8092 ports: - # SecretNote - - 8092:8888 - entrypoint: /root/scripts/start.sh + - 8092:8092 + volumes: + - ./bob:/root/workspace diff --git a/package.json b/package.json index 6d0ff78..28b57a6 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "ci:check:javascript": "nx run-many -t format:prettier -t lint:eslint -t lint:stylelint -t test:vitest -t typecheck:tsc", "ci:check:python": "nx run-many -t format:black -t lint:ruff -t test:pytest -t typecheck:pyright", "ci:build": "nx run-many -t build:js -t build:py", - "docker:build": "docker build --build-arg version=1.3.0b0 -t secretflow/secretnote:1.3.0-amd64 -f ./docker/app/Dockerfile .", + "docker:build": "docker build -t secretflow/secretnote:1.6.1-amd64 -f ./docker/app/Dockerfile .", "docker:up": "docker-compose -f ./docker/sim/docker-compose.yml up" }, "nx": {}, diff --git a/pyprojects/secretnote/pyproject.toml b/pyprojects/secretnote/pyproject.toml index 02b04ef..77eb14a 100644 --- a/pyprojects/secretnote/pyproject.toml +++ b/pyprojects/secretnote/pyproject.toml @@ -32,7 +32,6 @@ dependencies = [ "python-lsp-server==1.8.2", # https://github.com/python/typing_extensions/issues/369#issuecomment-2051331676 "typing_extensions>=4.6", - "secretflow==1.6.1b0" ] description = "Notebook suite for SecretFlow" dynamic = ["version"]