Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
naoki9911 committed Jan 11, 2024
1 parent 6589ab9 commit d8c1703
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 74 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,29 @@ jobs:
path: /tmp/test-image.tar.zst
lookup-only: true

- name: setup lxd (v5.19)
- name: setup lxd
id: s1
if: steps.cache-restore.outputs.cache-hit != 'true'
run: ./setup_lxd.sh
run: ./test/setup_lxd.sh

- name: launch lxc container
id: s6
id: s2
if: steps.s1.conclusion == 'success'
run: ./launch_test_lxc.sh
run: ./test/launch_test_lxc.sh

- name: install dependencies and build
id: s7
if: steps.s6.conclusion == 'success'
id: s3
if: steps.s2.conclusion == 'success'
run: sudo lxc exec test -- sudo --login --user ubuntu /host/test/init_test.sh

- name: export image
id: s8
if: steps.s7.conclusion == 'success'
run: ./export_lxc_image.sh test
id: s4
if: steps.s3.conclusion == 'success'
run: ./test/export_lxc_image.sh test

- uses: actions/cache/save@v3
id: s11
if: steps.s8.conclusion == 'success'
id: s5
if: steps.s4.conclusion == 'success'
with:
key: lxc-image-base-${{ hashFiles('go.sum', 'test/init_test.sh') }}
path: /tmp/test-image.tar.zst
Expand All @@ -74,8 +74,8 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/[email protected]
- name: setup lxd (v5.19)
run: ./setup_lxd.sh
- name: setup lxd
run: ./test/setup_lxd.sh
- uses: actions/cache/restore@v3
id: cache-restore
with:
Expand All @@ -85,12 +85,12 @@ jobs:
- name: load lxc image
run: sudo lxc image import /tmp/test-image.tar.zst --alias test-export
- name: launch lxc container
run: ./launch_test_lxc.sh test-export
run: ./test/launch_test_lxc.sh test-export
- name: run test
run: sudo lxc exec test -- sudo --login --user ubuntu /bin/bash -c "sleep 3 && /home/ubuntu/bypass4netns/test/run_test.sh SYNC"
# some source codes may be updated. re-export new image.
- name: export image
run: sudo lxc image alias delete test-export && rm -f /tmp/test-image.tar.zst && ./export_lxc_image.sh test
run: sudo lxc image alias delete test-export && rm -f /tmp/test-image.tar.zst && ./test/export_lxc_image.sh test
- uses: actions/cache/save@v3
with:
key: lxc-image-${{ github.sha }}
Expand All @@ -107,8 +107,8 @@ jobs:
script: ["iperf3/iperf3_host", "iperf3/iperf3", "postgres/postgres", "redis/redis", "block/block", "memcached/memcached", "rabbitmq/rabbitmq", "etcd/etcd", "mysql/mysql"]
steps:
- uses: actions/[email protected]
- name: setup lxd (v5.19)
run: ./setup_lxd.sh
- name: setup lxd
run: ./test/setup_lxd.sh
- uses: actions/cache/restore@v3
id: cache-restore
with:
Expand All @@ -118,7 +118,7 @@ jobs:
- name: load lxc image
run: sudo lxc image import /tmp/test-image.tar.zst --alias test-export
- name: launch lxc container
run: ./launch_test_lxc.sh test-export
run: ./test/launch_test_lxc.sh test-export
- name: run benchmark (${{ matrix.script }})
run: sudo lxc exec test -- sudo --login --user ubuntu /bin/bash -c "sleep 3 && /home/ubuntu/bypass4netns/benchmark/${{ matrix.script }}.sh"
- name: upload plot
Expand Down Expand Up @@ -147,8 +147,8 @@ jobs:
script: ["iperf3/iperf3", "postgres/postgres", "redis/redis", "block/block", "memcached/memcached", "rabbitmq/rabbitmq", "etcd/etcd", "mysql/mysql"]
steps:
- uses: actions/[email protected]
- name: setup lxd (v5.19)
run: ./setup_lxd.sh
- name: setup lxd
run: ./test/setup_lxd.sh
- uses: actions/cache/restore@v3
id: cache-restore
with:
Expand All @@ -158,7 +158,7 @@ jobs:
- name: load lxc image
run: sudo lxc image import /tmp/test-image.tar.zst --alias test-export
- name: launch lxc container
run: ./launch_test_lxc.sh test-export
run: ./test/launch_test_lxc.sh test-export
- name: run benchmark (${{ matrix.script }})
run: ./benchmark/${{ matrix.script }}_multinode.sh
- name: upload plot
Expand Down
2 changes: 1 addition & 1 deletion benchmark/block/block_multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh

set +e
NAME="test" exec_lxc sudo nerdctl rm -f block-server
Expand Down
2 changes: 1 addition & 1 deletion benchmark/etcd/etcd_multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh

set +e
NAME="test" exec_lxc sudo nerdctl rm -f etcd-server
Expand Down
2 changes: 1 addition & 1 deletion benchmark/iperf3/iperf3_multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh

set +e
NAME="test" exec_lxc sudo nerdctl rm -f iperf3-server
Expand Down
2 changes: 1 addition & 1 deletion benchmark/memcached/memcached_multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh

set +e
NAME="test" exec_lxc sudo nerdctl rm -f memcached-server
Expand Down
2 changes: 1 addition & 1 deletion benchmark/mysql/mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BENCH_IMAGE="mysql-bench"

source ~/.profile
cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh
. ../param.bash

# sometimes fail to pull images
Expand Down
2 changes: 1 addition & 1 deletion benchmark/mysql/mysql_multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh

set +e
NAME="test" exec_lxc sudo nerdctl rm -f mysql-server
Expand Down
2 changes: 1 addition & 1 deletion benchmark/postgres/postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ POSTGRES_IMAGE="postgres:$POSTGRES_VERSION"

source ~/.profile
cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh
. ../param.bash

sudo nerdctl pull --quiet $POSTGRES_IMAGE
Expand Down
2 changes: 1 addition & 1 deletion benchmark/postgres/postgres_multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh

set +e
NAME="test" exec_lxc sudo nerdctl rm -f psql-server
Expand Down
2 changes: 1 addition & 1 deletion benchmark/rabbitmq/rabbitmq_multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh

set +e
NAME="test" exec_lxc sudo nerdctl rm -f rabbitmq-server
Expand Down
2 changes: 1 addition & 1 deletion benchmark/redis/redis_multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../../util.sh
. ../../test/util.sh

set +e
NAME="test" exec_lxc sudo nerdctl rm -f redis-server
Expand Down
39 changes: 0 additions & 39 deletions debug.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/multinode.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../util.sh
. ./util.sh

set +e
NAME="test" exec_lxc nerdctl rm -f vxlan
Expand Down
4 changes: 2 additions & 2 deletions setup_lxd.sh → test/setup_lxd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -eux -o pipefail

cd $(dirname $0)

#sudo snap remove --purge lxd && sudo snap install lxd --revision=26093
sudo modprobe vxlan
cat test/lxd.yaml | sudo lxd init --preseed
cat lxd.yaml | sudo lxd init --preseed
sudo sysctl -w net.ipv4.ip_forward=1

#https://andreas.scherbaum.la/post/2023-01-18_fix-lxc-network-issues-in-ubuntu-22.04/
sudo iptables -I DOCKER-USER -i lxdbr0 -o eth0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
Expand Down
2 changes: 1 addition & 1 deletion test/setup_vxlan.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cd $(dirname $0)
. ../util.sh
. ./util.sh

set -eux -o pipefail

Expand Down
File renamed without changes.

0 comments on commit d8c1703

Please sign in to comment.