Skip to content
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

conda-store helm chart #1032

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1e083db
Setup helm chart
soapy1 Oct 16, 2024
1cf0109
Add an example using the helm chart
soapy1 Oct 16, 2024
199a7e5
Add ui deployment
soapy1 Oct 17, 2024
1471974
Fix worker file permissions
soapy1 Oct 17, 2024
2560fff
Support multiple workers
soapy1 Nov 12, 2024
0f29a97
Add more instructions for how to setup the helm install
soapy1 Nov 12, 2024
d66d834
Seperate config per service
soapy1 Nov 12, 2024
b77609f
Add some notes on running the service
soapy1 Nov 13, 2024
acc0ba1
Use local build of conda-store-server for testing
soapy1 Nov 13, 2024
9d984a3
The ui pod needs the api service enabled within it in order to work
soapy1 Nov 13, 2024
580c394
Get viewing artifacts to work
soapy1 Nov 13, 2024
5806203
Use individal secrets for all required config secrets
soapy1 Nov 14, 2024
1804a82
Use gomplate to generate values file
soapy1 Nov 14, 2024
5af4ce6
Trim server deployments
soapy1 Nov 15, 2024
70fd42d
Setup PVC to bind to user provided environments volume
soapy1 Nov 15, 2024
26bb3e2
Setup local volume
soapy1 Nov 18, 2024
ab8a604
Add notes for values.yaml
soapy1 Dec 3, 2024
bb8f1bf
Get liveness/readiness for api and ui deployments
soapy1 Dec 4, 2024
7501c36
Add suggested conda store config for each deployment
soapy1 Dec 4, 2024
c99fd15
Don't include values file by default
soapy1 Dec 27, 2024
35bd89b
Clean up unused config
soapy1 Dec 27, 2024
d12bd20
Clean up end of file new lines
soapy1 Dec 27, 2024
a5ba25f
helm lint
soapy1 Dec 27, 2024
2b05382
Use shared labels
soapy1 Dec 27, 2024
5a93f60
Respect resource limits
soapy1 Dec 27, 2024
5ec075b
Use conda-store ui docker image
soapy1 Jan 1, 2025
412cb67
Disable ui in api server
soapy1 Jan 13, 2025
3f1e60f
Ensure correct port is used for health checks
soapy1 Jan 13, 2025
c53be6c
Bump docker image versions
soapy1 Jan 30, 2025
a1c7564
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ conda-store.sqlite

# generated test assets
conda-store-server/tests/alembic.ini

*.local.yaml
23 changes: 23 additions & 0 deletions conda-store-server/install/conda-store/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
7 changes: 7 additions & 0 deletions conda-store-server/install/conda-store/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: conda-store
description: A Helm chart for deploying conda-store to kubernetes
type: application
version: 0.1.0
icon: https://raw.githubusercontent.com/conda-incubator/conda-store/refs/heads/main/docusaurus-docs/community/images/logos/conda-store-logo-vertical-lockup.svg
home: https://github.com/conda-incubator/conda-store
78 changes: 78 additions & 0 deletions conda-store-server/install/conda-store/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Conda Store Helm Chart

In order to install conda store with helm, you must
have the following things set up:

## Services
* S3/minio
* DB (eg. Postgres, MySql, etc)
* Redis

## Secrets
* following secrets:
* conda-store-postgres-secret
* conda-store-minio-secret
* conda-store-redis-secret

For example
```
---
apiVersion: v1
data:
username: YWRtaW4=
pasword: cGFzc3dvcmQ=
kind: Secret
metadata:
name: conda-store-postgres-secret
type: Opaque

---
apiVersion: v1
data:
username: YWRtaW4=
pasword: cGFzc3dvcmQ=
kind: Secret
metadata:
name: conda-store-minio-secret
type: Opaque

---
apiVersion: v1
data:
pasword: cGFzc3dvcmQ=
kind: Secret
metadata:
name: conda-store-redis-secret
type: Opaque
```

## Volumes

Conda store requires a persistent volume for installing conda environments into. Users should provide a PersistentVolume that binds to the conda-store-worker PVC. For example:

```
apiVersion: v1
kind: PersistentVolume
metadata:
name: conda-store-environments
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
volumeMode: Filesystem
storageClassName: local-storage
local: # required for local-storage
path: /tmp/mnt-vol-kub
claimRef:
namespace: conda-store
name: conda-store-worker-claim
nodeAffinity: # required for local-storage
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- mynode
```
78 changes: 78 additions & 0 deletions conda-store-server/install/conda-store/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "condaStore.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "condaStore.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "condaStore.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "condaStore.labels" -}}
helm.sh/chart: {{ include "condaStore.chart" . }}
{{ include "condaStore.selectorLabels" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "condaStore.selectorLabels" -}}
app.kubernetes.io/name: {{ include "condaStore.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Set's the worker resources if the user has set any.
*/}}
{{- define "worker.resources" -}}
{{- if .Values.worker.resources -}}
resources:
{{ toYaml .Values.worker.resources | indent 12}}
{{ end }}
{{- end -}}

{{/*
Set's the uiServer resources if the user has set any.
*/}}
{{- define "uiServer.resources" -}}
{{- if .Values.uiServer.resources -}}
resources:
{{ toYaml .Values.uiServer.resources | indent 12}}
{{ end }}
{{- end -}}

