Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devspace integration mercury #10747

Merged
merged 12 commits into from
Sep 24, 2023
18 changes: 18 additions & 0 deletions .github/workflows/helm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Helm Publish

on:
pull_request:
types: [ labeled ]

jobs:
helm_release:
if: ${{ github.event.label.name == 'helm_release' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Release helm chart
uses: J12934/helm-gh-pages-action@master
with:
charts-folder: charts
deploy-branch: helm-release
access-token: ${{ secrets.HELM_PUSH_TOKEN }}
4 changes: 2 additions & 2 deletions charts/chainlink-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
name: chainlink-cluster
description: Chainlink nodes cluster
version: 0.1.0
appVersion: '0.1.0'
version: 0.1.3
appVersion: '2.6.0'
39 changes: 33 additions & 6 deletions charts/chainlink-cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Chainlink cluster
Example CL nodes cluster for system level tests

Enter the shell
Install `kubefwd` (no nixpkg for it yet, planned)
```
brew install txn2/tap/kubefwd
```

Enter the shell (from the root project dir)
```
nix develop
```
Expand All @@ -20,9 +25,6 @@ export DEVSPACE_IMAGE="${aws_account}.dkr.ecr.us-west-2.amazonaws.com/chainlink-
```
Enter the shell and deploy
```
nix develop
cd charts/chainlink-cluster

# set your unique namespace if it's a new cluster
devspace use namespace cl-cluster
devspace deploy
Expand Down Expand Up @@ -76,11 +78,36 @@ After that all the changes will be synced automatically
Check `.profiles` to understand what is uploaded in profiles `runner` and `node`

# Helm
If you would like to use `helm` directly, please uncomment data in `values.yaml`
## Install
If you would like to use `helm` directly, please uncomment data in `values-raw-helm.yaml`
## Install from local files
```
helm install -f values-raw-helm.yaml cl-cluster .
```
Forward all apps (in another terminal)
```
sudo kubefwd svc
```
Then you can connect and run your tests

## Install from release
Add the repository
```
helm repo add chainlink-cluster https://raw.githubusercontent.com/smartcontractkit/chainlink/helm-release/
helm repo update
```
Set default namespace
```
kubectl create ns cl-cluster
kubectl config set-context --current --namespace cl-cluster
```

Install
```
helm install -f values-raw-helm.yaml cl-cluster chainlink-cluster/chainlink-cluster --version v0.1.2
```

## Create a new release
Bump version in `Chart.yml` add your changes and add `helm_release` label to any PR to trigger a release

## Helm Test
```
Expand Down
1 change: 1 addition & 0 deletions charts/chainlink-cluster/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ deployments:
image: ${DEVSPACE_IMAGE}
stateful: false
geth:
version: v1.12.0
wsrpc-port: 8546
httprpc-port: 8544
networkid: 1337
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
name: {{ $.Release.Name }}-{{ $cfg.name }}-cm
containers:
- name: chainlink-db
image: {{ default "postgres" $.Values.db.image }}:{{ default "11.15" $.Values.db.version }}
image: {{ default "postgres:11.15" $.Values.db.image }}
command:
- docker-entrypoint.sh
args:
Expand Down Expand Up @@ -164,15 +164,15 @@ spec:
limits:
memory: {{ default "1024Mi" $.Values.chainlink.resources.limits.memory }}
cpu: {{ default "500m" $.Values.chainlink.resources.limits.cpu }}
{{- with $.Values.nodeSelector }}
{{ else }}
{{ end }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with $.Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with $.Values.tolerations }}
tolerations:
Expand Down
5 changes: 2 additions & 3 deletions charts/chainlink-cluster/templates/geth-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ kind: Deployment
metadata:
name: geth
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: geth
Expand Down Expand Up @@ -102,11 +101,11 @@ spec:
{{ end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
Expand Down
21 changes: 10 additions & 11 deletions charts/chainlink-cluster/templates/mockserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,18 @@ spec:
limits:
memory: {{ default "1024Mi" $.Values.chainlink.resources.limits.memory }}
cpu: {{ default "500m" $.Values.chainlink.resources.limits.cpu }}
{{- with $.Values.nodeSelector }}
{{ else }}
{{ end }}
{{- with .Values.nodeSelector }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{ end }}
{{ toYaml . | indent 8 }}
{{- end }}
---
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ spec:
limits:
memory: {{ default "1024Mi" $.Values.runner.resources.limits.memory }}
cpu: {{ default "500m" $.Values.runner.resources.limits.cpu }}
{{- with $.Values.nodeSelector }}
{{ else }}
{{ end }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
Expand Down
81 changes: 71 additions & 10 deletions charts/chainlink-cluster/values-raw-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,48 @@ chainlink:
p2p_port: 8090
nodes:
- name: node-1
image: "public.ecr.aws/chainlink/chainlink:latest"
# override default config per node
#toml: |
# [Log]
# JSONConsole = true
# override image and a tag
# image: public.ecr.aws/chainlink/chainlink
# version: latest
# for example, use OCRv2 P2P setup, the whole config
# toml: |
# RootDir = './clroot'
# [Log]
# JSONConsole = true
# Level = 'debug'
# [WebServer]
# AllowOrigins = '*'
# SecureCookies = false
# SessionTimeout = '999h0m0s'
# [OCR2]
# Enabled = true
# [P2P]
# [P2P.V2]
# Enabled = false
# AnnounceAddresses = []
# DefaultBootstrappers = []
# DeltaDial = '15s'
# DeltaReconcile = '1m0s'
# ListenAddresses = []
# [[EVM]]
# ChainID = '1337'
# MinContractPayment = '0'
# [[EVM.Nodes]]
# Name = 'node-0'
# WSURL = 'ws://geth:8546'
# HTTPURL = 'http://geth:8544'
# [WebServer.TLS]
# HTTPSPort = 0
- name: node-2
- name: node-3
- name: node-4
resources:
requests:
cpu: 350m
memory: 1024Mi
limits:
cpu: 350m
memory: 1024Mi

# each CL node have a dedicated PostgreSQL 11.15
# use StatefulSet by setting:
#
Expand All @@ -33,24 +65,53 @@ chainlink:
# if you are running long tests
db:
stateful: false
resources:
requests:
cpu: 1
memory: 1024Mi
limits:
cpu: 1
memory: 1024Mi
# default cluster shipped with latest Geth ( dev mode by default )
geth:
version: v1.12.0
wsrpc-port: 8546
httprpc-port: 8544
networkid: 1337
blocktime: 1
resources:
requests:
cpu: 1
memory: 1024Mi
limits:
cpu: 1
memory: 1024Mi
# mockserver is https://www.mock-server.com/where/kubernetes.html
# used to stub External Adapters
mockserver:
port: 1080
resources:
requests:
cpu: 1
memory: 1024Mi
limits:
cpu: 1
memory: 1024Mi
runner:
stateful: false
resources:
requests:
cpu: 1
memory: 512Mi
limits:
cpu: 1
memory: 512Mi

# monitoring.coreos.com/v1 PodMonitor for each node
prometheusMonitor: false

# deployment placement, standard helm stuff
podAnnotations: { }
nodeSelector: { }
tolerations: [ ]
affinity: { }
podAnnotations:
nodeSelector:
tolerations:
affinity:
Loading