-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af06ae8
commit 9e7c3f2
Showing
9 changed files
with
91 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:18.04 as builder | ||
FROM wedpr_component_vcpkg_cache:latest as builder | ||
|
||
LABEL maintainer [email protected] | ||
|
||
|
@@ -8,26 +8,12 @@ ARG SOURCE_BRANCH | |
ENV DEBIAN_FRONTEND=noninteractive \ | ||
SOURCE=${SOURCE_BRANCH:-master} | ||
|
||
RUN apt-get -q update && apt-get install -qy --no-install-recommends \ | ||
vim curl git make build-essential cmake \ | ||
libgmp-dev flex bison patch libzstd-dev unzip ninja-build pkg-config curl zip tar ccache uuid-runtime automake autoconf \ | ||
m4 tcpdump net-tools libkrb5-dev krb5-user pkg-config default-libmysqlclient-dev gcc g++ \ | ||
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& apt-get install -qy --no-install-recommends tzdata \ | ||
&& dpkg-reconfigure --frontend noninteractive tzdata \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# install rust | ||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y | ||
|
||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
ENV VCPKG_FORCE_SYSTEM_BINARIES=1 | ||
|
||
RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component.git --recursive --depth=1 -b ${SOURCE} \ | ||
&& mkdir -p WeDPR-Component/cpp/build && cd WeDPR-Component/cpp/build \ | ||
&& cmake .. -DBUILD_STATIC=ON && make -j8 && cat /WeDPR-Component/cpp/build/*.log | ||
|
||
RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component.git --recursive --depth=1 -b ${SOURCE} \ | ||
# ln the cached vcpkg and compile | ||
RUN cd WeDPR-Component/cpp && rm -rf vcpkg && ln -s /vcpkg \ | ||
&& mkdir -p build && cd build \ | ||
&& cmake .. -DBUILD_STATIC=ON \ | ||
&& make -j8 | ||
|
||
FROM ubuntu:18.04 as wedpr-gateway-service | ||
LABEL maintainer [email protected] | ||
|
@@ -44,7 +30,6 @@ COPY --from=builder /WeDPR-Component/cpp/build/bin/ppc-gateway-service /data/hom | |
|
||
ENTRYPOINT ["/data/home/wedpr/wedpr-gateway-service/ppc-gateway-service", "-c", "config.ini"] | ||
|
||
|
||
FROM ubuntu:18.04 as wedpr-pro-node-service | ||
LABEL maintainer [email protected] | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
echo "========= BUILD IMAGES for WEDPR-COMPONENT, BRANCH: ${1} =========" | ||
|
||
echo "* build wedpr-gateway-service image" | ||
docker build --target wedpr-gateway-service --build-arg SOURCE_BRANCH=${1} -t wedpr-gateway-service . | ||
echo "* build wedpr-gateway-service image success" | ||
|
||
echo "* build wedpr-pro-node-service image" | ||
docker build --target wedpr-pro-node-service --build-arg SOURCE_BRANCH=${1} -t wedpr-pro-node-service . | ||
echo "* build wedpr-pro-node-service image success" | ||
|
||
echo "* build wedpr-mpc-service image" | ||
docker build --target wedpr-mpc-service --build-arg SOURCE_BRANCH=${1} -t wedpr-mpc-service . | ||
echo "* build wedpr-mpc-service image success" | ||
|
||
echo "========= BUILD IMAGES for WEDPR-COMPONENT, BRANCH: ${1} =========" |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM ubuntu:18.04 as wedpr_component_vcpkg_cache | ||
|
||
LABEL maintainer [email protected] | ||
|
||
WORKDIR / | ||
|
||
ARG SOURCE_BRANCH | ||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
SOURCE=${SOURCE_BRANCH:-master} | ||
|
||
RUN apt-get -q update && apt-get install -qy --no-install-recommends \ | ||
vim curl git make build-essential cmake \ | ||
libgmp-dev flex bison patch libzstd-dev unzip ninja-build pkg-config curl zip tar ccache uuid-runtime automake autoconf \ | ||
m4 tcpdump net-tools libkrb5-dev krb5-user pkg-config default-libmysqlclient-dev gcc g++ \ | ||
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& apt-get install -qy --no-install-recommends tzdata \ | ||
&& dpkg-reconfigure --frontend noninteractive tzdata \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# install rust | ||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y | ||
|
||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
ENV VCPKG_FORCE_SYSTEM_BINARIES=1 | ||
|
||
# first download and compile the vcpkg dependecies | ||
RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component.git --recursive --depth=1 -b ${SOURCE} \ | ||
&& mkdir -p WeDPR-Component/cpp/build && cd WeDPR-Component/cpp/build \ | ||
&& cmake .. -DBUILD_STATIC=ON \ | ||
|
||
# move the vcpkg dependecies to /vcpkg | ||
RUN mv /WeDPR-Component/cpp/vcpkg / | ||
|
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
echo "* build image: wedpr_component_vcpkg_cache, branch: ${1}" | ||
docker build --build-arg SOURCE_BRANCH=${1} -t wedpr_component_vcpkg_cache . | ||
echo "* build image: wedpr_component_vcpkg_cache success, branch: ${1}" |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM wedpr-image:latest as wedpr-model-service-base-image | ||
|
||
LABEL maintainer [email protected] | ||
|
||
RUN apt-get install -qy --no-install-recommends libkrb5-dev pkg-config default-libmysqlclient-dev | ||
RUN mkdir -p /data/home/wedpr | ||
# copy requirements | ||
COPY depends/requirements.txt /data/home/wedpr/requirements.txt | ||
|
||
# install the requirements | ||
RUN pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ -r /data/home/wedpr/requirements.txt |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
echo "* build image: wedpr-model-service-base-image" | ||
docker build -t wedpr-model-service-base-image . | ||
echo "* build image: wedpr-model-service-base-image success" |
File renamed without changes.
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,5 +1,4 @@ | ||
FROM wedpr-image:latest as wedpr-model-service | ||
|
||
FROM wedpr-model-service-base-image:latest as wedpr-model-service | ||
LABEL maintainer [email protected] | ||
|
||
ENV LANG zh_CN.UTF-8 | ||
|
@@ -9,23 +8,20 @@ ENV LC_ALL zh_CN.UTF-8 | |
WORKDIR /data/home/wedpr | ||
ARG SOURCE_BRANCH | ||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
SOURCE=${SOURCE_BRANCH:-master} | ||
|
||
RUN mkdir -p /data/home/wedpr | ||
# copy requirements | ||
COPY depends/requirements.txt /data/home/wedpr/requirements.txt | ||
SOURCE=${SOURCE_BRANCH:-main} | ||
|
||
# install the requirements | ||
RUN pip install --no-cache-dir -i https://pypi.mirrors.ustc.edu.cn/simple/ -r /data/home/wedpr/requirements.txt | ||
# install the gateway sdk | ||
# TODO: replace with pypip | ||
RUN pip install -i https://test.pypi.org/simple/ wedpr-python-gateway-sdk | ||
|
||
# obtain the source | ||
RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component.git --recursive --depth=1 -b ${SOURCE} | ||
# obtain the source, no need to fetch the submodule(vcpkg) here | ||
RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component.git -b ${SOURCE} | ||
# move the files to the /data/app path | ||
RUN mkdir -p /data/home/wedpr/wedpr-model/ \ | ||
&& mv /data/home/wedpr/WeDPR-Component/python/ppc_common /data/home/wedpr/wedpr-model/ppc-common \ | ||
&& mv /data/home/wedpr/WeDPR-Component/python/ppc_model /data/home/wedpr/wedpr-model/ppc-model \ | ||
&& mv /data/home/wedpr/WeDPR-Component/python/aes_key.bin /data/home/wedpr/wedpr-model/ppc-model \ | ||
&& cp /data/home/wedpr/model/ppc-model/tools/*.sh /data/home/wedpr/wedpr-model/ppc-model | ||
&& mv /data/home/wedpr/WeDPR-Component/python/ppc_common /data/home/wedpr/wedpr-model/ppc_common \ | ||
&& mv /data/home/wedpr/WeDPR-Component/python/ppc_model /data/home/wedpr/wedpr-model/ppc_model \ | ||
&& mv /data/home/wedpr/WeDPR-Component/python/aes_key.bin /data/home/wedpr/wedpr-model/ppc_model \ | ||
&& cp /data/home/wedpr/WeDPR-Component/Python/ppc_model/tools/*.sh /data/home/wedpr/wedpr-model/ppc_model | ||
|
||
# clear the WeDPR-Component | ||
RUN rm -rf /data/home/wedpr/WeDPR-Component | ||
|
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
echo "* build image: wedpr-model-service, branch: ${1}" | ||
docker build --build-arg SOURCE_BRANCH=${1} -t wedpr-model-service . | ||
echo "* build image: wedpr-model-service success, branch: ${1}" |