{{/*
Set's the apiServer resources if the user has set any.
*/}}
{{- define "apiServer.resources" -}}
{{- if .Values.apiServer.resources -}}
resources:
{{ toYaml .Values.apiServer.resources | indent 12}}
{{ end }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
data:
conda_store_config.py: |
{{ .Values.apiServer.condaStoreConfig | nindent 4 }}
kind: ConfigMap
metadata:
name: "{{ template "condaStore.fullname" . }}-api-server"
namespace: {{ .Values.global.namespace }}
labels:
{{- include "condaStore.labels" . | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ template "condaStore.fullname" . }}-api-server"
namespace: {{ .Values.global.namespace }}
labels:
app: "{{ template "condaStore.fullname" . }}-api-server"
{{ include "condaStore.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.apiServer.replicas }}
selector:
matchLabels:
app: "{{ template "condaStore.fullname" . }}-api-server"
template:
metadata:
labels:
app: "{{ template "condaStore.fullname" . }}-api-server"
{{ include "condaStore.labels" . | nindent 8 }}
spec:
containers:
- name: "{{ template "condaStore.fullname" . }}-api-server"
image: "{{ .Values.apiServer.image.repository }}:{{ .Values.apiServer.image.tag }}"
imagePullPolicy: {{ .Values.apiServer.image.pullPolicy }}
args:
- "conda-store-server"
- "--config"
- "/etc/conda-store/conda_store_config.py"
ports:
- containerPort: {{ .Values.apiServer.port }}
livenessProbe:
httpGet:
path: /api/v1/
port: {{ .Values.apiServer.port }}
initialDelaySeconds: {{ .Values.apiServer.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.apiServer.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.apiServer.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.apiServer.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
path: /api/v1/
port: {{ .Values.apiServer.port }}
initialDelaySeconds: {{ .Values.apiServer.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.apiServer.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.apiServer.readinessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.apiServer.readinessProbe.failureThreshold }}
{{ template "apiServer.resources" . }}
env:
- name: POSTGRES_USERNAME
valueFrom:
secretKeyRef:
name: conda-store-postgres-secret
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: conda-store-postgres-secret
key: password
- name: MINIO_USERNAME
valueFrom:
secretKeyRef:
name: conda-store-minio-secret
key: username
- name: MINIO_PASSWORD
valueFrom:
secretKeyRef:
name: conda-store-minio-secret
key: password
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: conda-store-redis-secret
key: password
volumeMounts:
- name: config
mountPath: "/etc/conda-store/"
readOnly: true
restartPolicy: Always
volumes:
- name: config
configMap:
name: "{{ template "condaStore.fullname" . }}-api-server"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ template "condaStore.fullname" . }}-api-server"
namespace: {{ .Values.global.namespace }}
labels:
{{ include "condaStore.labels" . | nindent 4 }}
spec:
type: NodePort
ports:
- port: {{ .Values.apiServer.port }}
nodePort: {{ .Values.apiServer.nodePort }}
targetPort: {{ .Values.apiServer.port }}
protocol: TCP
name: http
selector:
app: "{{ template "condaStore.fullname" . }}-api-server"
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ template "condaStore.fullname" . }}-ui-server"
namespace: {{ .Values.global.namespace }}
labels:
{{ include "condaStore.labels" . | nindent 4 }}
app: "{{ template "condaStore.fullname" . }}-ui-server"
spec:
replicas: {{ .Values.uiServer.replicas }}
selector:
matchLabels:
app: "{{ template "condaStore.fullname" . }}-ui-server"
template:
metadata:
labels:
{{ include "condaStore.labels" . | nindent 8 }}
app: "{{ template "condaStore.fullname" . }}-ui-server"
spec:
containers:
- name: "{{ template "condaStore.fullname" . }}-ui-server"
image: "{{ .Values.uiServer.image.repository }}:{{ .Values.uiServer.image.tag }}"
imagePullPolicy: {{ .Values.uiServer.image.pullPolicy }}
env:
- name: REACT_APP_STYLE_TYPE
value: green-accent
- name: REACT_APP_API_URL
value: {{ .Values.uiServer.appEnv.apiUrl }}
- name: REACT_APP_LOGIN_PAGE_URL
value: {{ .Values.uiServer.appEnv.loginPageUrl }}
- name: REACT_APP_LOGOUT_PAGE_URL
value: {{ .Values.uiServer.appEnv.logoutPageUrl }}
- name: REACT_APP_URL_BASENAME
value: {{ .Values.uiServer.appEnv.urlBasename }}
- name: PORT
value: "{{ .Values.uiServer.port }}"
ports:
- containerPort: {{ .Values.uiServer.port }}
livenessProbe:
httpGet:
path: /status
port: {{ .Values.uiServer.port }}
initialDelaySeconds: {{ .Values.uiServer.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.uiServer.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.uiServer.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.uiServer.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
path: /status
port: {{ .Values.uiServer.port }}
initialDelaySeconds: {{ .Values.uiServer.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.uiServer.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.uiServer.readinessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.uiServer.readinessProbe.failureThreshold }}
{{ template "uiServer.resources" . }}
restartPolicy: Always
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ template "condaStore.fullname" . }}-ui-server"
namespace: {{ .Values.global.namespace }}
labels:
{{ include "condaStore.labels" . | nindent 4 }}
spec:
type: NodePort
ports:
- port: {{ .Values.uiServer.port }}
nodePort: {{ .Values.uiServer.nodePort }}
targetPort: {{ .Values.uiServer.port }}
protocol: TCP
name: http
selector:
app: "{{ template "condaStore.fullname" . }}-ui-server"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
data:
conda_store_config.py: |
{{ .Values.worker.condaStoreConfig | nindent 4 }}
kind: ConfigMap
metadata:
name: "{{ template "condaStore.fullname" . }}-worker"
namespace: {{ .Values.global.namespace }}
labels:
{{- include "condaStore.labels" . | nindent 8 }}
Loading
Loading