Skip to content

Commit

Permalink
ci: reduce size of Rust interop-test image (backport #3926)
Browse files Browse the repository at this point in the history
This is an automatic backport of pull request #3926 done by [Mergify](https://mergify.com).

Pull-Request: #3944.
  • Loading branch information
mergify[bot] authored May 15, 2023
1 parent d8de86e commit 97071b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/interop-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ concurrency:
jobs:
run-multidim-interop:
name: Run multidimensional interoperability tests
runs-on: ubuntu-22.04
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "xlarge"]' || '"ubuntu-latest"') }}
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: Build image
run: docker buildx build --load -t rust-libp2p-head . -f interop-tests/Dockerfile
- uses: libp2p/test-plans/.github/actions/run-interop-ping-test@482e8ac2e5d91c69d7f432d325337e2ddca39cf9
- uses: libp2p/test-plans/.github/actions/run-interop-ping-test@master
with:
test-filter: rust-libp2p-head
extra-versions: ${{ github.workspace }}/interop-tests/ping-version.json
Expand Down
15 changes: 12 additions & 3 deletions interop-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# syntax=docker/dockerfile:1.5-labs
FROM rust:1.67.0
FROM rust:1.67.0 as builder

# Install zlib as long as libp2p-websocket requires it: https://github.com/paritytech/soketto/issues/72
RUN apt-get update && \
apt-get download zlib1g && \
mkdir /dpkg && \
for deb in *.deb; do dpkg --extract $deb /dpkg || exit 10; done

# Setup protoc. TODO this breaks reproducibility and uses an old version of protoc.
# In the future protobuf generated files will be checked in, so we can remove this
Expand All @@ -11,10 +17,13 @@ WORKDIR /workspace
ADD . .
RUN --mount=type=cache,target=./target \
--mount=type=cache,target=/usr/local/cargo/registry \
cargo build --package interop-tests
cargo build --release --package interop-tests

RUN --mount=type=cache,target=./target \
mv ./target/debug/ping /usr/local/bin/testplan
mv ./target/release/ping /usr/local/bin/testplan

FROM gcr.io/distroless/cc
COPY --from=builder /usr/local/bin/testplan /usr/local/bin/testplan
COPY --from=builder /dpkg /
ENV RUST_BACKTRACE=1
ENTRYPOINT ["testplan"]

0 comments on commit 97071b9

Please sign in to comment.