Skip to content

Commit 62e8a6a

Browse files
committed
docs(helm): fix spelling and grammar errors in README documentation
- Correct "authentification" to "authentication" - Fix "entreprise" to "enterprise" and "intégrate" to "integrate" - Improve grammar: "own section" to "their own section" - Add comma in "changed and the following" for better readability - Clarify "all roles" usage with article "the" - Add new section documenting tiktoken cache solution for on-premise deployments - Document global.truststoreContainerImage configuration in values table - Update truststore container image reference in bot_api deployment
1 parent caf48f4 commit 62e8a6a

File tree

5 files changed

+132
-16
lines changed

5 files changed

+132
-16
lines changed

charts/tock/README.md

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ This chart helps to setup a Tock environnement.
3737

3838
## Sections
3939

40-
This creates values, but sectioned into own section tables if a section comment is provided.
40+
This creates values, but sectioned into their own section tables if a section comment is provided.
4141

4242
## Values
4343

@@ -244,6 +244,8 @@ This creates values, but sectioned into own section tables if a section comment
244244
| global.mongodbPort | string | `"27017"` | If mongoDB is not deployed by the chart, the mongodb port |
245245
| global.mongodbUrls | string | `"mongodb://myuser:[email protected]:27017,xx.xx.xx.xx:27017,xx.xx.xx.xx:27017/mydb?replicaSet=rs0"` | If mongoDB is not deployed by the chart, you can use this to connect to an external mongoDB mongodbUrls: mongodb://myuser:mypass@fqdn-node1:27017,fqdn-node2:27017,fqdn-node3:27017/mydb?replicaSet=rs0 |
246246
| global.mongodbcheckfqdn | string | `"fqdn-node1"` | If mongoDB is not deployed by the chart, the node use to check if the mongodb is up |
247+
| global.truststoreContainerImage | object | `{"containerSecurityContext":{"enabled":true,"runAsGroup":99,"runAsNonRoot":true,"runAsUser":99},"pullPolicy":"IfNotPresent","pullSecrets":[],"registry":"docker.io","repository":"eclipse-temurin","tag":"17-jdk"}` | truststore images |
248+
| global.truststoreContainerImage.containerSecurityContext | object | `{"enabled":true,"runAsGroup":99,"runAsNonRoot":true,"runAsUser":99}` | Configure Container Security Context ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod @param containerSecurityContext.enabled Enabled truststore generator container Security Context @param containerSecurityContext.runAsUser Set truststore generator container Security Context runAsUser |
247249
| global.wildcardDomain | string | `"rancher.localhost"` | Default domain used for ingress |
248250

249251
### KotlinCompiler
@@ -339,7 +341,7 @@ This creates values, but sectioned into own section tables if a section comment
339341
| postgresql.image.repository | string | `"onelans/pgvector"` | |
340342
| postgresql.image.tag | string | `"pg16"` | |
341343

342-
## Authentification configurations
344+
## Authentication configurations
343345

344346
The following sample could be added as ConfigMap to configure the authentication of the admin web interface.
345347

