-
Notifications
You must be signed in to change notification settings - Fork 278
Adding an optional deployment to increase AI pickup speed #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Bumps [helm/chart-testing-action](https://github.com/helm/chart-testing-action) from 2.6.1 to 2.7.0. - [Release notes](https://github.com/helm/chart-testing-action/releases) - [Commits](helm/chart-testing-action@v2.6.1...v2.7.0) --- updated-dependencies: - dependency-name: helm/chart-testing-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Daniel Hendricken <[email protected]>
Signed-off-by: Daniel Hendricken <[email protected]>
Signed-off-by: Daniel Hendricken <[email protected]>
Signed-off-by: Daniel Hendricken <[email protected]>
…rker deployment Signed-off-by: Daniel Hendricken <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle this is a good idea, but the entire system is shifting away from being cron based, so I don't know how much sense it makes to add this now.
Co-authored-by: Kate <[email protected]> Signed-off-by: Daniel Hendricken <[email protected]>
Alright no worries, I add these workers per kustomization myself at the moment. Works like a charm. I made the PR because I thought it might increase the ease of use for others that decide to use the assistant. Ah and I forgot to mention that I tested it with both the apache and fpm-alpine images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good first try.
volumeMounts: | ||
{{- include "aiWorker.volumeMounts" . | trim | nindent 12 }} | ||
volumes: | ||
- name: nextcloud-main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should we move that into _helpers.tpl and reuse it with deployment of nextcloud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So then we would divide the nextcloud.volumeMounts into for example:
nextcloud.volumeMounts
nextcloud.configMounts
Then include both for the nextcloud deployment and only nextcloud.volumeMounts
for the ai-worker deployment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean to create a new one with nextcloud.volumes
like i have done with: c7a0bc7
|
||
|
||
{{/* | ||
Create volume mounts for the nextcloud-aiworker container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it needed without the defaultConfigs and configs like in nextcloud.volumeMounts
?
I believe we should use the same setup then in the main deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the required config is written to disk by the main deployment. As the ai-worker deployment is dependent on the main deployment being ready I thought mounting them would be unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all config are written down. The mounted one are read-only in the configmaps / secrets. So I believe you still need them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright then I will make the adjustment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now it uses nexcloud.volumeMounts
. I also corrected some of the templating logic for the init-container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you correct on templating logic?
…me suffix '-ai-worker' Signed-off-by: Daniel Hendricken <[email protected]> chore(ai-worker): changed componant label to ai-worker and removed name suffix '-ai-worker'
Signed-off-by: Daniel Hendricken <[email protected]>
Signed-off-by: Daniel Hendricken <[email protected]>
Hello, this is still on my todo list, I've been rather busy lately. I think I might have time on saturday to implement the suggested changes. |
Signed-off-by: Daniel Hendricken <[email protected]>
Signed-off-by: Daniel Hendricken <[email protected]> chore: uncommented dependencies in Chart.yaml
I can provide the values I used to test, if that's helpful. |
b47e79a
to
c7a0bc7
Compare
Signed-off-by: WrenIX <[email protected]>
Signed-off-by: WrenIX <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Could you check if my changes works?
-
And maybe add your test-values in an test?
- therefore put a values.yaml here: https://github.com/nextcloud/helm/tree/main/charts/nextcloud/test-values
- call them as a testcase job in the github-actions matrix:
helm/.github/workflows/lint-test.yaml
Line 70 in 7785d69
test_cases:
Signed-off-by: Daniel Hendricken <[email protected]>
Tested your changes and added a test-case with values. Works like a charm :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the codequality is nice, now. (i rebase is needed to current nextcloud main).
What do you think @provokateurin ?
- sh | ||
- -c | ||
- >- | ||
until curl -sf {{- if .Values.aiWorker.useHostName }}https://{{ .Values.nextcloud.host }}/status.php{{- else }}http://{{ template "nextcloud.fullname" . }}:{{ .Values.service.port }}/status.php{{- end }}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not know if it is better:
until curl -sf {{- if .Values.aiWorker.useHostName }}https://{{ .Values.nextcloud.host }}/status.php{{- else }}http://{{ template "nextcloud.fullname" . }}:{{ .Values.service.port }}/status.php{{- end }}; | |
until curl -sf {{ ternary (printf "https://%s/status.php" .Values.nextcloud.host ) (printf "http://%s:%d/status.php" (template "nextcloud.fullname" .) .Values.service.port) .Values.aiWorker.useHostName }}; |
I'll rebase once the we agree on the changes. I didn't get a chance to check your suggested change yet. |
Signed-off-by: Daniel Hendricken <[email protected]>
Description of the change
The aim of this PR is to add the process described in increasing AI pickup speed in a simple but functional way to the helm-chart.
It functions similarly to the cronjob sidecar by mounting the volumes under nextcloud-main.
Benefits
The deployment is completely optional as it only has relevance to those who want to use the nextcloud-assistant or other AI integrations. Additionally this method allows for scaling by increasing the number of replicas of the deployment. (This is why I decided against using a container withing the main pod).
It makes use of the same image and volumes as the main nextcloud pod, so I don't think it will require additional maintenance unless something about how AI Tasks are handled changes in the future. Maybe we won't even need this anymore who knows :)
Possible drawbacks
None that I can think of.
Applicable issues
I didn't find any open issues concerning this functionality.
Additional information
I created a modified version of the nextcloud.volumeMounts helper template to reduce the required volumes that need to be mounted to the pods as much as possible.
Checklist
Chart.yaml
according to semver.