Compare commits
64 Commits
4a20994511
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| a74e6c796c | |||
| 2649221f92 | |||
| 8f0de6ca92 | |||
| b3451396a3 | |||
| ef62602002 | |||
| b8558a7ba1 | |||
| 79ff982b82 | |||
| e0727515c8 | |||
| 58c46d009f | |||
| fa5d65d891 | |||
| ec86c2192c | |||
| e1675ae886 | |||
| 100567a5f6 | |||
| 9bd209ee01 | |||
| 553733debf | |||
| 51a9e55c19 | |||
| d0594d55b8 | |||
| 2b58a3cea8 | |||
| 0a3add4e5f | |||
| 6519bba6e9 | |||
| 173c85101e | |||
| 3929df9bb5 | |||
| c203c2f635 | |||
| a48dc2e2a5 | |||
| cd2a60f8f1 | |||
| a1f0d1beb8 | |||
| e1ea1e6905 | |||
| 6a48dc135f | |||
| bf60add2f5 | |||
| 3a90bc8cba | |||
| b541e20bd8 | |||
| 5014a0d0c2 | |||
| d2dbc3c467 | |||
| 0110629b31 | |||
| fea93e4633 | |||
| 78b78c6c21 | |||
| c48543165a | |||
| 2fbc329077 | |||
| e80f85b1bf | |||
| 22759bdbeb | |||
| 122fa397ef | |||
| 01f0a1d949 | |||
| 4e97d37196 | |||
| 7fc5dbe23d | |||
| e2b4f87ded | |||
| c69ac54ade | |||
| b79f1c575b | |||
| 08a6e6610c | |||
| e9f868ee3d | |||
| 69e5695a8c | |||
| 9a22b1ba33 | |||
| d3115dfc59 | |||
| 7a146b9930 | |||
| d8debf7d40 | |||
| fdf81b2712 | |||
| 71d3fb8f1c | |||
| 8cfb292a1b | |||
| a9620565c9 | |||
| 62bb0b318f | |||
| 128489835d | |||
| 34cc927b46 | |||
| 74df2f66dc | |||
| 2d344f3791 | |||
| 3341f92fca |
43
.gitea/workflows/app-continuous-deploy.yml
Normal file
43
.gitea/workflows/app-continuous-deploy.yml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: Casa LMS CI/CD Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- fix/*
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 15 * * 0' # every sunday 3 pm
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
|
||||||
|
runs-on: casa-vlan-cicd
|
||||||
|
env:
|
||||||
|
GITHUB_TEMP: ${{ runner.temp }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Fetch limbo public actions
|
||||||
|
env:
|
||||||
|
RUNNER_TEMP: "${{ runner.temp }}"
|
||||||
|
WORKSPACE: "${{ gitea.workspace }}"
|
||||||
|
run: |
|
||||||
|
curl -fsSL https://git.limbosolutions.com/kb/gitea/raw/branch/main/cloud-scripts/setup-limbo-actions.sh | bash 2>&1
|
||||||
|
|
||||||
|
- name: Setup kubectl
|
||||||
|
uses: ./.gitea/limbo_actions/kubectl-setup
|
||||||
|
with:
|
||||||
|
kube_server: ${{ secrets.CASA_VLAN_KUBE_SERVER }}
|
||||||
|
kube_ca_base64: ${{ secrets.CASA_VLAN_KUBE_CA_BASE64 }}
|
||||||
|
kube_token: ${{ secrets.CASA_VLAN_KUBE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
./ops-scripts/apply-app.sh
|
||||||
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
_volumes
|
_volumes
|
||||||
_volumes
|
_volumes
|
||||||
.vscode
|
.vscode
|
||||||
|
.obsidian
|
||||||
|
|||||||
80
README.md
80
README.md
@@ -1 +1,79 @@
|
|||||||
Welcome
|
# Lyrion Music Server (LMS)
|
||||||
|
|
||||||
|
Welcome to my Lyrion Music Server (LMS) setup repo.
|
||||||
|
|
||||||
|
Currently hosted on [kubernetes cluster - casa](https://git.limbosolutions.com/myLimbo/casa).
|
||||||
|
|
||||||
|
**Table of Contents:**
|
||||||
|
|
||||||
|
- [Music](#music)
|
||||||
|
- [Clients](#clients)
|
||||||
|
- [Setup and Deploy](#setup-and-deploy)
|
||||||
|
- [App](#app)
|
||||||
|
- [Infra](#infra)
|
||||||
|
- [Continuous Deploy](#continuous-deploy)
|
||||||
|
- [Links](#links)
|
||||||
|
|
||||||
|
## Music
|
||||||
|
|
||||||
|
Using the SeaweedFS CSI driver on the Casa Kubernetes cluster, connected to central storage on the Chimera Kubernetes cluster.
|
||||||
|
|
||||||
|
[Manifest deployed by app kustomization](./deploy/infra/music-pv.yaml).
|
||||||
|
|
||||||
|
## Clients
|
||||||
|
|
||||||
|
**RaspberryPI client:**
|
||||||
|
|
||||||
|
- <https://git.limbosolutions.com/marcio.fernandes/pi.bluetooth.speaker>
|
||||||
|
|
||||||
|
**Fedora workstation:**
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
sudo dfn install squeezelite
|
||||||
|
```
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# ~/.config/systemd/user/squeezelite.service
|
||||||
|
[Unit]
|
||||||
|
Description=Squeezelite Client
|
||||||
|
After=pipewire.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/squeezelite -o pipewire -s lms.casa.limbosolutions.com -n dionysus
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
|
```
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
systemctl --user enable --now squeezelite.service
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setup and Deploy
|
||||||
|
|
||||||
|
### App
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
./ops-scripts/apply-app.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Infra
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
./ops-scripts/apply-infra.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Continuous Deploy
|
||||||
|
|
||||||
|
Weekly cron update.
|
||||||
|
|
||||||
|
[Gitea Workflow](./.gitea/workflows/deploy.yml)
|
||||||
|
|
||||||
|
## Links
|
||||||
|
|
||||||
|
- Lyrion Music Server - Official
|
||||||
|
- [WebSite](https://lyrion.org)
|
||||||
|
- [github](https://github.com/LMS-Community)
|
||||||
|
- [Community Forum](https://forums.slimdevices.com/)
|
||||||
|
- [Docker Hub](https://hub.docker.com/r/lmscommunity/lyrionmusicserver)
|
||||||
62
deploy/app/deployment.yaml
Normal file
62
deploy/app/deployment.yaml
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
name: lyrionmusicserver
|
||||||
|
labels:
|
||||||
|
app: lyrionmusicserver
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: lyrionmusicserver
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: lyrionmusicserver
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
role: worker-node
|
||||||
|
containers:
|
||||||
|
- name: lyrionmusicserver
|
||||||
|
image: lmscommunity/lyrionmusicserver:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /config
|
||||||
|
name: lyrionmusicserver
|
||||||
|
- mountPath: /music
|
||||||
|
readOnly: true
|
||||||
|
name: music
|
||||||
|
- mountPath: /playlist
|
||||||
|
name: playlists
|
||||||
|
ports:
|
||||||
|
- name: 9000-web
|
||||||
|
containerPort: 9000
|
||||||
|
protocol: TCP
|
||||||
|
- name: 9090-api
|
||||||
|
containerPort: 9090
|
||||||
|
protocol: TCP
|
||||||
|
- name: 3483-sqz-tcp
|
||||||
|
containerPort: 3483
|
||||||
|
protocol: TCP
|
||||||
|
- name: 3483-sqz-udp
|
||||||
|
containerPort: 3483
|
||||||
|
protocol: UDP
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "256Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
limits:
|
||||||
|
memory: "512Mi"
|
||||||
|
cpu: "400m"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: lyrionmusicserver
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: lyrionmusicserver
|
||||||
|
- name: music
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: storage-limbosolutions-com-media-music
|
||||||
|
- name: playlists
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: playlists
|
||||||
10
deploy/app/kustomization.yaml
Normal file
10
deploy/app/kustomization.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
- music-pvc.yaml
|
||||||
|
- lms-data-pvc.yaml
|
||||||
|
- playlists-pvc.yaml
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
11
deploy/app/lms-data-pvc.yaml
Normal file
11
deploy/app/lms-data-pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: lyrionmusicserver
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
15
deploy/app/music-pvc.yaml
Normal file
15
deploy/app/music-pvc.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# check permissions on storage source
|
||||||
|
# lms required o+rx on /music folder to scan
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: storage-limbosolutions-com-media-music
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
spec:
|
||||||
|
storageClassName: "" # it must stay empty to work, dont know why storage-limbosolutions-com
|
||||||
|
volumeName: storage-limbosolutions-com-media-music
|
||||||
|
accessModes:
|
||||||
|
- ReadOnlyMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 128Gi
|
||||||
11
deploy/app/playlists-pvc.yaml
Normal file
11
deploy/app/playlists-pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: playlists
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 64Mi
|
||||||
47
deploy/app/service.yaml
Normal file
47
deploy/app/service.yaml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: lyrionmusicserver-web
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
labels:
|
||||||
|
app: lyrionmusicserver
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: lyrionmusicserver
|
||||||
|
ports:
|
||||||
|
- name: 9000-web
|
||||||
|
protocol: TCP
|
||||||
|
port: 9000
|
||||||
|
targetPort: 9000
|
||||||
|
type: ClusterIP
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: lyrionmusicserver-clients
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: lyrionmusicserver
|
||||||
|
type: LoadBalancer
|
||||||
|
ports:
|
||||||
|
#! SlimProto clients require both control and stream ports.
|
||||||
|
# - TCP/UDP 3483: control channel (registration, handshake, status).
|
||||||
|
# - TCP 9000: audio stream channel for local library playback.
|
||||||
|
# If 9000 is blocked, internet radio may still work (clients connect directly to external servers),
|
||||||
|
# but playback of music stored on the LMS host will fail because audio delivery depends on 9000.
|
||||||
|
- name: sqz-http
|
||||||
|
port: 9000
|
||||||
|
targetPort: 9000
|
||||||
|
protocol: TCP
|
||||||
|
- name: sqz-tcp
|
||||||
|
port: 3483
|
||||||
|
nodePort: 31444
|
||||||
|
targetPort: 3483
|
||||||
|
protocol: TCP
|
||||||
|
- name: sqz-udp
|
||||||
|
port: 3483
|
||||||
|
nodePort: 31445
|
||||||
|
targetPort: 3483
|
||||||
|
protocol: UDP
|
||||||
|
|
||||||
27
deploy/infra/cd-rbac.yaml
Normal file
27
deploy/infra/cd-rbac.yaml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
name: ci-cd # change name to continuous-deploy
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["pods", "services", "secrets", "configmaps", "persistentvolumeclaims", "endpoints"]
|
||||||
|
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
|
||||||
|
- apiGroups: ["apps"]
|
||||||
|
resources: ["deployments", "statefulsets"]
|
||||||
|
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: ci-cd #change name to continuous-deploy
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: casa-ci-cd
|
||||||
|
namespace: home-assistant
|
||||||
|
roleRef:
|
||||||
|
kind: Role
|
||||||
|
name: ci-cd
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
16
deploy/infra/ingress.yaml
Normal file
16
deploy/infra/ingress.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: lyrionmusicserver
|
||||||
|
namespace: lyrionmusicserver
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
routes:
|
||||||
|
- match: Host(`lms.casa.limbosolutions.com`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: lyrionmusicserver-web
|
||||||
|
port: 9000
|
||||||
|
tls:
|
||||||
|
secretName: casa-limbosolutions-com-tls
|
||||||
8
deploy/infra/kustomization.yaml
Normal file
8
deploy/infra/kustomization.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- cd-rbac.yaml
|
||||||
|
- music-pv.yaml
|
||||||
|
- ingress.yaml
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
18
deploy/infra/music-pv.yaml
Normal file
18
deploy/infra/music-pv.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: storage-limbosolutions-com-media-music
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadOnlyMany
|
||||||
|
capacity:
|
||||||
|
storage: 128Gi
|
||||||
|
csi:
|
||||||
|
driver: storage-limbosolutions-com-seaweedfs-csi
|
||||||
|
volumeHandle: storage-limbosolutions-com-media-music
|
||||||
|
volumeAttributes:
|
||||||
|
collection: media.music
|
||||||
|
path: /buckets/media.music
|
||||||
|
volumeServerAccess: filerProxy
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
volumeMode: Filesystem
|
||||||
7
deploy/infra/namespace.yaml
Normal file
7
deploy/infra/namespace.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: lyrionmusicserver
|
||||||
|
labels:
|
||||||
|
name: lyrionmusicserver
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
services:
|
|
||||||
lms:
|
|
||||||
image: lmscommunity/logitechmediaserver:8.3.0
|
|
||||||
volumes:
|
|
||||||
- config:/config
|
|
||||||
- music:/music
|
|
||||||
- playlist:/playlist
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
|
||||||
ports:
|
|
||||||
- 9000:9000/tcp
|
|
||||||
- 9090:9090/tcp
|
|
||||||
- 3483:3483/tcp
|
|
||||||
- 3483:3483/udp
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
config:
|
|
||||||
playlist:
|
|
||||||
music:
|
|
||||||
external: true # docker volume create --driver local --opt type=none --opt device=/srv/music@nas.lan --opt o=bind music
|
|
||||||
5
ops-scripts/apply-app.sh
Executable file
5
ops-scripts/apply-app.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
echo "Executing app deploy."
|
||||||
|
|
||||||
|
kubectl kustomize deploy/app | kubectl apply -f -
|
||||||
5
ops-scripts/apply-infra.sh
Executable file
5
ops-scripts/apply-infra.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
echo "Executing infra deploy."
|
||||||
|
|
||||||
|
kubectl kustomize deploy/infra | kubectl apply -f -
|
||||||
Reference in New Issue
Block a user