Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
auricom committed Sep 24, 2024
1 parent 79c744f commit 00a347b
Show file tree
Hide file tree
Showing 17 changed files with 271 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/prepare-matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_app_metadata(subdir, meta, forRelease=False, channels=None):
toBuild["branch"] = channel["branch"]
toBuild["update_modules"] = channel["update_modules"]
toBuild["build_command"] = meta["build_command"]
toBuild["build_artifacts"] = meta["build_artifacts"]
toBuild["publish_artifacts"] = meta["publish_artifacts"]

# Container Tags
toBuild["tags"] = [channel]
Expand Down Expand Up @@ -87,7 +87,7 @@ def get_app_metadata(subdir, meta, forRelease=False, channels=None):
platformToBuild["tests_command"] = channel["tests"]["command"]

platformToBuild["build_command"] = toBuild["build_command"]
platformToBuild["build_artifacts"] = meta["build_artifacts"]
platformToBuild["publish_artifacts"] = meta["publish_artifacts"]
platformToBuild["update_modules"] = channel["update_modules"]

appsToBuild["appsPlatforms"].append(platformToBuild)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
echo "${matrices}"
build-platform-app:
name: Build/Test ${{ matrix.app.name }} ${{ matrix.app.channel }} (${{ matrix.app.platform }})
name: "Build ${{ matrix.app.name }} ${{ matrix.app.channel }} (${{ matrix.app.platform }})"
needs: prepare
runs-on: ubuntu-latest
if: ${{ toJSON(fromJSON(needs.prepare.outputs.matrices).appsPlatforms) != '[]' && toJSON(fromJSON(needs.prepare.outputs.matrices).appsPlatforms) != '' }}
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
- name: Run Goss Tests
id: dgoss
if: ${{ matrix.image.tests_enabled }} && ${{ matrix.image.publish_artifacts }}
if: ${{ matrix.image.tests_enabled && matrix.image.publish_artifacts }}
env:
CONTAINER_RUNTIME: docker
GOSS_FILES_PATH: ${{ github.workspace }}/nightly-stack/containers/cosmos-sdk/ci
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/nightlies-scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
with:
# appsToBuild: ${{ inputs.appsToBuild }}
appsToBuild: all
publishArtifacts: true
sendNotifications: true

# render-readme:
Expand Down
44 changes: 44 additions & 0 deletions apps/cosmos-sdk-comet/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM cgr.dev/chainguard/wolfi-base:latest@sha256:0f1d81605bda6e2388c3c7f731700d8c12e17259d58ffba11f36ddc81d9c0a76

ARG BINARY

WORKDIR /app

USER root

COPY ./$BINARY /app/node

RUN apk update && \
apk add --no-cache \
bash \
libstdc++ \
jq \
tini \
&& \
mkdir -p /config && \
chown -R nonroot:nonroot /app /config && \
chmod -R u=rwX,go=rX /app /config && \
chmod +x /app/node

USER nonroot

COPY ./entrypoint.sh /entrypoint.sh

# API Server
EXPOSE 1317

# Pprof Server
EXPOSE 6060

# gRPC Server
EXPOSE 9090

# CometBFT RPC interface
EXPOSE 26657

HEALTHCHECK --interval=1m --timeout=3s CMD /app/node query node status | grep validator_hash || exit 1

VOLUME ["/config"]

ENTRYPOINT ["tini", "--"]
CMD ["/entrypoint.sh"]
11 changes: 11 additions & 0 deletions apps/cosmos-sdk-comet/ci/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process
process:
node:
running: true

# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port
port:
# https://github.com/aelsabbahy/goss/issues/149
tcp:26657:
listening: true
28 changes: 28 additions & 0 deletions apps/cosmos-sdk-comet/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -x

NODE_HOME=${NODE_HOME:-/config}
START_CMD=${START_CMD:-start}

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}
/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
/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}
/app/node genesis collect-gentxs --home ${NODE_HOME}
fi

exec \
/app/node ${START_CMD} --home ${NODE_HOME} \
"$@"
2 changes: 1 addition & 1 deletion apps/cosmos-sdk-comet/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ app: cosmos-sdk-comet
repository: cosmos/cosmos-sdk
path: simapp
build_command: make install
build_artifacts: true
publish_artifacts: true
channels:
- name: main
platforms: ["linux/amd64","linux/arm64"]
Expand Down
2 changes: 1 addition & 1 deletion apps/cosmos-sdk/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ app: cosmos-sdk
repository: cosmos/cosmos-sdk
path: simapp
build_command: make install
build_artifacts: true
publish_artifacts: true
channels:
- name: main
platforms: ["linux/amd64","linux/arm64"]
Expand Down
44 changes: 44 additions & 0 deletions apps/ibc-go/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM cgr.dev/chainguard/wolfi-base:latest@sha256:0f1d81605bda6e2388c3c7f731700d8c12e17259d58ffba11f36ddc81d9c0a76

