From 834087cbed957b5f0d680c055cca9d758ec5f68a Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Mon, 28 Aug 2023 09:43:52 +0300 Subject: [PATCH 1/3] ci: fix worker binaries could not be found Signed-off-by: Alexandru Gheorghe --- .gitlab/pipeline/build.yml | 4 ++++ docker/malus_injected.Dockerfile | 2 +- docker/polkadot_injected_debug.Dockerfile | 6 ++++-- docker/polkadot_injected_release.Dockerfile | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml index 290ef8c8f72d1..c46aa895a4eb1 100644 --- a/.gitlab/pipeline/build.yml +++ b/.gitlab/pipeline/build.yml @@ -23,6 +23,8 @@ build-linux-stable: - mkdir -p ./artifacts - VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name - mv ./target/testnet/polkadot ./artifacts/. + - mv ./target/testnet/polkadot-prepare-worker ./artifacts/. + - mv ./target/testnet/polkadot-execute-worker ./artifacts/. - pushd artifacts - sha256sum polkadot | tee polkadot.sha256 - shasum -c polkadot.sha256 @@ -68,6 +70,8 @@ build-malus: # pack artifacts - mkdir -p ./artifacts - mv ./target/testnet/malus ./artifacts/. + - mv ./target/testnet/polkadot-execute-worker ./artifacts/. + - mv ./target/testnet/polkadot-prepare-worker ./artifacts/. - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG - echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" diff --git a/docker/malus_injected.Dockerfile b/docker/malus_injected.Dockerfile index ecffd2c4f9b48..762a2e442c828 100644 --- a/docker/malus_injected.Dockerfile +++ b/docker/malus_injected.Dockerfile @@ -39,7 +39,7 @@ RUN apt-get update && \ # add adder-collator binary to docker image -COPY ./artifacts/malus /usr/local/bin +COPY ./artifacts/malus ./artifacts/polkadot-execute-worker ./artifacts/polkadot-prepare-worker /usr/local/bin USER nonroot diff --git a/docker/polkadot_injected_debug.Dockerfile b/docker/polkadot_injected_debug.Dockerfile index 3dd62f7ba56f4..f7f764d335a25 100644 --- a/docker/polkadot_injected_debug.Dockerfile +++ b/docker/polkadot_injected_debug.Dockerfile @@ -32,13 +32,15 @@ RUN apt-get update && \ chown -R polkadot:polkadot /data && \ ln -s /data /polkadot/.local/share/polkadot -# add polkadot binary to docker image -COPY ./artifacts/polkadot /usr/local/bin +# add polkadot binaries to docker image +COPY ./artifacts/polkadot ./artifacts/polkadot-execute-worker ./artifacts/polkadot-prepare-worker /usr/local/bin USER polkadot # check if executable works in this container RUN /usr/local/bin/polkadot --version +RUN /usr/local/bin/polkadot-execute-worker --version +RUN /usr/local/bin/polkadot-prepare-worker --version EXPOSE 30333 9933 9944 VOLUME ["/polkadot"] diff --git a/docker/polkadot_injected_release.Dockerfile b/docker/polkadot_injected_release.Dockerfile index ba0a79e781871..87ae7ac27dc0c 100644 --- a/docker/polkadot_injected_release.Dockerfile +++ b/docker/polkadot_injected_release.Dockerfile @@ -44,6 +44,8 @@ USER polkadot # check if executable works in this container RUN /usr/bin/polkadot --version +RUN /usr/local/bin/polkadot-execute-worker --version +RUN /usr/local/bin/polkadot-prepare-worker --version EXPOSE 30333 9933 9944 VOLUME ["/polkadot"] From dc4d05be916c3c6f2938df896bbe7eec708f420c Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Mon, 28 Aug 2023 10:20:33 +0300 Subject: [PATCH 2/3] Add missing bits Signed-off-by: Alexandru Gheorghe --- .gitlab/pipeline/build.yml | 4 ++-- polkadot/Cargo.toml | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml index c46aa895a4eb1..422bea02efeec 100644 --- a/.gitlab/pipeline/build.yml +++ b/.gitlab/pipeline/build.yml @@ -18,7 +18,7 @@ build-linux-stable: # Ensure we run the UI tests. RUN_UI_TESTS: 1 script: - - time cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot + - time cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker # pack artifacts - mkdir -p ./artifacts - VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name @@ -66,7 +66,7 @@ build-malus: - .run-immediately - .collect-artifacts script: - - time cargo build --locked --profile testnet --verbose -p polkadot-test-malus + - time cargo build --locked --profile testnet --verbose -p polkadot-test-malus --bin polkadot-prepare-worker --bin polkadot-execute-worker # pack artifacts - mkdir -p ./artifacts - mv ./target/testnet/malus ./artifacts/. diff --git a/polkadot/Cargo.toml b/polkadot/Cargo.toml index 561b49ab42041..925d6589dc0bc 100644 --- a/polkadot/Cargo.toml +++ b/polkadot/Cargo.toml @@ -159,6 +159,16 @@ assets = [ "/usr/bin/", "755", ], + [ + "target/release/polkadot-prepare-worker", + "/usr/lib/polkadot/", + "755" + ], + [ + "target/release/polkadot-execute-worker", + "/usr/lib/polkadot/", + "755" + ], [ "scripts/packaging/polkadot.service", "/lib/systemd/system/", From 8f4e0a379029626efef414fd5c51c93c10e04bcb Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Mon, 28 Aug 2023 11:04:17 +0300 Subject: [PATCH 3/3] Fix malus build Signed-off-by: Alexandru Gheorghe --- .gitlab/pipeline/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml index 422bea02efeec..5782b4745e705 100644 --- a/.gitlab/pipeline/build.yml +++ b/.gitlab/pipeline/build.yml @@ -66,7 +66,7 @@ build-malus: - .run-immediately - .collect-artifacts script: - - time cargo build --locked --profile testnet --verbose -p polkadot-test-malus --bin polkadot-prepare-worker --bin polkadot-execute-worker + - time cargo build --locked --profile testnet --verbose -p polkadot-test-malus --bin malus --bin polkadot-prepare-worker --bin polkadot-execute-worker # pack artifacts - mkdir -p ./artifacts - mv ./target/testnet/malus ./artifacts/.