Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade CI to min ubuntu 20.04 #839

Merged
merged 5 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/bench_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,25 @@ env:

jobs:
benchmarks:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
name: Benchmarks
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
# PRs do not share caches, instead each PR initially pulls from the cache of the main branch for the first run.
# This workflow does not run on main, so to make use of a cache before this workflow has completed once on a PR,
# we need to manually recreate the key used by ubuntu-18.04 release builds.
shared-key: "ubuntu-18.04 - --release-build_and_test"
# we need to manually recreate the key used by ubuntu-20.04 release builds.
shared-key: "ubuntu-20.04 - --release-build_and_test"
# TODO: while we want to leach off this cache we dont want to overwrite it
# so once something like https://github.com/Swatinem/rust-cache/issues/66 becomes available,
# we should do something like this:
# save-if: false
- name: cache custom ubuntu packages
uses: actions/cache@v3
with:
path: shotover-proxy/build/packages
key: ubuntu-20.04-packages
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
- name: Run benchmarks
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ jobs:
- name: Ubuntu 22.04 - Release - aarch64
runner: ubuntu-22.04
cargo_flags: --target aarch64-unknown-linux-gnu --release
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
steps:
- name: cache custom ubuntu packages
uses: actions/cache@v3
with:
path: shotover-proxy/build/packages
key: ubuntu-22.04-packages
- uses: actions/checkout@v3
# We purposefully dont cache here as build_and_test will always be the bottleneck
# so we should leave the cache alone so build_and_test can make more use of it.
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,23 @@ jobs:
strategy:
matrix:
include:
# the cassandra cpp driver is only supported on 18.04
- name: Ubuntu 18.04 - Release - cassandra_int_tests
runner: ubuntu-18.04
- name: Ubuntu 20.04 - Release - cassandra_int_tests
runner: ubuntu-20.04
cargo_flags: --release
test_flags: cassandra_int_tests

- name: Ubuntu 18.04 - Release
runner: ubuntu-18.04
- name: Ubuntu 20.04 - Release
runner: ubuntu-20.04
cargo_flags: --release
test_flags: --skip cassandra_int_tests

- name: Ubuntu 18.04 - Debug - cassandra_int_tests
runner: ubuntu-18.04
- name: Ubuntu 20.04 - Debug - cassandra_int_tests
runner: ubuntu-20.04
cargo_flags:
test_flags: cassandra_int_tests

- name: Ubuntu 18.04 - Debug
runner: ubuntu-18.04
- name: Ubuntu 20.04 - Debug
runner: ubuntu-20.04
cargo_flags:
test_flags: --skip cassandra_int_tests

Expand All @@ -53,6 +52,11 @@ jobs:
# Otherwise only the last build to finish would get saved to the cache.
# We allow different test_flags to share a cache as they should have identical build outputs
key: ${{ matrix.runner }} - ${{ matrix.cargo_flags }}
- name: cache custom ubuntu packages
uses: actions/cache@v3
with:
path: shotover-proxy/build/packages
key: ubuntu-20.04-packages
- name: Install ubuntu packages
run: shotover-proxy/build/install_ubuntu_packages.sh
- name: Install cargo-hack
Expand All @@ -68,7 +72,7 @@ jobs:
run: cargo test ${{ matrix.cargo_flags }} --all-features -- --include-ignored --show-output --nocapture ${{ matrix.test_flags }}
- name: Ensure that custom benches run
run: cargo run --release --example cassandra_bench -- --config-dir example-configs/cassandra-passthrough --rate 1000
if: ${{ matrix.name == 'Ubuntu 18.04 - Release' }}
if: ${{ matrix.name == 'Ubuntu 20.04 - Release' }}
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
run: |
if [ -n "$(git status --porcelain)" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

publish-binary:
name: "Publish Binary to GitHub"
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install ubuntu packages
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ output.txt
/docs/mdbook_bin
shotover-proxy/read-localhost:9042.json
shotover-proxy/read-localhost:9043.json
/shotover-proxy/build/packages
7 changes: 7 additions & 0 deletions shotover-proxy/build/cassandra-cpp-driver.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Package: cassandra-cpp-driver
Version: VERSION
Section: base
Priority: optional
Architecture: amd64
Maintainer: Shotover team
Description: cassandra cpp-driver installed by shotover
55 changes: 35 additions & 20 deletions shotover-proxy/build/install_ubuntu_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,41 @@

set -e

cd "$(dirname "$0")"

sudo apt-get update
sudo apt-get install -y libpcap-dev wget gcc-aarch64-linux-gnu

. /etc/lsb-release

if [ ${DISTRIB_RELEASE} == "18.04" ]
then
mkdir pkgs
pushd pkgs
wget https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver_2.16.0-1_amd64.deb &
wget https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver-dev_2.16.0-1_amd64.deb &
wget https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1_1.35.0-1_amd64.deb &
wget https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1-dev_1.35.0-1_amd64.deb &
wait

sudo apt -y install ./cassandra-cpp-driver_2.16.0-1_amd64.deb \
./cassandra-cpp-driver-dev_2.16.0-1_amd64.deb \
./libuv1_1.35.0-1_amd64.deb ./libuv1-dev_1.35.0-1_amd64.deb

popd
rm -r pkgs
sudo apt-get install -y libpcap-dev gcc-aarch64-linux-gnu

# Install dependencies of the cpp-driver even if they are already on CI so that we can run this locally
sudo apt-get install -y libuv1 libuv1-dev cmake g++ libssl-dev zlib1g-dev

# set VERSION to one of the tags here: https://github.com/datastax/cpp-driver/tags
VERSION=2.16.2

PACKAGE_NAME="cassandra-cpp-driver_${VERSION}-1_amd64"
FILE_PATH="packages/${PACKAGE_NAME}.deb"

# Create package if it doesnt already exist
if [ ! -f "$FILE_PATH" ]; then
rm -rf cpp-driver # Clean just in case the script failed halfway through last time
git clone --depth 1 --branch $VERSION https://github.com/datastax/cpp-driver
pushd cpp-driver

cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib -Wno-error .
make

mkdir -p $PACKAGE_NAME/DEBIAN
make DESTDIR="$PACKAGE_NAME/" install

cp ../cassandra-cpp-driver.control $PACKAGE_NAME/DEBIAN/control
sed -i "s/VERSION/${VERSION}/g" $PACKAGE_NAME/DEBIAN/control
dpkg-deb --build $PACKAGE_NAME

mkdir -p ../packages
cp ${PACKAGE_NAME}.deb ../$FILE_PATH

popd
rm -rf cpp-driver
fi

sudo dpkg -i $FILE_PATH