77analytics_settings (False )
88
99# Use the ACTIVE_DEPLOYMENTS env var to select which Cortex bundles to deploy.
10- ACTIVE_DEPLOYMENTS_ENV = os .getenv ('ACTIVE_DEPLOYMENTS' , 'nova,manila,cinder,ironcore,pods' )
10+ ACTIVE_DEPLOYMENTS_ENV = os .getenv (
11+ 'ACTIVE_DEPLOYMENTS' ,
12+ 'nova,manila,cinder,ironcore,pods,placement' ,
13+ )
1114if ACTIVE_DEPLOYMENTS_ENV == "" :
1215 ACTIVE_DEPLOYMENTS = [] # Catch "".split(",") = [""]
1316else :
@@ -50,6 +53,11 @@ helm_repo(
5053 'https://prometheus-community.github.io/helm-charts' ,
5154 labels = ['Repositories' ],
5255)
56+ helm_repo (
57+ 'perses' ,
58+ 'https://perses.github.io/helm-charts' ,
59+ labels = ['Repositories' ],
60+ )
5361
5462########### Certmanager
5563# Certmanager is required for the validating webhooks in the cortex bundles, so
@@ -78,13 +86,22 @@ local('kubectl wait --namespace cert-manager --for=condition=available deploymen
7886url = 'https://raw.githubusercontent.com/cobaltcore-dev/openstack-hypervisor-operator/refs/heads/main/charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_hypervisors.yaml'
7987local ('curl -L ' + url + ' | kubectl apply -f -' )
8088
81- ########### Cortex Operator & CRDs
89+ ########### Cortex Manager & CRDs
8290docker_build ('ghcr.io/cobaltcore-dev/cortex' , '.' ,
8391 dockerfile = 'Dockerfile' ,
92+ build_args = {'GOMAIN' : 'cmd/manager/main.go' },
8493 only = ['internal/' , 'cmd/' , 'api/' , 'pkg' , 'go.mod' , 'go.sum' , 'Dockerfile' ],
8594)
8695local ('sh helm/sync.sh helm/library/cortex' )
8796
97+ ########### Cortex Shim
98+ docker_build ('ghcr.io/cobaltcore-dev/cortex-shim' , '.' ,
99+ dockerfile = 'Dockerfile' ,
100+ build_args = {'GOMAIN' : 'cmd/shim/main.go' },
101+ only = ['internal/' , 'cmd/' , 'api/' , 'pkg' , 'go.mod' , 'go.sum' , 'Dockerfile' ],
102+ )
103+ local ('sh helm/sync.sh helm/library/cortex-shim' )
104+
88105########### Cortex Bundles
89106docker_build ('ghcr.io/cobaltcore-dev/cortex-postgres' , 'postgres' )
90107
@@ -98,6 +115,7 @@ bundle_charts = [
98115 ('helm/bundles/cortex-cinder' , 'cortex-cinder' ),
99116 ('helm/bundles/cortex-ironcore' , 'cortex-ironcore' ),
100117 ('helm/bundles/cortex-pods' , 'cortex-pods' ),
118+ ('helm/bundles/cortex-placement-shim' , 'cortex-placement-shim' ),
101119]
102120dep_charts = {
103121 'cortex-crds' : [
@@ -123,6 +141,9 @@ dep_charts = {
123141 ('helm/library/cortex-postgres' , 'cortex-postgres' ),
124142 ('helm/library/cortex' , 'cortex' ),
125143 ],
144+ 'cortex-placement-shim' : [
145+ ('helm/library/cortex-shim' , 'cortex-shim' ),
146+ ],
126147}
127148
128149for (bundle_chart_path , bundle_chart_name ) in bundle_charts :
@@ -184,14 +205,14 @@ if 'nova' in ACTIVE_DEPLOYMENTS:
184205 k8s_resource ('cortex-nova-knowledge-controller-manager' , labels = ['Cortex-Nova' ])
185206 local_resource (
186207 'Scheduler E2E Tests (Nova)' ,
187- '/bin/sh -c "kubectl exec deploy/cortex-nova-scheduling-controller-manager -- /manager e2e-nova"' ,
208+ '/bin/sh -c "kubectl exec deploy/cortex-nova-scheduling-controller-manager -- /main e2e-nova"' ,
188209 labels = ['Cortex-Nova' ],
189210 trigger_mode = TRIGGER_MODE_MANUAL ,
190211 auto_init = False ,
191212 )
192213 local_resource (
193214 'Commitments E2E Tests' ,
194- '/bin/sh -c "kubectl exec deploy/cortex-nova-scheduling-controller-manager -- /manager e2e-commitments"' ,
215+ '/bin/sh -c "kubectl exec deploy/cortex-nova-scheduling-controller-manager -- /main e2e-commitments"' ,
195216 labels = ['Cortex-Nova' ],
196217 trigger_mode = TRIGGER_MODE_MANUAL ,
197218 auto_init = False ,
@@ -209,7 +230,7 @@ if 'manila' in ACTIVE_DEPLOYMENTS:
209230 k8s_resource ('cortex-manila-knowledge-controller-manager' , labels = ['Cortex-Manila' ])
210231 local_resource (
211232 'Scheduler E2E Tests (Manila)' ,
212- '/bin/sh -c "kubectl exec deploy/cortex-manila-scheduling-controller-manager -- /manager e2e-manila"' ,
233+ '/bin/sh -c "kubectl exec deploy/cortex-manila-scheduling-controller-manager -- /main e2e-manila"' ,
213234 labels = ['Cortex-Manila' ],
214235 trigger_mode = TRIGGER_MODE_MANUAL ,
215236 auto_init = False ,
@@ -226,7 +247,7 @@ if 'cinder' in ACTIVE_DEPLOYMENTS:
226247 k8s_resource ('cortex-cinder-knowledge-controller-manager' , labels = ['Cortex-Cinder' ])
227248 local_resource (
228249 'Scheduler E2E Tests (Cinder)' ,
229- '/bin/sh -c "kubectl exec deploy/cortex-cinder-scheduling-controller-manager -- /manager e2e-cinder"' ,
250+ '/bin/sh -c "kubectl exec deploy/cortex-cinder-scheduling-controller-manager -- /main e2e-cinder"' ,
230251 labels = ['Cortex-Cinder' ],
231252 trigger_mode = TRIGGER_MODE_MANUAL ,
232253 auto_init = False ,
@@ -255,6 +276,10 @@ if 'pods' in ACTIVE_DEPLOYMENTS:
255276 k8s_yaml ('samples/pods/pod.yaml' )
256277 k8s_resource ('test-pod' , labels = ['Cortex-Pods' ])
257278
279+ if 'placement' in ACTIVE_DEPLOYMENTS :
280+ print ("Activating Cortex Placement Shim bundle" )
281+ k8s_yaml (helm ('./helm/bundles/cortex-placement-shim' , name = 'cortex-placement-shim' , values = tilt_values , set = env_set_overrides ))
282+
258283########### Dev Dependencies
259284local ('sh helm/sync.sh helm/dev/cortex-prometheus-operator' )
260285k8s_yaml (helm ('./helm/dev/cortex-prometheus-operator' , name = 'cortex-prometheus-operator' )) # Operator
@@ -282,3 +307,20 @@ k8s_resource('cortex-plutono', port_forwards=[
282307], links = [
283308 link ('http://localhost:5000/d/cortex/cortex?orgId=1' , 'cortex dashboard' ),
284309], labels = ['Monitoring' ])
310+
311+ helm_resource (
312+ 'cortex-perses' ,
313+ 'perses/perses' ,
314+ flags = ['--values=./tools/perses/values.yaml' ],
315+ port_forwards = [port_forward (5080 , 8080 , name = 'perses' )],
316+ links = [link ('http://localhost:5080' , 'perses dashboard' )],
317+ labels = ['Monitoring' ],
318+ resource_deps = ['perses' ],
319+ )
320+ watch_file ('./tools/perses/dashboards' )
321+ k8s_yaml (local (' ' .join ([
322+ 'kubectl create configmap cortex-perses-dashboards' ,
323+ '--from-file=./tools/perses/dashboards/' ,
324+ '--dry-run=client -o yaml |' ,
325+ 'kubectl label --local -f - perses.dev/resource=true --dry-run=client -o yaml' ,
326+ ])))
0 commit comments