Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "ghcr.io/dfinity/ic-dev@sha256:16f8614341dee3f04e528262a6e23b94a524cd33e543908eccf8fb8b9cda8f27",
"image": "ghcr.io/dfinity/ic-dev@sha256:b001f2fa9ed28fc86b055879303a9dbcf3d20d0cc0625504941b855f5a688ed6",
"remoteUser": "ubuntu",
"privileged": true,
"runArgs": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api-bn-recovery-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on:
labels: dind-large
container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host
--mount type=tmpfs,target="/home/buildifier/.local/share/containers"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: &dind-large-setup
labels: dind-large
container: &container-setup
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 90
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pr-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: &dind-small-setup
labels: dind-small
container: &container-setup
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --mount type=tmpfs,target="/tmp/containers"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container-api-bn-recovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on:
labels: dind-large
container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host
--mount type=tmpfs,target="/home/buildifier/.local/share/containers"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container-scan-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on:
labels: dind-large
container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 60
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pocket-ic-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
bazel-build-pocket-ic:
name: Bazel Build PocketIC
container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 90
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rate-limits-backend-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
labels: dind-large

container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host -v /var/tmp:/var/tmp -v /ceph-s3-info:/ceph-s3-info --mount type=tmpfs,target="/tmp/containers"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: &dind-large-setup
labels: dind-large
container: &container-setup
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 180
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rosetta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on:
labels: dind-large
container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host --mount type=tmpfs,target="/tmp/containers"
environment: DockerHub
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/salt-sharing-canister-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
labels: dind-large

container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host -v /var/tmp:/var/tmp -v /ceph-s3-info:/ceph-s3-info --mount type=tmpfs,target="/tmp/containers"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: &dind-large-setup
labels: dind-large
container: &container-setup
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 720 # 12 hours
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-rust-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# see linux-x86-64 runner group
labels: rust-benchmarks
container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
# running on bare metal machine using ubuntu user
options: --user ubuntu --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 720 # 12 hours
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/system-tests-benchmarks-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on:
labels: dind-large
container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 480
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-mainnet-canister-revisions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
labels: dind-small
environment: CREATE_PR
container:
image: ghcr.io/dfinity/ic-build@sha256:ac24f205995a1c36921bb8606e0ee16b8b26d73be7dd0cac786c6882f3569680
image: ghcr.io/dfinity/ic-build@sha256:d7f562394dc9f2b801d7d9154f3a276a156d01d03a39fb37da5848bc116d1b36
options: >-
-e NODE_NAME --privileged --cgroupns host -v /var/tmp:/var/tmp -v /ceph-s3-info:/ceph-s3-info --mount type=tmpfs,target="/tmp/containers"
env:
Expand Down
73 changes: 42 additions & 31 deletions ci/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,29 @@ FROM ghcr.io/dfinity/library/ubuntu@sha256:985be7c735afdf6f18aaa122c23f87d989c30
ENV TZ=UTC
RUN export DEBIAN_FRONTEND=noninteractive && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# copy/write config files
ARG PACKAGE_FILE=ci/container/files/packages.common
COPY ${PACKAGE_FILE} /tmp/
COPY ./ci/container/files/gitconfig /etc/gitconfig
COPY ./ci/container/files/containers.conf /etc/containers/containers.conf
RUN echo "[storage]\nrootless_storage_path=\"/tmp/containers\"" > /etc/containers/storage.conf
# marker for scripts to check if they are running in this container
RUN touch /home/ubuntu/.ic-build-container

RUN apt -yq update && \
apt -yqq install $(sed -e "s/#.*//" "/tmp/$(basename $PACKAGE_FILE)") && \
rm "/tmp/$(basename $PACKAGE_FILE)"
apt -yqq install --no-install-recommends ca-certificates curl sudo gnupg git build-essential zlib1g-dev

# AFLplusplus build image
FROM base as afl

# Install AFLplusplus for fuzzing
# LLVM is only a build time dependency now since we link the fuzzer lib from the hermetic toolchain directly
ARG AFLPLUSPLUS_RELEASE_VERSION=v4.35c
ARG LLVM_VERSION=21
RUN curl -L "https://apt.llvm.org/llvm-snapshot.gpg.key" | apt-key add - && \
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main" | tee -a /etc/apt/sources.list.d/llvm.list && \
apt -yq update && \
apt -yqq install --no-install-recommends lld-${LLVM_VERSION} llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev clang-${LLVM_VERSION} libclang-rt-${LLVM_VERSION}-dev && \
mkdir -p /afl && \
chown -R ubuntu:ubuntu /afl && \
cd /afl && \
git clone --depth=1 --branch=${AFLPLUSPLUS_RELEASE_VERSION} https://github.com/AFLplusplus/AFLplusplus.git && \
cd AFLplusplus && \
STATIC=1 LLVM_CONFIG=/usr/bin/llvm-config-${LLVM_VERSION} CC=/usr/bin/clang-${LLVM_VERSION} CXX=/usr/bin/clang++-${LLVM_VERSION} make all && \
STATIC=1 LLVM_CONFIG=/usr/bin/llvm-config-${LLVM_VERSION} CC=/usr/bin/clang-${LLVM_VERSION} CXX=/usr/bin/clang++-${LLVM_VERSION} make install

FROM base as build

## Because the container is used for both CI and development, we need to have a user that matches the UID of the runner (1001) and a user that matches the UID of ubuntu (1000)
RUN groupadd -g 1001 buildifier && useradd -ms /bin/bash -u 1001 -g 1001 -G ubuntu buildifier && \
Expand Down Expand Up @@ -59,24 +70,6 @@ RUN curl -sSL "https://github.com/rui314/mold/releases/download/v${MOLD_VERSION}
ARG motoko_version=0.16.3
RUN curl -fsSL https://github.com/dfinity/motoko/releases/download/${motoko_version}/motoko-linux-x86_64-${motoko_version}.tar.gz | tar -xz -C /usr/local/bin && chmod +x /usr/local/bin/moc

# Install AFLplusplus for fuzzing
# LLVM is only a build time dependency now since we link the fuzzer lib from the hermetic toolchain directly
ARG AFLPLUSPLUS_RELEASE_VERSION=v4.35c
ARG LLVM_VERSION=21
RUN curl -L "https://apt.llvm.org/llvm-snapshot.gpg.key" | apt-key add - && \
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main" | tee -a /etc/apt/sources.list.d/llvm.list && \
apt -yq update && \
apt -yqq install --no-install-recommends lld-${LLVM_VERSION} llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev clang-${LLVM_VERSION} libclang-rt-${LLVM_VERSION}-dev && \
mkdir -p /afl && \
chown -R ubuntu:ubuntu /afl && \
cd /afl && \
git clone --depth=1 --branch=${AFLPLUSPLUS_RELEASE_VERSION} https://github.com/AFLplusplus/AFLplusplus.git && \
cd AFLplusplus && \
STATIC=1 LLVM_CONFIG=/usr/bin/llvm-config-${LLVM_VERSION} CC=/usr/bin/clang-${LLVM_VERSION} CXX=/usr/bin/clang++-${LLVM_VERSION} make all && \
STATIC=1 LLVM_CONFIG=/usr/bin/llvm-config-${LLVM_VERSION} CC=/usr/bin/clang-${LLVM_VERSION} CXX=/usr/bin/clang++-${LLVM_VERSION} make install && \
mv afl-fuzz afl-showmap /afl && \
cd .. && rm -rf AFLplusplus

# install cargo with the ubuntu user
USER ubuntu
ENV PATH=/ic/bin:/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:$PATH
Expand All @@ -99,11 +92,29 @@ USER root
WORKDIR /
CMD ["/bin/bash"]

FROM base as build

# copy/write config files

ARG PACKAGE_FILE=ci/container/files/packages.common
COPY ${PACKAGE_FILE} /tmp/
RUN apt -yqq install $(sed -e "s/#.*//" "/tmp/$(basename $PACKAGE_FILE)") && \
rm "/tmp/$(basename $PACKAGE_FILE)"
COPY ./ci/container/files/gitconfig /etc/gitconfig
COPY ./ci/container/files/containers.conf /etc/containers/containers.conf
RUN echo hello
RUN echo "[storage]\nrootless_storage_path=\"/tmp/containers\"" > /etc/containers/storage.conf

# copy executables built elsewhere
COPY --from=afl /usr/local/bin/afl-fuzz /usr/local/bin/afl-fuzz

# marker for scripts to check if they are running in this container
RUN touch /home/ubuntu/.ic-build-container

USER buildifier

FROM base as dev
FROM build as dev

USER root

# Add zshrc generated from zsh-newuser-install (option 2)
COPY --chown=ubuntu:ubuntu ./ci/container/files/zshrc /home/ubuntu/.zshrc
Expand Down
2 changes: 1 addition & 1 deletion ci/container/TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d0dbd29b1eb7ca6666e77fde4ca0c785293974ac02bdab3c0dfe14e91f7e657a
1c7befc831d88679bfe678cf9cea6a2f447bab0c2e85e98690ad5e69cf3b54cf
Loading