From 2a14fc00f5f722d5cddd8001cd64564abdf2f79b Mon Sep 17 00:00:00 2001 From: auricom <27022259+auricom@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:08:54 +0200 Subject: [PATCH] wip --- .github/scripts/prepare-matrices.py | 5 +++- .github/scripts/update-go-modules.sh | 2 +- .github/workflows/build-applications.yaml | 11 ++++++- apps/cosmos-sdk-comet/entrypoint.sh | 7 +++-- apps/cosmos-sdk/entrypoint.sh | 7 +++-- apps/cosmos-sdk/metadata.yaml.c | 35 +++++++++++------------ apps/ibc-go/entrypoint.sh | 7 +++-- apps/ignite-example/ci/build.sh | 10 ------- apps/ignite-example/ci/test.sh | 24 ++++++++++++++-- apps/ignite-example/entrypoint.sh | 9 +++--- apps/ignite-example/metadata.yaml | 15 +++++++--- metadata.rules.cue | 1 + 12 files changed, 82 insertions(+), 51 deletions(-) diff --git a/.github/scripts/prepare-matrices.py b/.github/scripts/prepare-matrices.py index 5ef5518..ce896fd 100644 --- a/.github/scripts/prepare-matrices.py +++ b/.github/scripts/prepare-matrices.py @@ -65,7 +65,7 @@ def get_app_metadata(subdir, meta, forRelease=False, channels=None): platformToBuild["repository"] = toBuild["repository"] platformToBuild["path"] = toBuild["path"] platformToBuild["branch"] = toBuild["branch"] - if meta["fetch_full_history"]: + if meta.get("fetch_full_history"): platformToBuild["fetch_full_history"] = meta["fetch_full_history"] platformToBuild["platform"] = platform platformToBuild["target_os"] = target_os @@ -87,6 +87,9 @@ def get_app_metadata(subdir, meta, forRelease=False, channels=None): platformToBuild["tests_enabled"] = channel["tests_enabled"] and platform in TESTABLE_PLATFORMS platformToBuild["publish_artifacts"] = meta["publish_artifacts"] + if meta.get("binary_name"): + platformToBuild["binary_name"] = meta["binary_name"] + platformToBuild["update_modules_enabled"] = channel["update_modules"]["enabled"] if channel["update_modules"]["enabled"]: platformToBuild["update_modules_branch"] = channel["update_modules"]["cosmossdk_branch"] diff --git a/.github/scripts/update-go-modules.sh b/.github/scripts/update-go-modules.sh index da758fe..c24b57d 100755 --- a/.github/scripts/update-go-modules.sh +++ b/.github/scripts/update-go-modules.sh @@ -106,7 +106,7 @@ for module in $modules; do exit 1 fi ;; - *errors*) + *errors*|*api*|*core*) echo "ignore $module" ;; *) diff --git a/.github/workflows/build-applications.yaml b/.github/workflows/build-applications.yaml index 202351e..0a8bfde 100644 --- a/.github/workflows/build-applications.yaml +++ b/.github/workflows/build-applications.yaml @@ -121,6 +121,7 @@ jobs: MATRIX_APP_REPOSITORY: ${{ matrix.app.repository }} MATRIX_APP_PATH: ${{ matrix.app.path }} GOARCH: ${{ matrix.app.target_arch }} + BINARY_NAME: ${{ matrix.app.binary_name }} run: ./nightly-stack/apps/${{ matrix.app.name }}/ci/build.sh - name: Run and monitor application @@ -131,16 +132,24 @@ jobs: MATRIX_APP_REPOSITORY: ${{ matrix.app.repository }} MATRIX_APP_PATH: ${{ matrix.app.path }} GOARCH: ${{ matrix.app.target_arch }} + BINARY_NAME: ${{ matrix.app.binary_name }} run: ./nightly-stack/apps/${{ matrix.app.name }}/ci/test.sh - name: Create archive if: ${{ matrix.app.publish_artifacts }} + env: + BINARY_NAME: ${{ matrix.app.binary_name }} run: | set -oue pipefail set -x # Create archive - BINARY_PATH=$(find $(go env GOPATH)/bin | tail -n 1) + if [[ -z $BINARY_NAME ]]; then + BINARY_PATH=$(find $(go env GOPATH)/bin | tail -n 1) + else + BINARY_PATH=$(find $(go env GOPATH)/bin | grep $BINARY_NAME | tail -n 1) + fi + chmod +x $BINARY_PATH mv $BINARY_PATH ${{ github.workspace }}/${{ matrix.app.name }}-${{ matrix.app.channel }}-${{ matrix.app.target_os }}-${{ matrix.app.target_arch }} - name: Upload Artifact diff --git a/apps/cosmos-sdk-comet/entrypoint.sh b/apps/cosmos-sdk-comet/entrypoint.sh index 3b06239..ee01eeb 100755 --- a/apps/cosmos-sdk-comet/entrypoint.sh +++ b/apps/cosmos-sdk-comet/entrypoint.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +set -Eeuo pipefail set -x NODE_HOME=${NODE_HOME:-/config} @@ -14,9 +15,9 @@ if [[ ! -f "${NODE_HOME}/config.json" ]]; then /app/node keys add alice --home ${NODE_HOME} /app/node keys add bob --home ${NODE_HOME} /app/node init testchain-node --chain-id testchain --home ${NODE_HOME} - jq '.app_state.gov.params.voting_period = "600s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json - jq '.app_state.gov.params.expedited_voting_period = "300s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json - jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json # to change the inflation + jq '.app_state.gov.params.voting_period = "600s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json + jq '.app_state.gov.params.expedited_voting_period = "300s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json + jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json # to change the inflation /app/node genesis add-genesis-account alice 5000000000stake --keyring-backend test --home ${NODE_HOME} /app/node genesis add-genesis-account bob 5000000000stake --keyring-backend test --home ${NODE_HOME} /app/node genesis gentx alice 1000000stake --chain-id testchain --home ${NODE_HOME} diff --git a/apps/cosmos-sdk/entrypoint.sh b/apps/cosmos-sdk/entrypoint.sh index 3b06239..ee01eeb 100755 --- a/apps/cosmos-sdk/entrypoint.sh +++ b/apps/cosmos-sdk/entrypoint.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +set -Eeuo pipefail set -x NODE_HOME=${NODE_HOME:-/config} @@ -14,9 +15,9 @@ if [[ ! -f "${NODE_HOME}/config.json" ]]; then /app/node keys add alice --home ${NODE_HOME} /app/node keys add bob --home ${NODE_HOME} /app/node init testchain-node --chain-id testchain --home ${NODE_HOME} - jq '.app_state.gov.params.voting_period = "600s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json - jq '.app_state.gov.params.expedited_voting_period = "300s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json - jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json # to change the inflation + jq '.app_state.gov.params.voting_period = "600s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json + jq '.app_state.gov.params.expedited_voting_period = "300s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json + jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json # to change the inflation /app/node genesis add-genesis-account alice 5000000000stake --keyring-backend test --home ${NODE_HOME} /app/node genesis add-genesis-account bob 5000000000stake --keyring-backend test --home ${NODE_HOME} /app/node genesis gentx alice 1000000stake --chain-id testchain --home ${NODE_HOME} diff --git a/apps/cosmos-sdk/metadata.yaml.c b/apps/cosmos-sdk/metadata.yaml.c index 35d2277..080addb 100644 --- a/apps/cosmos-sdk/metadata.yaml.c +++ b/apps/cosmos-sdk/metadata.yaml.c @@ -6,25 +6,24 @@ publish_artifacts: true channels: - name: v0.50.x branch: refs/heads/release/v0.50.x - # platforms: ["linux/amd64","linux/arm64"] - platforms: ["linux/amd64"] + platforms: ["linux/amd64","linux/arm64"] container_tag_name: "0.50" update_modules: enabled: false tests_enabled: true - # - name: v0.50.x-mods - # branch: refs/heads/release/v0.50.x - # platforms: ["linux/amd64","linux/arm64"] - # container_tag_name: 0.50-mods - # update_modules: - # enabled: true - # cosmossdk_branch: refs/heads/release/v0.50.x - # tests_enabled: true - # - name: v0.52.x - # branch: refs/heads/release/v0.52.x - # platforms: ["linux/amd64","linux/arm64"] - # container_tag_name: "0.52" - # update_modules: - # enabled: false - # cosmossdk_branch: refs/heads/release/v0.52.x - # tests_enabled: true + - name: v0.50.x-mods + branch: refs/heads/release/v0.50.x + platforms: ["linux/amd64","linux/arm64"] + container_tag_name: 0.50-mods + update_modules: + enabled: true + cosmossdk_branch: refs/heads/release/v0.50.x + tests_enabled: true + - name: v0.52.x + branch: refs/heads/release/v0.52.x + platforms: ["linux/amd64","linux/arm64"] + container_tag_name: "0.52" + update_modules: + enabled: false + cosmossdk_branch: refs/heads/release/v0.52.x + tests_enabled: true diff --git a/apps/ibc-go/entrypoint.sh b/apps/ibc-go/entrypoint.sh index 3b06239..ee01eeb 100755 --- a/apps/ibc-go/entrypoint.sh +++ b/apps/ibc-go/entrypoint.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +set -Eeuo pipefail set -x NODE_HOME=${NODE_HOME:-/config} @@ -14,9 +15,9 @@ if [[ ! -f "${NODE_HOME}/config.json" ]]; then /app/node keys add alice --home ${NODE_HOME} /app/node keys add bob --home ${NODE_HOME} /app/node init testchain-node --chain-id testchain --home ${NODE_HOME} - jq '.app_state.gov.params.voting_period = "600s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json - jq '.app_state.gov.params.expedited_voting_period = "300s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json - jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json # to change the inflation + jq '.app_state.gov.params.voting_period = "600s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json + jq '.app_state.gov.params.expedited_voting_period = "300s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json + jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json # to change the inflation /app/node genesis add-genesis-account alice 5000000000stake --keyring-backend test --home ${NODE_HOME} /app/node genesis add-genesis-account bob 5000000000stake --keyring-backend test --home ${NODE_HOME} /app/node genesis gentx alice 1000000stake --chain-id testchain --home ${NODE_HOME} diff --git a/apps/ignite-example/ci/build.sh b/apps/ignite-example/ci/build.sh index 5916ac5..d63c69d 100755 --- a/apps/ignite-example/ci/build.sh +++ b/apps/ignite-example/ci/build.sh @@ -3,16 +3,6 @@ set -Eeuo pipefail set -x -# Install go -# apt update && apt install -y curl wget git -# wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz -# tar -C /usr/local -xzf go1.23.1.linux-amd64.tar.gz -# export PATH=$PATH:/usr/local/go/bin -# rm go1.23.1.linux-amd64.tar.gz -# cd ~ -# git clone https://github.com/auricom/example.git -# cd ~/example - # Install ignite CLI curl https://get.ignite.com/cli! | bash diff --git a/apps/ignite-example/ci/test.sh b/apps/ignite-example/ci/test.sh index 518b19e..c15afb0 100755 --- a/apps/ignite-example/ci/test.sh +++ b/apps/ignite-example/ci/test.sh @@ -3,12 +3,30 @@ set -oue pipefail set -x +BINARY_PATH=$(find $(go env GOPATH)/bin | grep $BINARY_NAME | tail -n 1) + # Set the timeout to 60 seconds TIMEOUT=60 START_TIME=$(date +%s) -cd ${MATRIX_APP_REPOSITORY} -exampled start > ./output.log 2>1 & +echo "Launch init procedure..." +CONFIG_HOME=$(${BINARY_PATH} config home) +${BINARY_PATH} config set client chain-id testchain +${BINARY_PATH} config set client keyring-backend test +sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.002token1"/' ${CONFIG_HOME}/config/app.toml +${BINARY_PATH} config set app api.enable true +${BINARY_PATH} keys add alice +${BINARY_PATH} keys add bob +${BINARY_PATH} init testchain-node --chain-id testchain +jq '.app_state.gov.params.voting_period = "600s"' ${CONFIG_HOME}/config/genesis.json > temp.json && mv temp.json ${CONFIG_HOME}/config/genesis.json +jq '.app_state.gov.params.expedited_voting_period = "300s"' ${CONFIG_HOME}/config/genesis.json > temp.json && mv temp.json ${CONFIG_HOME}/config/genesis.json +jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${CONFIG_HOME}/config/genesis.json > temp.json && mv temp.json ${CONFIG_HOME}/config/genesis.json # to change the inflation +${BINARY_PATH} genesis add-genesis-account alice 5000000000stake --keyring-backend test +${BINARY_PATH} genesis add-genesis-account bob 5000000000stake --keyring-backend test +${BINARY_PATH} genesis gentx alice 1000000stake --chain-id testchain +${BINARY_PATH} genesis collect-gentxs + +${BINARY_PATH} start > ./output.log 2>1 & APP_PID=$! @@ -24,7 +42,7 @@ while true; do fi # Check that 4th block is produced to validate the application - if simd query block-results 4; then + if ${BINARY_PATH} query block-results 4; then echo "Block #4 has been committed. Application is working correctly." kill $APP_PID exit 0 diff --git a/apps/ignite-example/entrypoint.sh b/apps/ignite-example/entrypoint.sh index 3b06239..f46036f 100755 --- a/apps/ignite-example/entrypoint.sh +++ b/apps/ignite-example/entrypoint.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +set -Eeuo pipefail set -x NODE_HOME=${NODE_HOME:-/config} @@ -9,14 +10,14 @@ if [[ ! -f "${NODE_HOME}/config.json" ]]; then echo "Launch init procedure..." /app/node config set client chain-id testchain --home ${NODE_HOME} /app/node config set client keyring-backend test --home ${NODE_HOME} - /app/node config set client keyring-default-keyname alice --home ${NODE_HOME} + sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.002token1"/' ${NODE_HOME}/config/app.toml /app/node config set app api.enable true --home ${NODE_HOME} /app/node keys add alice --home ${NODE_HOME} /app/node keys add bob --home ${NODE_HOME} /app/node init testchain-node --chain-id testchain --home ${NODE_HOME} - jq '.app_state.gov.params.voting_period = "600s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json - jq '.app_state.gov.params.expedited_voting_period = "300s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json - jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json # to change the inflation + jq '.app_state.gov.params.voting_period = "600s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json + jq '.app_state.gov.params.expedited_voting_period = "300s"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json + jq '.app_state.mint.minter.inflation = "0.300000000000000000"' ${NODE_HOME}/config/genesis.json > temp.json && mv temp.json ${NODE_HOME}/config/genesis.json # to change the inflation /app/node genesis add-genesis-account alice 5000000000stake --keyring-backend test --home ${NODE_HOME} /app/node genesis add-genesis-account bob 5000000000stake --keyring-backend test --home ${NODE_HOME} /app/node genesis gentx alice 1000000stake --chain-id testchain --home ${NODE_HOME} diff --git a/apps/ignite-example/metadata.yaml b/apps/ignite-example/metadata.yaml index 5ee8083..ae1024f 100644 --- a/apps/ignite-example/metadata.yaml +++ b/apps/ignite-example/metadata.yaml @@ -1,16 +1,23 @@ --- app: ignite-example -repository: auricom/example +repository: ignite/example path: ./ fetch_full_history: true publish_artifacts: true +binary_name: exampled channels: - name: master - # platforms: ["linux/amd64","linux/arm64"] platforms: ["linux/amd64"] branch: master container_tag_name: master update_modules: enabled: false - cosmossdk_branch: refs/heads/release/v0.50.x - tests_enabled: false \ No newline at end of file + tests_enabled: true + # - name: master-mods + # platforms: ["linux/amd64","linux/arm64"] + # branch: master + # container_tag_name: master + # update_modules: + # enabled: true + # cosmossdk_branch: refs/heads/release/v0.50.x + # tests_enabled: true \ No newline at end of file diff --git a/metadata.rules.cue b/metadata.rules.cue index 68b21ea..5813c9b 100644 --- a/metadata.rules.cue +++ b/metadata.rules.cue @@ -5,6 +5,7 @@ path: string fetch_full_history?: bool publish_artifacts: bool + binary_name?: string channels: [...#Channels] }