From ed86c71ae1719868febe6de5d40563464275be70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Tue, 17 Oct 2023 15:16:50 +0200 Subject: [PATCH 1/5] Add c2patool --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index b6ce5f437..c2776fdfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,6 +49,9 @@ RUN npm install --prefix /app/go-tools/w3 # chown needed to make everything owned by one user for userspace podman execution RUN chown -R root:root /app/go-tools/w3 +FROM rust:1.73.0 as rust-build +RUN cargo install --version 0.6.2 c2patool + FROM ubuntu:22.04 AS catalyst ENV DEBIAN_FRONTEND=noninteractive @@ -71,6 +74,7 @@ RUN apt update && apt install -yqq \ && rm -rf /var/lib/apt/lists/* COPY --from=catalyst-build /opt/bin/ /usr/local/bin/ +COPY --from=rust-build /usr/local/cargo/bin/c2patool /usr/local/bin/ COPY --from=node-build /app/go-tools/w3 /opt/local/lib/livepeer-w3 RUN ln -s /opt/local/lib/livepeer-w3/livepeer-w3.js /usr/local/bin/livepeer-w3 && \ npm install -g ipfs-car From e57d7f0604f4f39f588857d6df2d90c9b65e1700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Thu, 19 Oct 2023 11:40:11 +0200 Subject: [PATCH 2/5] Add c2patool to the binary tarball --- .github/workflows/build.yaml | 8 ++++++++ Dockerfile | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 124e98e21..c4e20696a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -77,6 +77,14 @@ jobs: cp ./scripts/livepeer-vmagent ./bin/livepeer-vmagent + - name: Build c2patool + run: | + apt update && apt install -y curl build-essential git + curl https://sh.rustup.rs -sSf | sh -s -- -y + source "$HOME/.cargo/env" + cargo install c2patool + cp "${HOME}/.cargo/bin/c2patool" ./bin/c2patool + - name: Strip binaries of debug symbols if: matrix.platform.name == 'linux' && matrix.architecture == 'amd64' run: | diff --git a/Dockerfile b/Dockerfile index 7bd4b6fe2..b85370e12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,7 +76,7 @@ RUN apt update && apt install -yqq \ # Most of ./scripts is for livepeer-in-a-box except livepeer-vmagent, which is used in production in Catalyst proper ADD ./scripts/livepeer-vmagent /usr/local/bin COPY --from=catalyst-build /opt/bin/ /usr/local/bin/ -COPY --from=rust-build /usr/local/cargo/bin/c2patool /usr/local/bin/ +COPY --from=rust-build /usr/local/cargo/bin/c2patool /bin/ COPY --from=node-build /app/go-tools/w3 /opt/local/lib/livepeer-w3 RUN ln -s /opt/local/lib/livepeer-w3/livepeer-w3.js /usr/local/bin/livepeer-w3 && \ npm install -g ipfs-car From 50b2d8a4c5ca3844eb1627bd434ec4b2746309aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Tue, 24 Oct 2023 12:43:13 +0200 Subject: [PATCH 3/5] Update .github/workflows/build.yaml Co-authored-by: iameli-streams <136638730+iameli-streams@users.noreply.github.com> --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c4e20696a..bdee32ee9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -82,7 +82,7 @@ jobs: apt update && apt install -y curl build-essential git curl https://sh.rustup.rs -sSf | sh -s -- -y source "$HOME/.cargo/env" - cargo install c2patool + cargo install --version 0.6.2 c2patool cp "${HOME}/.cargo/bin/c2patool" ./bin/c2patool - name: Strip binaries of debug symbols From 539bc9c468effd3e2a465f0aaebf41307f79a4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Tue, 24 Oct 2023 12:47:20 +0200 Subject: [PATCH 4/5] Try using cargo-install GH Action --- .github/workflows/build.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bdee32ee9..3e00ee93f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -78,11 +78,13 @@ jobs: cp ./scripts/livepeer-vmagent ./bin/livepeer-vmagent - name: Build c2patool + uses: baptiste0928/cargo-install@v2 + with: + crate: c2patool + version: "0.6.2" + + - name: Copy c2patool run: | - apt update && apt install -y curl build-essential git - curl https://sh.rustup.rs -sSf | sh -s -- -y - source "$HOME/.cargo/env" - cargo install --version 0.6.2 c2patool cp "${HOME}/.cargo/bin/c2patool" ./bin/c2patool - name: Strip binaries of debug symbols From 4fe19cb017763e8b3de99defa155553218c10c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Tue, 24 Oct 2023 13:57:55 +0200 Subject: [PATCH 5/5] Try using cargo-install GH Action --- .github/workflows/build.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3e00ee93f..3364bcf6a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -77,6 +77,11 @@ jobs: cp ./scripts/livepeer-vmagent ./bin/livepeer-vmagent + - name: Configure Rust Toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - name: Build c2patool uses: baptiste0928/cargo-install@v2 with: