-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support devspace local-dev profile for CRIB (#12938)
* Support devspace local-dev profile for CRIB * Remove testing section in README
- Loading branch information
Showing
9 changed files
with
322 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Helm | ||
charts/ | ||
requirements.lock | ||
.rendered | ||
values-profiles/* | ||
!values-profiles/values-dev.yaml.example | ||
!values-profiles/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,174 @@ | ||
# Chainlink cluster | ||
|
||
Example CL nodes cluster for system level tests | ||
Install `kubefwd` (no nixpkg for it yet, planned) | ||
|
||
```sh | ||
brew install txn2/tap/kubefwd | ||
``` | ||
|
||
If you want to build images you need [docker](https://docs.docker.com/engine/install/) service running | ||
|
||
Enter the shell (from the root project dir) | ||
|
||
```sh | ||
nix develop | ||
``` | ||
|
||
# Develop | ||
## Install from release | ||
Note: The setup below doesn't work at the moment. | ||
|
||
Add the repository | ||
## New cluster | ||
|
||
We are using [devspace](https://www.devspace.sh/docs/getting-started/installation?x0=3) | ||
|
||
Configure the cluster, see `deployments.app.helm.values` and [values.yaml](./values.yaml) comments for more details | ||
|
||
Set up your K8s access | ||
|
||
```sh | ||
export DEVSPACE_IMAGE="..." | ||
./setup.sh ${my-personal-namespace-name-crib} | ||
``` | ||
helm repo add chainlink-cluster https://raw.githubusercontent.com/smartcontractkit/chainlink/helm-release/ | ||
helm repo update | ||
|
||
Create a .env file based on the .env.sample file | ||
|
||
```sh | ||
cp .env.sample .env | ||
# Fill in the required values in .env | ||
``` | ||
|
||
Set default namespace | ||
Build and deploy the current state of your repository | ||
|
||
```sh | ||
devspace deploy | ||
``` | ||
kubectl create ns cl-cluster | ||
kubectl config set-context --current --namespace cl-cluster | ||
|
||
Default `ttl` is `72h`, use `ttl` command to update if you need more time | ||
|
||
Valid values are `1h`, `2m`, `3s`, etc. Go time format is invalid `1h2m3s` | ||
|
||
```sh | ||
devspace run ttl ${namespace} 120h | ||
``` | ||
|
||
If you want to deploy an image tag that is already available in ECR, use: | ||
|
||
```sh | ||
devspace deploy --override-image-tag "<image-tag>" | ||
``` | ||
|
||
Install | ||
If you want to deploy an image tag from a public ECR repo, use: | ||
|
||
```sh | ||
export DEVSPACE_IMAGE=public.ecr.aws/chainlink/chainlink | ||
devspace deploy --override-image-tag 2.9.0 | ||
``` | ||
|
||
To apply custom TOML configuration specific for your nodes, create a `values-dev.yaml` file in the `./values-profiles` directory. Start by copying the example file: | ||
|
||
```sh | ||
cp values-profiles/values-dev.yaml.example values-profiles/values-dev.yaml | ||
|
||
``` | ||
|
||
Then customize the values-dev.yaml file as needed. To use this configuration during deployment, pass the --profile local-dev flag: | ||
|
||
```sh | ||
devspace deploy --profile local-dev | ||
``` | ||
|
||
Forward ports to check UI or run tests | ||
|
||
```sh | ||
devspace run connect ${my-personal-namespace-name-crib} | ||
``` | ||
|
||
List ingress hostnames | ||
|
||
```sh | ||
devspace run ingress-hosts | ||
``` | ||
|
||
Destroy the cluster | ||
|
||
```sh | ||
devspace purge | ||
``` | ||
|
||
## Running load tests | ||
|
||
Check this [doc](../../integration-tests/load/ocr/README.md) | ||
|
||
If you used `devspace dev ...` always use `devspace reset pods` to switch the pods back | ||
|
||
# Helm | ||
|
||
If you would like to use `helm` directly, please uncomment data in `values.yaml` | ||
|
||
## Install from local files | ||
|
||
```sh | ||
helm install -f values.yaml cl-cluster . | ||
``` | ||
|
||
Forward all apps (in another terminal) | ||
|
||
```sh | ||
sudo kubefwd svc -n cl-cluster | ||
``` | ||
|
||
Then you can connect and run your tests | ||
|
||
## Install from release | ||
|
||
Add the repository | ||
|
||
```sh | ||
helm repo add chainlink-cluster https://raw.githubusercontent.com/smartcontractkit/chainlink/helm-release/ | ||
helm repo update | ||
``` | ||
|
||
Set default namespace | ||
|
||
```sh | ||
kubectl create ns cl-cluster | ||
kubectl config set-context --current --namespace cl-cluster | ||
``` | ||
|
||
## Create a new release | ||
Note: The setup below doesn't work at the moment. | ||
|
||
Bump version in `Chart.yml` add your changes and add `helm_release` label to any PR to trigger a release | ||
|
||
## Helm Test | ||
|
||
``` | ||
```sh | ||
helm test cl-cluster | ||
``` | ||
|
||
## Uninstall | ||
|
||
``` | ||
```sh | ||
helm uninstall cl-cluster | ||
``` | ||
``` | ||
|
||
# Grafana dashboard | ||
|
||
We are using [Grabana](https://github.com/K-Phoen/grabana) lib to create dashboards programmatically | ||
|
||
You can also select dashboard platform in `INFRA_PLATFORM` either `kubernetes` or `docker` | ||
|
||
```sh | ||
export LOKI_TENANT_ID=promtail | ||
export LOKI_URL=... | ||
export GRAFANA_URL=... | ||
export GRAFANA_TOKEN=... | ||
export PROMETHEUS_DATA_SOURCE_NAME=Thanos | ||
export LOKI_DATA_SOURCE_NAME=Loki | ||
export INFRA_PLATFORM=kubernetes | ||
export GRAFANA_FOLDER=CRIB | ||
export DASHBOARD_NAME=Core-Cluster-Load | ||
|
||
devspace run dashboard_deploy | ||
``` | ||
|
||
Open Grafana folder `DashboardCoreDebug` and find dashboard `ChainlinkClusterDebug` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# values-profiles | ||
|
||
Store helm values files for different [DevSpace profiles](https://www.devspace.sh/docs/configuration/profiles/) here. The convention is to make the yaml file name in here match the DevSpace profile name. |
95 changes: 95 additions & 0 deletions
95
charts/chainlink-cluster/values-profiles/values-dev.yaml.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Disable geth if using existing testnets. | ||
geth: | ||
enabled: false | ||
chainlink: | ||
global: | ||
toml: |- | ||
RootDir = './clroot' | ||
[Log] | ||
JSONConsole = true | ||
Level = 'debug' | ||
[WebServer] | ||
AllowOrigins = '*' | ||
SecureCookies = false | ||
SessionTimeout = '999h0m0s' | ||
[Feature] | ||
FeedsManager = true | ||
LogPoller = true | ||
UICSAKeys = true | ||
[OCR] | ||
Enabled = true | ||
DefaultTransactionQueueDepth = 0 | ||
[P2P] | ||
[P2P.V2] | ||
Enabled = true | ||
ListenAddresses = ['0.0.0.0:6690'] | ||
AnnounceAddresses = ['0.0.0.0:6690'] | ||
DeltaDial = '500ms' | ||
DeltaReconcile = '5s' | ||
[[EVM]] | ||
# Avax Fuji Testnet | ||
ChainID = "43113" | ||
MinContractPayment = '0' | ||
AutoCreateKey = true | ||
FinalityDepth = 1 | ||
[[EVM.Nodes]] | ||
Name = 'avax-fuji-testnet-official' | ||
WSURL = 'wss://api.avax-test.network/ext/bc/C/ws' | ||
HTTPURL = 'https://api.avax-test.network/ext/bc/C/rpc' | ||
[[EVM]] | ||
# BSC Testnet | ||
ChainID = "97" | ||
MinContractPayment = '0' | ||
AutoCreateKey = true | ||
FinalityDepth = 1 | ||
[[EVM.Nodes]] | ||
Name = 'bsc-testnet-official' | ||
HTTPURL = 'https://data-seed-prebsc-1-s.bnbchain.org:8545' | ||
WSURL = 'wss://data-seed-prebsc-1-s1.binance.org:8545/' | ||
[WebServer.TLS] | ||
HTTPSPort = 0 | ||
|
||
overridesToml: |- | ||
[Feature] | ||
LogPoller = true | ||
|
||
[Log] | ||
Level = 'debug' | ||
JSONConsole = true | ||
|
||
[Log.File] | ||
MaxSize = '0b' | ||
|
||
[WebServer] | ||
AllowOrigins = '*' | ||
HTTPPort = 6688 | ||
SecureCookies = false | ||
HTTPWriteTimeout = '1m' | ||
|
||
[WebServer.RateLimit] | ||
Authenticated = 2000 | ||
Unauthenticated = 1000 | ||
|
||
[WebServer.TLS] | ||
HTTPSPort = 0 | ||
|
||
[Database] | ||
MaxIdleConns = 50 | ||
MaxOpenConns = 50 | ||
MigrateOnStartup = true | ||
|
||
[OCR2] | ||
Enabled = true | ||
DefaultTransactionQueueDepth = 0 | ||
|
||
[OCR] | ||
Enabled = false | ||
DefaultTransactionQueueDepth = 0 | ||
|
||
[P2P] | ||
[P2P.V2] | ||
Enabled = true | ||
ListenAddresses = ['0.0.0.0:6690'] | ||
AnnounceAddresses = ['0.0.0.0:6690'] | ||
DeltaDial = '500ms' | ||
DeltaReconcile = '5s' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.