-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathTiltfile
More file actions
142 lines (130 loc) · 3.18 KB
/
Copy pathTiltfile
File metadata and controls
142 lines (130 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# -*- mode: Python -*-
docker_build(
"ghcr.io/marmotdata/marmot",
".",
dockerfile="Dockerfile",
ignore=[
".git",
".github",
"*.md",
"LICENSE",
"test/",
"web/docs/",
"testenv/",
],
)
k8s_yaml("charts/marmot/crds/runs.marmotdata.io_runs.yaml")
k8s_yaml(blob("""
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
labels:
app: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:16-alpine
ports:
- containerPort: 5432
env:
- name: POSTGRES_USER
value: marmot
- name: POSTGRES_PASSWORD
value: marmot
- name: POSTGRES_DB
value: marmot
readinessProbe:
exec:
command: ["pg_isready", "-U", "marmot"]
initialDelaySeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: postgres
spec:
selector:
app: postgres
ports:
- port: 5432
targetPort: 5432
"""))
helm_values = encode_yaml({
"image": {
"repository": "ghcr.io/marmotdata/marmot",
"pullPolicy": "Never",
},
"replicaCount": 1,
"autoscaling": {"enabled": False},
"resources": {
"limits": {"cpu": "1000m", "memory": "512Mi"},
"requests": {"cpu": "100m", "memory": "128Mi"},
},
"postgresql": {"enabled": False},
"cnpg": {"enabled": False},
"config": {
"server": {
"port": 8080,
"host": "0.0.0.0",
"autoGenerateEncryptionKey": True,
"allow_unencrypted": True,
},
"database": {
"host": "postgres",
"port": 5432,
"user": "marmot",
"name": "marmot",
"sslmode": "disable",
"max_conns": 20,
"idle_conns": 5,
"conn_lifetime": 5,
},
"logging": {
"level": "debug",
"format": "console",
},
"auth": {
"anonymous": {
"enabled": True,
"role": "admin",
},
},
"pipelines": {
"max_workers": 5,
"scheduler_interval": 30,
"lease_expiry": 300,
"claim_expiry": 30,
},
"operator": {
"enabled": True,
"namespace": "default",
},
},
"operator": {
"enabled": True,
"replicas": 1,
"leaderElect": False,
"resources": {
"limits": {"cpu": "500m", "memory": "256Mi"},
"requests": {"cpu": "50m", "memory": "64Mi"},
},
},
"env": {
"MARMOT_DATABASE_PASSWORD": "marmot",
},
})
k8s_yaml(local("helm template marmot charts/marmot -f -", stdin=helm_values))
k8s_resource("postgres", port_forwards=["5432:5432"], labels=["infra"])
k8s_resource("marmot", port_forwards=["8080:8080"], labels=["marmot"], resource_deps=["postgres"])
k8s_resource("marmot-operator", labels=["marmot"], resource_deps=["marmot"])