Skip to content

Commit 90713cf

Browse files
committed
merge bugfixes
1 parent 31c497a commit 90713cf

27 files changed

Lines changed: 163 additions & 239 deletions

aggregator-platform/templates/NOTES.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ This is displayed after helm install / upgrade
1010
Aggregation platform is available at:
1111

1212
{{- if .Values.tls.enabled }}
13-
https://{{ .Values.host }}
13+
https://{{ .Values.external.host }}
1414
{{- else }}
15-
http://{{ .Values.host }}
15+
http://{{ .Values.external.host }}
1616
{{- end }}
1717

1818
----------------------------------------------------------
1919
Manage transformations:
2020

2121
{{- if .Values.tls.enabled }}
22-
- https://{{ .Values.host }}{{ .Values.spec.transformation_catalog }}
22+
- https://{{ .Values.external.host }}{{ .Values.spec.transformation_catalog }}
2323
{{- else }}
24-
- http://{{ .Values.host }}{{ .Values.spec.transformation_catalog }}
24+
- http://{{ .Values.external.host }}{{ .Values.spec.transformation_catalog }}
2525
{{- end }}
2626

2727
----------------------------------------------------------
2828
Create aggregators at:
2929

3030
{{- if .Values.tls.enabled }}
31-
- https://{{ .Values.host }}{{ .Values.spec.registration }}
31+
- https://{{ .Values.external.host }}{{ .Values.spec.registration }}
3232
{{- else }}
33-
- http://{{ .Values.host }}{{ .Values.spec.registration }}
33+
- http://{{ .Values.external.host }}{{ .Values.spec.registration }}
3434
{{- end }}
3535

3636
##########################################################

aggregator-platform/templates/ingress-uma-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
failureThreshold: {{ .Values.ingressUma.readinessProbe.failureThreshold }}
3939
env:
4040
- name: EXTERNAL_HOST
41-
value: "{{ .Values.host }}"
41+
value: "{{ .Values.external.host }}"
4242
- name: DISABLE_AUTH
4343
value: "{{ .Values.ingressUma.disableAuth }}"
4444
- name: CLIENT_ID

aggregator-platform/templates/server-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ data:
1111
NAMESPACE: {{ .Release.Namespace }}
1212
LOG_LEVEL: {{ .Values.loglevel }}
1313
EXTERNAL_HOST: {{ .Values.external.host }}
14-
EXTERNAL_HTTP_PORT: {{ .Values.external.httpPort }}
15-
EXTERNAL_HTTPS_PORT: {{ .Values.external.httpsPort }}
14+
EXTERNAL_HTTP_PORT: {{ .Values.external.httpPort | quote }}
15+
EXTERNAL_HTTPS_PORT: {{ .Values.external.httpsPort | quote }}
1616
CLIENT_ID: {{ .Values.auth.clientId }}
1717
AUTH_SERVER: {{ .Values.auth.server }}
1818
ALLOWED_REGISTRATION_TYPES: {{ join "," .Values.auth.allowedRegistrationTypes | quote }}

aggregator-platform/templates/server-ingress.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ spec:
1313
{{- if .Values.tls.enabled }}
1414
tls:
1515
- hosts:
16-
- {{ .Values.host }}
16+
- {{ .Values.external.host }}
1717
secretName: {{ .Values.tls.secretName }}
1818
{{- end }}
1919

2020
rules:
21-
- host: {{ .Values.host }}
21+
- host: {{ .Values.external.host }}
2222
http:
2323
paths:
2424
- path: /

aggregator-platform/templates/server-secrets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
- {{ . }}
4040
{{- end }}
4141
{{- else }}
42-
- {{ .Values.host }}
42+
- {{ .Values.external.host }}
4343
{{- end }}
4444
issuerRef:
4545
name: {{ .Values.tls.certManager.issuerName }}

