diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fdade8b..804ceba 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -134,7 +134,7 @@ jobs: matrix: script: ["apache", "mysql", "nginx", "postgres", "redis"] thread: ["4"] - sched: ["none", "size-ordered"] + sched: ["none"] comp: ["bzip2", "zstd"] steps: - uses: actions/checkout@v4 diff --git a/go.mod b/go.mod index 77041ab..48dfc28 100644 --- a/go.mod +++ b/go.mod @@ -28,8 +28,7 @@ require ( replace github.com/icedream/go-bsdiff v1.0.1 => github.com/naoki9911/go-bsdiff v1.0.3 -//replace github.com/nine-lives-later/go-xdelta v0.3.2-0.20200813195159-a23b3640ca1a => github.com/naoki9911/go-xdelta v0.0.1 -replace github.com/nine-lives-later/go-xdelta v0.3.2-0.20200813195159-a23b3640ca1a => ../go-xdelta +replace github.com/nine-lives-later/go-xdelta v0.3.2-0.20200813195159-a23b3640ca1a => github.com/naoki9911/go-xdelta v0.0.2 require ( github.com/Microsoft/go-winio v0.6.1 // indirect @@ -59,7 +58,6 @@ require ( github.com/opencontainers/selinux v1.10.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/ulikunitz/xz v0.5.12 // indirect github.com/vbatts/tar-split v0.11.3 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect go.etcd.io/bbolt v1.3.6 // indirect diff --git a/go.sum b/go.sum index 6d5e193..1aaf7c0 100644 --- a/go.sum +++ b/go.sum @@ -516,6 +516,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoki9911/go-bsdiff v1.0.3 h1:vWQ42T3I04EJr2YfnBIIoyami5aL6C0n+dyZLtY75v4= github.com/naoki9911/go-bsdiff v1.0.3/go.mod h1:gGhdZZqlpfmaUUEzntr3mDeO3dy0tvlIJ7F+a4z/vxY= +github.com/naoki9911/go-xdelta v0.0.2 h1:xwj0UbiFrJruBa3CfutQSEBjbkAQNflHopUE5Djtc8Y= +github.com/naoki9911/go-xdelta v0.0.2/go.mod h1:uFQzElLkPDY5XVZWBJxDXaymJk/IrWZnq4uEl8rxaVg= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -685,8 +687,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= -github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 670c535..83698e1 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -9,7 +9,6 @@ import ( "math/rand" "os" "strings" - "time" "github.com/klauspost/compress/zstd" "github.com/opencontainers/go-digest" @@ -111,7 +110,6 @@ var ( ) func randSequence(n int) string { - rand.Seed(time.Now().UnixNano()) b := make([]byte, n) for i := range b { b[i] = letters[rand.Intn(len(letters))] diff --git a/tests/bench_cdimg_impl.sh b/tests/bench_cdimg_impl.sh index 1f65fcd..1ba8c3d 100755 --- a/tests/bench_cdimg_impl.sh +++ b/tests/bench_cdimg_impl.sh @@ -77,7 +77,7 @@ for ((i=0; i < $(expr ${#IMAGE_VERSIONS[@]} - 1); i++));do for ((j=0; j < $RUN_NUM; j++));do NOW_COUNT=$(expr $j + 1) echo "Benchmark di3fs $DIFF_NAME binary-diff ($NOW_COUNT/$RUN_NUM)" - $BIN_FUSE --parentCdimg=./$LOWER.cdimg --diffCdimg=./diff_$DIFF_NAME.cdimg --benchmark=true /tmp/fuse >/dev/null 2>&1 & + $BIN_FUSE --daemon --parentCdimg=./$LOWER.cdimg --diffCdimg=./diff_$DIFF_NAME.cdimg --benchmark=true /tmp/fuse sleep 1 if [ $j -eq 0 ]; then diff -r $UPPER /tmp/fuse --no-dereference @@ -111,7 +111,7 @@ echo "Testing merged $MERGED" $BIN_CTR_CLI cdimg patch --baseDir=./$IMAGE_LOWER --outDir=./$IMAGE_UPPER-merged --diffCdimg=./diff_merged_$MERGED.cdimg diff -r $IMAGE_UPPER $IMAGE_UPPER-merged --no-dereference ls -l diff_merged_$MERGED.cdimg -$BIN_FUSE --parentCdimg=./$IMAGE_LOWER.cdimg --diffCdimg=./diff_merged_$MERGED.cdimg /tmp/fuse >/dev/null 2>&1 & +$BIN_FUSE --daemon --parentCdimg=./$IMAGE_LOWER.cdimg --diffCdimg=./diff_merged_$MERGED.cdimg /tmp/fuse sleep 1 diff -r $IMAGE_UPPER /tmp/fuse --no-dereference fusermount3 -u /tmp/fuse diff --git a/tests/launch_test_lxc.sh b/tests/launch_test_lxc.sh index 10bac00..17eac29 100755 --- a/tests/launch_test_lxc.sh +++ b/tests/launch_test_lxc.sh @@ -1,7 +1,7 @@ #!/bin/bash set -ux -o pipefail -IMAGE=${1:-"images:ubuntu/22.04"} +IMAGE=${1:-"ubuntu/22.04"} cd $(cd $(dirname $0); pwd) diff --git a/tests/setup_test.sh b/tests/setup_test.sh index 4ec3db0..711eb4c 100755 --- a/tests/setup_test.sh +++ b/tests/setup_test.sh @@ -28,8 +28,12 @@ echo "===== Prepare =====" sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y dbus-user-session docker-ce containerd.io fuse3 python3 python3-pip jq + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y git build-essential automake # for xdelta3 sudo pip3 install docker-squash matplotlib + git clone https://github.com/naoki9911/go-xdelta + cd go-xdelta && git checkout v0.0.3 && ./build_install.sh + systemctl --user start dbus curl -fsSL https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz | sudo tar Cxz /usr/local diff --git a/tests/test_fast.sh b/tests/test_fast.sh index de25cf9..3708459 100755 --- a/tests/test_fast.sh +++ b/tests/test_fast.sh @@ -20,7 +20,8 @@ mkdir -p $IMAGE_DIR mkdir -p /tmp/benchmark TESTS=("apache" "mysql" "nginx" "postgres" "redis") -ENCODINGS=("bsdiffx" "xdelta3") +#ENCODINGS=("bsdiffx" "xdelta3") +ENCODINGS=("xdelta3") #TESTS=("pytorch" "tensorflow") #TESTS=("pytorch") for TEST in "${TESTS[@]}"; do