Skip to content

Commit

Permalink
[TT-652] Migrate qa-charts (#750)
Browse files Browse the repository at this point in the history
* [TT-652] Migrate qa-charts

* update with missed changes

* fix linting issues

* bump helm/chart-testing-action

* Fix issue with pointing to the wrong helm chart repo
  • Loading branch information
tateexon authored Nov 1, 2023
1 parent 24568e1 commit 47cda6b
Show file tree
Hide file tree
Showing 89 changed files with 3,200 additions and 64 deletions.
2 changes: 2 additions & 0 deletions .github/configs/ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target-branch: main
validate-maintainers: false
16 changes: 7 additions & 9 deletions .github/workflows/k8s-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: (k8s package) E2E tests
on:
pull_request:
paths:
- "k8s/**"

concurrency:
group: e2e-tests-k8s-${{ github.ref }}
Expand All @@ -27,7 +25,7 @@ jobs:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build Base Image
uses: smartcontractkit/chainlink-github-actions/docker/build-push@ce87f8986ca18336cc5015df75916c2ec0a7c4b3 # v2.1.2
with:
Expand All @@ -54,10 +52,10 @@ jobs:
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Test Image Built
run: |
# shellcheck disable=SC2086
cat <<EOT >>$GITHUB_STEP_SUMMARY
### chainlink-testing-framework-tests image tag for this test run :ship: -> \`ci.${{ github.sha }}\`
EOT
# shellcheck disable=SC2086
cat <<EOT >>$GITHUB_STEP_SUMMARY
### chainlink-testing-framework-tests image tag for this test run :ship: -> \`ci.${{ github.sha }}\`
EOT
e2e_tests:
runs-on: ubuntu-latest
environment: integration
Expand All @@ -67,7 +65,7 @@ jobs:
env:
TEST_SUITE: local-runner
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ce87f8986ca18336cc5015df75916c2ec0a7c4b3 # v2.1.2
with:
Expand Down Expand Up @@ -100,7 +98,7 @@ jobs:
TEST_SUITE: remote-runner
TEST_TRIGGERED_BY: chainlink-testing-framework-remote-runner-ci
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run Remote Runner Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ce87f8986ca18336cc5015df75916c2ec0a7c4b3 # v2.1.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/k8s-publish-test-base-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
BASE_IMAGE_TAG: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image:${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build Base Image
uses: smartcontractkit/chainlink-github-actions/docker/build-push@cb4a8f51d77cbf77ea6a765bd1f437ffc7a18730 # v2.0.28
with:
Expand Down
53 changes: 43 additions & 10 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out Code
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Parse tool-versions file
uses: smartcontractkit/[email protected]
id: tool-versions
Expand All @@ -23,7 +23,7 @@ jobs:
needs: [tools]
steps:
- name: Check out Code
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Go
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
with:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
needs: [tools]
steps:
- name: Check out Code
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Go
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
with:
Expand All @@ -63,26 +63,60 @@ jobs:
- name: Write Go List
run: go list -json -deps ./... > go.list
- name: Nancy
uses: sonatype-nexus-community/[email protected]
uses: sonatype-nexus-community/nancy-github-action@726e338312e68ecdd4b4195765f174d3b3ce1533 # v1.0.3

actionlint:
asdf-install:
name: Validate GitHub Action Workflows
runs-on: ubuntu-latest
steps:
- name: Check out Code
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install asdf dependencies
uses: asdf-vm/actions/[email protected]
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2

prettier:
name: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run Prettier
uses: creyD/prettier_action@31355f8eef017f8aeba2e0bc09d8502b13dbbad1 # v4.3
with:
dry: true
prettier_options: --write **/*.{yaml,yml,json} --config ./.prettierrc.yaml --ignore-path ./.prettierignore

helmlint:
name: Lint Helm Charts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Without this parameter, the merged commit that CI produces will make it so that ct will
# not detect a diff even if one exists
fetch-depth: 0
- name: Set up chart-testing
uses: helm/chart-testing-action@b43128a8b25298e1e7b043b78ea6613844e079b1 # v2.6.0
- name: Run chart-testing (lint)
run: ct lint --config ${{ github.workspace }}/.github/configs/ct.yaml

actionlint:
name: Validate GitHub Action Workflows
runs-on: ubuntu-latest
steps:
- name: Check out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run actionlint
run: actionlint
uses: reviewdog/action-actionlint@82693e9e3b239f213108d6e412506f8b54003586 # v1.39.1

sonarqube:
name: SonarQube Analysis
needs: [golangci]
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # fetches all history for all tags and branches to provide more metadata for sonar reports
- name: Download all workflow run artifacts
Expand All @@ -95,4 +129,3 @@ jobs:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ on:
push:
tags:
- v*
branches:
- main
pull_request:
jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout the Repo
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Go
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
with:
Expand Down
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: 6e2418c5521b7d606e72914dced3253f9ace1205 # v3.4.0
hooks:
- id: detect-private-key
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: check-added-large-files
- id: check-json
- repo: https://github.com/gruntwork-io/pre-commit
rev: e9250bd69bb312d55364213ff5ff037a09be55d9 # v0.1.12
hooks:
- name: Check Helm charts
id: helmlint
- name: Check shell scripts
id: shellcheck
- repo: git://github.com/pre-commit/mirrors-prettier
rev: bc48c541add1551be726f23c4294c773442341cb # v2.3.2
hooks:
- name: Prettier
id: prettier
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
charts/**/templates/**/*.yml
charts/**/templates/**/*.yaml
charts/**/README.md
node_modules/
index.yaml
3 changes: 3 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tabWidth: 2
semi: false
singleQuote: true
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
golang 1.21.3
nodejs 14.20.0
k3d 5.5.1
act 0.2.30
act 0.2.52
golangci-lint 1.54.2
actionlint 1.6.17
actionlint 1.6.26
shellcheck 0.9.0
helm 3.10.3
helm 3.13.1
kubectl 1.25.5
yarn 1.22.19
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @sebawo @skudasov @kalverra @tateexon @AnieeG @gheorghestrimtu @lukaszcl @Tofel
* @sebawo @smartcontractkit/test-tooling-team
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,29 @@ If you have [chaosmesh]() installed in your cluster you can pull and generated C
make chaosmesh
```

If you need to check your system tests coverage, use [that](./k8s/TUTORIAL.md#coverage)
If you need to check your system tests coverage, use [that](./k8s/TUTORIAL.md#coverage)

# Chainlink Charts

This repository contains helm charts used by the chainlink organization mostly in QA.

## Chart Repository

You can add the published chart repository by pointing helm to the `gh-pages` branch with a personal access token (PAT) that has at least read-only access to the repository.

```sh
helm repo add chainlink-qa https://raw.githubusercontent.com/smartcontractkit/qa-charts/gh-pages/
helm search repo chainlink
```

## Releasing Charts

The following cases will trigger a chart release once a PR is merged into the `main` branch.
Modified packages or new packages get added and pushed to the `gh-pages` branch of the [qa-charts](https://github.com/smartcontractkit/qa-charts) repository.

- An existing chart is version bumped
- A new chart is added

Removed charts do not trigger a re-publish, the packages have to be removed and the index file regenerated in the `gh-pages` branch of the [qa-charts](https://github.com/smartcontractkit/qa-charts) repository.

Note: The qa-charts repository is scheduled to look for changes to the charts once every hour. This can be expedited by going to that repo and running the cd action via github UI.
23 changes: 23 additions & 0 deletions charts/chainlink/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
14 changes: 14 additions & 0 deletions charts/chainlink/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
name: chainlink
description: A Helm chart for Kubernetes

# 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: 0.2.6

# 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: '2.5.0'
43 changes: 43 additions & 0 deletions charts/chainlink/templates/chainlink-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- range $cfg := .Values.nodes }}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ $.Release.Name }}-{{ $cfg.name }}-cm
release: {{ $.Release.Name }}
name: {{ $.Release.Name }}-{{ $cfg.name }}-cm
data:
apicredentials: |
[email protected]
fj293fbBnlQ!f9vNs
node-password: T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ
init.sql: |
CREATE EXTENSION pg_stat_statements;
default.toml: |
RootDir = './clroot'
[Log]
JSONConsole = true
Level = 'debug'
[WebServer]
AllowOrigins = '*'
SecureCookies = false
SessionTimeout = '999h0m0s'
[WebServer.TLS]
HTTPSPort = 0
overrides.toml: |
{{- $toml := $.Values.toml }}
{{- if $cfg.toml }}
{{- $toml = $cfg.toml }}
{{- end }}
{{ indent 4 $toml }}
secrets.toml: |
{{- $secrets := $.Values.secretsToml }}
{{- if $cfg.secretsToml }}
{{- $secrets = $cfg.secretsToml }}
{{- end }}
{{ indent 4 $secrets }}
---
{{- end }}
Loading

0 comments on commit 47cda6b

Please sign in to comment.