Skip to content

Commit

Permalink
Merge pull request #126 from cole-miller/docker
Browse files Browse the repository at this point in the history
Dockerize
  • Loading branch information
cole-miller authored Aug 17, 2023
2 parents 7322a62 + 6a2688d commit f4be20a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 29 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- 'master'
paths:
- 'image-version'
- 'Dockerfile'

jobs:
Expand Down
36 changes: 11 additions & 25 deletions .github/workflows/test-build-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ jobs:
workload: ${{ fromJSON(inputs.workloads) }}
nemesis: ${{ fromJSON(inputs.nemeses) }}
disk: ${{ fromJSON(inputs.disk) }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: ghcr.io/canonical/jepsen-dqlite-unofficial:latest
options: --privileged

timeout-minutes: 25
steps:
- name: Checkout code
Expand All @@ -123,16 +127,6 @@ jobs:
restore-keys: |
${{ runner.os }}-clojure
- name: Install Go
uses: actions/setup-go@v3

- name: Setup environment
timeout-minutes: 15
run: |
sudo apt update
sudo apt install -y gnuplot libsqlite3-dev libuv1-dev liblz4-dev libjna-java graphviz leiningen build-essential
printf core | sudo tee /proc/sys/kernel/core_pattern
- name: Install local Jepsen
if: ${{ inputs.jepsen-repo && inputs.jepsen-branch }}
run: |
Expand All @@ -142,17 +136,6 @@ jobs:
lein install
cd ../..
- name: Install libbacktrace
run: |
git clone https://github.com/ianlancetaylor/libbacktrace --depth 1
cd libbacktrace
autoreconf -i
./configure
make -j4
sudo make install
sudo ldconfig
cd ..
- name: Check out raft
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -187,17 +170,20 @@ jobs:
sudo make install
sudo ldconfig
- name: sysctl
run: |
sudo sysctl -w kernel.core_pattern=core
sudo sysctl -w fs.suid_dumpable=2
- name: Test
env:
LD_LIBRARY_PATH: "/usr/local/lib"
timeout-minutes: 8
run: |
export PATH="/usr/local/go/bin:$PATH"
go get golang.org/x/sync/semaphore
go get -tags libsqlite3 github.com/canonical/go-dqlite/app@master
go build -tags libsqlite3 -o resources/app resources/app.go
sudo ufw disable
sleep 0.200
sudo systemctl stop ufw.service
sudo ./resources/network.sh setup 5
if test ${{ matrix.workload }} = set; then echo 180 >time-limit; else echo 240 >time-limit; fi
lein run test --no-ssh --binary $(pwd)/resources/app \
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ name: Dqlite Jepsen tests - expected pass
on:
push:
paths-ignore:
- 'image-version'
- 'Dockerfile'
pull_request:
paths-ignore:
- 'image-version'
- 'Dockerfile'
schedule:
- cron: '0 */1 * * *'
Expand Down
3 changes: 2 additions & 1 deletion resources/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ fi
if [ "${cmd}" = "teardown" ]; then
ip link del "${BRIDGE}"
for i in $(seq 5); do
sed -i "/^10.2.1.1${i} n${i}/d" /etc/hosts
sed -e "/^10.2.1.1${i} n${i}/d" /etc/hosts >/tmp/jepsen-network-hosts
cp /tmp/jepsen-network-hosts /etc/hosts
done
rm -f $FILE
exit 0
Expand Down

0 comments on commit f4be20a

Please sign in to comment.