-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: optimize docker image build and libro's deps version control (#60
) * docs: update docs * chore: debug ci * chore: debug ci * chore: optimize docker build and version lock * refactor: handle ci errors * refactor: fix ci issues
- Loading branch information
Showing
25 changed files
with
3,573 additions
and
3,336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,6 @@ pnpm-lock.yaml | |
|
||
# template | ||
**/template | ||
|
||
# JSON | ||
**/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,50 @@ | ||
FROM alpine:3.14 as source-tree | ||
# This Dockerfile will build the secretflow/secretnote image for depolying a node | ||
# for SecretNote. | ||
|
||
# Get the repository and remove unncessary files | ||
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:amd64-v2 as build | ||
|
||
# Build the project | ||
FROM nikolaik/python-nodejs:python3.10-nodejs18 AS build | ||
ENV CI=true | ||
|
||
USER root | ||
WORKDIR /repo | ||
|
||
RUN npm config set registry https://registry.npmmirror.com | ||
RUN npm install -g pnpm@9.4.0 | ||
RUN pip install build --break-system-packages | ||
COPY --from=source-tree /repo/pnpm-lock.yaml /repo/.npmrc /repo/ | ||
|
||
RUN pnpm fetch | ||
|
||
COPY --from=source-tree /repo /repo | ||
|
||
RUN pnpm install --no-frozen-lockfile | ||
|
||
RUN cargo install gcc | ||
RUN pnpm exec nx run-many -t build:js -t build:py | ||
|
||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm run ci:build | ||
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.6.1b0 | ||
|
||
# Config the runtime | ||
# TODO Update the version here | ||
FROM secretflow/secretflow-anolis8:1.9.0b0 | ||
RUN python --version | ||
RUN useradd -m secretnote | ||
|
||
COPY --from=build /dist /dist | ||
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ | ||
RUN pip install /dist/pyprojects/secretnote/dist/*.whl | ||
|
||
WORKDIR /home/secretnote | ||
|
||
COPY ./docker/app/root/ ./ | ||
|
||
RUN curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - | ||
RUN yum install -y nodejs | ||
RUN npm config set registry https://registry.npmmirror.com | ||
RUN npm install @difizen/libro-analyzer | ||
|
||
RUN npm install @difizen/libro-analyzer@0.1.2 | ||
RUN mkdir workspace | ||
|
||
RUN chown -R secretnote:secretnote /home/secretnote | ||
USER secretnote | ||
|
||
|
||
# Start the project | ||
ENV SELF_PARTY=alice | ||
ENV ALL_PARTIES=alice,bob | ||
|
||
EXPOSE 8888 | ||
|
||
ENTRYPOINT [ "/home/secretnote/scripts/start.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.