Skip to content

Commit

Permalink
fix some charts and easy deployment of chart with github action
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaizet-ledger committed Sep 2, 2024
1 parent c558e58 commit e71b2d1
Show file tree
Hide file tree
Showing 14 changed files with 133 additions and 27 deletions.
124 changes: 112 additions & 12 deletions .github/workflows/publish-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: Lint, test and publish charts

on:
push:
branches: [ develop ]
paths:
- 'charts/**'
# branches: [ develop ]
# paths:
# - 'charts/**'

jobs:
helm-chart-testing:
helm-chart-testing-not-scroll-sdk:
name: chart-testing-without-scroll-sdk
runs-on: ubuntu-latest
environment: test
steps:
Expand All @@ -29,32 +30,33 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Setup scroll-sdk values
run: cd charts/scroll-sdk && docker run --rm -t -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-v0.0.9
# - name: Setup scroll-sdk values
# run: cd charts/scroll-sdk && docker run --rm -t -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-v0.0.17

- name: Helm registry login
run: |
helm registry login ghcr.io/scroll-tech/helm/scroll-sdk --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
env:
HELM_GITHUB_PASSWORD: "${{ secrets.HELM_GITHUB_PASSWORD }}"

# List chart change except scroll-sdk
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
changed=$(ct list-changed --excluded-charts scroll-sdk --target-branch ${{ github.event.repository.default_branch }} )
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config ct.yaml --target-branch ${{ github.event.repository.default_branch }}
run: ct lint --config ct.yaml --excluded-charts scroll-sdk --target-branch ${{ github.event.repository.default_branch }}

publish-ghcr:
name: publish-to-github
publish-ghcr-not-scroll-sdk:
name: publish-to-github-without-scroll-sdk
runs-on: ubuntu-latest
needs:
- helm-chart-testing
- helm-chart-testing-not-scroll-sdk
outputs:
charts: ${{ steps.list-changed.outputs.changed }}
steps:
Expand All @@ -65,11 +67,109 @@ jobs:
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
base: ${{ github.event.repository.default_branch }}
list-files: shell
filters: |
addedOrModified:
- added|modified: 'charts/**'
- exclude: '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 }}
env:
HELM_GITHUB_PASSWORD: "${{ secrets.HELM_GITHUB_PASSWORD }}"

- name: Push chart to ghcr
if: steps.filter.outputs.addedOrModified == 'true'
env:
HELM_EXPERIMENTAL_OCI: 1
run: |
set -x
CHARTS=()
PATHS=(${{ steps.filter.outputs.addedOrModified_files }})
echo ${PATHS}
# Get only the chart paths
for i in "${PATHS[@]}"
do
CHARTS+=($(echo $i | awk -F "/" '{print $2}'))
done
# Remove duplicates
CHARTS=( `for i in ${CHARTS[@]}; do echo $i; done | sort -u` )
echo "CHARTS: ${CHARTS[@]}"
for chart in ${CHARTS[@]}; do
helm dependencies build charts/$chart
helm package charts/$chart
export CHART_VERSION=$(grep 'version:' charts/$chart/Chart.yaml | head -n1 | awk '{ print $2 }')
helm push $chart-${CHART_VERSION}.tgz oci://ghcr.io/scroll-tech/scroll-sdk/helm
done
helm-chart-testing-scroll-sdk:
name: chart-testing-scroll-sdk
runs-on: ubuntu-latest
needs:
- publish-ghcr-not-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/[email protected]

- name: Setup scroll-sdk values
run: cd charts/scroll-sdk && docker run --rm -t -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-v0.0.17

- name: Helm registry login
run: |
helm registry login ghcr.io/scroll-tech/helm/scroll-sdk --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
env:
HELM_GITHUB_PASSWORD: "${{ secrets.HELM_GITHUB_PASSWORD }}"

# List scroll-sdk chart if it has changed
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --charts scroll-sdk --target-branch ${{ github.event.repository.default_branch }} )
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config ct.yaml --charts scroll-sdk --target-branch ${{ github.event.repository.default_branch }}

publish-ghcr-scroll-sdk:
name: publish-scroll-sdk-to-github
runs-on: ubuntu-latest
needs:
- helm-chart-testing-scroll-sdk
outputs:
charts: ${{ steps.list-changed.outputs.changed }}
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: |
Expand Down
2 changes: 1 addition & 1 deletion charts/coordinator-cron/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: coordinator-cron helm charts
name: coordinator-cron
version: 0.0.1
version: 0.0.2
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/coordinator-cron/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coordinator-cron

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

