Skip to content

Commit 5b0d5c1

Browse files
committed
feat(k8s/magiclove/home-assistant): piper and whisper
1 parent 2e03208 commit 5b0d5c1

File tree

12 files changed

+291
-2
lines changed

12 files changed

+291
-2
lines changed

k8s/magiclove/home_assistant/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ cue_library(
2222
"//cue.mod/gen/k8s.io/api/apps/v1:cue_v1_library",
2323
"//cue.mod/gen/k8s.io/api/core/v1:cue_v1_library",
2424
"//cue.mod/gen/sigs.k8s.io/gateway-api/apis/v1:cue_v1_library",
25+
"//k8s/magiclove/home_assistant/piper:cue_piper_library",
26+
"//k8s/magiclove/home_assistant/whisper:cue_whisper_library",
2527
],
2628
)

k8s/magiclove/home_assistant/list.cue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package home_assistant
33
import (
44
"list"
55

6+
"github.com/uhthomas/automata/k8s/magiclove/home_assistant/piper"
7+
"github.com/uhthomas/automata/k8s/magiclove/home_assistant/whisper"
68
"k8s.io/api/core/v1"
79
)
810

@@ -20,8 +22,8 @@ import (
2022
name: string | *#Name
2123
namespace: #Namespace
2224
labels: {
23-
"app.kubernetes.io/name": #Name
24-
"app.kubernetes.io/version": #Version
25+
"app.kubernetes.io/name": string | *#Name
26+
"app.kubernetes.io/version": string | *#Version
2527
}
2628
}
2729
}]
@@ -39,4 +41,6 @@ _items: [
3941
#ServiceList.items,
4042
#StatefulSetList.items,
4143
#VMServiceScrapeList.items,
44+
piper.#List.items,
45+
whisper.#List.items,
4246
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
load("@com_github_tnarg_rules_cue//cue:cue.bzl", "cue_library")
2+
3+
cue_library(
4+
name = "cue_piper_library",
5+
srcs = [
6+
"list.cue",
7+
"service_list.cue",
8+
"stateful_set_list.cue",
9+
],
10+
importpath = "github.com/uhthomas/automata/k8s/magiclove/home_assistant/piper",
11+
visibility = ["//visibility:public"],
12+
deps = [
13+
"//cue.mod/gen/k8s.io/api/apps/v1:cue_v1_library",
14+
"//cue.mod/gen/k8s.io/api/core/v1:cue_v1_library",
15+
],
16+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Wyoming Piper
2+
3+
[https://github.com/home-assistant/addons/blob/be105fa07eedf5b29fc9ce9d0702914f5a8d6b03/piper/DOCS.md](https://github.com/home-assistant/addons/blob/be105fa07eedf5b29fc9ce9d0702914f5a8d6b03/piper/DOCS.md)
4+
5+
[https://hub.docker.com/r/rhasspy/wyoming-piper](https://hub.docker.com/r/rhasspy/wyoming-piper)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package piper
2+
3+
import (
4+
"list"
5+
6+
"k8s.io/api/core/v1"
7+
)
8+
9+
#Name: "piper"
10+
11+
// renovate: datasource=docker depName=rhasspy/wyoming-piper
12+
#Version: "1.5.0"
13+
14+
#List: v1.#List & {
15+
apiVersion: "v1"
16+
kind: "List"
17+
items: [...{
18+
metadata: {
19+
name: #Name
20+
labels: {
21+
"app.kubernetes.io/name": #Name
22+
"app.kubernetes.io/version": #Version
23+
}
24+
}
25+
}]
26+
}
27+
28+
#List: items: list.Concat(_items)
29+
30+
_items: [
31+
#ServiceList.items,
32+
#StatefulSetList.items,
33+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package piper
2+
3+
import "k8s.io/api/core/v1"
4+
5+
#ServiceList: v1.#ServiceList & {
6+
apiVersion: "v1"
7+
kind: "ServiceList"
8+
items: [...{
9+
apiVersion: "v1"
10+
kind: "Service"
11+
}]
12+
}
13+
14+
#ServiceList: items: [{
15+
spec: {
16+
ports: [{
17+
name: "wyoming"
18+
port: 10200
19+
targetPort: "wyoming"
20+
}]
21+
selector: "app.kubernetes.io/name": #Name
22+
}
23+
}]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package piper
2+
3+
import (
4+
appsv1 "k8s.io/api/apps/v1"
5+
"k8s.io/api/core/v1"
6+
)
7+
8+
#StatefulSetList: appsv1.#StatefulSetList & {
9+
apiVersion: "apps/v1"
10+
kind: "StatefulSetList"
11+
items: [...{
12+
apiVersion: "apps/v1"
13+
kind: "StatefulSet"
14+
}]
15+
}
16+
17+
#StatefulSetList: items: [{
18+
spec: {
19+
selector: matchLabels: "app.kubernetes.io/name": #Name
20+
template: {
21+
metadata: labels: "app.kubernetes.io/name": #Name
22+
spec: containers: [{
23+
name: #Name
24+
image: "rhasspy/wyoming-piper:\(#Version)"
25+
args: [
26+
"--voice=en_US-lessac-medium",
27+
// "--device=cuda",
28+
]
29+
ports: [{
30+
name: "wyoming"
31+
containerPort: 10200
32+
}]
33+
resources: {
34+
requests: {
35+
(v1.#ResourceCPU): "200m"
36+
(v1.#ResourceMemory): "512Mi"
37+
}
38+
limits: {
39+
(v1.#ResourceCPU): "1"
40+
(v1.#ResourceMemory): "1Gi"
41+
"nvidia.com/gpu": "1"
42+
}
43+
}
44+
volumeMounts: [{
45+
name: "data"
46+
mountPath: "/data"
47+
}]
48+
49+
imagePullPolicy: v1.#PullIfNotPresent
50+
}]
51+
}
52+
volumeClaimTemplates: [{
53+
metadata: name: "data"
54+
spec: {
55+
accessModes: [v1.#ReadWriteOnce]
56+
storageClassName: "rook-ceph-nvme"
57+
resources: requests: (v1.#ResourceStorage): "1Gi"
58+
}
59+
}]
60+
serviceName: #Name
61+
}
62+
}]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
load("@com_github_tnarg_rules_cue//cue:cue.bzl", "cue_library")
2+
3+
cue_library(
4+
name = "cue_whisper_library",
5+
srcs = [
6+
"list.cue",
7+
"service_list.cue",
8+
"stateful_set_list.cue",
9+
],
10+
importpath = "github.com/uhthomas/automata/k8s/magiclove/home_assistant/whisper",
11+
visibility = ["//visibility:public"],
12+
deps = [
13+
"//cue.mod/gen/k8s.io/api/apps/v1:cue_v1_library",
14+
"//cue.mod/gen/k8s.io/api/core/v1:cue_v1_library",
15+
],
16+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Wyoming Whisper
2+
3+
[https://github.com/home-assistant/addons/blob/be105fa07eedf5b29fc9ce9d0702914f5a8d6b03/whisper/DOCS.md](https://github.com/home-assistant/addons/blob/be105fa07eedf5b29fc9ce9d0702914f5a8d6b03/whisper/DOCS.md)
4+
5+
[https://hub.docker.com/r/rhasspy/wyoming-whisper](https://hub.docker.com/r/rhasspy/wyoming-whisper)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package whisper
2+
3+
import (
4+
"list"
5+
6+
"k8s.io/api/core/v1"
7+
)
8+
9+
#Name: "whisper"
10+
11+
// renovate: datasource=docker depName=rhasspy/wyoming-whisper
12+
#Version: "2.4.0"
13+
14+
#List: v1.#List & {
15+
apiVersion: "v1"
16+
kind: "List"
17+
items: [...{
18+
metadata: {
19+
name: #Name
20+
labels: {
21+
"app.kubernetes.io/name": #Name
22+
"app.kubernetes.io/version": #Version
23+
}
24+
}
25+
}]
26+
}
27+
28+
#List: items: list.Concat(_items)
29+
30+
_items: [
31+
#ServiceList.items,
32+
#StatefulSetList.items,
33+
]

0 commit comments

Comments
 (0)