diff --git a/.github/workflows/publish-dev-chart.yaml b/.github/workflows/publish-dev-chart.yaml index 4946acd1..89b33e8e 100644 --- a/.github/workflows/publish-dev-chart.yaml +++ b/.github/workflows/publish-dev-chart.yaml @@ -198,3 +198,157 @@ jobs: export CHART_VERSION=$(grep 'version:' charts/$chart/Chart.yaml | head -n1 | awk '{ print $2 }') helm push $chart-${CHART_VERSION}.tgz oci://${HELM_REGISTRY} done + + kubeconform: + name: kubeconform-check + runs-on: ubuntu-latest + needs: + - publish-ghcr-scroll-sdk + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: dorny/paths-filter@v2 + id: filter + with: + base: ${{ github.event.repository.default_branch }} + list-files: shell + filters: | + addedOrModified: + - added|modified: 'charts/scroll-sdk/**' + + - name: Helm registry login + run: | + helm registry login ghcr.io/scroll-tech/helm/scroll-sdk --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} + + - name: Replace helm registry by helm/dev + run: | + find charts/ -type f -exec sed -i 's|oci://ghcr.io/scroll-tech/scroll-sdk/helm|oci://ghcr.io/scroll-tech/scroll-sdk/helm/dev|g' {} + + + - name: Install Kubeconform + run: | + set -e + wget https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz + tar xf kubeconform-linux-amd64.tar.gz + sudo mv kubeconform /usr/local/bin/ + + - name: Add Helm repositories + run: | + helm repo add grafana https://grafana.github.io/helm-charts + helm repo add prometheus-community https://prometheus-community.github.io/helm-charts + helm repo add blockscout https://blockscout.github.io/helm-charts + helm repo update + + - name: Validate rendered templates + run: | + set -e + failed_charts=() + for chart in charts/*; do + if [ -d "$chart" ]; then + echo "Processing chart $chart" + if [[ $(basename $chart) == "common" ]] || [[ $(basename $chart) == "external-secrets-lib" ]]; then + echo "Skipping library chart: $chart" + continue + fi + + if ! helm dependency update $chart; then + failed_charts+=("$chart - dependency update failed") + continue + fi + + if ! helm dependency build $chart; then + failed_charts+=("$chart - dependency build failed") + continue + fi + + if ! helm template $(basename $chart) $chart | kubeconform \ + -summary \ + -output json \ + -schema-location default \ + -schema-location https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/jsonnet/prometheus-operator/servicemonitors-crd.json \ + -schema-location https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/jsonnet/prometheus-operator/alertmanagers-crd.json \ + -schema-location https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/jsonnet/prometheus-operator/prometheusrules-crd.json \ + -schema-location https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/jsonnet/prometheus-operator/prometheuses-crd.json \ + -schema-location https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/jsonnet/prometheus-operator/podmonitors-crd.json \ + -strict \ + -; then + failed_charts+=("$chart - validation failed") + fi + fi + done + + if [ ${#failed_charts[@]} -ne 0 ]; then + echo "faild charts are:" + printf '%s\n' "${failed_charts[@]}" + exit 1 + fi + + run-k8s-test: + name: check-services-up-and-running + runs-on: ubuntu-latest + needs: + - publish-ghcr-scroll-sdk + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.12.1 + + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.0 + + - name: Replace helm registry by helm/dev + run: | + find devnet/ -type f -exec sed -i 's|oci://ghcr.io/scroll-tech/scroll-sdk/helm|oci://ghcr.io/scroll-tech/scroll-sdk/helm/dev|g' {} + + + - name: Create Kind Cluster + uses: helm/kind-action@v1.8.0 + with: + cluster_name: chart-testing + + - name: Helm registry login + run: | + helm registry login ghcr.io/scroll-tech/helm/scroll-sdk --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} + + - name: Run Devnet Bootstrap + run: cd devnet && make bootstrap + + - name: Install Charts using Makefile + run: | + cd devnet + make install + + - name: Ensure all services are up and running + run: | + START_TIME=$(date +%s) + TIMEOUT=600 + + while true; do + ELAPSED_TIME=$(( $(date +%s) - START_TIME )) + + if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then + echo "Timeout reached: Exiting after $TIMEOUT seconds" + exit 1 + fi + kubectl get pods + kubectl describe nodes + + if kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Succeeded,status.phase!=Failed --timeout=5s; then + echo "All pods are ready." + break + else + echo "Waiting for pods to be ready..." + sleep 10 + fi + done diff --git a/charts/blockscout/Chart.yaml b/charts/blockscout/Chart.yaml index b4ab203f..329df5be 100644 --- a/charts/blockscout/Chart.yaml +++ b/charts/blockscout/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: blockscout scroll helm charts name: blockscout -version: 0.1.0 +version: 0.1.1 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: diff --git a/charts/blockscout/README.md b/charts/blockscout/README.md index 265aa041..c4688cb5 100644 --- a/charts/blockscout/README.md +++ b/charts/blockscout/README.md @@ -1,6 +1,6 @@ # blockscout -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) +![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) blockscout scroll helm charts @@ -48,6 +48,8 @@ Kubernetes: `>=1.22.0-0` | blockscout-stack.blockscout.ingress.className | string | `"nginx"` | | | blockscout-stack.blockscout.ingress.enabled | bool | `true` | | | blockscout-stack.blockscout.ingress.hostname | string | `"blockscout-backend.scrollsdk"` | | +| blockscout-stack.blockscout.resources.requests.cpu | string | `"250m"` | | +| blockscout-stack.blockscout.resources.requests.memory | string | `"512Mi"` | | | blockscout-stack.frontend.env.FAVICON_MASTER_URL | string | `"https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/favicons/scroll_180x180.png"` | | | blockscout-stack.frontend.env.NEXT_PUBLIC_AD_BANNER_PROVIDER | string | `"none"` | | | blockscout-stack.frontend.env.NEXT_PUBLIC_AD_TEXT_PROVIDER | string | `"none"` | | diff --git a/charts/blockscout/values.yaml b/charts/blockscout/values.yaml index 900cabc2..52b15e41 100644 --- a/charts/blockscout/values.yaml +++ b/charts/blockscout/values.yaml @@ -10,6 +10,10 @@ blockscout-stack: repository: blockscout/blockscout-scroll pullPolicy: IfNotPresent tag: 6.9.0-alpha.1 + resources: + requests: + cpu: "250m" + memory: "512Mi" env: ETHEREUM_JSONRPC_HTTP_URL: http://l2-rpc:8545 diff --git a/charts/rollup-explorer-backend/Chart.yaml b/charts/rollup-explorer-backend/Chart.yaml index 2e873d07..1819b483 100644 --- a/charts/rollup-explorer-backend/Chart.yaml +++ b/charts/rollup-explorer-backend/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: rollup-explorer-backend helm charts name: rollup-explorer-backend -version: 0.1.0 +version: 0.1.1 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: diff --git a/charts/rollup-explorer-backend/README.md b/charts/rollup-explorer-backend/README.md index e6c80caf..5911be83 100644 --- a/charts/rollup-explorer-backend/README.md +++ b/charts/rollup-explorer-backend/README.md @@ -1,6 +1,6 @@ # rollup-explorer-backend -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) +![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) rollup-explorer-backend helm charts @@ -72,7 +72,7 @@ Kubernetes: `>=1.22.0-0` | probes.startup.<<.spec.httpGet.port | int | `8090` | | | resources.limits.cpu | string | `"3"` | | | resources.limits.memory | string | `"6Gi"` | | -| resources.requests.cpu | string | `"2"` | | +| resources.requests.cpu | string | `"1"` | | | resources.requests.memory | string | `"4Gi"` | | | scrollConfig | string | `"{}\n"` | | | service.main.enabled | bool | `true` | | diff --git a/charts/rollup-explorer-backend/values.yaml b/charts/rollup-explorer-backend/values.yaml index 589aae89..277dac9e 100644 --- a/charts/rollup-explorer-backend/values.yaml +++ b/charts/rollup-explorer-backend/values.yaml @@ -15,7 +15,7 @@ image: resources: requests: memory: "4Gi" - cpu: "2" + cpu: "100m" limits: memory: "6Gi" cpu: "3" diff --git a/charts/scroll-sdk/Chart.yaml b/charts/scroll-sdk/Chart.yaml index 1c1784fb..7afef398 100644 --- a/charts/scroll-sdk/Chart.yaml +++ b/charts/scroll-sdk/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: scroll helm charts to deploy scroll sdk name: scroll-sdk -version: 0.1.0 +version: 0.1.1 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: @@ -22,7 +22,7 @@ dependencies: repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" condition: balance-checker.enabled - name: blockscout - version: 0.1.0 + version: 0.1.1 repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" condition: blockscout.enabled - name: bridge-history-api @@ -82,7 +82,7 @@ dependencies: version: 15.5.0 condition: postgresql.enabled - name: rollup-explorer-backend - version: 0.1.0 + version: 0.1.1 repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" condition: rollup-explorer-backend.enabled - name: rollup-node diff --git a/charts/scroll-sdk/README.md b/charts/scroll-sdk/README.md index e09fc1a9..c8acd3d3 100644 --- a/charts/scroll-sdk/README.md +++ b/charts/scroll-sdk/README.md @@ -1,6 +1,6 @@ # scroll-sdk -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) +![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) scroll helm charts to deploy scroll sdk @@ -22,7 +22,7 @@ Kubernetes: `>=1.22.0-0` | oci://ghcr.io/scroll-tech/scroll-sdk/helm | admin-system-cron | 0.1.0 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | admin-system-dashboard | 0.1.0 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | balance-checker | 0.1.0 | -| oci://ghcr.io/scroll-tech/scroll-sdk/helm | blockscout | 0.1.0 | +| oci://ghcr.io/scroll-tech/scroll-sdk/helm | blockscout | 0.1.1 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | blockscout-sc-verifier | 0.0.2 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | bridge-history-api | 0.1.0 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | bridge-history-fetcher | 0.1.0 | @@ -37,7 +37,7 @@ Kubernetes: `>=1.22.0-0` | oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-bootnode | 0.1.0 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-rpc | 0.1.0 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-sequencer | 0.1.0 | -| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rollup-explorer-backend | 0.1.0 | +| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rollup-explorer-backend | 0.1.1 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | rollup-node | 0.1.0 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | rpc-gateway | 0.1.0 | | oci://ghcr.io/scroll-tech/scroll-sdk/helm | scroll-common | 0.1.0 | diff --git a/devnet/Makefile b/devnet/Makefile index 578aaaf0..8bdb819a 100644 --- a/devnet/Makefile +++ b/devnet/Makefile @@ -7,14 +7,14 @@ L1_RPC_HOST := l1-devnet.scrollsdk bootstrap: echo "Pulling helm chart..." - helm pull oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-sdk --version 0.1.0 + helm pull oci://ghcr.io/scroll-tech/scroll-sdk/helm/scroll-sdk --version 0.1.1 echo "Extracting helm chart..." tar -xvf *.tgz $(MAKE) config config: echo "Creating configuration files..." - cd scroll-sdk && time docker run --rm -it -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-2eba3d2c418b16f4a66d9baadeb1c1bafdca81b1 + cd scroll-sdk && time docker run --rm -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-2eba3d2c418b16f4a66d9baadeb1c1bafdca81b1 echo "Creating env files..." ./create-env-files.sh scroll-sdk ./prepare-config-files.sh diff --git a/examples/Makefile.example b/examples/Makefile.example index bb23a5ab..1054a9d5 100644 --- a/examples/Makefile.example +++ b/examples/Makefile.example @@ -65,7 +65,7 @@ install: --values values/l2-rpc-production.yaml helm upgrade -i rollup-explorer-backend oci://ghcr.io/scroll-tech/scroll-sdk/helm/rollup-explorer-backend -n $(NAMESPACE) \ - --version=0.1.0 \ + --version=0.1.1 \ --values values/rollup-explorer-backend-production.yaml \ --values values/rollup-explorer-backend-config.yaml