Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
auricom committed Sep 26, 2024
1 parent 702eb94 commit 2a14fc0
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 51 deletions.
5 changes: 4 additions & 1 deletion .github/scripts/prepare-matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/update-go-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ for module in $modules; do
exit 1
fi
;;
*errors*)
*errors*|*api*|*core*)
echo "ignore $module"
;;
*)
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build-applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions apps/cosmos-sdk-comet/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

set -Eeuo pipefail
set -x

NODE_HOME=${NODE_HOME:-/config}
Expand All @@ -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}
Expand Down
7 changes: 4 additions & 3 deletions apps/cosmos-sdk/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

set -Eeuo pipefail
set -x

NODE_HOME=${NODE_HOME:-/config}
Expand All @@ -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}
Expand Down
35 changes: 17 additions & 18 deletions apps/cosmos-sdk/metadata.yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions apps/ibc-go/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

set -Eeuo pipefail
set -x

NODE_HOME=${NODE_HOME:-/config}
Expand All @@ -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}
Expand Down
10 changes: 0 additions & 10 deletions apps/ignite-example/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 21 additions & 3 deletions apps/ignite-example/ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$!


Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions apps/ignite-example/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

set -Eeuo pipefail
set -x

NODE_HOME=${NODE_HOME:-/config}
Expand All @@ -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}
Expand Down
15 changes: 11 additions & 4 deletions apps/ignite-example/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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
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
1 change: 1 addition & 0 deletions metadata.rules.cue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
path: string
fetch_full_history?: bool
publish_artifacts: bool
binary_name?: string
channels: [...#Channels]
}

Expand Down

0 comments on commit 2a14fc0

Please sign in to comment.