Compare commits

...

3 Commits

Author SHA1 Message Date
6e0c77f3c2 add stable diffusion 2025-01-26 01:43:59 -06:00
528749a1b7 remove stable diffusion 2025-01-26 01:43:45 -06:00
565a920c39 add logtail 2025-01-26 01:13:33 -06:00
8 changed files with 105 additions and 123 deletions

View File

@@ -22,38 +22,6 @@ spec:
key: /cl01tl/ollama/key
metadataPolicy: None
property: key
- secretKey: civitai-key
remoteRef:
conversionStrategy: Default
decodingStrategy: None
key: /cl01tl/ollama/config
metadataPolicy: None
property: civitai-key
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: stable-diffusion-script
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: stable-diffusion-script
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: {{ .Release.Name }}
spec:
secretStoreRef:
kind: ClusterSecretStore
name: vault
data:
- secretKey: provisioning-script.sh
remoteRef:
conversionStrategy: Default
decodingStrategy: None
key: /cl01tl/ollama/config
metadataPolicy: None
property: provisioning-script.sh
---
apiVersion: external-secrets.io/v1beta1

View File

@@ -1,19 +0,0 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: stable-diffusion-nfs-storage-models
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: stable-diffusion-nfs-storage-models
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: {{ .Release.Name }}
spec:
volumeMode: Filesystem
storageClassName: nfs-client
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

View File

@@ -14,3 +14,21 @@ metadata:
spec:
externalName: placeholder
type: ExternalName
---
apiVersion: v1
kind: Service
metadata:
name: stable-diffusion-pd05wd
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: stable-diffusion-pd05wd
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: network
app.kubernetes.io/part-of: {{ .Release.Name }}
annotations:
tailscale.com/tailnet-fqdn: stable-diffusion-pd05wd.boreal-beaufort.ts.net
spec:
externalName: placeholder
type: ExternalName

View File

@@ -24,41 +24,6 @@ ollama:
limits:
cpu: 4
gpu.intel.com/i915: 1
stable-diffusion:
type: deployment
replicas: 1
strategy: Recreate
revisionHistoryLimit: 3
containers:
main:
image:
repository: ghcr.io/ai-dock/stable-diffusion-webui
tag: v2-cpu-22.04
pullPolicy: IfNotPresent
env:
- name: CIVITAI_TOKEN
valueFrom:
secretKeyRef:
name: ollama-key-secret
key: civitai-key
- name: WEBUI_ARGS
value: --api --listen --always-batch-cond-uncond --opt-split-attention --device-id=0
- name: CF_QUICK_TUNNELS
value: false
- name: WEB_ENABLE_AUTH
value: false
- name: PORT
value: "7860"
- name: SUPERVISOR_NO_AUTOSTART
value: jupyter,syncthing,logtail
resources:
requests:
cpu: 100m
memory: 1Gi
gpu.intel.com/i915: 1
limits:
cpu: 4
gpu.intel.com/i915: 1
web:
type: deployment
replicas: 1
@@ -127,13 +92,6 @@ ollama:
port: 11434
targetPort: 11434
protocol: HTTP
stable-diffusion:
controller: stable-diffusion
ports:
http:
port: 7860
targetPort: 7860
protocol: HTTP
web:
controller: web
ports:
@@ -167,36 +125,6 @@ ollama:
main:
- path: /root/.ollama
readOnly: false
# provisioning-script:
# enabled: true
# type: secret
# name: stable-diffusion-script
# defaultMode: 0755
# advancedMounts:
# stable-diffusion:
# main:
# - path: /opt/ai-dock/bin/provisioning.sh
# readOnly: true
# mountPropagation: None
# subPath: provisioning-script.sh
workspace:
storageClass: ceph-block
accessMode: ReadWriteOnce
size: 50Gi
retain: true
advancedMounts:
stable-diffusion:
main:
- path: /workspace
readOnly: false
models:
type: persistentVolumeClaim
existingClaim: stable-diffusion-nfs-storage-models
advancedMounts:
stable-diffusion:
main:
- path: /opt/stable-diffusion-webui/models/Stable-diffusion
readOnly: false
web-data:
storageClass: ceph-block
accessMode: ReadWriteOnce

View File

@@ -43,6 +43,8 @@ services:
container_name: ollama
environment:
- OLLAMA_KEEP_ALIVE=24h
labels:
- "com.centurylinklabs.watchtower.scope=ollama"
restart: always
deploy:
resources:

View File

@@ -0,0 +1 @@
TS_AUTHKEY=""

View File

@@ -0,0 +1,68 @@
---
services:
tailscale-stable-diffusion:
image: ghcr.io/tailscale/tailscale:latest
container_name: tailscale-stable-diffusion
cap_add:
- net_admin
- sys_module
environment:
- TS_STATE_DIR=/var/lib/tailscale
- TS_ENABLE_METRICS=true
- TS_HOSTNAME=stable-diffusion-pd05wd
- TS_SERVE_CONFIG=/config/serve.json
env_file:
- .ts-env
labels:
- "com.centurylinklabs.watchtower.scope=stable-diffusion"
network_mode: service:stable-diffusion
restart: always
volumes:
- tailscale:/var/lib/tailscale
- ${PWD}/serve.json:/config/serve.json
devices:
- /dev/net/tun:/dev/net/tun
watchtower:
image: ghcr.io/containrrr/watchtower:latest
container_name: stable-diffusion-watchtower
command: --scope stable-diffusion
environment:
- TZ=America/Chicago
- WATCHTOWER_HTTP_API_METRICS=true
- WATCHTOWER_HTTP_API_TOKEN=token
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_POLL_INTERVAL=3600
labels:
- "com.centurylinklabs.watchtower.scope=stable-diffusion"
network_mode: service:stable-diffusion
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
stable-diffusion:
image: ghcr.io/ai-dock/stable-diffusion-webui:latest-cpu
container_name: stable-diffusion
environment:
- WEBUI_ARGS="--api --listen"
- CF_QUICK_TUNNELS=false
- WEB_ENABLE_AUTH=false
- PORT="7860"
- SUPERVISOR_NO_AUTOSTART=jupyter,syncthing
labels:
- "com.centurylinklabs.watchtower.scope=stable-diffusion"
restart: always
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: ["gpu"]
count: all
volumes:
- workspace:/workspace:rshared
- ./models:/opt/stable-diffusion-webui/models/Stable-diffusion
volumes:
tailscale:
workspace:

View File

@@ -0,0 +1,16 @@
{
"TCP": {
"443": {
"HTTPS": true
}
},
"Web": {
"${TS_CERT_DOMAIN}:443": {
"Handlers": {
"/": {
"Proxy": "http://127.0.0.1:7860"
}
}
}
}
}