Skip to content
Open
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-build@sha256:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b",
"image": "ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7",
"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:2caf6df6009b29ede72a520b60f3db064324e22192be532349caa82a987f8c50
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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 @@ -26,7 +26,7 @@ jobs:
runs-on: &dind-large-setup
labels: dind-large
container: &container-setup
image: ghcr.io/dfinity/ic-build@sha256:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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:2caf6df6009b29ede72a520b60f3db064324e22192be532349caa82a987f8c50
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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 @@ -32,7 +32,7 @@ jobs:
runs-on: &dind-large-setup
labels: dind-large
container: &container-setup
image: ghcr.io/dfinity/ic-build@sha256:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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 @@ -20,7 +20,7 @@ jobs:
runs-on: &dind-large-setup
labels: dind-large
container: &container-setup
image: ghcr.io/dfinity/ic-build@sha256:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
# 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/schedule-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on:
labels: dind-large
container:
image: ghcr.io/dfinity/ic-build@sha256:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
options: >-
-e NODE_NAME --mount type=tmpfs,target="/tmp/containers"
timeout-minutes: 60 # 1 hour
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:15e6eca52d696697a681916c92ab3623ebff1fcff70156220b0270c2985a6b2b
image: ghcr.io/dfinity/ic-build@sha256:2157bda72421ff05104e22333a5c1271faa41b575d7d9045930ec97494afbce7
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
18 changes: 3 additions & 15 deletions ci/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ RUN curl -fsSL https://github.com/FiloSottile/mkcert/releases/download/v${mkcert
echo "$mkcert_sha /usr/local/bin/mkcert" | sha256sum --check && \
chmod +x /usr/local/bin/mkcert

ARG bazelisk_sha=fd8fdff418a1758887520fa42da7e6ae39aefc788cf5e7f7bb8db6934d279fc4
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64 -o /usr/bin/bazel && \
ARG bazelisk_sha=22e7d3a188699982f661cf4687137ee52d1f24fec1ec893d91a6c4d791a75de8
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.28.1/bazelisk-linux-amd64 -o /usr/bin/bazel && \
echo "$bazelisk_sha /usr/bin/bazel" | sha256sum --check && \
chmod 777 /usr/bin/bazel

Expand Down Expand Up @@ -84,22 +84,10 @@ RUN curl -L "https://apt.llvm.org/llvm-snapshot.gpg.key" | apt-key add - && \
mv afl-fuzz afl-showmap /afl && \
cd .. && rm -rf AFLplusplus

# Pre-populate the Bazel installation for root
# (note: this is only used for bash completion; the actual bazel version comes from bazelisk)
COPY .bazelversion /tmp/bazel/
RUN cd /tmp/bazel && bazel version

COPY ./ci/container/files/generate-bazel-completion.sh /tmp/
RUN USE_BAZEL_VERSION=$(tail -1 /tmp/bazel/.bazelversion) /tmp/generate-bazel-completion.sh && \
echo "source /etc/bash_completion.d/bazel" >>/etc/bash.bashrc

USER ubuntu
# Set PATH for ubuntu user
ENV PATH=/ic/bin:/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:$PATH

# Pre-populate the Bazel installation for ubuntu
RUN cd /tmp/bazel && bazel version

# Add Rust/Cargo support
RUN mkdir -p /tmp/rust-version/
COPY rust-toolchain.toml /tmp/rust-version/rust-toolchain.toml
Expand Down Expand Up @@ -141,4 +129,4 @@ RUN apt -yq update && \
apt -yqq install $(sed -e "s/#.*//" "/tmp/$(basename $PACKAGE_DEV_FILE)") && \
rm "/tmp/$(basename $PACKAGE_DEV_FILE)"

USER $CI_USER
USER $CI_USER
2 changes: 1 addition & 1 deletion ci/container/TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
78f43e9dc76effbe2569e56b3cd6ed40d94a68d0488eb1127245de97bc42dfd6
d6be76135e33664d3232e5476a6707d7c3bf9fc9fa5407b3496a444d2e16a7f8
29 changes: 16 additions & 13 deletions ci/container/container-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,17 @@ while test $# -gt $CTR; do
esac
done

# option to pass in another shell if desired
if [ $# -eq 0 ]; then
cmd=("${USHELL:-/usr/bin/bash}")
# if no command is specified, create an shell
if [ -z "${USHELL:-}" ] || [ "$USHELL" == "bash" ]; then
# bit of a hack: we source the completion by passing it as an rcfile.
# The completion itself requires `.bazelversion` to exist.
# We avoid generating the completion in the container _build_ so that
# the container itself does not depend on the bazel version.
cmd=("/usr/bin/bash" -c "exec bash --rcfile <(bazel completion bash)")
else
cmd=("$USHELL")
fi
else
cmd=("$@")
fi
Expand Down Expand Up @@ -134,6 +142,8 @@ USER=$(whoami)

PODMAN_RUN_ARGS=(
-w "$WORKDIR"
--rm # remove container after it ran
--log-driver=none # by default podman logs all of stdout to the journal which is resource-consuming and wasteful

-u "ubuntu:ubuntu"
-e HOSTUSER="$USER"
Expand Down Expand Up @@ -225,21 +235,14 @@ else
eprintln "No ssh-agent to forward."
fi

# Omit -t if not a tty.
# Also shut up logging, because podman will by default log
# every byte of standard output to the journal, and that
# destroys the journal + wastes enormous amounts of CPU.
# I witnessed journald and syslog peg 2 cores of my devenv
# when running a simple cat /path/to/file.
# if a user is attached, make it interactive and create tty
if tty >/dev/null 2>&1; then
tty_arg=-t
else
tty_arg=
PODMAN_RUN_ARGS+=(-i -t)
fi

# Privileged rootful podman is required due to requirements of IC-OS guest build;
# additionally, we need to use hosts's cgroups and network.
OTHER_ARGS=(--pids-limit=-1 -i $tty_arg --log-driver=none --rm --privileged --network=host --cgroupns=host)
PODMAN_RUN_ARGS+=(--pids-limit=-1 --privileged --network=host --cgroupns=host)

if [ -f "$HOME/.container-run.conf" ]; then
# conf file with user's custom PODMAN_RUN_USR_ARGS
Expand All @@ -255,4 +258,4 @@ if [ -f "$HOME/.container-run.conf" ]; then
fi

set -x
exec "${CONTAINER_CMD[@]}" run "${OTHER_ARGS[@]}" "${PODMAN_RUN_ARGS[@]}" -w "$WORKDIR" "$IMAGE" "${cmd[@]}"
exec "${CONTAINER_CMD[@]}" run "${PODMAN_RUN_ARGS[@]}" -w "$WORKDIR" "$IMAGE" "${cmd[@]}"
10 changes: 0 additions & 10 deletions ci/container/files/generate-bazel-completion.sh

This file was deleted.

Loading