ARG BINARY

WORKDIR /app

USER root

COPY ./$BINARY /app/node

RUN apk update && \
apk add --no-cache \
bash \
libstdc++ \
jq \
tini \
&& \
mkdir -p /config && \
chown -R nonroot:nonroot /app /config && \
chmod -R u=rwX,go=rX /app /config && \
chmod +x /app/node

USER nonroot

COPY ./entrypoint.sh /entrypoint.sh

# API Server
EXPOSE 1317

# Pprof Server
EXPOSE 6060

# gRPC Server
EXPOSE 9090

# CometBFT RPC interface
EXPOSE 26657

HEALTHCHECK --interval=1m --timeout=3s CMD /app/node query node status | grep validator_hash || exit 1

VOLUME ["/config"]

ENTRYPOINT ["tini", "--"]
CMD ["/entrypoint.sh"]
11 changes: 11 additions & 0 deletions apps/ibc-go/ci/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process
process:
node:
running: true

# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port
port:
# https://github.com/aelsabbahy/goss/issues/149
tcp:26657:
listening: true
28 changes: 28 additions & 0 deletions apps/ibc-go/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -x

NODE_HOME=${NODE_HOME:-/config}
START_CMD=${START_CMD:-start}

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}
/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
/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}
/app/node genesis collect-gentxs --home ${NODE_HOME}
fi

exec \
/app/node ${START_CMD} --home ${NODE_HOME} \
"$@"
2 changes: 1 addition & 1 deletion apps/ibc-go/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ app: ibc-go
repository: cosmos/ibc-go
path: simapp
build_command: make build
build_artifacts: true
publish_artifacts: true
channels:
- name: main
platforms: ["linux/amd64","linux/arm64"]
Expand Down
44 changes: 44 additions & 0 deletions apps/ignite-example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM cgr.dev/chainguard/wolfi-base:latest@sha256:0f1d81605bda6e2388c3c7f731700d8c12e17259d58ffba11f36ddc81d9c0a76

ARG BINARY

WORKDIR /app

USER root

COPY ./$BINARY /app/node

RUN apk update && \
apk add --no-cache \
bash \
libstdc++ \
jq \
tini \
&& \
mkdir -p /config && \
chown -R nonroot:nonroot /app /config && \
chmod -R u=rwX,go=rX /app /config && \
chmod +x /app/node

USER nonroot

COPY ./entrypoint.sh /entrypoint.sh

# API Server
EXPOSE 1317

# Pprof Server
EXPOSE 6060

# gRPC Server
EXPOSE 9090

# CometBFT RPC interface
EXPOSE 26657

HEALTHCHECK --interval=1m --timeout=3s CMD /app/node query node status | grep validator_hash || exit 1

VOLUME ["/config"]

ENTRYPOINT ["tini", "--"]
CMD ["/entrypoint.sh"]
11 changes: 11 additions & 0 deletions apps/ignite-example/ci/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process
process:
node:
running: true

# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port
port:
# https://github.com/aelsabbahy/goss/issues/149
tcp:26657:
listening: true
28 changes: 28 additions & 0 deletions apps/ignite-example/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -x

NODE_HOME=${NODE_HOME:-/config}
START_CMD=${START_CMD:-start}

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}
/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
/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}
/app/node genesis collect-gentxs --home ${NODE_HOME}
fi

exec \
/app/node ${START_CMD} --home ${NODE_HOME} \
"$@"
14 changes: 14 additions & 0 deletions apps/ignite-example/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
app: ignite-example
repository: ignite/example
path: ./
build_command: go install
publish_artifacts: true
channels:
- name: master
platforms: ["linux/amd64","linux/arm64"]
branch: master
update_modules: true
tests:
enabled: true
command: make init-simapp && simd start
2 changes: 1 addition & 1 deletion metadata.rules.cue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
repository: string
path: string
build_command: string
build_artifacts: bool
publish_artifacts: bool
channels: [...#Channels]
}

Expand Down

0 comments on commit 00a347b

Please sign in to comment.