Skip to content

Commit

Permalink
feat: align with the agent plane charts.
Browse files Browse the repository at this point in the history
  • Loading branch information
drcgjung committed May 13, 2024
1 parent 0ee7e64 commit f991056
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/matchmaking-agent/ci/integration-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# SPDX-License-Identifier: Apache-2.0
#

image:
#image:

Check failure on line 24 in charts/matchmaking-agent/ci/integration-values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

24:2 [comments] missing starting space in comment
# registry: ghcr.io/catenax-ng/tx-knowledge-agents/
# tag: 1.12.19-SNAPSHOT

Expand Down
56 changes: 52 additions & 4 deletions charts/matchmaking-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{/*
Create a default fully qualified app name for the connector.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "agent.connector.fullname" -}}
{{- if .Values.connector }}
{{- printf "%s-%s" .Release.Name .Values.connector | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down Expand Up @@ -87,11 +100,46 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{/*
Control DSP URL
*/}}
{{- define "agent.controlplane.url.protocol" -}}
{{- if (and .Values.controlplane.url .Values.controlplane.url.protocol) }}{{/* if dsp api url has been specified explicitly */}}
{{- .Values.controlplane.url.protocol }}
{{- else }}{{/* else when dsp api url has not been specified explicitly */}}
{{- with (index .Values.controlplane.ingresses 0) }}
{{- if .enabled }}{{/* if ingress enabled */}}
{{- if .tls.enabled }}{{/* if TLS enabled */}}
{{- printf "https://%s" .hostname -}}
{{- else }}{{/* else when TLS not enabled */}}
{{- printf "http://%s" .hostname -}}
{{- end }}{{/* end if tls */}}
{{- else }}{{/* else when ingress not enabled */}}
{{- printf "http://%s-controlplane:%v" ( include "agent.connector.fullname" $ ) $.Values.controlplane.endpoints.protocol.port -}}
{{- end }}{{/* end if ingress */}}
{{- end }}{{/* end with ingress */}}
{{- end }}{{/* end if .Values.controlplane.url.protocol */}}
{{- end }}

{{/*
Validation URL
*/}}
{{- define "agent.controlplane.url.control" -}}
{{- printf "http://%s-controlplane:%v%s" ( include "agent.connector.fullname" $ ) .Values.controlplane.endpoints.control.port .Values.controlplane.endpoints.control.path -}}
{{- end }}

{{/*
Validation URL
*/}}
{{- define "agent.controlplane.url.validation" -}}
{{- printf "http://%s-controlplane:%v%s/token" ( include "agent.fullname" $ ) $.Values.controlplane.endpoints.control.port $.Values.controlplane.endpoints.control.path -}}
{{- define "agent.controlplane.url.management" -}}
{{- printf "http://%s-controlplane:%v%s" ( include "agent.connector.fullname" $ ) .Values.controlplane.endpoints.management.port .Values.controlplane.endpoints.management.path -}}
{{- end }}

{{/*
Data Control URL (Expects the Chart Root to be accessible via .root, the current dataplane via .dataplane)
*/}}
{{- define "agent.url.callback" -}}
{{- printf "http://%s:%v%s" (include "agent.fullname" . ) .Values.agent.endpoints.callback.port .Values.agent.endpoints.callback.path -}}
{{- end }}

{{/*
Expand All @@ -100,7 +148,7 @@ join a map
{{- define "agent.remotes" -}}
{{- $res := dict "servers" (list) -}}
{{- range $bpn, $connector := .Values.agent.connectors -}}
{{- $noop := printf "$s=%s" $bpn $connector | append $res.servers | set $res "servers" -}}
{{- $noop := printf "%s=%s" $bpn $connector | append $res.servers | set $res "servers" -}}
{{- end -}}
{{- join "," $res.servers -}}
{{- join "," $res.servers }}
{{- end -}}
10 changes: 5 additions & 5 deletions charts/matchmaking-agent/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ data:
cx.agent.matchmaking.external.api={{ .Values.agent.endpoints.internal.port }}
# Single Control Plane setup
edc.dataplane.token.validation.endpoint={{ include "agent.controlplane.url.validation" .}}
edc.dataplane.token.validation.endpoint={{ include "agent.controlplane.url.control" .}}/token
###
# Chapter Dataspace
###
cx.agent.controlplane.protocol={{ printf "http://%s-controlplane:%v" ( include "agent.fullname" . ) .Values.controlplane.endpoints.protocol.port }}
cx.agent.controlplane.management={{ printf "http://%s-controlplane:%v%s" ( include "agent.fullname" . ) .Values.controlplane.endpoints.management.port .Values.controlplane.endpoints.management.path }}
cx.agent.callback={{ printf "http://%s:%v%s/transfer-process-started" ( include "agent.fullname" . ) .Values.agent.endpoints.callback.port .Values.agent.endpoints.callback.path }}
cx.agent.controlplane.protocol={{ include "agent.controlplane.url.protocol" . }}
cx.agent.controlplane.management={{ include "agent.controlplane.url.management" . }}
cx.agent.callback={{ include "agent.url.callback" . }}/transfer-process-started
{{- if .Values.agent.skillcontract }}
cx.agent.skill.contract.default={{ .Values.agent.skillcontract }}
{{- end }}
Expand Down Expand Up @@ -91,7 +91,7 @@ data:
###################
# AGENT SYNC #
###################
cx.agent.dataspace.remotes={{- include "agent.remotes" . }}
cx.agent.dataspace.remotes={{ include "agent.remotes" . }}
cx.agent.dataspace.synchronization={{ .Values.agent.synchronization | required ".Values.agent.synchronization should be set if connectors are specified" }}
cx.agent.federation.batch.max={{ .Values.agent.maxbatchsize }}
Expand Down
5 changes: 5 additions & 0 deletions charts/matchmaking-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ participant:
# -- BPN Number
id: ""

# -- Name of the connector deployment
connector: ""

# -- References to the control plane deployment
controlplane:
endpoints:
Expand All @@ -165,6 +168,8 @@ controlplane:
port: 8084
# -- path for incoming api calls
path: /api/v1/dsp
ingresses:
- enabled: false

# -- A set of additional configuration files
configs:
Expand Down

0 comments on commit f991056

Please sign in to comment.