Skip to content

Commit

Permalink
Merge pull request #141 from cole-miller/build-raft
Browse files Browse the repository at this point in the history
github: Use the new dqlite build everywhere
  • Loading branch information
cole-miller authored Mar 4, 2024
2 parents 3662b55 + 7f6fb27 commit f6e3cc5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 72 deletions.
33 changes: 1 addition & 32 deletions .github/workflows/test-build-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ name: Callable Dqlite Jepsen tests
on:
workflow_dispatch:
inputs:
raft-repo:
description: 'raft repo'
default: 'canonical/raft'
raft-ref:
description: 'raft branch or ref'
default: 'master'
dqlite-repo:
description: 'dqlite repo'
default: 'canonical/dqlite'
Expand Down Expand Up @@ -49,12 +43,6 @@ on:
jepsen-branch:
type: string
required: false
raft-repo:
type: string
required: false
raft-ref:
type: string
required: false
dqlite-repo:
type: string
required: false
Expand All @@ -81,8 +69,6 @@ on:
required: false

env:
RAFT_REPO: 'canonical/raft'
RAFT_BRANCH: 'master'
DQLITE_REPO: 'canonical/dqlite'
DQLITE_BRANCH: 'master'
GO_DQLITE_REPO: 'canonical/go-dqlite'
Expand Down Expand Up @@ -136,23 +122,6 @@ jobs:
lein install
cd ../..
- name: Check out raft
uses: actions/checkout@v3
with:
repository: ${{ inputs.raft-repo || env.RAFT_REPO }}
ref: ${{ inputs.raft-ref || env.RAFT_REF }}
path: raft

- name: Build raft
run: |
cd raft
git log -n 1
autoreconf -i
./configure --enable-debug --enable-backtrace
make -j4
sudo make install
sudo ldconfig
- name: Check out dqlite
uses: actions/checkout@v3
with:
Expand All @@ -165,7 +134,7 @@ jobs:
cd dqlite
git log -n 1
autoreconf -i
./configure --enable-debug --enable-backtrace
./configure --enable-debug --enable-backtrace --enable-build-raft
make -j4
sudo make install
sudo ldconfig
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/test-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ name: Dqlite Jepsen tests - custom dispatch
on:
workflow_dispatch:
inputs:
raft-repo:
description: raft repo
default: canonical/raft
raft-ref:
description: raft branch or ref
default: master
dqlite-repo:
description: dqlite repo
default: canonical/dqlite
Expand Down Expand Up @@ -38,7 +32,5 @@ jobs:
cli-opts: ${{ inputs.cli-opts }}
jepsen-dqlite-repo: canonical/jepsen.dqlite
jepsen-dqlite-ref: master
raft-repo: ${{ inputs.raft-repo || 'canonical/raft' }}
raft-ref: ${{ inputs.raft-ref || 'master' }}
dqlite-repo: ${{ inputs.dqlite-repo || 'canonical/dqlite' }}
dqlite-ref: ${{ inputs.dqlite-ref || 'master' }}
8 changes: 0 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ on:
- cron: '0 */1 * * *'
workflow_dispatch:
inputs:
raft-repo:
description: raft repo
default: canonical/raft
raft-ref:
description: raft branch or ref
default: master
dqlite-repo:
description: dqlite repo
default: canonical/dqlite
Expand All @@ -38,7 +32,5 @@ jobs:
[ '0', '1' ]
jepsen-dqlite-repo: ${{ github.repository }}
jepsen-dqlite-ref: ${{ github.ref }}
raft-repo: ${{ inputs.raft-repo || 'canonical/raft' }}
raft-ref: ${{ inputs.raft-ref || 'master' }}
dqlite-repo: ${{ inputs.dqlite-repo || 'canonical/dqlite' }}
dqlite-ref: ${{ inputs.dqlite-ref || 'master' }}
31 changes: 7 additions & 24 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
# ./test.sh setup
# ./test.sh run JEPSEN_ARGS
#
# `setup` should be run only once to launch and initialize the jepsen container.
# JEPSEN_ARGS are passed directly to Jepsen (you can omit --no-ssh and --binary).
# For `./test.sh run`, set the env vars RAFT_BRANCH and DQLITE_BRANCH to control
# which raft/dqlite are built, e.g. RAFT_BRANCH=mathieu/fix will build the `fix`
# branch of https://github.com/MathieuBordere/raft.
# `setup` should be run only once to launch and initialize the jepsen
# container. JEPSEN_ARGS are passed directly to Jepsen (you can omit --no-ssh
# and --binary). For `./test.sh run`, set the env var and DQLITE_BRANCH to
# control which dqlite is built, e.g. DQLITE_BRANCH=cole/fix will build the
# `fix` branch of https://github.com/cole-miller/dqlite.

set -o errexit -o pipefail -o nounset

Expand Down Expand Up @@ -48,13 +48,6 @@ setup-inner() {

pushd "$workspace"

git clone -o canonical https://github.com/canonical/raft
pushd raft
git remote add cole https://github.com/cole-miller/raft
git remote add mathieu https://github.com/MathieuBordere/raft
git remote add mohamed https://github.com/mwnsiri/raft
popd

git clone -o canonical https://github.com/canonical/dqlite
pushd dqlite
git remote add cole https://github.com/cole-miller/dqlite
Expand All @@ -75,20 +68,11 @@ setup() {
run-inner() {
pushd "$workspace"

pushd raft
git fetch --all
git checkout "$RAFT_BRANCH"
autoreconf -i
./configure --enable-debug
make -j"$(nproc)"
make install
popd

pushd dqlite
git fetch --all
git checkout "$DQLITE_BRANCH"
autoreconf -i
./configure --enable-debug
./configure --enable-debug --enable-build-raft
make -j"$(nproc)"
make install
popd
Expand All @@ -110,8 +94,7 @@ run() {
test "$(sysctl -n fs.suid_dumpable)" -gt 0 || exit 1
push-this-repo
lxc exec $jepsen -- \
env RAFT_BRANCH="${RAFT_BRANCH:-canonical/master}" \
DQLITE_BRANCH="${DQLITE_BRANCH:-canonical/master}" \
env DQLITE_BRANCH="${DQLITE_BRANCH:-canonical/master}" \
"$workspace/jepsen.dqlite/test.sh" run-inner "$@"
}

Expand Down

0 comments on commit f6e3cc5

Please sign in to comment.