diff --git a/.apt-packages.txt b/.apt-packages.txt new file mode 100644 index 000000000..6b347f0f5 --- /dev/null +++ b/.apt-packages.txt @@ -0,0 +1,9 @@ +pv +lz4 +git-cliff +npm +jq +curl +unzip +wget +make diff --git a/.envrc b/.envrc index f5ce87435..47c5fefb2 100644 --- a/.envrc +++ b/.envrc @@ -48,6 +48,21 @@ if ! has readlink; then exit 1 fi +if ! has pv; then + echo "pv is not installed" + exit 1 +fi + +if ! has lz4; then + echo "lz4 is not installed" + exit 1 +fi + +if ! has git-cliff; then + echo "git-cliff is not installed" + exit 1 +fi + if [ -z "$GOPATH" ]; then GOPATH=$(go env GOPATH) export GOPATH diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e4c41638d..d173e80db 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,6 +14,8 @@ jobs: steps: - uses: actions/checkout@v4 - run: git fetch --prune --unshallow + - name: Install dependencies + run: xargs -ar .apt-packages.txt apt install -y - name: Detect required Go version run: | toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//') @@ -47,7 +49,7 @@ jobs: # using PAT as homebrew is located in different repo GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test-network-upgrade-on-release: - runs-on: upgrade-tester + runs-on: self-hosted1 needs: - publish steps: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3f1b4ae40..b858cdb43 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: Install dependencies run: | - brew install bash direnv + brew install bash direnv pv lz4 git-cliff sudo chsh -s /usr/local/bin/bash - name: Hook direnv to bash run: echo 'eval "$(direnv hook bash)"' >> $HOME/.bashrc @@ -44,6 +44,8 @@ jobs: steps: - uses: actions/checkout@v4 - run: git fetch --prune --unshallow + - name: Install dependencies + run: xargs -ar .apt-packages.txt apt install -y - name: Detect required Go version run: | toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//') @@ -64,6 +66,8 @@ jobs: steps: - uses: actions/checkout@v4 - run: git fetch --prune --unshallow + - name: Install dependencies + run: xargs -ar .apt-packages.txt apt install -y - name: Detect required Go version run: | toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//') @@ -82,6 +86,8 @@ jobs: steps: - uses: actions/checkout@v4 - run: git fetch --prune --unshallow + - name: Install dependencies + run: xargs -ar .apt-packages.txt apt install -y - name: Detect required Go version run: | toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//') @@ -101,6 +107,8 @@ jobs: steps: - uses: actions/checkout@v4 - run: git fetch --prune --unshallow + - name: Install dependencies + run: xargs -ar .apt-packages.txt apt install -y - name: Detect required Go version run: | toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//') @@ -119,6 +127,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install dependencies + run: xargs -ar .apt-packages.txt apt install -y - run: git fetch --prune --unshallow - name: Detect required Go version run: | @@ -140,6 +150,8 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 + - name: Install dependencies + run: xargs -ar .apt-packages.txt apt install -y - name: Detect required Go version run: | toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//') @@ -165,6 +177,8 @@ jobs: steps: - uses: actions/checkout@v4 - run: git fetch --prune --unshallow + - name: Install dependencies + run: xargs -ar .apt-packages.txt apt install -y - name: Detect required Go version run: | toolchain=$(./script/tools.sh gotoolchain | sed 's/go*//') @@ -189,7 +203,7 @@ jobs: run: make release network-upgrade-names: - runs-on: upgrade-tester + runs-on: self-hosted1 steps: - name: Cleanup build folder run: | @@ -222,7 +236,7 @@ jobs: ./script/semver.sh validate "$upgrade" done <<< $(find "$dir" ! -path "$dir" -maxdepth 1 -type d -exec basename {} \;) network-upgrade: - runs-on: upgrade-tester + runs-on: self-hosted1 steps: - name: Cleanup build folder run: | diff --git a/make/test-upgrade.mk b/make/test-upgrade.mk index 4b74a7ebd..ef42d976d 100644 --- a/make/test-upgrade.mk +++ b/make/test-upgrade.mk @@ -22,6 +22,8 @@ UPGRADE_BINARY_VERSION ?= local REMOTE_TEST_WORKDIR ?= ~/go/src/github.com/akash-network/node REMOTE_TEST_HOST ?= +COSMOVISOR := /Users/amr/go/src/github.com/cosmos/cosmos-sdk/tools/cosmovisor/cosmovisor + $(AKASH_INIT): $(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --gbv=$(GENESIS_BINARY_VERSION) --ufrom=$(UPGRADE_FROM) --uto=$(UPGRADE_TO) --config="$(PWD)/config.json" init touch $@ diff --git a/script/upgrades.sh b/script/upgrades.sh index 0a5b257df..10e3c0a8f 100755 --- a/script/upgrades.sh +++ b/script/upgrades.sh @@ -258,13 +258,6 @@ function init() { cp "$validators_dir/.akash0/cosmovisor/upgrades/$UPGRADE_TO/bin/akash" "$upgrade_bin/akash" fi - pushd "$(pwd)" - cd "$cosmovisor_dir" - - ln -snf "current" "genesis" - - popd - AKASH=$genesis_bin/akash $AKASH init --home "$valdir" "$(jq -rc '.moniker' <<<"$val")" >/dev/null 2>&1 @@ -286,6 +279,7 @@ function init() { tar_cmd=$(content_type "$(content_name "$GENESIS_ORIG")") + # shellcheck disable=SC2086 wget -nv -O - "$GENESIS_ORIG" | pv $pv_args | eval "$tar_cmd" else echo "unable to download genesis" @@ -441,13 +435,6 @@ function bins() { cp "$validators_dir/.akash0/cosmovisor/upgrades/$UPGRADE_TO/bin/akash" "$upgrade_bin/akash" fi - pushd "$(pwd)" - cd "$cosmovisor_dir" - - ln -snf "genesis" "current" - - popd - ((cnt++)) || true done } diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 4bbea9123..8c26a3dc8 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -546,13 +546,6 @@ func TestUpgrade(t *testing.T) { fail = true } } - - // select { - // case errs := <-vl.testErrsCh: - // - // - // case <-vl.ctx.Done(): - // } } if fail {