Skip to content

Commit

Permalink
Document using a public ECR image with custom tag in DevSpace (#12419)
Browse files Browse the repository at this point in the history
* Make small syntax tweak

* Document using a public ECR image with custom tag in devspace

* Kick stuck SonarQube CI check
  • Loading branch information
chainchad authored Mar 14, 2024
1 parent 9f656e9 commit 587c8ed
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 5 deletions.
53 changes: 49 additions & 4 deletions charts/chainlink-cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,115 +1,156 @@
# Chainlink cluster

Example CL nodes cluster for system level tests

Install `kubefwd` (no nixpkg for it yet, planned)

```
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)

```
nix develop
```

# Develop

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

```
export DEVSPACE_IMAGE="..."
./setup.sh ${my-personal-namespace-name-crib}
```

Create a .env file based on the .env.sample file

```sh
cp .env.sample .env
# Fill in the required values in .env
```

Build and deploy the current state of your repository
Build and deploy the current state of your repository

```
devspace deploy
```

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`

```
devspace run ttl ${namespace} 120h
```

If you want to deploy an image tag that is already available in ECR, use:
If you want to deploy an image tag that is already available in ECR, use:

```
# -o is override-image-tag
devspace deploy -o "<image-tag>"
devspace deploy --override-image-tag "<image-tag>"
```

If you want to deploy an image tag from a public ECR repo, use:

```
export DEVSPACE_IMAGE=public.ecr.aws/chainlink/chainlink
devspace deploy --override-image-tag 2.9.0
```

Forward ports to check UI or run tests

```
devspace run connect ${my-personal-namespace-name-crib}
```

List ingress hostnames

```
devspace run ingress-hosts
```

Destroy the cluster

```
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

```
helm install -f values.yaml cl-cluster .
```

Forward all apps (in another terminal)

```
sudo kubefwd svc -n cl-cluster
```

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.yaml cl-cluster .
```

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

```
helm test cl-cluster
```

## Uninstall

```
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`

```
export LOKI_TENANT_ID=promtail
export LOKI_URL=...
Expand All @@ -123,6 +164,7 @@ export DASHBOARD_NAME=CL-Cluster
devspace run dashboard_deploy
```

Open Grafana folder `DashboardCoreDebug` and find dashboard `ChainlinkClusterDebug`

# Testing
Expand All @@ -136,11 +178,14 @@ devspace run dashboard_test
```

# Local Testing

Go to [dashboard-lib](../../dashboard) and link the modules locally

```
cd dashboard
pnpm link --global
cd charts/chainlink-cluster/dashboard/tests
pnpm link --global dashboard-tests
```

Then run the tests with commands mentioned above
2 changes: 1 addition & 1 deletion charts/chainlink-cluster/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pipelines:
tagOverride=$(get_flag "override-image-tag")
run_dependencies --all
if [ -n "$tagOverride" ]; then
if [[ -n "${tagOverride}" ]]; then
image=${DEVSPACE_IMAGE}:${tagOverride}
echo "Using user provided image: $image"
Expand Down

0 comments on commit 587c8ed

Please sign in to comment.