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..66ecdc5 100644 --- a/community-solid-server/Chart.yaml +++ b/community-solid-server/Chart.yaml @@ -15,15 +15,15 @@ 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: "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 diff --git a/community-solid-server/templates/NOTES.txt b/community-solid-server/templates/NOTES.txt index e93bb5c..95f8392 100644 --- a/community-solid-server/templates/NOTES.txt +++ b/community-solid-server/templates/NOTES.txt @@ -1,10 +1,6 @@ 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 }} -{{- end }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.host }}{{ .Values.ingress.path }} {{- 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/_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/community-solid-server/templates/deployment.yaml b/community-solid-server/templates/deployment.yaml index 17b2d61..c38212e 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 }} @@ -30,9 +31,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 +44,7 @@ spec: {{- with .Values.config}} - "-c" {{- if not .configMapName }} - - "config/{{.bundled}}.json" + - "config/{{ .bundled }}.json" {{- else }} - "/config/{{ .configMapKey }}" {{- end }} @@ -52,10 +53,19 @@ spec: - "-f" - "/data/" {{- end }} + {{- if .Values.multithreading.enabled }} + - "-w" + - {{ .Values.multithreading.workers | 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/templates/persistentVolumeClaim.yaml b/community-solid-server/templates/persistentVolumeClaim.yaml index f40d77a..73575b9 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.persistence.storageClassName) }} + storageClassName: "" + {{- else }} + storageClassName: {{ .Values.persistence.storageClassName | quote }} + {{- end }} + {{- end }} accessModes: - ReadWriteOnce resources: diff --git a/community-solid-server/values.yaml b/community-solid-server/values.yaml index 1b10772..2923ddb 100644 --- a/community-solid-server/values.yaml +++ b/community-solid-server/values.yaml @@ -53,12 +53,25 @@ 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.workers define how many worker threads to use, special values: -1 (num_cores-1) and 0 (num_cores) +multithreading: + enabled: false + workers: "-1" + ## @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 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 +# value: debug ## @section Persistence parameters ## Enable persistence using Persistent Volume Claims 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