@@ -368,7 +370,7 @@ apiVersion: v1
368370
tock_roles: "botUser,nlpUser|botUser|admin|technicalAdmin" # Roles separated | (and then by commas). Default value is empty."
369371
```
370372
371-
In this example, Alice has the role 'botUser', whereas Bob has all roles.
373+
In this example, Alice has the role 'botUser', whereas Bob has all the roles.
372374
To define the identities and roles of several users, separate their values with commas.
373375
374376
You can find more information about the roles in the [Tock documentation](https://doc.tock.ai/tock/fr/admin/securite/#r%C3%B4les)
@@ -379,7 +381,7 @@ It seems the native build of MongoDB requires AVX instructions at the processor
379381
380382
https://github.com/bitnami/charts/issues/12834
381383
382-
For Arm, the image used in value must be changed and the following Mongodb chart image should be used instead.
384+
For Arm, the image used in value must be changed, and the following Mongodb chart image should be used instead.
383385
384386
https://artifacthub.io/packages/helm/bitnami/mongodb/14.8.3
385387
@@ -466,9 +468,9 @@ adminWeb:
466468
> You can get the external IP of the ingress controller with the following command
467469
> `kubectl get ingress mytock-admin-web --output yaml`
468470

469-
## Add entreprise certificates
471+
## Add enterprise certificates
470472

471-
If you have to intégrate coded stories that require entreprise certificates, you can use the truststore feature.
473+
If you have to integrate coded stories that require enterprise certificates, you can use the truststore feature.
472474

473475
To enable it, set the following values in your `values.yaml` file:
474476

@@ -487,3 +489,43 @@ kubectl create secret generic corp-root-ca --from-file=corp-root-ca.crt
487489

488490
This will create a Secret named `corp-root-ca` with the certificate file `corp-root-ca.crt`.
489491

492+
## Solve langchain and tiktoken issues on on-premise deployments
493+
494+
If you are using OpenAI as LLM, langchain needs tiktoken as tokenizer. Langchain tries to download tiktoken base if he is not present in the local cache.
495+
To solve the issue with tiktoken on on-premise deployments without internet access, you can provide a local cache through a dedicated initcontainer.
496+
497+
You can get the tiktoken base files from the following URL:
498+
499+
```shell
500+
export CL100K_BASE_URL= https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken
501+
export CL100K_BASE_CACHE_NAME= $(shell echo -n $(CL100K_BASE_URL) | sha1sum | head -c 40)
502+
wget ${CL100K_BASE_URL} -O tiktoken-bases/${CL100K_BASE_CACHE_NAME}
503+
```
504+
505+
And build the initcontainer image with the following Dockerfile:
506+
507+
```Dockerfile
508+
FROM busybox:1.36.1-uclibc
509+
# cl100k_base.tiktoken (~1.6 MiB)
510+
# (optionnel) o200k_base.tiktoken, p50k_base.tiktoken, etc.
511+
COPY tiktoken-bases/ /tiktoken/
512+
ENTRYPOINT ["/bin/true"]
513+
```
514+
515+
Build the image with the following command:
516+
517+
```shell
518+
docker build -t tiktoken-base-cache:1.0 .
519+
```
520+
521+
To use the initcontainer, set the following values in `genAiOrchestrator` in your `values.yaml` file:
522+
523+
```yaml
524+
genAiOrchestrator:
525+
langchain:
526+
tiktokencache:
527+
enabled: true
528+
registry: <your-registry>
529+
repository: tiktoken-cache-img
530+
tag: 1.0
531+
```

charts/tock/README.md.gotmpl

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ This chart helps to setup a Tock environnement.
3333

3434
## Sections
3535

36-
This creates values, but sectioned into own section tables if a section comment is provided.
36+
This creates values, but sectioned into their own section tables if a section comment is provided.
3737

3838
{{ template "chart.valuesSection" . }}
3939

4040

4141

42-
## Authentification configurations
42+
## Authentication configurations
4343

4444
The following sample could be added as ConfigMap to configure the authentication of the admin web interface.
4545

@@ -68,7 +68,7 @@ apiVersion: v1
6868
tock_roles: "botUser,nlpUser|botUser|admin|technicalAdmin" # Roles separated | (and then by commas). Default value is empty."
6969
```
7070
71-
In this example, Alice has the role 'botUser', whereas Bob has all roles.
71+
In this example, Alice has the role 'botUser', whereas Bob has all the roles.
7272
To define the identities and roles of several users, separate their values with commas.
7373
7474
You can find more information about the roles in the [Tock documentation](https://doc.tock.ai/tock/fr/admin/securite/#r%C3%B4les)
@@ -79,7 +79,7 @@ It seems the native build of MongoDB requires AVX instructions at the processor
7979
8080
https://github.com/bitnami/charts/issues/12834
8181
82-
For Arm, the image used in value must be changed and the following Mongodb chart image should be used instead.
82+
For Arm, the image used in value must be changed, and the following Mongodb chart image should be used instead.
8383
8484
https://artifacthub.io/packages/helm/bitnami/mongodb/14.8.3
8585
@@ -168,9 +168,9 @@ adminWeb:
168168
> You can get the external IP of the ingress controller with the following command
169169
> `kubectl get ingress mytock-admin-web --output yaml`
170170
171-
## Add entreprise certificates
171+
## Add enterprise certificates
172172
173-
If you have to intégrate coded stories that require entreprise certificates, you can use the truststore feature.
173+
If you have to integrate coded stories that require enterprise certificates, you can use the truststore feature.
174174
175175
To enable it, set the following values in your `values.yaml` file:
176176
@@ -189,3 +189,43 @@ kubectl create secret generic corp-root-ca --from-file=corp-root-ca.crt
189189
190190
This will create a Secret named `corp-root-ca` with the certificate file `corp-root-ca.crt`.
191191
192+
## Solve langchain and tiktoken issues on on-premise deployments
193+
194+
If you are using OpenAI as LLM, langchain needs tiktoken as tokenizer. Langchain tries to download tiktoken base if he is not present in the local cache.
195+
To solve the issue with tiktoken on on-premise deployments without internet access, you can provide a local cache through a dedicated initcontainer.
196+
197+
You can get the tiktoken base files from the following URL:
198+
199+
```shell
200+
export CL100K_BASE_URL= https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken
201+
export CL100K_BASE_CACHE_NAME= $(shell echo -n $(CL100K_BASE_URL) | sha1sum | head -c 40)
202+
wget ${CL100K_BASE_URL} -O tiktoken-bases/${CL100K_BASE_CACHE_NAME}
203+
```
204+
205+
And build the initcontainer image with the following Dockerfile:
206+
207+
```Dockerfile
208+
FROM busybox:1.36.1-uclibc
209+
# cl100k_base.tiktoken (~1.6 MiB)
210+
# (optionnel) o200k_base.tiktoken, p50k_base.tiktoken, etc.
211+
COPY tiktoken-bases/ /tiktoken/
212+
ENTRYPOINT ["/bin/true"]
213+
```
214+
215+
Build the image with the following command:
216+
217+
```shell
218+
docker build -t tiktoken-base-cache:1.0 .
219+
```
220+
221+
To use the initcontainer, set the following values in `genAiOrchestrator` in your `values.yaml` file:
222+
223+
```yaml
224+
genAiOrchestrator:
225+
langchain:
226+
tiktokencache:
227+
enabled: true
228+
registry: <your-registry
229+
repository: tiktoken-cache-img
230+
tag: 1.0
231+
```

charts/tock/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,13 @@ Return the proper busybox image name for init containers
371371
{{- include "common.images.image" (dict "imageRoot" .Values.global.initContainerImage "global" .Values.global) -}}
372372
{{- end -}}
373373

374+
{{/*
375+
Return the proper truststore image name for bot-api init containers
376+
*/}}
377+
{{- define "truststoreContainer.image" -}}
378+
{{- include "common.images.image" (dict "imageRoot" .Values.global.truststoreContainerImage "global" .Values.global) -}}
379+
{{- end -}}
380+
374381
{{/*
375382
Return the proper adminWeb Docker Image Registry Secret Names
376383
*/}}
@@ -385,6 +392,13 @@ Return the proper botApi Docker Image Registry Secret Names
385392
{{- include "common.images.pullSecrets" (dict "images" (list .Values.botApi.image) "global" .Values.global) -}}
386393
{{- end -}}
387394

395+
{{/*
396+
Return the proper truststore Docker Image Registry Secret Names
397+
*/}}
398+
{{- define "truststore.imagePullSecrets" -}}
399+
{{- include "common.images.pullSecrets" (dict "images" (list .Values.truststore.image) "global" .Values.global) -}}
400+
{{- end -}}
401+
388402
{{/*
389403
Return the proper buildWorker Docker Image Registry Secret Names
390404
*/}}

charts/tock/templates/bot_api.deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ spec:
7373
{{- end }}
7474
{{- if .Values.botApi.truststore.enabled }}
7575
- name: truststore-generator
76-
image: eclipse-temurin:17-jdk # Image Java officielle pour keytool
77-
{{- if .Values.global.initContainerImage.containerSecurityContext.enabled }}
78-
securityContext: {{- omit .Values.global.initContainerImage.containerSecurityContext "enabled" | toYaml | nindent 12 }}
76+
image: {{ include "truststoreContainer.image" . }} # Image Java officielle pour keytool
77+
{{- if .Values.global.truststoreContainerImage.containerSecurityContext.enabled }}
78+
securityContext: {{- omit .Values.global.truststoreContainerImage.containerSecurityContext "enabled" | toYaml | nindent 12 }}
7979
{{- end }}
8080
command: ["/bin/sh", "-c"]
8181
args:

charts/tock/values.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,27 @@ global:
111111
runAsUser: 99
112112
runAsGroup: 99
113113
runAsNonRoot: true
114-
114+
115+
# -- truststore images
116+
# @raw
117+
# @section -- Global
118+
truststoreContainerImage:
119+
registry: docker.io
120+
repository: eclipse-temurin
121+
tag: "17-jdk"
122+
pullPolicy: IfNotPresent
123+
pullSecrets: []
124+
# -- Configure Container Security Context
125+
# @section -- Global
126+
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
127+
# @param containerSecurityContext.enabled Enabled truststore generator container Security Context
128+
# @param containerSecurityContext.runAsUser Set truststore generator container Security Context runAsUser
129+
containerSecurityContext:
130+
enabled: true
131+
runAsUser: 99
132+
runAsGroup: 99
133+
runAsNonRoot: true
134+
115135
# ==============================================
116136
# AdminWeb Settings
117137
# ==============================================

0 commit comments

Comments
 (0)