Skip to content

Commit

Permalink
fix: rebase errors
Browse files Browse the repository at this point in the history
Signed-off-by: Guilhem Barthes <[email protected]>
  • Loading branch information
guilhem-barthes committed Aug 24, 2023
1 parent 62768e1 commit cba53a2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 304 deletions.
1 change: 1 addition & 0 deletions backend/substrapp/compute_tasks/image_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from tempfile import TemporaryDirectory

import structlog
from django.conf import settings

import orchestrator
import substrapp.clients.organization as organization_client
Expand Down
10 changes: 0 additions & 10 deletions backend/substrapp/tasks/tasks_compute_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@

import orchestrator
from backend.celery import app
from builder.tasks.tasks_build_image import build_image
from substrapp import models
from substrapp import utils
from substrapp.clients import organization as organization_client
from substrapp.compute_tasks import compute_task as task_utils
from substrapp.compute_tasks import errors as compute_task_errors
Expand Down Expand Up @@ -149,13 +146,6 @@ def queue_compute_task(channel_name: str, task: orchestrator.ComputeTask) -> Non
)
return

# add image build to the Celery queue
with get_orchestrator_client(channel_name) as client:
function = client.query_function(task.function_key)
builder_queue = get_builder_queue()
# TODO switch to function.model_dump_json() as soon as pydantic is updated to > 2.0
build_image.apply_async((function.json(),), queue=builder_queue, task_id=function.key)

with get_orchestrator_client(channel_name) as client:
if not task_utils.is_task_runnable(task.key, client):
return # avoid creating a Celery task
Expand Down
240 changes: 0 additions & 240 deletions charts/substra-backend/templates/deployment-builder.yaml

This file was deleted.

55 changes: 1 addition & 54 deletions charts/substra-backend/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,57 +182,4 @@ roleRef:
kind: Role
name: {{ template "substra.fullname" . }}-builder
apiGroup: rbac.authorization.k8s.io
{{- end -}}
{{- if .Values.builder.rbac.create }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "substra.fullname" . }}-builder
labels:
{{ include "substra.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ template "substra.name" . }}
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "substra.fullname" . }}-builder
labels:
{{ include "substra.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ template "substra.name" . }}
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "watch", "list"]
- apiGroups: [""]
resources: ["pods/log", "pods/status"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["pods", "pods/exec"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: [""]
resources: ["services"]
verbs: ["get"]
{{- if .Values.psp.create }}
- apiGroups: [""]
resources: ["podsecuritypolicies"]
verbs: ["use"]
resourceNames:
- {{ template "substra.fullname" . }}-psp
{{- end }}
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "substra.fullname" . }}-builder
labels:
{{ include "substra.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ template "substra.name" . }}
subjects:
- kind: ServiceAccount
name: {{ template "substra.fullname" . }}-builder
roleRef:
kind: Role
name: {{ template "substra.fullname" . }}-builder
apiGroup: rbac.authorization.k8s.io
{{- end }}
{{- end -}}

0 comments on commit cba53a2

Please sign in to comment.