Skip to content

Commit

Permalink
Merge pull request #7956 from filecoin-project/nonsense/add-lotus-tes…
Browse files Browse the repository at this point in the history
…t-image-building

feat: infra/ci: add `lotus-test` image as CI build step
  • Loading branch information
magik6k authored Mar 21, 2022
2 parents a94e47c + fee69a8 commit efdcd00
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,11 @@ jobs:
default: "latest"
description: A comma-separated string containing docker image tags to build and push (default = latest)

target:
type: string
default: "lotus-all-in-one"
description: Docker target to build

steps:
- run:
name: Confirm that environment variables are set
Expand Down Expand Up @@ -667,6 +672,7 @@ jobs:
docker build \
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
--target <<parameters.target>> \
-f <<parameters.path>>/<<parameters.dockerfile>> \
$docker_tag_args \
<<parameters.path>>
Expand Down Expand Up @@ -1037,6 +1043,13 @@ workflows:
path: .
repo: lotus-dev
tag: '${CIRCLE_SHA1:0:8}'
target: lotus-all-in-one
- build-and-push-image:
dockerfile: Dockerfile.lotus
path: .
repo: lotus-test
tag: '${CIRCLE_SHA1:0:8}'
target: lotus-test
- publish-packer-mainnet:
requires:
- build-all
Expand Down
13 changes: 13 additions & 0 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,11 @@ jobs:
default: "latest"
description: A comma-separated string containing docker image tags to build and push (default = latest)

target:
type: string
default: "lotus-all-in-one"
description: Docker target to build

steps:
- run:
name: Confirm that environment variables are set
Expand Down Expand Up @@ -667,6 +672,7 @@ jobs:
docker build \
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
--target <<parameters.target>> \
-f <<parameters.path>>/<<parameters.dockerfile>> \
$docker_tag_args \
<<parameters.path>>
Expand Down Expand Up @@ -862,6 +868,13 @@ workflows:
path: .
repo: lotus-dev
tag: '${CIRCLE_SHA1:0:8}'
target: lotus-all-in-one
- build-and-push-image:
dockerfile: Dockerfile.lotus
path: .
repo: lotus-test
tag: '${CIRCLE_SHA1:0:8}'
target: lotus-test
- publish-packer-mainnet:
requires:
- build-all
Expand Down
45 changes: 45 additions & 0 deletions Dockerfile.lotus
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ WORKDIR /opt/filecoin
RUN make clean deps


FROM builder-local AS builder-test
MAINTAINER Lotus Development Team

WORKDIR /opt/filecoin

RUN make debug


FROM builder-local AS builder
MAINTAINER Lotus Development Team

Expand Down Expand Up @@ -198,6 +206,43 @@ RUN chown fc: /var/lib/lotus-worker
RUN chown fc: /var/lib/lotus-wallet


VOLUME /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/lotus
VOLUME /var/lib/lotus-miner
VOLUME /var/lib/lotus-worker
VOLUME /var/lib/lotus-wallet

EXPOSE 1234
EXPOSE 2345
EXPOSE 3456
EXPOSE 1777

###
from base as lotus-test

ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
ENV LOTUS_PATH /var/lib/lotus
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
ENV WALLET_PATH /var/lib/lotus-wallet

COPY --from=builder-test /opt/filecoin/lotus /usr/local/bin/
COPY --from=builder-test /opt/filecoin/lotus-miner /usr/local/bin/
COPY --from=builder-test /opt/filecoin/lotus-worker /usr/local/bin/
COPY --from=builder-test /opt/filecoin/lotus-seed /usr/local/bin/

RUN mkdir /var/tmp/filecoin-proof-parameters
RUN mkdir /var/lib/lotus
RUN mkdir /var/lib/lotus-miner
RUN mkdir /var/lib/lotus-worker
RUN mkdir /var/lib/lotus-wallet
RUN chown fc: /var/tmp/filecoin-proof-parameters
RUN chown fc: /var/lib/lotus
RUN chown fc: /var/lib/lotus-miner
RUN chown fc: /var/lib/lotus-worker
RUN chown fc: /var/lib/lotus-wallet


VOLUME /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/lotus
VOLUME /var/lib/lotus-miner
Expand Down

0 comments on commit efdcd00

Please sign in to comment.