-
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.
Merge branch 'develop' into TT-1049-Provide-e2e-coverage-reports-for-…
…docker-tests
- Loading branch information
Showing
105 changed files
with
1,513 additions
and
551 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"chainlink": minor | ||
--- | ||
|
||
#nops : Enable configurable client error regexes for error classification | ||
#added : New toml configuration options for [EVM.NodePool.Errors] to pass regexes on NonceTooLow, NonceTooHigh, ReplacementTransactionUnderpriced, LimitReached, TransactionAlreadyInMempool, TerminallyUnderpriced, InsufficientEth, TxFeeExceedsCap, L2FeeTooLow, L2FeeTooHigh, L2Full, TransactionAlreadyMined, Fatal, and ServiceUnavailable. |
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,5 +1,5 @@ | ||
--- | ||
"chainlink": removed | ||
"chainlink": patch | ||
--- | ||
|
||
Drop unused queryTimeout config from TXM strategy #internal |
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,5 @@ | ||
--- | ||
"chainlink": patch | ||
--- | ||
|
||
cleanup set #bugfix |
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 |
---|---|---|
|
@@ -56,44 +56,6 @@ jobs: | |
dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }} | ||
git-commit-sha: ${{ steps.git-ref.outputs.checked-out || github.sha }} | ||
|
||
- name: Setup GAP | ||
# Don't run for plugins. | ||
if: matrix.image.name == '' | ||
uses: smartcontractkit/.github/actions/setup-gap@1bc7ce34fa81fffcb4a6eb0e4e12e59d94d0fc8f # [email protected] | ||
with: | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
aws-role-arn: ${{ secrets.AWS_OIDC_CRIB_ROLE_ARN_SAND }} | ||
api-gateway-host: ${{ secrets.AWS_API_GW_HOST_K8S_SAND }} | ||
use-k8s: "true" | ||
k8s-cluster-name: ${{ secrets.AWS_EKS_CLUSTER_NAME_SAND }} | ||
use-private-ecr-registry: true | ||
ecr-private-registry: ${{ secrets.AWS_ACCOUNT_ID_PROD }} | ||
metrics-job-name: push-chainlink-develop ${{ matrix.image.name }} | ||
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }} | ||
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} | ||
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} | ||
|
||
# A mutable image tag is used for these CRIBs and it was just built/published | ||
# from this workflow. The deployment has an `imagePullPolicy: Always` set, so | ||
# we need to restart the deployments to pick up the new image. | ||
- name: Restart K8s Deployments for CRIBs | ||
# Don't run for plugins. | ||
if: matrix.image.name == '' | ||
shell: bash | ||
run: | | ||
set -euo pipefail | ||
# Removes the "smartcontractkit/" (org name) prefix. | ||
REPO_NAME_ONLY="${GITHUB_REPOSITORY##*/}" | ||
K8S_NAMESPACE="crib-${REPO_NAME_ONLY}-develop" | ||
deployment_node_names=$(kubectl --namespace "${K8S_NAMESPACE}" \ | ||
get deployments \ | ||
-l "app=${K8S_NAMESPACE}" \ | ||
-o custom-columns=:metadata.name --no-headers) | ||
echo "Restarting deployments: $deployment_node_names" | ||
kubectl rollout restart deployment $deployment_node_names --namespace "${K8S_NAMESPACE}" | ||
- name: Collect Metrics | ||
if: always() | ||
id: collect-gha-metrics | ||
|
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,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. |
Oops, something went wrong.