aggregator-platform/templates/tokens-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ spec:
4646
value: "{{ .Values.auth.server }}"
4747
- name: LOG_LEVEL
4848
value: "{{ .Values.loglevel }}"
49-
terminationGracePeriodSeconds: {{ .Values.tokenService.terminationGracePeriodSeconds }}
49+
terminationGracePeriodSeconds: {{ .Values.tokenService.terminationGracePeriodSeconds }}

collect-logs.sh

100644100755
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
#!/usr/bin/env bash
2-
3-
set -euo pipefail
4-
5-
NAMESPACE="${1:-default}"
6-
LOG_DIR="./logs"
7-
INTERVAL=5
8-
9-
mkdir -p "$LOG_DIR"
10-
11-
echo "Watching namespace: $NAMESPACE"
12-
echo "Logs directory: $LOG_DIR"
13-
14-
declare -A POD_PIDS
15-
16-
start_logging() {
17-
local pod="$1"
18-
19-
# Skip if already logging
20-
if [[ -n "${POD_PIDS[$pod]:-}" ]]; then
21-
return
22-
fi
23-
24-
echo "Starting logs for pod: $pod"
25-
26-
kubectl logs -n "$NAMESPACE" -f "$pod" \
27-
> "$LOG_DIR/${pod}.log" 2>&1 &
28-
29-
POD_PIDS[$pod]=$!
30-
}
31-
32-
stop_logging() {
33-
local pod="$1"
34-
35-
if [[ -n "${POD_PIDS[$pod]:-}" ]]; then
36-
echo "Stopping logs for pod: $pod"
37-
kill "${POD_PIDS[$pod]}" 2>/dev/null || true
38-
unset POD_PIDS[$pod]
39-
fi
40-
}
41-
42-
while true; do
43-
# Get current pods
44-
current_pods=$(kubectl get pods -n "$NAMESPACE" \
45-
-o jsonpath='{.items[*].metadata.name}')
46-
47-
# Start logging for new pods
48-
for pod in $current_pods; do
49-
start_logging "$pod"
50-
done
51-
52-
# Stop logging for deleted pods
53-
for pod in "${!POD_PIDS[@]}"; do
54-
if ! grep -qw "$pod" <<< "$current_pods"; then
55-
stop_logging "$pod"
56-
fi
57-
done
58-
59-
sleep "$INTERVAL"
60-
done
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
NAMESPACE="${1:-default}"
6+
LOG_DIR="./logs"
7+
INTERVAL=5
8+
9+
mkdir -p "$LOG_DIR"
10+
11+
echo "Watching namespace: $NAMESPACE"
12+
echo "Logs directory: $LOG_DIR"
13+
14+
declare -A POD_PIDS
15+
16+
start_logging() {
17+
local pod="$1"
18+
19+
# Skip if already logging
20+
if [[ -n "${POD_PIDS[$pod]:-}" ]]; then
21+
return
22+
fi
23+
24+
echo "Starting logs for pod: $pod"
25+
26+
kubectl logs -n "$NAMESPACE" -f "$pod" \
27+
> "$LOG_DIR/${pod}.log" 2>&1 &
28+
29+
POD_PIDS[$pod]=$!
30+
}
31+
32+
stop_logging() {
33+
local pod="$1"
34+
35+
if [[ -n "${POD_PIDS[$pod]:-}" ]]; then
36+
echo "Stopping logs for pod: $pod"
37+
kill "${POD_PIDS[$pod]}" 2>/dev/null || true
38+
unset POD_PIDS[$pod]
39+
fi
40+
}
41+
42+
while true; do
43+
# Get current pods
44+
current_pods=$(kubectl get pods -n "$NAMESPACE" \
45+
-o jsonpath='{.items[*].metadata.name}')
46+
47+
# Start logging for new pods
48+
for pod in $current_pods; do
49+
start_logging "$pod"
50+
done
51+
52+
# Stop logging for deleted pods
53+
for pod in "${!POD_PIDS[@]}"; do
54+
if ! grep -qw "$pod" <<< "$current_pods"; then
55+
stop_logging "$pod"
56+
fi
57+
done
58+
59+
sleep "$INTERVAL"
60+
done

