-
Notifications
You must be signed in to change notification settings - Fork 0
Ollama service used in the classroom backend #410
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
Draft
ZQyou
wants to merge
7
commits into
main
Choose a base branch
from
zyou_ollama_for_classroom
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
49fdb5b
Add ollama for classroom
ZQyou 2f9ef1f
Update osc-common
ZQyou cd3ea02
Fix test-private workflows to support pull from Harbor
ZQyou 37ba79e
Add more values required for osc-common and update the upstream tempa…
ZQyou 81a4bd9
Fixed dependency
ZQyou 7d19087
Fixed the comment lines
ZQyou a7170b9
Fix the format errors
ZQyou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: v2 | ||
| name: ollama | ||
| description: OSC Ollama service for classroom | ||
| type: application | ||
| version: 0.2.0 | ||
| appVersion: '0.18.3' | ||
| maintainers: | ||
| - name: zyou | ||
| dependencies: | ||
| - name: osc-common | ||
| version: 0.14.0 | ||
| repository: https://osc.github.io/osc-helm-charts/ | ||
| # repository: file://../../charts/osc-common | ||
| - name: ollama | ||
| version: 1.54.0-osc-r2 | ||
| repository: oci://docker-registry.osc.edu/kubernetes/charts | ||
| # version: 1.54.0 | ||
| # repository: file://./ollama-helm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| global: | ||
| environment: dev | ||
| imagePullSecret: | ||
| password: IMAGE-PULL-PASSWORD | ||
| nodeSelectorRole: test | ||
| debugGroups: | ||
| - foobar | ||
| maintenanceGroups: | ||
| - foo | ||
| - bar | ||
| project: PAS0710 | ||
|
|
||
| ollama: | ||
| persistentVolume: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| storageClass: standard | ||
|
|
||
| podSecurityContext: | ||
| runAsUser: 65534 | ||
| runAsGroup: 65534 | ||
| fsGroup: 65534 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| global: | ||
| # -- The service account used by OSC deployments. | ||
| # Also pulled from global.env.<env>.serviceAccount | ||
| oscServiceAccount: '{{ include "ollama.fullname" . }}' | ||
| # -- The deployment's OSC environment | ||
| environment: production | ||
| # -- The nodeSelector role | ||
| nodeSelectorRole: webservices | ||
| imagePullSecret: | ||
| # -- Create the image pull secret | ||
| create: true | ||
| # -- imagePullSecret name | ||
| name: osc-registry | ||
| # -- imagePullSecret registry | ||
| registry: docker-registry.osc.edu | ||
| # -- imagePullSecret username | ||
| username: robot$webservices-read | ||
| # -- imagePullSecret password. | ||
| # This value will be set by OSC's Puppet. | ||
| # This value must be set to IMAGE-PULL-PASSWORD for CI tests. | ||
| password: | ||
| # @ignored | ||
| networkPolicy: | ||
| # -- Create the network policy | ||
| create: false | ||
| # -- Labels for NetworkPolicy podSelector. Defaults to `"osc.common.selectorLabels"` | ||
| podSelector: ~ | ||
| # Example define podSelector labels | ||
| # podSelector: | ||
| # app.kubernetes.io/name: test | ||
| # | ||
| # -- Labels of pods allowed to Ingress from the same namespace | ||
| ingressAllowedPods: [] | ||
| # Example additional ingress labels | ||
| # ingressAllowedPods: | ||
| # - require: test | ||
| # - client: test | ||
| # | ||
| # @ignored | ||
| ingressNamespace: ingress-nginx | ||
| # @ignored | ||
| prometheusNamespace: prometheus | ||
| # @ignored | ||
| webservicesDeploy: | ||
| # -- Create webservices deployment rolebinding | ||
| create: false | ||
| # -- Groups that debug pods | ||
| debugGroups: | ||
| - sappstf | ||
| # -- Groups that can perform maintenance operations | ||
| maintenanceGroups: | ||
| - sappstf | ||
| # -- Groups that are allowed to perform port forwarding | ||
| portforwardGroups: [] | ||
| auth: | ||
| # @ignored | ||
| enable: false | ||
| # @ignored | ||
| allowGroups: [] | ||
| ingress: | ||
| # -- Ingress host | ||
| # @default -- **required** | ||
| host: "" | ||
| # -- Ingress host alias | ||
| # @default -- **required** | ||
| hostAlias: "" | ||
| alert: | ||
| # -- The alert receiver | ||
| receiver: sciapps | ||
| # -- The service project | ||
| # @default -- **required** | ||
| project: '' | ||
|
|
||
| ollama: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see |
||
| # -- Map of labels to add to the pods | ||
| podLabels: | ||
| '{{ include "osc.common.serviceAccountKey" . }}': '{{ tpl (include "osc.common.serviceAccountValue" .) . }}' | ||
| receiver: '{{ .Values.global.alert.receiver }}' | ||
|
|
||
| deployment: | ||
| # -- Labels to add to the deployment | ||
| labels: | ||
| '{{ include "osc.common.serviceAccountKey" . }}': '{{ include "osc.common.serviceAccountValue" . }}' | ||
| receiver: '{{ .Values.global.alert.receiver }}' | ||
|
|
||
| # -- Docker registry secret names as an array | ||
| imagePullSecrets: | ||
| - name: '{{ .Values.global.imagePullSecret.name }}' | ||
|
|
||
| image: | ||
| # -- Docker image registry | ||
| repository: docker-registry.osc.edu/kubernetes/ollama/ollama | ||
| # -- Docker image tag, overrides the image tag whose default is the chart appVersion. | ||
| tag: '0.18.3' | ||
|
|
||
| ollama: | ||
| mountPath: /ollama | ||
| gpu: | ||
| # -- Enable GPU integration | ||
| enabled: true | ||
| type: nvidia | ||
| # -- Specify the number of GPU | ||
| number: 1 | ||
| models: | ||
| # -- List of models to pull at container startup | ||
| # The more you add, the longer the container will take to start if models are not present | ||
| pull: [] | ||
|
|
||
| # -- Node labels for pod assignment. | ||
| nodeSelector: | ||
| nvidia.com/gpu.product: NVIDIA-A100-PCIE-40GB-MIG-1g.5gb | ||
| '{{ include "osc.common.nodeSelectorRoleKey" . }}': '' | ||
|
|
||
|
ZQyou marked this conversation as resolved.
|
||
| service: | ||
| # -- Labels to add to the service | ||
| labels: | ||
| receiver: '{{ .Values.global.alert.receiver }}' | ||
| # -- Annotations to add to the service | ||
| annotations: | ||
| prometheus.io/probe_module: http | ||
|
ZQyou marked this conversation as resolved.
|
||
| prometheus.io/probe_scheme: http | ||
|
|
||
| # -- Pod Security Context | ||
| podSecurityContext: | ||
| runAsNonRoot: true | ||
|
|
||
| # -- Container Security Context | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| privileged: false | ||
|
|
||
| resources: | ||
| limits: | ||
| memory: 8Gi | ||
| cpu: 4 | ||
| requests: | ||
| memory: 4Gi | ||
| cpu: 2 | ||
|
|
||
| extraEnv: | ||
| - name: OLLAMA_MODELS | ||
| value: /ollama | ||
| - name: HOME | ||
| value: /ollama | ||
| - name: OLLAMA_FLASH_ATTENTION | ||
| value: '1' | ||
|
|
||
| persistentVolume: | ||
| # -- Enable persistence using PVC | ||
| enabled: true | ||
| accessModes: | ||
| - ReadWriteMany | ||
| annotations: | ||
| osc.edu/fileset: '{{ .Values.global.project }}' | ||
| size: 500Gi | ||
| storageClass: local-ess | ||
|
|
||
| serviceAccount: | ||
| # -- Specifies whether a service account should be created | ||
| create: true | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think an update to osc-common is needed to allow an additional
namespaceSelector. This way we can limit traffic to OnDemand namespaces.