Skip to content

Commit

Permalink
Fixes deployment problems caused by kind changes (#2807)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenac95 authored Jan 18, 2025
1 parent 8b223ff commit c2157c6
Show file tree
Hide file tree
Showing 22 changed files with 213 additions and 85 deletions.
2 changes: 2 additions & 0 deletions ops/clusters/local/apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
spec:
dependsOn:
- name: infrastructure-controllers
- name: certificates
- name: operators
interval: 1h
retryInterval: 1m
timeout: 5m
Expand Down
19 changes: 19 additions & 0 deletions ops/clusters/local/certificates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: certificates
namespace: flux-system
spec:
dependsOn:
- name: infrastructure-controllers
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./ops/k8s-certificates/kind
force: true
prune: true
wait: true
19 changes: 19 additions & 0 deletions ops/clusters/local/operators.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: operators
namespace: flux-system
spec:
dependsOn:
- name: certificates
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./ops/k8s-operators/kind
force: true
prune: true
wait: true
19 changes: 19 additions & 0 deletions ops/clusters/warehouse/certificates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: certificates
namespace: flux-system
spec:
dependsOn:
- name: infrastructure-controllers
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./ops/k8s-certificates/gke
force: true
prune: true
wait: true
19 changes: 19 additions & 0 deletions ops/clusters/warehouse/operators.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: operators
namespace: flux-system
spec:
dependsOn:
- name: certificates
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./ops/k8s-operators/gke
force: true
prune: true
wait: true
2 changes: 2 additions & 0 deletions ops/clusters/warehouse/production-apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
spec:
dependsOn:
- name: infrastructure-controllers
- name: certificates
- name: operators
interval: 1h
retryInterval: 1m
timeout: 5m
Expand Down
2 changes: 2 additions & 0 deletions ops/clusters/warehouse/staging-apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
spec:
dependsOn:
- name: infrastructure-controllers
- name: certificates
- name: operators
interval: 1h
retryInterval: 1m
timeout: 5m
Expand Down
80 changes: 1 addition & 79 deletions ops/k8s-apps/base/trino/trino.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ spec:
remediation:
retries: 3
values:
additionalConfigProperties:
- retry-policy=QUERY
additionalExchangeManagerProperties:
- "exchange.sink-buffers-per-partition=6"
- "exchange.sink-buffer-pool-min-size=6"
- "exchange.source-concurrent-readers=6"
- "exchange.s3.region=us"
- "exchange.s3.aws-access-key=${ENV:TRINO_GCS_KEY_ID}"
- "exchange.s3.aws-secret-key=${ENV:TRINO_GCS_SECRET}"
- "exchange.s3.endpoint=https://storage.googleapis.com"
serviceAccount:
create: true
name: base-trino
Expand All @@ -54,8 +44,6 @@ spec:
additionalVolumeMounts:
- name: cache
mountPath: /metrics-cache
jvm:
maxHeapSize: "17G"
additionalJVMConfig:
- "--add-opens=java.base/java.nio=ALL-UNNAMED"

Expand All @@ -67,71 +55,5 @@ spec:
- name: cache
mountPath: /metrics-cache

config:
query:
maxMemoryPerNode: 140GB
jvm:
maxHeapSize: "350G"
additionalJVMConfig:
- "--add-opens=java.base/java.nio=ALL-UNNAMED"

server:
exchangeManager:
name: filesystem
baseDir: gs://oso-dataset-transfer-bucket/trino-exchange/
config:
query:
maxMemory: "1400GB"
workers: 1
autoscaling:
enabled: true
maxReplicas: 9
targetCPUUtilizationPercentage: 20
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Pods
value: 1
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
- type: Pods
value: 4
periodSeconds: 15
selectPolicy: Max
catalogs:
metrics: |
connector.name=iceberg
iceberg.catalog.type=hive_metastore
hive.metastore.uri=thrift://10.145.192.27:9083
hive.metastore-cache-ttl=0s
hive.metastore-refresh-interval=5s
hive.metastore.thrift.client.connect-timeout=10s
hive.metastore.thrift.client.read-timeout=30s
iceberg.use-file-size-from-metadata=false
fs.native-gcs.enabled=true
fs.cache.enabled=true
fs.cache.max-sizes=300GB
fs.cache.directories=/metrics-cache
gcs.project-id=opensource-observer
iceberg.max-partitions-per-writer=1000
source: |
connector.name=hive
hive.metastore.uri=thrift://10.145.192.27:9083
fs.native-gcs.enabled=true
gcs.project-id=opensource-observer
hive.non-managed-table-writes-enabled=true
bigquery: |
connector.name=bigquery
bigquery.project-id=opensource-observer
clickhouse: |
connector.name=clickhouse
connection-url=${ENV:CLICKHOUSE_URL}
connection-user=${ENV:CLICKHOUSE_USER}
connection-password=${ENV:CLICKHOUSE_PASSWORD}
clickhouse.map-string-as-varchar=true
- "--add-opens=java.base/java.nio=ALL-UNNAMED"
2 changes: 1 addition & 1 deletion ops/k8s-apps/local/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
resources: []
- ./redis
- ./minio
- ./test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: local-mcs
spec:
values:
mcs:
cluster:
image:
repo: "ghcr.io/opensource-observer/oso"
tag: "latest"
trino:
host: local-trino-trino.local-trino.svc.cluster.local
port: 8080
user: sqlmesh
11 changes: 11 additions & 0 deletions ops/k8s-apps/local/metrics-calculation-service/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base/metrics-calculation-service
namespace: local-mcs
patches:
- path: ./custom-helm-values.yaml
target:
kind: HelmRelease
options:
allowNameChange: true
82 changes: 81 additions & 1 deletion ops/k8s-apps/production/trino/custom-helm-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ spec:
effect: NoSchedule
nodeSelector:
pool_type: trino-coordinator
jvm:
maxHeapSize: "17G"

worker:
resources:
requests:
Expand All @@ -40,4 +43,81 @@ spec:
value: trino-worker
effect: NoSchedule
nodeSelector:
pool_type: trino-worker
pool_type: trino-worker
config:
query:
maxMemoryPerNode: 140GB
jvm:
maxHeapSize: "350G"

additionalConfigProperties:
- retry-policy=QUERY
additionalExchangeManagerProperties:
- "exchange.sink-buffers-per-partition=6"
- "exchange.sink-buffer-pool-min-size=6"
- "exchange.source-concurrent-readers=6"
- "exchange.s3.region=us"
- "exchange.s3.aws-access-key=${ENV:TRINO_GCS_KEY_ID}"
- "exchange.s3.aws-secret-key=${ENV:TRINO_GCS_SECRET}"
- "exchange.s3.endpoint=https://storage.googleapis.com"

server:
exchangeManager:
name: filesystem
baseDir: gs://oso-dataset-transfer-bucket/trino-exchange/
config:
query:
maxMemory: "1400GB"
workers: 1
autoscaling:
enabled: true
maxReplicas: 9
targetCPUUtilizationPercentage: 20
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Pods
value: 1
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
- type: Pods
value: 4
periodSeconds: 15
selectPolicy: Max
catalogs:
metrics: |
connector.name=iceberg
iceberg.catalog.type=hive_metastore
hive.metastore.uri=thrift://10.145.192.27:9083
hive.metastore-cache-ttl=0s
hive.metastore-refresh-interval=5s
hive.metastore.thrift.client.connect-timeout=10s
hive.metastore.thrift.client.read-timeout=30s
iceberg.use-file-size-from-metadata=false
fs.native-gcs.enabled=true
fs.cache.enabled=true
fs.cache.max-sizes=300GB
fs.cache.directories=/metrics-cache
gcs.project-id=opensource-observer
iceberg.max-partitions-per-writer=1000
source: |
connector.name=hive
hive.metastore.uri=thrift://10.145.192.27:9083
fs.native-gcs.enabled=true
gcs.project-id=opensource-observer
hive.non-managed-table-writes-enabled=true
bigquery: |
connector.name=bigquery
bigquery.project-id=opensource-observer
clickhouse: |
connector.name=clickhouse
connection-url=${ENV:CLICKHOUSE_URL}
connection-user=${ENV:CLICKHOUSE_USER}
connection-password=${ENV:CLICKHOUSE_PASSWORD}
clickhouse.map-string-as-varchar=true
4 changes: 4 additions & 0 deletions ops/k8s-certificates/gke/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../common/self-signed-certs.yaml
4 changes: 4 additions & 0 deletions ops/k8s-certificates/kind/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../common/self-signed-certs.yaml
2 changes: 2 additions & 0 deletions ops/k8s-infrastructure/common/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ metadata:
name: trust-manager
namespace: cert-manager
spec:
dependsOn:
- name: cert-manager
interval: 30m
chart:
spec:
Expand Down
1 change: 0 additions & 1 deletion ops/k8s-infrastructure/gke/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../common/cert-manager.yaml
- ../common/self-signed-certs.yaml
- kube-secrets-init.yaml
- ingress-internal-cloudflare.yaml
- cloudsql-proxy-operator.yaml
2 changes: 0 additions & 2 deletions ops/k8s-infrastructure/kind/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../common/cert-manager.yaml
- ../common/self-signed-certs.yaml
- ./minio-operator.yaml
3 changes: 3 additions & 0 deletions ops/k8s-operators/gke/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources: []
4 changes: 4 additions & 0 deletions ops/k8s-operators/kind/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./minio-operator.yaml
File renamed without changes.
6 changes: 5 additions & 1 deletion ops/opsscripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@ def cluster_setup(branch_name, cluster_name, repo_owner, repo_name):
check=True,
)

rendered_flux_instance = flux_instance_yaml.format(
repo_owner=repo_owner, repo_name=repo_name, branch_name=branch_name
)

subprocess.run(
["kubectl", "apply", "-f", "-"],
input=flux_instance_yaml.encode("utf-8"),
input=rendered_flux_instance.encode("utf-8"),
check=True,
)

Expand Down

0 comments on commit c2157c6

Please sign in to comment.