Skip to content

Commit

Permalink
fix(ci): build from source when not released on github (#14495) (#14501)
Browse files Browse the repository at this point in the history
Co-authored-by: Noel Kwan <[email protected]>
  • Loading branch information
github-actions[bot] and kwannoel authored Jan 11, 2024
1 parent 5488a52 commit 71898b4
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 11 deletions.
3 changes: 1 addition & 2 deletions backwards-compat-tests/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
59 changes: 50 additions & 9 deletions ci/scripts/backwards-compat-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > 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 <<EOF > 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
}
Expand All @@ -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() {
Expand All @@ -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
Expand Down

0 comments on commit 71898b4

Please sign in to comment.