From f6353c9bbfa58fe89217a2a5429242ad61621a89 Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Thu, 8 Sep 2022 13:51:23 +0200 Subject: [PATCH 1/9] feat: update to v5.0.0 + new options --- .github/workflows/lint-test.yml | 3 +-- ...eadme-metadata.yml => readme-metadata.yml} | 8 ++++++- community-solid-server/Chart.yaml | 4 ++-- community-solid-server/templates/NOTES.txt | 4 +--- .../templates/deployment.yaml | 22 ++++++++++++------- community-solid-server/values.yaml | 12 ++++++++++ 6 files changed, 37 insertions(+), 16 deletions(-) rename .github/workflows/{check-readme-metadata.yml => readme-metadata.yml} (91%) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index d83f582..8b52e12 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -13,13 +13,12 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - token: ${{ secrets.OBLX_PAT || secrets.github_token }} fetch-depth: 0 - name: Set up Helm uses: azure/setup-helm@v3.3 with: - version: v3.9.2 + version: v3.9.4 # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and # yamllint (https://github.com/adrienverge/yamllint) which require Python diff --git a/.github/workflows/check-readme-metadata.yml b/.github/workflows/readme-metadata.yml similarity index 91% rename from .github/workflows/check-readme-metadata.yml rename to .github/workflows/readme-metadata.yml index 1aa4195..40459f8 100644 --- a/.github/workflows/check-readme-metadata.yml +++ b/.github/workflows/readme-metadata.yml @@ -7,6 +7,12 @@ on: - next paths: - '*/values.yaml' + push: + branches: + - main + - next + paths: + - '*/values.yaml' jobs: check-and-update-readme: @@ -47,5 +53,5 @@ jobs: git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" git add community-solid-server/README.md - git commit -am "docs: Update chart parameters readme" + git commit -am "docs: Update chart parameters readme [skip ci]" git push diff --git a/community-solid-server/Chart.yaml b/community-solid-server/Chart.yaml index 4fa65cb..f68117b 100644 --- a/community-solid-server/Chart.yaml +++ b/community-solid-server/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.1.0 +version: 3.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "4.1.0" +appVersion: "5.0.0" home: https://github.com/idlab-gent/css-helm-chart icon: https://raw.githubusercontent.com/solid/community-server/main/templates/images/solid.svg diff --git a/community-solid-server/templates/NOTES.txt b/community-solid-server/templates/NOTES.txt index e93bb5c..b98bf79 100644 --- a/community-solid-server/templates/NOTES.txt +++ b/community-solid-server/templates/NOTES.txt @@ -1,9 +1,7 @@ 1. Get the application URL by running these commands: {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.host }}{{ .Values.ingress.path }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "community-solid-server.fullname" . }}) diff --git a/community-solid-server/templates/deployment.yaml b/community-solid-server/templates/deployment.yaml index 17b2d61..280514c 100644 --- a/community-solid-server/templates/deployment.yaml +++ b/community-solid-server/templates/deployment.yaml @@ -30,9 +30,9 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} {{- $appVersion := .Chart.AppVersion -}} {{- with .Values.image }} - image: "{{.registry}}/{{ .repository }}:{{ .tag | default $appVersion }}" - {{- end}} - args: + image: "{{.registry}}/{{ .repository }}:{{ default $appVersion .tag }}" + {{- end }} + args: - "-l" - "{{ .Values.logLevel}}" - "-b" @@ -43,7 +43,7 @@ spec: {{- with .Values.config}} - "-c" {{- if not .configMapName }} - - "config/{{.bundled}}.json" + - "config/{{ .bundled }}.json" {{- else }} - "/config/{{ .configMapKey }}" {{- end }} @@ -52,10 +52,16 @@ spec: - "-f" - "/data/" {{- end }} - {{- range $val := .Values.customParameters }} - - {{ $val.flag | quote }} - - {{ $val.value | quote }} - {{- end }} + # {{- if .Values.multithreading.enabled }} + # - "-w" + # - {{ .Values.multithreading.threads | quote }} + # {{- end }} + # {{- range $val := .Values.customParameters }} + # - {{ $val.flag | quote }} + # - {{ $val.value | quote }} + # {{- end }} + # env: + # {{ .Values.env | nindent 12 }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http diff --git a/community-solid-server/values.yaml b/community-solid-server/values.yaml index 1b10772..68e0584 100644 --- a/community-solid-server/values.yaml +++ b/community-solid-server/values.yaml @@ -53,6 +53,13 @@ sparqlEndpoint: "" ## @param baseUrlOverride From the helm config, an appropriate --baseUrl value will be passed to the community server. If however you wish to override this set this parameter appropriately. baseUrlOverride: "" +## @param multithreading.enabled Run in multithreaded mode using workers. +## See [CSS - Multithreading](https://github.com/CommunitySolidServer/CommunitySolidServer#-multithreading). +## @param multithreading.threads define how many threads to use, special values: -1 (num_cores-1) and 0 (num_cores) +multithreading: + enabled: false + threads: "-1" + ## @param customParameters An array of `flag` `value` pairs to be added to the CSS cli command for custom parameters/overwrites. customParameters: [] # - flag: --serverKey @@ -60,6 +67,11 @@ customParameters: [] # - flag: --serverCert # value: server.cert +## @param Array of `name` and `value` pairs to be passed as environment variables to the CSS. +## See [CSS - Environment Variables](https://github.com/CommunitySolidServer/CommunitySolidServer#%EF%B8%8F-environment-variables). +environmentVariables: [] + + ## @section Persistence parameters ## Enable persistence using Persistent Volume Claims ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/ From 78f9e52e527aee1ad6bd2638caf05de996264a84 Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Thu, 8 Sep 2022 15:58:24 +0200 Subject: [PATCH 2/9] fix: env var passing + disableServiceLinks --- community-solid-server/templates/NOTES.txt | 2 -- .../templates/deployment.yaml | 24 +++++++++++-------- community-solid-server/values.yaml | 15 +++++++----- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/community-solid-server/templates/NOTES.txt b/community-solid-server/templates/NOTES.txt index b98bf79..95f8392 100644 --- a/community-solid-server/templates/NOTES.txt +++ b/community-solid-server/templates/NOTES.txt @@ -1,8 +1,6 @@ 1. Get the application URL by running these commands: {{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.host }}{{ .Values.ingress.path }} -{{- end }} {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "community-solid-server.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") diff --git a/community-solid-server/templates/deployment.yaml b/community-solid-server/templates/deployment.yaml index 280514c..36352a5 100644 --- a/community-solid-server/templates/deployment.yaml +++ b/community-solid-server/templates/deployment.yaml @@ -18,6 +18,7 @@ spec: labels: {{- include "community-solid-server.selectorLabels" . | nindent 8 }} spec: + enableServiceLinks: false {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} @@ -52,16 +53,19 @@ spec: - "-f" - "/data/" {{- end }} - # {{- if .Values.multithreading.enabled }} - # - "-w" - # - {{ .Values.multithreading.threads | quote }} - # {{- end }} - # {{- range $val := .Values.customParameters }} - # - {{ $val.flag | quote }} - # - {{ $val.value | quote }} - # {{- end }} - # env: - # {{ .Values.env | nindent 12 }} + {{- if .Values.multithreading.enabled }} + - "-w" + - {{ .Values.multithreading.threads | quote }} + {{- end }} + {{- range $val := .Values.customParameters }} + - {{ $val.flag | quote }} + - {{ $val.value | quote }} + {{- end }} + env: + {{- range $val := .Values.env }} + - name: {{ $val.name | quote}} + value: {{ $val.value | quote}} + {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http diff --git a/community-solid-server/values.yaml b/community-solid-server/values.yaml index 68e0584..e643ca9 100644 --- a/community-solid-server/values.yaml +++ b/community-solid-server/values.yaml @@ -62,14 +62,17 @@ multithreading: ## @param customParameters An array of `flag` `value` pairs to be added to the CSS cli command for custom parameters/overwrites. customParameters: [] - # - flag: --serverKey - # value: server.key - # - flag: --serverCert - # value: server.cert +# - flag: --serverKey +# value: server.key +# - flag: --serverCert +# value: server.cert -## @param Array of `name` and `value` pairs to be passed as environment variables to the CSS. +## @param Array of `name: ""` and `value: ""` pairs to be passed as environment variables to the CSS. ## See [CSS - Environment Variables](https://github.com/CommunitySolidServer/CommunitySolidServer#%EF%B8%8F-environment-variables). -environmentVariables: [] +env: [] +# - name: CSS_LOGGING_LEVEL +# value: debug + ## @section Persistence parameters From 5c8b03c36e4661ef46af5853d6437ed27f36e4f0 Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Thu, 8 Sep 2022 16:02:51 +0200 Subject: [PATCH 3/9] format: fix newlines for linter --- community-solid-server/values.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/community-solid-server/values.yaml b/community-solid-server/values.yaml index e643ca9..6c013fb 100644 --- a/community-solid-server/values.yaml +++ b/community-solid-server/values.yaml @@ -73,8 +73,6 @@ env: [] # - name: CSS_LOGGING_LEVEL # value: debug - - ## @section Persistence parameters ## Enable persistence using Persistent Volume Claims ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/ From ba1f0936c1b6efbc8b8950bc2e65aed5e60bfa6f Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Thu, 8 Sep 2022 16:22:32 +0200 Subject: [PATCH 4/9] docs: fix values metadata --- community-solid-server/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community-solid-server/values.yaml b/community-solid-server/values.yaml index 6c013fb..61daa4e 100644 --- a/community-solid-server/values.yaml +++ b/community-solid-server/values.yaml @@ -67,7 +67,7 @@ customParameters: [] # - flag: --serverCert # value: server.cert -## @param Array of `name: ""` and `value: ""` pairs to be passed as environment variables to the CSS. +## @param env Array of `name: ""` and `value: ""` pairs to be passed as environment variables to the CSS. ## See [CSS - Environment Variables](https://github.com/CommunitySolidServer/CommunitySolidServer#%EF%B8%8F-environment-variables). env: [] # - name: CSS_LOGGING_LEVEL From 66d9a479dc2bc49b554e431f739de85883bb8248 Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Mon, 24 Oct 2022 10:43:58 +0200 Subject: [PATCH 5/9] fix: default storageclass usage --- .../templates/persistentVolumeClaim.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/community-solid-server/templates/persistentVolumeClaim.yaml b/community-solid-server/templates/persistentVolumeClaim.yaml index f40d77a..82b4c09 100644 --- a/community-solid-server/templates/persistentVolumeClaim.yaml +++ b/community-solid-server/templates/persistentVolumeClaim.yaml @@ -6,7 +6,13 @@ metadata: labels: {{- include "community-solid-server.labels" . | nindent 4 }} spec: - storageClassName: {{ .Values.persistence.storageClassName }} + {{- if .Values.persistence.storageClassName }} + {{- if (eq "-" .Values.server.persistentVolume.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.server.persistentVolume.storageClass }}" + {{- end }} + {{- end }} accessModes: - ReadWriteOnce resources: From 44e8d526ec4eb4bda80b7a0ddab24e633ee64085 Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Mon, 24 Oct 2022 13:15:21 +0200 Subject: [PATCH 6/9] fix: setting number of workers --- community-solid-server/templates/deployment.yaml | 2 +- community-solid-server/templates/persistentVolumeClaim.yaml | 2 +- community-solid-server/values.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/community-solid-server/templates/deployment.yaml b/community-solid-server/templates/deployment.yaml index 36352a5..c38212e 100644 --- a/community-solid-server/templates/deployment.yaml +++ b/community-solid-server/templates/deployment.yaml @@ -55,7 +55,7 @@ spec: {{- end }} {{- if .Values.multithreading.enabled }} - "-w" - - {{ .Values.multithreading.threads | quote }} + - {{ .Values.multithreading.workers | quote }} {{- end }} {{- range $val := .Values.customParameters }} - {{ $val.flag | quote }} diff --git a/community-solid-server/templates/persistentVolumeClaim.yaml b/community-solid-server/templates/persistentVolumeClaim.yaml index 82b4c09..94b6c4f 100644 --- a/community-solid-server/templates/persistentVolumeClaim.yaml +++ b/community-solid-server/templates/persistentVolumeClaim.yaml @@ -10,7 +10,7 @@ spec: {{- if (eq "-" .Values.server.persistentVolume.storageClass) }} storageClassName: "" {{- else }} - storageClassName: "{{ .Values.server.persistentVolume.storageClass }}" + storageClassName: "{{ .Values.server.persistentVolume.storageClassName }}" {{- end }} {{- end }} accessModes: diff --git a/community-solid-server/values.yaml b/community-solid-server/values.yaml index 61daa4e..2923ddb 100644 --- a/community-solid-server/values.yaml +++ b/community-solid-server/values.yaml @@ -55,10 +55,10 @@ baseUrlOverride: "" ## @param multithreading.enabled Run in multithreaded mode using workers. ## See [CSS - Multithreading](https://github.com/CommunitySolidServer/CommunitySolidServer#-multithreading). -## @param multithreading.threads define how many threads to use, special values: -1 (num_cores-1) and 0 (num_cores) +## @param multithreading.workers define how many worker threads to use, special values: -1 (num_cores-1) and 0 (num_cores) multithreading: enabled: false - threads: "-1" + workers: "-1" ## @param customParameters An array of `flag` `value` pairs to be added to the CSS cli command for custom parameters/overwrites. customParameters: [] From e2ed74bfbf18d355dec030ab1f32152f16129d20 Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Mon, 25 Sep 2023 11:06:44 +0200 Subject: [PATCH 7/9] chore: add redis locker example --- community-solid-server/templates/_helpers.tpl | 4 +- examples/redis-locking/README.md | 11 +++ examples/redis-locking/config.json | 78 +++++++++++++++++++ examples/redis-locking/values.yaml | 13 ++++ 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 examples/redis-locking/README.md create mode 100644 examples/redis-locking/config.json create mode 100644 examples/redis-locking/values.yaml diff --git a/community-solid-server/templates/_helpers.tpl b/community-solid-server/templates/_helpers.tpl index 03aa2ce..c46679c 100644 --- a/community-solid-server/templates/_helpers.tpl +++ b/community-solid-server/templates/_helpers.tpl @@ -68,8 +68,8 @@ Pass a correct baseUrl {{- if .Values.baseUrlOverride }} {{- .Values.baseUrlOverride }} {{- else if .Values.ingress.enabled }} -{{- printf "http://%s%s" .Values.ingress.host .Values.ingress.path}} +{{- printf "https://%s%s" .Values.ingress.host .Values.ingress.path}} {{- else }} {{- printf "http://%s.%s/" ( include "community-solid-server.fullname" . ) .Release.Namespace }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/examples/redis-locking/README.md b/examples/redis-locking/README.md new file mode 100644 index 0000000..1e432ee --- /dev/null +++ b/examples/redis-locking/README.md @@ -0,0 +1,11 @@ +# Multithreaded CSS with Redis based resource locking + +A config has been provided to setup CSS with a file backend and Redis resource locking. First we need to get this config deployed on the cluster in a configmap: + +```bash +kubectl create configmap css-redis-file --from-file examples/redis-locking/config.json +``` + +```bash +helm install css-redis bitnami/redis --set auth.enabled=false +``` diff --git a/examples/redis-locking/config.json b/examples/redis-locking/config.json new file mode 100644 index 0000000..d50844d --- /dev/null +++ b/examples/redis-locking/config.json @@ -0,0 +1,78 @@ +{ + "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^5.0.0/components/context.jsonld", + "@graph": [ + { + "comment": "A single-pod server that stores its resources on disk." + }, + { + "@id": "urn:solid-server-app-setup:default:CliExtractor", + "@type": "YargsCliExtractor", + "parameters": [ + { + "@type": "YargsParameter", + "name": "redisUri", + "options": { + "demandOption": true, + "describe": "Connection URI of Redis instance to be used for resource locking", + "requiresArg": true, + "type": "string" + } + } + ] + }, + { + "@id": "urn:solid-server-app-setup:default:ShorthandResolver", + "@type": "CombinedShorthandResolver", + "comment": "Adds resolvers to assign the Redis CLI values to the Components.js variables.", + "resolvers": [ + { + "CombinedShorthandResolver:_resolvers_key": "urn:solid-server:custom:variable:redisUri", + "CombinedShorthandResolver:_resolvers_value": { + "@type": "KeyExtractor", + "key": "redisUri" + } + } + ] + }, + { + "@id": "urn:solid-server:default:RedisLocker", + "@type": "RedisLocker", + "redisClient": { + "@id": "urn:solid-server:custom:variable:redisUri", + "@type": "Variable" + } + } + ], + "import": [ + "css:config/app/main/default.json", + "css:config/app/init/default.json", + "css:config/app/setup/required.json", + "css:config/app/variables/default.json", + "css:config/http/handler/default.json", + "css:config/http/middleware/websockets.json", + "css:config/http/server-factory/websockets.json", + "css:config/http/static/default.json", + "css:config/identity/access/public.json", + "css:config/identity/email/default.json", + "css:config/identity/handler/default.json", + "css:config/identity/ownership/token.json", + "css:config/identity/pod/static.json", + "css:config/identity/registration/enabled.json", + "css:config/ldp/authentication/dpop-bearer.json", + "css:config/ldp/authorization/webacl.json", + "css:config/ldp/handler/default.json", + "css:config/ldp/metadata-parser/default.json", + "css:config/ldp/metadata-writer/default.json", + "css:config/ldp/modes/default.json", + "css:config/storage/backend/file.json", + "css:config/storage/key-value/resource-store.json", + "css:config/storage/middleware/default.json", + "css:config/util/auxiliary/acl.json", + "css:config/util/identifiers/suffix.json", + "css:config/util/index/default.json", + "css:config/util/logging/winston.json", + "css:config/util/representation-conversion/default.json", + "css:config/util/resource-locker/redis.json", + "css:config/util/variables/default.json" + ] +} diff --git a/examples/redis-locking/values.yaml b/examples/redis-locking/values.yaml new file mode 100644 index 0000000..5a8072a --- /dev/null +++ b/examples/redis-locking/values.yaml @@ -0,0 +1,13 @@ +config: + configMapKey: config.json + configMapName: css-redis-file +logLevel: info +multithreading: + enabled: true + workers: 4 +persistence: + enabled: true + size: 512Mi +env: + - name: CSS_REDIS_URI + value: css-redis-master:6379 From a70fcf61900f631b456917efed83a4f8d421536b Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Mon, 25 Sep 2023 11:50:28 +0200 Subject: [PATCH 8/9] fix: pvc template fixed --- community-solid-server/templates/persistentVolumeClaim.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/community-solid-server/templates/persistentVolumeClaim.yaml b/community-solid-server/templates/persistentVolumeClaim.yaml index 94b6c4f..73575b9 100644 --- a/community-solid-server/templates/persistentVolumeClaim.yaml +++ b/community-solid-server/templates/persistentVolumeClaim.yaml @@ -7,10 +7,10 @@ metadata: {{- include "community-solid-server.labels" . | nindent 4 }} spec: {{- if .Values.persistence.storageClassName }} - {{- if (eq "-" .Values.server.persistentVolume.storageClass) }} - storageClassName: "" + {{- if (eq "-" .Values.persistence.storageClassName) }} + storageClassName: "" {{- else }} - storageClassName: "{{ .Values.server.persistentVolume.storageClassName }}" + storageClassName: {{ .Values.persistence.storageClassName | quote }} {{- end }} {{- end }} accessModes: From bba01b6f3a5d7be02dfd079c99f09fd94a19de6c Mon Sep 17 00:00:00 2001 From: Jasper Vaneessen Date: Mon, 25 Sep 2023 11:50:42 +0200 Subject: [PATCH 9/9] feat!: update to CSS v6.0.2 --- community-solid-server/Chart.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/community-solid-server/Chart.yaml b/community-solid-server/Chart.yaml index f68117b..66ecdc5 100644 --- a/community-solid-server/Chart.yaml +++ b/community-solid-server/Chart.yaml @@ -21,9 +21,9 @@ version: 3.0.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "5.0.0" +appVersion: "6.0.2" -home: https://github.com/idlab-gent/css-helm-chart +home: https://github.com/CommunitySolidServer/css-helm-chart icon: https://raw.githubusercontent.com/solid/community-server/main/templates/images/solid.svg keywords: - solid @@ -32,4 +32,4 @@ maintainers: - email: jasper.vaneessen@gmail.com name: MisterTimn sources: - - https://github.com/solid/community-server + - https://github.com/CommunitySolidServer/CommunitySolidServer