From 71898b4873a32b9df911a8157864100c0dfab27d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 06:29:56 +0000 Subject: [PATCH] fix(ci): build from source when not released on github (#14495) (#14501) Co-authored-by: Noel Kwan <47273164+kwannoel@users.noreply.github.com> --- backwards-compat-tests/scripts/utils.sh | 3 +- ci/scripts/backwards-compat-test.sh | 59 +++++++++++++++++++++---- 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/backwards-compat-tests/scripts/utils.sh b/backwards-compat-tests/scripts/utils.sh index a8daebf3b9e2d..1afbf08dd4441 100644 --- a/backwards-compat-tests/scripts/utils.sh +++ b/backwards-compat-tests/scripts/utils.sh @@ -186,9 +186,8 @@ get_rw_versions() { # Setup table and materialized view. # Run updates and deletes on the table. # Get the results. -# TODO: Run nexmark, tpch queries -# TODO(kwannoel): use sqllogictest. seed_old_cluster() { + echo "--- Start cluster on old_version: $OLD_VERSION" # Caller should make sure the test env has these. # They are called here because the current tests # may not be backwards compatible, so we need to call diff --git a/ci/scripts/backwards-compat-test.sh b/ci/scripts/backwards-compat-test.sh index 9e86e3807db35..0c013574d4185 100755 --- a/ci/scripts/backwards-compat-test.sh +++ b/ci/scripts/backwards-compat-test.sh @@ -64,9 +64,40 @@ ENABLE_BUILD_RUST=false # Ensure it will link the all-in-one binary from our release. ENABLE_ALL_IN_ONE=true -# Even if CI is release profile, we won't ever -# build the binaries from scratch. -# So we just use target/debug for simplicity. +# Use target/debug for simplicity. +ENABLE_RELEASE_PROFILE=false +EOF +} + +configure_rw_build() { +echo "--- Setting up cluster config" +cat < risedev-profiles.user.yml +full-without-monitoring: + steps: + - use: minio + - use: etcd + - use: meta-node + - use: compute-node + - use: frontend + - use: compactor + - use: zookeeper + - use: kafka +EOF + +cat < risedev-components.user.env +RISEDEV_CONFIGURED=true + +ENABLE_MINIO=true +ENABLE_ETCD=true +ENABLE_KAFKA=true + +# Make sure that it builds +ENABLE_BUILD_RUST=true + +# Ensure it will link the all-in-one binary from our release. +ENABLE_ALL_IN_ONE=true + +# Use target/debug for simplicity. ENABLE_RELEASE_PROFILE=false EOF } @@ -76,13 +107,23 @@ setup_old_cluster() { git config --global --add safe.directory /risingwave git checkout "v${OLD_VERSION}" cargo build -p risedev + echo "--- Get RisingWave binary for $OLD_VERSION" OLD_URL=https://github.com/risingwavelabs/risingwave/releases/download/v${OLD_VERSION}/risingwave-v${OLD_VERSION}-x86_64-unknown-linux.tar.gz + set +e wget $OLD_URL - tar -xvf risingwave-v${OLD_VERSION}-x86_64-unknown-linux.tar.gz - mv risingwave target/debug/risingwave - - echo "--- Start cluster on tag $OLD_VERSION" - git config --global --add safe.directory /risingwave + if [[ "$?" -ne 0 ]]; then + set -e + echo "Failed to download ${OLD_VERSION} from github releases, build from source later during ./risedev d" + configure_rw_build + else + set -e + tar -xvf risingwave-v${OLD_VERSION}-x86_64-unknown-linux.tar.gz + mv risingwave target/debug/risingwave + + echo "--- Start cluster on tag $OLD_VERSION" + git config --global --add safe.directory /risingwave + configure_rw + fi } setup_new_cluster() { @@ -98,8 +139,8 @@ main() { # Make sure we have all the branches git fetch --all get_rw_versions + setup_old_cluster - configure_rw seed_old_cluster "$OLD_VERSION" setup_new_cluster