Skip to content

Commit

Permalink
Merge branch 'feat/css-v5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterTimn committed Sep 25, 2023
2 parents 3ea20ad + bba01b6 commit 13e4cb2
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 23 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
- next
paths:
- '*/values.yaml'
push:
branches:
- main
- next
paths:
- '*/values.yaml'

jobs:
check-and-update-readme:
Expand Down Expand Up @@ -47,5 +53,5 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
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
8 changes: 4 additions & 4 deletions community-solid-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,4 +32,4 @@ maintainers:
- email: [email protected]
name: MisterTimn
sources:
- https://github.com/solid/community-server
- https://github.com/CommunitySolidServer/CommunitySolidServer
6 changes: 1 addition & 5 deletions community-solid-server/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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}")
Expand Down
4 changes: 2 additions & 2 deletions community-solid-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
{{- end }}
18 changes: 14 additions & 4 deletions community-solid-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
labels:
{{- include "community-solid-server.selectorLabels" . | nindent 8 }}
spec:
enableServiceLinks: false
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
Expand All @@ -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"
Expand All @@ -43,7 +44,7 @@ spec:
{{- with .Values.config}}
- "-c"
{{- if not .configMapName }}
- "config/{{.bundled}}.json"
- "config/{{ .bundled }}.json"
{{- else }}
- "/config/{{ .configMapKey }}"
{{- end }}
Expand All @@ -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
Expand Down
8 changes: 7 additions & 1 deletion community-solid-server/templates/persistentVolumeClaim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 17 additions & 4 deletions community-solid-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions examples/redis-locking/README.md
Original file line number Diff line number Diff line change
@@ -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
```
78 changes: 78 additions & 0 deletions examples/redis-locking/config.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
13 changes: 13 additions & 0 deletions examples/redis-locking/values.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 13e4cb2

Please sign in to comment.