coordinator-cron helm charts

Expand Down
3 changes: 2 additions & 1 deletion charts/coordinator-cron/values/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ ingress:
main:
ingressClassName: "nginx"
hosts:
- host: coordinator-api-2.devnet.scroll.tech
- host: coordinator-api.scrollsdk
paths:
- path: /
pathType: Prefix

externalSecrets:
coordinator-cron-secret-env:
provider: aws
data:
- remoteRef:
key: scroll/coordinator-cron-secret-env
Expand Down
2 changes: 1 addition & 1 deletion charts/l2-bootnode/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: l2-bootnode helm chart
name: l2-bootnode
version: 0.0.4
version: 0.0.5
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down
3 changes: 2 additions & 1 deletion charts/l2-bootnode/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# l2-bootnode
![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

l2-bootnode helm chart

Expand Down
1 change: 1 addition & 0 deletions charts/l2-bootnode/values/production-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ configMaps:
data:
CHAIN_ID: ""
L2GETH_L1_ENDPOINT: ""
L2GETH_PEER_LIST: ""
1 change: 1 addition & 0 deletions charts/l2-bootnode/values/production-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ configMaps:
data:
CHAIN_ID: ""
L2GETH_L1_ENDPOINT: ""
L2GETH_PEER_LIST: ""
1 change: 1 addition & 0 deletions charts/l2-bootnode/values/production-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ configMaps:
data:
CHAIN_ID: ""
L2GETH_L1_ENDPOINT: ""
L2GETH_PEER_LIST: ""
2 changes: 1 addition & 1 deletion charts/l2-sequencer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: l2-sequencer helm charts
name: l2-sequencer
version: 0.0.4
version: 0.0.5
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/l2-sequencer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# l2-sequencer

![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

l2-sequencer helm charts

Expand Down
1 change: 1 addition & 0 deletions charts/l2-sequencer/values/production-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ persistence:

externalSecrets:
l2-sequencer-secret-1-env:
provider: aws
data:
- remoteRef:
key: scroll/l2-sequencer-secret-env
Expand Down
8 changes: 4 additions & 4 deletions charts/scroll-sdk/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
description: scroll helm charts to deploy scroll sdk
name: scroll-sdk
version: 0.0.7
version: 0.0.8
appVersion: v0.1.0
kubeVersion: ">=1.22.0-0"
maintainers:
Expand Down Expand Up @@ -50,7 +50,7 @@ dependencies:
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: coordinator-api.enabled
- name: coordinator-cron
version: 0.0.1
version: 0.0.2
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: coordinator-cron.enabled
- name: frontends
Expand All @@ -66,7 +66,7 @@ dependencies:
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: l1-explorer.enabled
- name: l2-bootnode
version: 0.0.4
version: 0.0.5
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: l2-bootnode.enabled
- name: l2-rpc
Expand All @@ -78,7 +78,7 @@ dependencies:
version: 7.3.11
condition: grafana.enabled
- name: l2-sequencer
version: 0.0.4
version: 0.0.5
repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm"
condition: l2-sequencer.enabled
- name: loki-stack
Expand Down
8 changes: 4 additions & 4 deletions charts/scroll-sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# scroll-sdk

![Version: 0.0.7](https://img.shields.io/badge/Version-0.0.7-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)
![Version: 0.0.8](https://img.shields.io/badge/Version-0.0.8-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

Expand Down Expand Up @@ -29,14 +29,14 @@ Kubernetes: `>=1.22.0-0`
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | chain-monitor | 0.0.2 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | contracts | 0.0.2 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | coordinator-api | 0.0.1 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | coordinator-cron | 0.0.1 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | coordinator-cron | 0.0.2 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | frontends | 0.0.2 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | gas-oracle | 0.0.1 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l1-devnet | 0.0.1 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l1-explorer | 0.0.1 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-bootnode | 0.0.4 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-bootnode | 0.0.5 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-rpc | 0.0.4 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-sequencer | 0.0.4 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | l2-sequencer | 0.0.5 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rollup-explorer-backend | 0.0.1 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rollup-node | 0.0.2 |
| oci://ghcr.io/scroll-tech/scroll-sdk/helm | rpc-gateway | 0.0.1 |
Expand Down

0 comments on commit e71b2d1

Please sign in to comment.