Skip to content

Commit

Permalink
Merge branch 'master' into prep/v1.6.0-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Jun 15, 2022
2 parents 4ba9561 + b391a09 commit 0647d0d
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/tag-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,17 @@ jobs:
--data-urlencode "link=$link" \
--data-urlencode "description=message:${{steps.vars.outputs.git_message}}, branch:${{steps.vars.outputs.branch}}, commit:${{steps.vars.outputs.short}}, tag:${{steps.vars.outputs.github_tag}}" \
--data-urlencode "version=${{steps.vars.outputs.short}}"
set -e
set -e
- name: Publish the Docker image
if: ${{ github.ref_type == 'tag' && github.event_name == 'create' }}
run: |
make docker-buildenv
make docker-runtime
docker build . --file dockerfile --tag filvenus/venus:latest
docker tag filvenus/venus:latest filvenus/venus:${{steps.vars.outputs.github_tag}}
docker login --username=filvenus --password ${{ secrets.DOCKER_PASSWORD }}
docker push filvenus/venus:${{steps.vars.outputs.github_tag}}
docker push filvenus/venus:latest
docker push filvenus/venus-runtime:latest
docker push filvenus/venus-buildenv:latest
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,16 @@ dist-clean:
build: $(BUILD_DEPS)
rm -f venus
go build -o ./venus $(GOFLAGS) .


.PHONY: docker


docker-buildenv:
docker build --build-arg https_proxy=$(BUILD_DOCKER_PROXY) -t filvenus/venus-buildenv -f docker/venus-buildenv.dockerfile .

docker-runtime:
docker build --build-arg https_proxy=$(BUILD_DOCKER_PROXY) -t filvenus/venus-runtime -f docker/venus-runtime.dockerfile .

docker:
docker build --build-arg https_proxy=$(BUILD_DOCKER_PROXY) -t venus .
11 changes: 11 additions & 0 deletions docker/script/compose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

echo $@

if [ $nettype = "calibnet" ];then
nettype="cali"
fi

echo "nettype:"
echo $nettype
./venus daemon --network=${nettype} --auth-url=http://127.0.0.1:8989 --import-snapshot /snapshot.car
14 changes: 14 additions & 0 deletions docker/venus-buildenv.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# build container stage
FROM golang:1.17 AS build-env

RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list


# download dependence
RUN apt-get update -y
RUN apt-get install -y \
mesa-opencl-icd ocl-icd-opencl-dev bzr jq pkg-config hwloc libhwloc-dev
RUN apt-get install -y \
gcc clang build-essential
RUN apt-get install -y \
make ncftp git curl wget
12 changes: 12 additions & 0 deletions docker/venus-runtime.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:20.04

# install dependence
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends ca-certificates curl vim telnet

# set time zone to Shanghai
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

# set charset
ENV LANG C.UTF-8
32 changes: 32 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM filvenus/venus-buildenv AS buildenv

COPY . ./venus
RUN export GOPROXY=https://goproxy.cn && cd venus && make
RUN cd venus && ldd ./venus


FROM filvenus/venus-runtime

# DIR for app
WORKDIR /app

# copy the app from build env
COPY --from=buildenv /go/venus/venus /app/venus
COPY ./docker/script /script

# copy ddl
COPY --from=buildenv /usr/lib/x86_64-linux-gnu/libhwloc.so.5 \
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1 \
/lib/x86_64-linux-gnu/libgcc_s.so.1 \
/lib/x86_64-linux-gnu/libutil.so.1 \
/lib/x86_64-linux-gnu/librt.so.1 \
/lib/x86_64-linux-gnu/libpthread.so.0 \
/lib/x86_64-linux-gnu/libm.so.6 \
/lib/x86_64-linux-gnu/libdl.so.2 \
/lib/x86_64-linux-gnu/libc.so.6 \
/usr/lib/x86_64-linux-gnu/libnuma.so.1 \
/usr/lib/x86_64-linux-gnu/libltdl.so.7 \
/lib/

EXPOSE 3453
ENTRYPOINT ["/app/venus","daemon"]

0 comments on commit 0647d0d

Please sign in to comment.