diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 00000000..89ae533f --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,76 @@ +name: Linting & Integration tests + +on: + pull_request: + types: + - opened + - synchronize + - reopened + +defaults: + run: + shell: bash + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.8.1 + + - uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: | + ct lint \ + --target-branch ${{ github.event.repository.default_branch }} \ + --lint-conf chart-testing/lintconf.yaml \ + --excluded-charts charts/common + if: steps.list-changed.outputs.changed == 'true' + + - name: Create kind cluster + uses: helm/kind-action@v1.2.0 + with: + node_image: kindest/node:v1.21.10 + if: steps.list-changed.outputs.changed == 'true' + + - name: Replace secrets in Helm charts + env: + SMF_BOT_MATRIX_ACCESS_TOKEN: ${{ secrets.SMF_BOT_MATRIX_ACCESS_TOKEN }} + run: | + shopt -s globstar + for f in $(find **/ci/*-values.yaml); do + sed -i "s/__GITHUB_SECRET_SMF_BOT_MATRIX_ACCESS_TOKEN/$SMF_BOT_MATRIX_ACCESS_TOKEN/g" $f + done + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: | + ct install \ + --target-branch ${{ github.event.repository.default_branch }} \ + --excluded-charts charts/common + if: steps.list-changed.outputs.changed == 'true' diff --git a/chart-testing/lintconf.yaml b/chart-testing/lintconf.yaml new file mode 100644 index 00000000..bbcb7e6c --- /dev/null +++ b/chart-testing/lintconf.yaml @@ -0,0 +1,40 @@ +--- +rules: + braces: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: disable + document-end: disable + document-start: disable # No --- to start a file + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + hyphens: + max-spaces-after: 1 + indentation: + spaces: consistent + indent-sequences: whatever # - list indentation will handle both indentation and without + check-multi-line-strings: false + key-duplicates: enable + line-length: disable # Lines can be any length + new-line-at-end-of-file: enable + new-lines: + type: unix + trailing-spaces: enable + truthy: + level: warning diff --git a/charts/node/Chart.yaml b/charts/node/Chart.yaml index e6c2e0de..42226e67 100644 --- a/charts/node/Chart.yaml +++ b/charts/node/Chart.yaml @@ -2,4 +2,7 @@ apiVersion: v2 name: node description: A Helm chart to deploy Substrate/Polkadot nodes type: application -version: 2.4.0 +version: 2.4.1 +maintainers: + - name: Parity + url: https://github.com/paritytech/helm-charts diff --git a/charts/node/ci/kind-values.yaml b/charts/node/ci/kind-values.yaml new file mode 100644 index 00000000..0c7b5464 --- /dev/null +++ b/charts/node/ci/kind-values.yaml @@ -0,0 +1,14 @@ +node: + chain: dev + role: invalid + dataVolumeSize: 1G + flags: + - "--force-authoring" + - "--alice" + - "--rpc-external" + - "--ws-external" + - "--rpc-methods=safe" + - "--rpc-cors=all" +storageClass: standard +image: + tag: v0.9.19 diff --git a/charts/node/values.yaml b/charts/node/values.yaml index 8de2f889..5b1873a3 100644 --- a/charts/node/values.yaml +++ b/charts/node/values.yaml @@ -11,7 +11,7 @@ nameOverride: "" fullnameOverride: "" ## Additional common labels on pods and services -## +## # extraLabels: # type: rpc @@ -60,7 +60,7 @@ serviceAccount: ## The name of the service account to use. ## If not set and create is true, a name is generated using the fullname template - ## + ## name: "" ## SecurityContext holds pod-level security attributes and common container settings. @@ -101,9 +101,9 @@ node: ## Database backend engine to use ## - # database: rocksdb - - ## Node may require custom name for chainspec file. + database: rocksdb + + ## Node may require custom name for chainspec file. ## ref: moonbeam https://github.com/PureStake/moonbeam/issues/1104#issuecomment-996787548 ## Note: path should start with /data/ since this folder mount in init container download-chainspec. ## @@ -112,7 +112,7 @@ node: forceDownloadChainspec: false ## Configuration to download chain snapshot from remote URL - ## + ## # chainDataSnapshotUrl: "https://dot-rocksdb.polkashots.io/snapshot" # chainDataSnapshotFormat: lz4 # chainDataKubernetesVolumeSnapshot: "" @@ -130,12 +130,12 @@ node: ## relayChain: polkadot ## File containing chainspec of relaychain for - ## + ## relayChainCustomChainspecPath: "/data/relay_chain_chainspec.json" # relayChainCustomChainspecUrl: "" ## Configuration to download relaychain snapshot from remote URL - ## + ## # relayChainDataSnapshotUrl: "https://dot-rocksdb.polkashots.io/snapshot" # relayChainDataSnapshotFormat: lz4 # relayChainDataKubernetesVolumeSnapshot: "" @@ -157,13 +157,13 @@ node: # relayChainFlags: [] ## Additional args to use - ## + ## flags: - "--rpc-external" - "--ws-external" - "--rpc-methods=safe" - "--rpc-cors=all" - + ## Keys to use by the node ## ref: https://wiki.polkadot.network/docs/learn-keys ## @@ -231,7 +231,7 @@ node: ## Enable Service Monitor of Prometheus-Operator ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/getting-started.md#include-servicemonitors - ## + ## serviceMonitor: enabled: false #namespace: monitoring @@ -260,7 +260,7 @@ node: hostname: example.com ttl: 300 ## If enabled, create service to expose relay chain P2P - ## + ## relayP2pService: enabled: false type: NodePort # or ClusterIP or LoadBalancer @@ -271,7 +271,7 @@ node: hostname: example.com ttl: 300 ## If enabled, create service to expose parachain P2P - ## + ## paraP2pService: enabled: false type: NodePort # or ClusterIP, LoadBalancer @@ -310,11 +310,11 @@ node: ## Resource limits & requests ## resources: {} - + ## Configuration of Substrate API ## ref: https://github.com/paritytech/substrate-api-sidecar -## +## substrateApiSidecar: image: repository: parity/substrate-api-sidecar diff --git a/charts/polkadot-introspector/Chart.yaml b/charts/polkadot-introspector/Chart.yaml index c96a4cff..50d984b5 100644 --- a/charts/polkadot-introspector/Chart.yaml +++ b/charts/polkadot-introspector/Chart.yaml @@ -2,5 +2,8 @@ apiVersion: v2 name: polkadot-introspector description: A Helm chart to deploy polkadot-introspector type: application -version: 0.1.0 +version: 0.1.1 appVersion: "0.1.0" +maintainers: + - name: Parity + url: https://github.com/paritytech/helm-charts diff --git a/charts/substrate-faucet/Chart.yaml b/charts/substrate-faucet/Chart.yaml index 9ad0436b..8d24f35c 100644 --- a/charts/substrate-faucet/Chart.yaml +++ b/charts/substrate-faucet/Chart.yaml @@ -2,4 +2,7 @@ apiVersion: v2 name: substrate-faucet description: A Helm chart to deploy substrate-faucet type: application -version: 1.0.0 +version: 1.0.1 +maintainers: + - name: Parity + url: https://github.com/paritytech/helm-charts diff --git a/charts/substrate-faucet/ci/kind-values.yaml b/charts/substrate-faucet/ci/kind-values.yaml new file mode 100644 index 00000000..25533bf3 --- /dev/null +++ b/charts/substrate-faucet/ci/kind-values.yaml @@ -0,0 +1,15 @@ +serviceMonitor: + enabled: false + +server: + config: + SMF_BACKEND_RPC_ENDPOINT: "https://westend-rpc.polkadot.io/" + +bot: + secret: + # your bot access token here is how to find it https://t2bot.io/docs/access_tokens/ + SMF_BOT_MATRIX_ACCESS_TOKEN: "__GITHUB_SECRET_SMF_BOT_MATRIX_ACCESS_TOKEN" + + config: + SMF_BOT_MATRIX_SERVER: "https://matrix.org" + SMF_BOT_MATRIX_BOT_USER_ID: "@parity_ci_bot:matrix.org" diff --git a/charts/substrate-faucet/templates/servicemonitor.yaml b/charts/substrate-faucet/templates/servicemonitor.yaml index 3c011c34..d0843388 100644 --- a/charts/substrate-faucet/templates/servicemonitor.yaml +++ b/charts/substrate-faucet/templates/servicemonitor.yaml @@ -1,3 +1,4 @@ +{{- if .Values.serviceMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: @@ -21,3 +22,4 @@ spec: endpoints: - port: metrics interval: 15s +{{- end }} diff --git a/charts/substrate-faucet/values.yaml b/charts/substrate-faucet/values.yaml index 11f4c168..2a44a36b 100644 --- a/charts/substrate-faucet/values.yaml +++ b/charts/substrate-faucet/values.yaml @@ -72,3 +72,6 @@ nodeSelector: {} tolerations: [] affinity: {} + +serviceMonitor: + enabled: true diff --git a/charts/substrate-telemetry/Chart.yaml b/charts/substrate-telemetry/Chart.yaml index 263f36da..0ce27ecb 100644 --- a/charts/substrate-telemetry/Chart.yaml +++ b/charts/substrate-telemetry/Chart.yaml @@ -15,10 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "2.1.1" +version: "2.1.2" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" +maintainers: + - name: Parity + url: https://github.com/paritytech/helm-charts diff --git a/charts/substrate-telemetry/values.yaml b/charts/substrate-telemetry/values.yaml index 86131c1e..266cd3c5 100644 --- a/charts/substrate-telemetry/values.yaml +++ b/charts/substrate-telemetry/values.yaml @@ -71,7 +71,7 @@ service: targetPort: 8000 annotations: {} # nodePort: 31000 - # externalTrafficPolicy: Cluster + # externalTrafficPolicy: Cluster # sessionAffinity: None core: type: ClusterIP @@ -79,7 +79,7 @@ service: targetPort: 8000 annotations: {} # nodePort: 31000 - # externalTrafficPolicy: Cluster + # externalTrafficPolicy: Cluster # sessionAffinity: None frontend: type: ClusterIP @@ -87,7 +87,7 @@ service: targetPort: 8000 annotations: {} # nodePort: 31000 - # externalTrafficPolicy: Cluster + # externalTrafficPolicy: Cluster # sessionAffinity: None ingress: