-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: easy-to-run docker compose setup for curio+forest #4848
Changes from all commits
fd43ab0
3e9a101
4da3429
30fccee
ce641b1
feec6c2
12fc089
9e8741c
5c69b4d
e15affc
e3a6a03
aab71c0
7112016
170d80f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Curio devnet image | ||
|
||
# Only build and publish this image on demand. | ||
# The compilation adds significant overhead to the CI and it is not supposed | ||
# to change very often (roughly once per per network upgrade; ~3-4 months). | ||
# This image is used in the local curio devnet. | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-push-docker-image: | ||
name: Build image and push to GHCR | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: List cached docker images | ||
run: docker image ls | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Login to Github Packages | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# This step yields the following labels | ||
# - latest, | ||
# - date+sha, e.g. 2023-01-19-da4692d, | ||
- name: Docker Meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/chainsafe/curio-devnet | ||
tags: | | ||
type=raw,value={{date 'YYYY-MM-DD'}}-{{sha}} | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
|
||
- name: Build image and push to GitHub Container Registry | ||
uses: docker/build-push-action@v6 | ||
with: | ||
file: ./scripts/devnet-curio/curio.dockerfile | ||
context: ./scripts/devnet-curio | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true | ||
- name: List docker images | ||
run: docker image ls | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,102 @@ | ||||||
##################################### | ||||||
ARG LOTUS_IMAGE | ||||||
# hadolint ignore=DL3006 | ||||||
FROM ${LOTUS_IMAGE} as lotus-test | ||||||
FROM golang:1.22.3-bullseye AS curio-builder | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to keep it as similar to the "official" curio build environment as possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The curio team uses |
||||||
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev | ||||||
|
||||||
ENV XDG_CACHE_HOME="/tmp" | ||||||
|
||||||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||||||
CARGO_HOME=/usr/local/cargo \ | ||||||
PATH=/usr/local/cargo/bin:$PATH \ | ||||||
RUST_VERSION=1.73.0 | ||||||
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||||||
|
||||||
RUN set -eux; \ | ||||||
dpkgArch="$(dpkg --print-architecture)"; \ | ||||||
case "${dpkgArch##*-}" in \ | ||||||
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c' ;; \ | ||||||
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='e189948e396d47254103a49c987e7fb0e5dd8e34b200aa4481ecc4b8e41fb929' ;; \ | ||||||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ | ||||||
esac; \ | ||||||
url="https://static.rust-lang.org/rustup/archive/1.25.1/${rustArch}/rustup-init"; \ | ||||||
wget --quiet "$url"; \ | ||||||
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ | ||||||
chmod +x rustup-init; \ | ||||||
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ | ||||||
rm rustup-init; \ | ||||||
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ | ||||||
rustup --version; \ | ||||||
cargo --version; \ | ||||||
rustc --version; | ||||||
|
||||||
RUN git clone --depth 1 --branch v1.23.1 https://github.com/filecoin-project/curio.git /opt/curio | ||||||
|
||||||
WORKDIR /opt/curio | ||||||
|
||||||
### make configurable filecoin-ffi build | ||||||
ARG FFI_BUILD_FROM_SOURCE=0 | ||||||
ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE} | ||||||
|
||||||
RUN make clean deps | ||||||
|
||||||
ARG RUSTFLAGS="" | ||||||
ARG GOFLAGS="" | ||||||
|
||||||
RUN make build | ||||||
|
||||||
##################################### | ||||||
FROM ubuntu:22.04 AS curio-all-in-one | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
RUN apt-get update && \ | ||||||
apt-get install -y --no-install-recommends dnsutils vim curl aria2 && \ | ||||||
apt-get clean && \ | ||||||
rm -rf /var/lib/apt/lists/* | ||||||
|
||||||
# Copy libraries and binaries from curio-builder | ||||||
COPY --from=curio-builder /etc/ssl/certs /etc/ssl/certs | ||||||
COPY --from=curio-builder /lib/*/libdl.so.2 /lib/ | ||||||
COPY --from=curio-builder /lib/*/librt.so.1 /lib/ | ||||||
COPY --from=curio-builder /lib/*/libgcc_s.so.1 /lib/ | ||||||
COPY --from=curio-builder /lib/*/libutil.so.1 /lib/ | ||||||
COPY --from=curio-builder /usr/lib/*/libltdl.so.7 /lib/ | ||||||
COPY --from=curio-builder /usr/lib/*/libnuma.so.1 /lib/ | ||||||
COPY --from=curio-builder /usr/lib/*/libhwloc.so.* /lib/ | ||||||
COPY --from=curio-builder /usr/lib/*/libOpenCL.so.1 /lib/ | ||||||
|
||||||
# Setup user and OpenCL configuration | ||||||
RUN useradd -r -u 532 -U fc && \ | ||||||
mkdir -p /etc/OpenCL/vendors && \ | ||||||
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd | ||||||
|
||||||
# Environment setup | ||||||
ENV FILECOIN_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters \ | ||||||
LOTUS_MINER_PATH=/var/lib/lotus-miner \ | ||||||
LOTUS_PATH=/var/lib/lotus \ | ||||||
CURIO_REPO_PATH=/var/lib/curio | ||||||
|
||||||
# Copy binaries and scripts | ||||||
COPY --from=lotus-test /usr/local/bin/lotus /usr/local/bin/ | ||||||
COPY --from=lotus-test /usr/local/bin/lotus-seed /usr/local/bin/ | ||||||
COPY --from=lotus-test /usr/local/bin/lotus-shed /usr/local/bin/ | ||||||
COPY --from=lotus-test /usr/local/bin/lotus-miner /usr/local/bin/ | ||||||
COPY --from=curio-builder /opt/curio/curio /usr/local/bin/ | ||||||
COPY --from=curio-builder /opt/curio/sptool /usr/local/bin/ | ||||||
|
||||||
# Set up directories and permissions | ||||||
RUN mkdir /var/tmp/filecoin-proof-parameters \ | ||||||
/var/lib/lotus \ | ||||||
/var/lib/lotus-miner \ | ||||||
/var/lib/curio && \ | ||||||
chown fc: /var/tmp/filecoin-proof-parameters /var/lib/lotus /var/lib/lotus-miner /var/lib/curio | ||||||
|
||||||
# Define volumes | ||||||
VOLUME ["/var/tmp/filecoin-proof-parameters", "/var/lib/lotus", "/var/lib/lotus-miner", "/var/lib/curio"] | ||||||
|
||||||
# Expose necessary ports | ||||||
EXPOSE 1234 2345 12300 4701 32100 | ||||||
|
||||||
CMD ["/bin/bash"] |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this built on every PR and subsequent commits? If so, it'd be better to save it, the same way we do with the Lotus Dockefiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to build on demand.