From 6dc5894b9a421fd106569d666a575ff5201f6778 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 13 May 2025 15:28:47 -0700 Subject: [PATCH 1/4] build multi-arch images for dist --- docker/dist/build_images.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/dist/build_images.sh b/docker/dist/build_images.sh index e0d83a5d8..ccfa9cc85 100755 --- a/docker/dist/build_images.sh +++ b/docker/dist/build_images.sh @@ -11,11 +11,12 @@ declare -A services=( ["bluewaveuptime/uptime_server"]="./docker/dist/server.Dockerfile" ) -# Loop through each service and build the corresponding image for service in "${!services[@]}"; do - docker build -f "${services[$service]}" -t "$service" . - - # Check if the build succeeded + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + -f "${services[$service]}" \ + -t "$service" \ + if [ $? -ne 0 ]; then echo "Error building $service image. Exiting..." exit 1 From 077fae2147adde973322ff5f135b70e80c7fc9c4 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 13 May 2025 15:32:28 -0700 Subject: [PATCH 2/4] update workflow --- .github/workflows/distribution-deploy.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/distribution-deploy.yml b/.github/workflows/distribution-deploy.yml index b96a0f3d7..55d7c5e4c 100644 --- a/.github/workflows/distribution-deploy.yml +++ b/.github/workflows/distribution-deploy.yml @@ -11,6 +11,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -20,7 +23,8 @@ jobs: - name: Build Client Docker image run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t ghcr.io/bluewave-labs/checkmate:frontend-dist \ -f ./docker/dist/client.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ @@ -36,6 +40,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -45,7 +52,8 @@ jobs: - name: Build Server Docker image run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t ghcr.io/bluewave-labs/checkmate:backend-dist \ -f ./docker/dist/server.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ @@ -56,7 +64,8 @@ jobs: - name: Build Mongo Docker image run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t ghcr.io/bluewave-labs/checkmate:mongo-dist \ -f ./docker/dist/mongoDB.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ @@ -67,7 +76,8 @@ jobs: - name: Build Redis Docker image run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t ghcr.io/bluewave-labs/checkmate:redis-dist \ -f ./docker/dist/redis.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ From be20fb0dbb7b68a8cf1debb36f89bce4dbfcdb09 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Wed, 14 May 2025 16:08:18 +0200 Subject: [PATCH 3/4] fix: TypeError in hardware notifications for null disk values --- server/service/notificationService.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/service/notificationService.js b/server/service/notificationService.js index 624056694..4b1ff6160 100755 --- a/server/service/notificationService.js +++ b/server/service/notificationService.js @@ -257,9 +257,7 @@ class NotificationService { const alerts = { cpu: cpuThreshold !== -1 && cpuUsage > cpuThreshold ? true : false, memory: memoryThreshold !== -1 && memoryUsage > memoryThreshold ? true : false, - disk: disk.some((d) => diskThreshold !== -1 && d.usage_percent > diskThreshold) - ? true - : false, + disk: disk?.some(d => diskThreshold !== -1 && d.usage_percent > diskThreshold) ?? false, }; const notifications = await this.db.getNotificationsByMonitorId( From f6e460d97a67cf8a0b3828f29059dce3c46a6b15 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Wed, 14 May 2025 19:37:47 +0200 Subject: [PATCH 4/4] fix: typeof number check and more safety --- server/service/notificationService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/notificationService.js b/server/service/notificationService.js index 4b1ff6160..e4f343c80 100755 --- a/server/service/notificationService.js +++ b/server/service/notificationService.js @@ -257,7 +257,7 @@ class NotificationService { const alerts = { cpu: cpuThreshold !== -1 && cpuUsage > cpuThreshold ? true : false, memory: memoryThreshold !== -1 && memoryUsage > memoryThreshold ? true : false, - disk: disk?.some(d => diskThreshold !== -1 && d.usage_percent > diskThreshold) ?? false, + disk: disk?.some(d => diskThreshold !== -1 && typeof d?.usage_percent === "number" && d?.usage_percent > diskThreshold) ?? false, }; const notifications = await this.db.getNotificationsByMonitorId(