mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-02-04 07:43:31 +00:00
whipearr lingrrr, vai ser trocado agora por libretrasnlate
This commit is contained in:
30
roles/lingarr/files/lingarr-deployment.yaml
Normal file
30
roles/lingarr/files/lingarr-deployment.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: lingarr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: lingarr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: lingarr
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: lingarr
|
||||||
|
image: lingarr/lingarr:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 9876
|
||||||
|
env:
|
||||||
|
- name: ASPNETCORE_URLS
|
||||||
|
value: "http://+:9876"
|
||||||
|
- name: WHISPER_BASE_URL
|
||||||
|
value: "http://whisperasr-service.stack-arr.svc.cluster.local:9000"
|
||||||
|
- name: SOURCE_LANGUAGE
|
||||||
|
value: "auto"
|
||||||
|
- name: TARGET_LANGUAGE
|
||||||
|
value: "pt"
|
||||||
|
|
||||||
12
roles/lingarr/files/lingarr-service.yaml
Normal file
12
roles/lingarr/files/lingarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: lingarr-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 9876
|
||||||
|
targetPort: 9876
|
||||||
|
selector:
|
||||||
|
app: lingarr
|
||||||
|
type: ClusterIP
|
||||||
42
roles/whisperasr/files/whisperasr-deployment.yaml
Normal file
42
roles/whisperasr/files/whisperasr-deployment.yaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: whisperasr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: whisperasr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: whisperasr
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
volumes:
|
||||||
|
- name: whisperasr-model
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: whisperasr-model-pvc
|
||||||
|
containers:
|
||||||
|
- name: whisperasr
|
||||||
|
image: onerahmet/openai-whisper-asr-webservice:latest-gpu
|
||||||
|
ports:
|
||||||
|
- containerPort: 9000
|
||||||
|
name: api
|
||||||
|
env:
|
||||||
|
- name: ASR_MODEL
|
||||||
|
value: medium
|
||||||
|
- name: ASR_ENGINE
|
||||||
|
value: faster_whisper
|
||||||
|
- name: ASR_MODEL_PATH
|
||||||
|
value: /data/whisper
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: '1'
|
||||||
|
volumeMounts:
|
||||||
|
- name: whisperasr-model
|
||||||
|
mountPath: /data/whisper
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
11
roles/whisperasr/files/whisperasr-nfs-csi.yaml
Normal file
11
roles/whisperasr/files/whisperasr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: whisperasr-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/whisperasr
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
29
roles/whisperasr/files/whisperasr-pvcs.yaml
Normal file
29
roles/whisperasr/files/whisperasr-pvcs.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: whisperasr-model-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 30Gi
|
||||||
|
storageClassName: whisperasr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/whisperasr/model
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: whisperasr-model-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: whisperasr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: whisperasr-model-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 30Gi
|
||||||
12
roles/whisperasr/files/whisperasr-service.yaml
Normal file
12
roles/whisperasr/files/whisperasr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: whisperasr-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 9000
|
||||||
|
targetPort: 9000
|
||||||
|
selector:
|
||||||
|
app: whisperasr
|
||||||
|
type: ClusterIP
|
||||||
51
roles/whisperasr/tasks/main.yml
Normal file
51
roles/whisperasr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/whisperasr/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/whisperasr/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/whisperasr/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/whisperasr/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.radarr.secret", dest: "/tmp/stack-arr/radarr/kubernetes-files/files/radarr-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/whisperasr/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/whisperasr/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/whisperasr/vars/main.yml
Normal file
4
roles/whisperasr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
Reference in New Issue
Block a user