Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/deploy-fisherman-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ jobs:
namespace: ignition-fisherman-sepolia
l1_network: sepolia
cluster: aztec-gke-private
semver: ${{ inputs.semver }}

setup-irm-mainnet:
needs: deploy-fisherman
Expand All @@ -195,3 +196,4 @@ jobs:
monitoring_namespace: mainnet-irm
l1_network: mainnet
cluster: aztec-gke-private
semver: ${{ inputs.semver }}
10 changes: 9 additions & 1 deletion .github/workflows/deploy-irm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ on:
required: true
type: string
default: "aztec-gke-private"

jobs:
deploy-irm:
env:
Expand Down Expand Up @@ -96,6 +95,13 @@ jobs:
run: |
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region ${{ env.REGION }}

- name: Get IRM version from VERSION file
id: get_version
run: |
VERSION=$(cat spartan/metrics/irm-monitor/VERSION | tr -d '[:space:]')
echo "IRM version: ${VERSION}"
echo "IMAGE_TAG=${VERSION}" >> "$GITHUB_ENV"

- name: Validate inputs
run: |
# Validate l1_network
Expand Down Expand Up @@ -136,10 +142,12 @@ jobs:
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
echo "Deploying IRM to network: ${{ inputs.network }}"
echo "Namespace to monitor: ${NAMESPACE}"
echo "Monitoring namespace: ${MONITORING_NAMESPACE}"
echo "L1 network: ${{ inputs.l1_network }}"
echo "Image tag: ${IMAGE_TAG}"

./spartan/metrics/irm-monitor/scripts/update-monitoring.sh $NAMESPACE $MONITORING_NAMESPACE ${{ inputs.network }} $INFURA_SECRET_NAME
2 changes: 1 addition & 1 deletion .github/workflows/deploy-network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:

if [ -n "$CLUSTER" ]; then
echo "cluster=$CLUSTER" >> $GITHUB_OUTPUT
else
else
echo "cluster=" >> $GITHUB_OUTPUT
fi

Expand Down
1 change: 1 addition & 0 deletions spartan/metrics/irm-monitor/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0
4 changes: 4 additions & 0 deletions spartan/metrics/irm-monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import client from "prom-client";

const { ROLLUP_CONTRACT_ADDRESS, ETHEREUM_HOST, NETWORK } = process.env;

//////////////////////////////
// IMPORTANT: Bump VERSION file when making changes
//////////////////////////////

if (!ROLLUP_CONTRACT_ADDRESS || !ETHEREUM_HOST || !NETWORK) {
console.error(
"ROLLUP_CONTRACT_ADDRESS, ETHEREUM_HOST and NETWORK are required. Provided: ",
Expand Down
20 changes: 13 additions & 7 deletions spartan/metrics/irm-monitor/scripts/build-and-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

set -euo pipefail

# Build and publish aztecprotocol/aztec-block-height-monitor if the tag doesn't exist
# Usage: ./build-and-publish.sh <tag>

TAG=${1:-latest}
IMAGE="aztecprotocol/block-height-monitor:${TAG}"
# Build and publish the IRM monitor image if it doesn't exist
# Usage: ./build-and-publish.sh <image> (e.g., aztecprotocol/block-height-monitor:2.3.4)

IMAGE=${1:-aztecprotocol/block-height-monitor:latest}

echo "Checking if ${IMAGE} exists on Docker Hub..."
if curl -fsSL "https://hub.docker.com/v2/repositories/aztecprotocol/block-height-monitor/tags/${TAG}" >/dev/null 2>&1; then
echo "Image tag already exists: ${IMAGE}"

# Extract repository and tag from the full image name
REPO="${IMAGE%%:*}"
TAG="${IMAGE##*:}"

echo "REPO: ${REPO}"
echo "TAG: ${TAG}"

if curl -fsSL "https://hub.docker.com/v2/repositories/${REPO}/tags/${TAG}" >/dev/null 2>&1; then
echo "Image already exists: ${IMAGE}"
exit 0
fi

Expand Down
8 changes: 4 additions & 4 deletions spartan/metrics/irm-monitor/scripts/update-monitoring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ INFURA_URL_SECRET=${4:-"infura-sepolia-url"}
# Deployment name includes the monitoring namespace prefix
export DEPLOYMENT_NAME="${MONITORING_NAMESPACE}-monitor"

# Docker image (can be overridden via IMAGE_TAG or IMAGE environment variable)
# Docker image tag (defaults to 'latest' if not provided via IMAGE_TAG environment variable)
IMAGE_TAG=${IMAGE_TAG:-latest}
IMAGE=${IMAGE:-"aztecprotocol/block-height-monitor:${IMAGE_TAG}"}
IMAGE="aztecprotocol/block-height-monitor:${IMAGE_TAG}"

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BASE_DIR="$SCRIPT_DIR/.."
Expand Down Expand Up @@ -156,8 +156,8 @@ yq eval ".metadata.name = \"${DEPLOYMENT_NAME}\" |
# Build image if missing (initial install path only)
SCRIPT_BUILD="$SCRIPT_DIR/build-and-publish.sh"
if [ -x "$SCRIPT_BUILD" ]; then
echo "Ensuring image aztecprotocol/block-height-monitor:${IMAGE_TAG} exists..."
"$SCRIPT_BUILD" "$IMAGE_TAG"
echo "Ensuring image ${IMAGE} exists..."
"$SCRIPT_BUILD" "$IMAGE"
fi

echo "Applying Deployment..."
Expand Down
Loading