containers/aggregator-server/config/transformations.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (config *TransformationsConfigData) updateCatalog() {
104104
reader := strings.NewReader(catalogBase)
105105
quads, errChan := rdfgo.Parse(reader, rdfgo.ParserOptions{
106106
Format: "turtle",
107-
BaseIRI: fmt.Sprintf("http://%s/config/transformations#", model.ExternalHost),
107+
BaseIRI: model.ExternalURL() + model.TransformationCatalog + "#",
108108
})
109109

110110
go func() {
@@ -118,11 +118,11 @@ func (config *TransformationsConfigData) updateCatalog() {
118118
config.store.Import(quads)
119119

120120
// Insert transformations
121-
for _, t := range config.transformations {
122-
reader := strings.NewReader(t.FNO)
121+
for _, tf := range config.transformations {
122+
reader := strings.NewReader(tf.FNO)
123123
quads, errChan := rdfgo.Parse(reader, rdfgo.ParserOptions{
124124
Format: "turtle",
125-
BaseIRI: fmt.Sprintf("http://%s/config/transformations#", model.ExternalHost),
125+
BaseIRI: model.ExternalURL() + model.TransformationCatalog + "#",
126126
})
127127

128128
go func() {
@@ -137,9 +137,9 @@ func (config *TransformationsConfigData) updateCatalog() {
137137

138138
// Link transformation to catalog
139139
config.store.AddQuadFromTerms(
140-
rdfgo.NewNamedNode(fmt.Sprintf("http://%s/config/transformations#transformation-catalog", model.ExternalHost)),
140+
rdfgo.NewNamedNode(model.ExternalURL()+model.TransformationCatalog+"#transformation-catalog"),
141141
rdfgo.NewNamedNode("https://spec.knows.idlab.ugent.be/aggregator-protocol/latest/#hasTransformation"),
142-
rdfgo.NewNamedNode(fmt.Sprintf("http://%s/config/transformations#%s", model.ExternalHost, t.ID)),
142+
rdfgo.NewNamedNode(model.ExternalURL()+model.TransformationCatalog+"#"+tf.ID),
143143
nil,
144144
)
145145
}

containers/aggregator-server/instance/egress.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ func ensureEgressDeployment(aggregatorId string, replicas int32, ownerID string,
9292
Env: []corev1.EnvVar{
9393
{Name: "CLIENT_ID", Value: model.ClientId},
9494
{Name: "CLIENT_SECRET", Value: model.ClientSecret},
95-
{Name: "AGGREGATOR_ID", Value: aggregatorId},
96-
{Name: "OWNER_ID", Value: ownerID},
95+
{Name: "USER_ID", Value: ownerID},
9796
{Name: "LOG_LEVEL", Value: model.LogLevel.String()},
9897
},
9998
},

containers/aggregator-server/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ func main() {
3737
if model.ExternalHost == "" {
3838
logrus.Fatal("Environment variable EXTERNAL_HOST must be set")
3939
}
40+
model.ExternalHttpPort = os.Getenv("EXTERNAL_HTTP_PORT")
41+
if model.ExternalHttpPort == "" {
42+
logrus.Warn("Environment variable EXTERNAL_HTTP_PORT was not set. default=80")
43+
model.ExternalHttpPort = "80"
44+
}
45+
model.ExternalHttpsPort = os.Getenv("EXTERNAL_HTTPS_PORT")
46+
if model.ExternalHttpsPort == "" {
47+
logrus.Warn("Environment variable EXTERNAL_HTTPS_PORT was not set. default=443")
48+
model.ExternalHttpsPort = "443"
49+
}
4050
model.TLSSecret = os.Getenv("TLS_SECRET")
4151
if model.TLSSecret != "" {
4252
logrus.Info("HTTPS enabled!")

0 commit comments

Comments
 (0)