-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More tweaks to defillama + dagster + blockbatch_markers invalid field…
… bug fix (#1241)
- Loading branch information
1 parent
6eeaf6a
commit df6ebcc
Showing
21 changed files
with
1,637 additions
and
139 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
9 changes: 9 additions & 0 deletions
9
ddl/bigquery/dailydata_defillama.revenue_protocols_metadata_v1.sql
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,9 @@ | ||
CREATE EXTERNAL TABLE `oplabs-tools-data.dailydata_defillama.revenue_protocols_metadata_v1` | ||
WITH PARTITION COLUMNS (dt DATE) | ||
OPTIONS ( | ||
format = 'PARQUET', | ||
uris = ['gs://oplabs-tools-data-sink/defillama/revenue_protocols_metadata_v1/*'], | ||
hive_partition_uri_prefix = 'gs://oplabs-tools-data-sink/defillama/revenue_protocols_metadata_v1', | ||
require_hive_partition_filter = true, | ||
decimal_target_types = ["NUMERIC", "BIGNUMERIC"] | ||
) |
4 changes: 2 additions & 2 deletions
4
..._defillama.dexs_protocols_metadata_v1.sql → ...efillama.volume_protocols_metadata_v1.sql
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,9 +1,9 @@ | ||
CREATE EXTERNAL TABLE `oplabs-tools-data.dailydata_defillama.dexs_protocols_metadata_v1` | ||
CREATE EXTERNAL TABLE `oplabs-tools-data.dailydata_defillama.volume_protocols_metadata_v1` | ||
WITH PARTITION COLUMNS (dt DATE) | ||
OPTIONS ( | ||
format = 'PARQUET', | ||
uris = ['gs://oplabs-tools-data-sink/defillama/dexs_protocols_metadata_v1/*'], | ||
hive_partition_uri_prefix = 'gs://oplabs-tools-data-sink/defillama/dexs_protocols_metadata_v1', | ||
hive_partition_uri_prefix = 'gs://oplabs-tools-data-sink/defillama/volume_protocols_metadata_v1', | ||
require_hive_partition_filter = true, | ||
decimal_target_types = ["NUMERIC", "BIGNUMERIC"] | ||
) |
26 changes: 26 additions & 0 deletions
26
ddl/clickhouse_oplabs/defillama.revenue_protocols_metadata_v1.sql
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,26 @@ | ||
CREATE DATABASE IF NOT EXISTS defillama; | ||
|
||
CREATE TABLE IF NOT EXISTS defillama.revenue_protocols_metadata_v1 ( | ||
`dt` Date, | ||
`name` String, | ||
`defillamaId` String, | ||
`displayName` Nullable(String), | ||
`module` Nullable(String), | ||
`category` Nullable(String), | ||
`logo` Nullable(String), | ||
`chains` Array(Nullable(String)), | ||
`protocolType` Nullable(String), | ||
`methodologyURL` Nullable(String), | ||
`methodology` Array( | ||
Tuple( | ||
key Nullable(String), | ||
value Nullable(String) | ||
) | ||
), | ||
`latestFetchIsOk` Nullable(Bool), | ||
`slug` Nullable(String), | ||
`id` Nullable(String), | ||
`parentProtocol` Nullable(String) | ||
) ENGINE = ReplacingMergeTree(dt) | ||
ORDER BY | ||
(dt, name, defillamaId) |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../defillama.dexs_protocols_metadata_v1.sql → ...efillama.volume_protocols_metadata_v1.sql
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,38 @@ | ||
|
||
# Installing the dagster helm chart | ||
|
||
Here is the procedure that was used to install the dagster helm chart. | ||
``` | ||
$ helm repo add dagster https://dagster-io.github.io/helm | ||
$ helm show values dagster/dagster > helm/dagster/values.yaml | ||
$ kubectl create namespace dagster | ||
$ helm upgrade --install dagster dagster/dagster -f helm/dagster/values.yaml -n dagster | ||
``` | ||
|
||
To expose the dagster webserver we created a self-signed certificate and used to configure | ||
a traefik ingressroute. | ||
``` | ||
$ openssl genpkey -algorithm RSA -out cert.key -pkeyopt rsa_keygen_bits:2048 | ||
$ openssl req -new -key cert.key -out cert.csr | ||
$ openssl x509 -req -in cert.csr -signkey cert.key -out cert.crt -days 365 | ||
$ kubectl create secret tls dagster-cert-tls --cert=cert.crt --key=cert.key -n dagster | ||
$ kubectl apply -f helm/dagster/ingressroute.yaml -n dagster | ||
``` | ||
|
||
To provide access to secrets from job kubernetes pods we created a service account | ||
and secret provider. | ||
``` | ||
$ kubectl apply -f helm/dagster/secret-provider.yaml | ||
$ kubectl apply -f helm/dagster/service-account.yaml | ||
``` | ||
|
||
Refer to the Google Cloud documentation for more information on how to grant secrets access to | ||
a kubernetes service account. | ||
|
||
# Updating the dagster helm chart | ||
|
||
When the dagster definitions docker image changes we need to update the image tag in values.yaml | ||
and re-deploy the helm chart | ||
``` | ||
$ helm upgrade dagster dagster/dagster -f helm/dagster/values.yaml -n dagster | ||
``` |
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,16 @@ | ||
--- | ||
apiVersion: traefik.containo.us/v1alpha1 | ||
kind: IngressRoute | ||
metadata: | ||
name: dagster | ||
spec: | ||
entryPoints: | ||
- websecure | ||
routes: | ||
- kind: Rule | ||
match: Host(`dagster.primary.data.tools.oplabs.cloud`) | ||
services: | ||
- name: dagster-dagster-webserver | ||
port: 80 | ||
tls: | ||
secretName: dagster-cert-tls |
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,11 @@ | ||
apiVersion: secrets-store.csi.x-k8s.io/v1 | ||
kind: SecretProviderClass | ||
metadata: | ||
name: dagster-secret-provider-class | ||
namespace: dagster | ||
spec: | ||
provider: gke | ||
parameters: | ||
secrets: | | ||
- resourceName: "projects/oplabs-tools-data/secrets/op-analytics-python-runner/versions/3" | ||
path: "op-analytics-vault.txt" |
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 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: dagster-service-account | ||
namespace: dagster |
Oops, something went wrong.