Skip to content

Commit

Permalink
Merge branch 'develop' into BCI-1176-configurable-client-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanTinianov authored Apr 16, 2024
2 parents 2c93ba7 + d97f14b commit 3ccc438
Show file tree
Hide file tree
Showing 19 changed files with 903 additions and 60 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-crabs-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Add support for workflow jobs to Operator UI #wip #added
5 changes: 5 additions & 0 deletions .changeset/rich-jars-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Narrowing topic, data_word indexes by adding (evm_chain_id, address, event_sig) to the index definition #db_update
5 changes: 4 additions & 1 deletion charts/chainlink-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ We are using [Grabana](https://github.com/K-Phoen/grabana) lib to create dashboa

You can also select dashboard platform in `INFRA_PLATFORM` either `kubernetes` or `docker`

You can select the dashboard panels with `PANELS_INCLUDED` which is a list of panel names separated by comma
If you don't specify it will include core panels by default

```
export LOKI_TENANT_ID=promtail
export LOKI_URL=...
Expand All @@ -159,7 +162,7 @@ export GRAFANA_TOKEN=...
export PROMETHEUS_DATA_SOURCE_NAME=Thanos
export LOKI_DATA_SOURCE_NAME=Loki
export INFRA_PLATFORM=kubernetes
export GRAFANA_FOLDER=CRIB
export GRAFANA_FOLDER=DashboardCoreDebug
export DASHBOARD_NAME=CL-Cluster
devspace run dashboard_deploy
Expand Down
19 changes: 19 additions & 0 deletions charts/chainlink-cluster/dashboard/cmd/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
lib "github.com/smartcontractkit/chainlink/dashboard-lib"
)

func main() {
cfg := lib.ReadEnvDeployOpts()
db := lib.NewDashboard(cfg.Name, cfg, nil)
err := db.Delete()
if err != nil {
lib.L.Fatal().Err(err).Msg("failed to delete the dashboard")
}
lib.L.Info().
Str("Name", db.Name).
Str("GrafanaURL", db.DeployOpts.GrafanaURL).
Str("GrafanaFolder", db.DeployOpts.GrafanaFolder).
Msg("Dashboard deleted")
}
47 changes: 31 additions & 16 deletions charts/chainlink-cluster/dashboard/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,48 @@ package main
import (
"github.com/K-Phoen/grabana/dashboard"
lib "github.com/smartcontractkit/chainlink/dashboard-lib"
atlas_don "github.com/smartcontractkit/chainlink/dashboard-lib/atlas-don"
core_don "github.com/smartcontractkit/chainlink/dashboard-lib/core-don"
k8spods "github.com/smartcontractkit/chainlink/dashboard-lib/k8s-pods"
waspdb "github.com/smartcontractkit/wasp/dashboard"
)

const (
DashboardName = "Chainlink Cluster (DON)"
"strings"
)

func main() {
cfg := lib.ReadEnvDeployOpts()
db := lib.NewDashboard(DashboardName, cfg,
db := lib.NewDashboard(cfg.Name, cfg,
[]dashboard.Option{
dashboard.AutoRefresh("10s"),
dashboard.Tags([]string{"generated"}),
},
)
db.Add(
core_don.New(
core_don.Props{
PrometheusDataSource: cfg.DataSources.Prometheus,
PlatformOpts: core_don.PlatformPanelOpts(cfg.Platform),
},
),
)
if len(cfg.PanelsIncluded) == 0 || cfg.PanelsIncluded["core"] {
db.Add(
core_don.New(
core_don.Props{
PrometheusDataSource: cfg.DataSources.Prometheus,
PlatformOpts: core_don.PlatformPanelOpts(cfg.Platform),
},
),
)
// TODO: refactor as a component later
addWASPRows(db, cfg)
}
if cfg.PanelsIncluded["ocr"] || cfg.PanelsIncluded["ocr2"] || cfg.PanelsIncluded["ocr3"] {
for key := range cfg.PanelsIncluded {
if strings.Contains(key, "ocr") {
db.Add(
atlas_don.New(
atlas_don.Props{
PrometheusDataSource: cfg.DataSources.Prometheus,
PlatformOpts: atlas_don.PlatformPanelOpts(cfg.Platform, key),
OcrVersion: key,
},
),
)
}
}
}
if cfg.Platform == "kubernetes" {
db.Add(
k8spods.New(
Expand All @@ -38,13 +55,11 @@ func main() {
),
)
}
// TODO: refactor as a component later
addWASPRows(db, cfg)
if err := db.Deploy(); err != nil {
lib.L.Fatal().Err(err).Msg("failed to deploy the dashboard")
}
lib.L.Info().
Str("Name", DashboardName).
Str("Name", db.Name).
Str("GrafanaURL", db.DeployOpts.GrafanaURL).
Str("GrafanaFolder", db.DeployOpts.GrafanaFolder).
Msg("Dashboard deployed")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
-- +goose Up

drop index if exists evm.evm_logs_idx_data_word_one;
drop index if exists evm.evm_logs_idx_data_word_two;
drop index if exists evm.evm_logs_idx_data_word_three;
drop index if exists evm.evm_logs_idx_data_word_four;
drop index if exists evm.evm_logs_idx_topic_two;
drop index if exists evm.evm_logs_idx_topic_three;
drop index if exists evm.evm_logs_idx_topic_four;

create index evm_logs_idx_data_word_one
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 1, 32));

create index evm_logs_idx_data_word_two
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 33, 32));

create index evm_logs_idx_data_word_three
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 65, 32));

create index evm_logs_idx_data_word_four
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 97, 32));

create index evm_logs_idx_data_word_five
on evm.logs (address, event_sig, evm_chain_id, "substring"(data, 129, 32));

create index evm_logs_idx_topic_two
on evm.logs (address, event_sig, evm_chain_id, (topics[2]));

create index evm_logs_idx_topic_three
on evm.logs (address, event_sig, evm_chain_id, (topics[3]));

create index evm_logs_idx_topic_four
on evm.logs (address, event_sig, evm_chain_id, (topics[4]));

-- +goose Down

drop index if exists evm.evm_logs_idx_data_word_one;
drop index if exists evm.evm_logs_idx_data_word_two;
drop index if exists evm.evm_logs_idx_data_word_three;
drop index if exists evm.evm_logs_idx_data_word_four;
drop index if exists evm.evm_logs_idx_data_word_five;
drop index if exists evm.evm_logs_idx_topic_two;
drop index if exists evm.evm_logs_idx_topic_three;
drop index if exists evm.evm_logs_idx_topic_four;

create index evm_logs_idx_data_word_one
on evm.logs ("substring"(data, 1, 32));

create index evm_logs_idx_data_word_two
on evm.logs ("substring"(data, 33, 32));

create index evm_logs_idx_data_word_three
on evm.logs ("substring"(data, 65, 32));

create index evm_logs_idx_data_word_four
on evm.logs ("substring"(data, 97, 32));

create index evm_logs_idx_topic_two
on evm.logs ((topics[2]));

create index evm_logs_idx_topic_three
on evm.logs ((topics[3]));

create index evm_logs_idx_topic_four
on evm.logs ((topics[4]));
2 changes: 1 addition & 1 deletion core/web/assets/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Operator UI</title><link rel="shortcut icon" href="https://smartcontract.imgix.net/chainlink.ico?auto=compress%2Cformat"/><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet"/><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/><link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"/><title>Chainlink</title><script defer="defer" src="/assets/main.4a9b933093bb165fcc8f.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Operator UI</title><link rel="shortcut icon" href="https://smartcontract.imgix.net/chainlink.ico?auto=compress%2Cformat"/><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet"/><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/><link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"/><title>Chainlink</title><script defer="defer" src="/assets/main.22957d5aeebe77369ec3.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
Binary file modified core/web/assets/index.html.gz
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Loading

0 comments on commit 3ccc438

Please sign in to comment.