Skip to content

Commit

Permalink
add de-DE image
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Dec 15, 2024
1 parent ffe2bb8 commit 5a6ef90
Show file tree
Hide file tree
Showing 415 changed files with 5,392 additions and 46 deletions.
37 changes: 36 additions & 1 deletion .github/workflows/build_img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ jobs:
body: |
This PR updates the base-image-url in `build_img_es.yml` to reflect the latest release.
labels: automated-update

update-nl-workflow:
runs-on: ubuntu-latest
needs: [ upload-image, get-date-release-name, modify-rpi-image ]
Expand Down Expand Up @@ -394,6 +393,42 @@ jobs:
This PR updates the base-image-url in `build_img_nl.yml` to reflect the latest release.
labels: automated-update

update-de-workflow:
runs-on: ubuntu-latest
needs: [ upload-image, get-date-release-name, modify-rpi-image ]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Update base-image-url in build_img_de.yml
run: |
sed -i '/^[^#]*base-image-url:/ {/sed/! s|base-image-url: .*|base-image-url: https://github.com/TigreGotico/raspOVOS/releases/download/${{ needs.get-date-release-name.outputs.release_name }}/${{ needs.modify-rpi-image.outputs.image-path }}|}' .github/workflows/build_img_de.yml
- name: Check for changes
id: check-changes
run: |
if git diff --exit-code .github/workflows/build_img_de.yml; then
echo "base image download url didnt change"
echo "no_changes=true" >> $GITHUB_ENV
else
echo "base image download url updated in build_img_de.yml"
echo "no_changes=false" >> $GITHUB_ENV
fi
- name: Create Pull Request
if: env.no_changes == 'false'
uses: peter-evans/create-pull-request@v5
with:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
token: ${{ secrets.PA_TOKEN }}
branch: "update-base-image-url-de"
commit-message: "Update base-image-url in build_img_de.yml"
title: "Update base-image-url-de"
body: |
This PR updates the base-image-url in `build_img_de.yml` to reflect the latest release.
labels: automated-update

update-gui-workflow:
runs-on: ubuntu-latest
needs: [ upload-image, get-date-release-name, modify-rpi-image ]
Expand Down
135 changes: 135 additions & 0 deletions .github/workflows/build_img_de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: build german headless image

on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/build_img_de.yml'
- 'build_raspOVOS_de.sh'
- 'intent_cache/de-DE/**'

jobs:
# Stage 1: Get Current Date and Release Name
get-date-release-name:
runs-on: ubuntu-latest
outputs:
release_name: ${{ steps.current-date.outputs.release_name }}
cache_key: ${{ steps.current-date.outputs.cache_key }}
steps:
- name: Get Current Date and Release Name
id: current-date
run: |
current_date=$(date +'%Y-%m-%d')
release_name="raspOVOS-german-bookworm-arm64-lite-${current_date}"
cache_key="raspOVOS-${{ github.run_id }}"
echo "release_name=$release_name" >> $GITHUB_OUTPUT
echo "cache_key=$cache_key" >> $GITHUB_OUTPUT
- name: Print outputs
shell: bash
run: |
echo "cache_key: ${{ steps.current-date.outputs.cache_key }}"
echo "release_name: ${{ steps.current-date.outputs.release_name }}"
# Stage 2: Build Image
modify-rpi-image:
runs-on: ubuntu-latest
needs: get-date-release-name
outputs:
image-path: ${{ steps.create-image.outputs.image-path }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configuring OVOS for German
uses: TigreGotico/rpi-image-modifier@main
id: create-image
env:
USER: 'ovos'
PASSWORD: 'ovos'
HOSTNAME: "raspOVOS"
CONSTRAINTS: "https://github.com/OpenVoiceOS/ovos-releases/raw/refs/heads/main/constraints-alpha.txt"
MYCROFT_CONFIG_FILES: "mycroft.conf,mycroft_de.conf"
with:
base-image-url: https://github.com/TigreGotico/raspOVOS/releases/download/raspOVOS-bookworm-arm64-lite-2024-12-11/raspOVOS-bookworm-arm64-lite.img.xz
image-path: raspOVOS-german-bookworm-arm64-lite.img
compress-with-xz: true
shrink: true
cache: false
mount-repository: true
env-vars: USER,PASSWORD,HOSTNAME,CONSTRAINTS,MYCROFT_CONFIG_FILES
script-path: build_raspOVOS_de.sh
- name: Print outputs
shell: bash
run: |
echo "image-path: ${{ steps.create-image.outputs.image-path }}"
echo "image-size: ${{ steps.create-image.outputs.image-size }}"
echo "image-sha256sum: ${{ steps.create-image.outputs.image-sha256sum }}"
- name: Save Image to Cache
uses: actions/cache@v4
with:
path: .
key: ${{ needs.get-date-release-name.outputs.cache_key }}

# Stage 3: Check if Release Exists and Create if Needed
check-release-or-create:
runs-on: ubuntu-latest
needs: [get-date-release-name, modify-rpi-image]
outputs:
release_id: ${{ steps.get-release-id.outputs.release_id }}
steps:
- name: Check if Release Exists
id: get-release-id
run: |
release_name="${{ needs.get-date-release-name.outputs.release_name }}"
release=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/releases/tags/$release_name")
release_id=$(echo $release | jq -r .id)
if [[ "$release_id" == "null" ]]; then
release=$(curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$release_name\",\"name\":\"$release_name\",\"body\":\"RaspOVOS pre-configured for German\"}" \
"https://api.github.com/repos/${{ github.repository }}/releases")
release_id=$(echo $release | jq -r .id)
fi
echo "release_id=$release_id" >> $GITHUB_OUTPUT
- name: Print outputs
shell: bash
run: |
echo "release_id: ${{ steps.get-release-id.outputs.release_id }}"
if [[ $release_id == "null" ]]; then
echo "Failed to create release. Response: $release"
exit 1
fi
# Stage 4: Upload to Release
upload-image:
runs-on: ubuntu-latest
if: ${{ needs.check-release-or-create.outputs.release_id }}
needs: [modify-rpi-image, check-release-or-create, get-date-release-name]
steps:
- name: Restore Cache for Image
uses: actions/cache@v4
with:
path: .
key: ${{ needs.get-date-release-name.outputs.cache_key }}
fail-on-cache-miss: true

- name: Debug Cache Content
run: ls .

- name: Upload to release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ${{ needs.modify-rpi-image.outputs.image-path }}
release_id: ${{ needs.check-release-or-create.outputs.release_id }}
draft: false
overwrite: true
prerelease: false
verbose: true
70 changes: 70 additions & 0 deletions build_raspOVOS_de.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash
# Exit on error
# If something goes wrong just stop.
# it allows the user to see issues at once rather than having
# scroll back and figure out what went wrong.
set -e

# Activate the virtual environment
source /home/$USER/.venvs/ovos/bin/activate

echo "Setting up default wifi country..."
/usr/bin/raspi-config nonint do_wifi_country DE

echo "Caching pre-trained padatious intents..."
mkdir -p /home/$USER/.local/share/mycroft/intent_cache
cp -rv /mounted-github-repo/intent_cache/de-DE /home/$USER/.local/share/mycroft/intent_cache/

echo "Installing Citrinet plugin..."
uv pip install ovos-stt-plugin-citrinet

echo "Downloading dutch citrinet model..."
python /mounted-github-repo/packages/download_citrinet_de.py
# since script was run as root, we need to move downloaded files
mkdir -p /home/ovos/.cache/huggingface/hub/
mv /root/.cache/huggingface/hub/models--neongeckocom--stt_de_citrinet_512_gamma_0_25/ /home/ovos/.cache/huggingface/hub/models--neongeckocom--stt_de_citrinet_512_gamma_0_25/

echo "Downloading german vosk model..."
# Download and extract VOSK model
VOSK_DIR="/home/$USER/.local/share/vosk"
mkdir -p $VOSK_DIR
wget https://alphacephei.com/vosk/models/vosk-model-small-de-0.15.zip -P $VOSK_DIR
unzip -o $VOSK_DIR/vosk-model-small-de-0.15.zip -d $VOSK_DIR
rm $VOSK_DIR/vosk-model-small-de-0.15.zip


echo "Installing Piper TTS..."
uv pip install --no-progress ovos-tts-plugin-piper -c $CONSTRAINTS

# download default piper voice for dutch
PIPER_DIR="/home/$USER/.local/share/piper_tts/thorsten-low"
VOICE_URL="https://github.com/rhasspy/piper/releases/download/v0.0.2/voice-de-thorsten-low.tar.gz"
VOICE_ARCHIVE="$PIPER_DIR/voice-de-thorsten-low.tar.gz"
mkdir -p "$PIPER_DIR"
echo "Downloading voice from $VOICE_URL..."
wget "$VOICE_URL" -O "$VOICE_ARCHIVE"
tar -xvzf "$VOICE_ARCHIVE" -C "$PIPER_DIR"
# if we remove the voice archive the plugin will think its missing and redownload voice on boot...
rm "$VOICE_ARCHIVE"
touch $VOICE_ARCHIVE


echo "Creating system level mycroft.conf..."
mkdir -p /etc/mycroft

CONFIG_ARGS=""
# Loop through the MYCROFT_CONFIG_FILES variable and append each file to the jq command
IFS=',' read -r -a config_files <<< "$MYCROFT_CONFIG_FILES"
for file in "${config_files[@]}"; do
CONFIG_ARGS="$CONFIG_ARGS /mounted-github-repo/$file"
done
# Execute the jq command and merge the files into mycroft.conf
jq -s 'reduce .[] as $item ({}; . * $item)' $CONFIG_ARGS > /etc/mycroft/mycroft.conf


echo "Ensuring permissions for $USER user..."
# Replace 1000:1000 with the correct UID:GID if needed
chown -R 1000:1000 /home/$USER

echo "Cleaning up apt packages..."
apt-get --purge autoremove -y && apt-get clean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8���
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{":0": 0, ":1": 1, ":2": 2, ":3": 3, ":4": 4, "m": 5, "'": 6, "he": 7, "perdut": 8, "els": 9, "recordadors": 10, "esdeveniments": 11, "quines": 12, "alertes": 13, "em": 14, "vaig": 15, "perdre": 16, "senyora": 17, "timer": 18, "manques": 19, "un": 20, "recordatori": 21, "qualsevol": 22, "alerta": 23, "algun": 24, "rellotge": 25, "esdeveniment": 26, "temporitzadors": 27, "oblidats": 28, "miss": 29, "reminders": 30, "l": 31, "alarma": 32, "temporitzador": 33, "oblidat": 34, "s": 35, "ha": 36, "alguna": 37, "alarmes": 38, "fallides": 39, "una": 40, "recordatoris": 41, "perdudes": 42, "es": 43, "va": 44, "record": 45, "fallar": 46, "quins": 47, "perduts": 48, "oblidades": 49, "qu\u00e8": 50, "quin": 51, "les": 52, "fallida": 53, "a": 54, "om\u00e8s": 55, "quina": 56, "mancar": 57, "records": 58, "de": 59, "el": 60, "perduda": 61, "recordat": 62, "misses": 63, "dels": 64, "timers": 65, "events": 66, "recordats": 67, "que": 68, "cosa": 69}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�H�C
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{":0": 0, ":1": 1, ":2": 2, ":3": 3, ":4": 4, "quin": 5, "color": 6, "t\u00e9": 7, "un": 8, "codi": 9, "hexadecimal": 10, "de": 11, "{hex": 12, "_": 13, "code}": 14}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FANN_FLO_2.1
num_layers=3
learning_rate=0.700000
connection_rate=1.000000
network_type=0
learning_momentum=0.000000
training_algorithm=2
train_error_function=1
train_stop_function=1
cascade_output_change_fraction=0.010000
quickprop_decay=-0.000100
quickprop_mu=1.750000
rprop_increase_factor=1.200000
rprop_decrease_factor=0.500000
rprop_delta_min=0.000000
rprop_delta_max=50.000000
rprop_delta_zero=0.100000
cascade_output_stagnation_epochs=12
cascade_candidate_change_fraction=0.010000
cascade_candidate_stagnation_epochs=12
cascade_max_out_epochs=150
cascade_min_out_epochs=50
cascade_max_cand_epochs=150
cascade_min_cand_epochs=50
cascade_num_candidate_groups=2
bit_fail_limit=1.00000000000000005551e-01
cascade_candidate_limit=1.00000000000000000000e+03
cascade_weight_multiplier=4.00000000000000022204e-01
cascade_activation_functions_count=10
cascade_activation_functions=3 5 7 8 10 11 14 15 16 17
cascade_activation_steepnesses_count=4
cascade_activation_steepnesses=2.50000000000000000000e-01 5.00000000000000000000e-01 7.50000000000000000000e-01 1.00000000000000000000e+00
layer_sizes=16 11 2
scale_included=0
neurons (num_inputs, activation_function, activation_steepness)=(0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (16, 6, 5.00000000000000000000e-01) (0, 6, 0.00000000000000000000e+00) (11, 6, 5.00000000000000000000e-01) (0, 6, 0.00000000000000000000e+00)
connections (connected_to_neuron, weight)=(0, 5.66634609272015699055e-01) (1, 1.25448414485383685779e-01) (2, 1.72016830544400839420e-01) (3, 7.01406909035927755847e-02) (4, 2.24759803514409689518e-01) (5, 7.14456169082869907427e-02) (6, -1.02338232258634823091e-01) (7, -1.76562693169762002787e-01) (8, -1.74415096765693555803e-01) (9, 1.58507402300105709747e-01) (10, 1.80249273266773393232e+01) (11, 1.18366841807624537108e-01) (12, -1.23165744813646532707e-02) (13, -1.46429014639302662593e-01) (14, 6.02509332812150785741e-02) (15, -3.56388493806768374972e-02) (0, -1.17409867056033470623e-01) (1, -2.29788362461250339486e-01) (2, -2.79993697482269321419e-01) (3, -3.41698072332065616585e-01) (4, -2.28982686477821384408e-01) (5, 2.86246212692338464212e-01) (6, 4.24072469169613441853e-01) (7, 1.79241091977270006197e-01) (8, 1.76831557281926649017e-01) (9, 2.05849207770002290419e-01) (10, 2.75239604379271085577e+00) (11, 1.25258398970222173396e-01) (12, 2.55770951728711892770e-01) (13, 3.82481880670367424546e-01) (14, 1.24353714917042668109e-01) (15, -4.98206570521194769263e-01) (0, 7.54687847024680724672e-01) (1, 6.65736738025859420276e-02) (2, 1.29724444764824337062e-01) (3, 1.99788147526951259669e-01) (4, 1.20005467849941677150e-01) (5, -5.76342568881816133541e-02) (6, -1.40222519533606902048e-02) (7, -6.73992108697796764305e-03) (8, 5.65662251680056349379e-02) (9, 5.13633255131545132799e-02) (10, 1.02295501074616765891e+01) (11, 2.02325811290977791712e-01) (12, -5.24907168806375223902e-01) (13, -1.90344200438359367755e-01) (14, 5.00751874010367872825e-02) (15, -1.71567716703289047109e-01) (0, -3.98352179948101736695e-01) (1, 1.22286775850547854705e-01) (2, 2.24649039798273192359e-01) (3, 2.46012804799570189429e-01) (4, 9.84261238508358643484e-02) (5, 1.60710167171296047783e-01) (6, 3.98604146909433354473e-01) (7, 1.79672106406611381546e-01) (8, 3.16185029563081754223e-01) (9, 8.43830978677653775755e-01) (10, 1.05582649246385443575e+02) (11, 2.52643450804122204900e-01) (12, -2.35467895806347549126e+00) (13, 3.92164125455696094269e-02) (14, 4.85995012355000977067e-01) (15, -2.62239405595986047048e-02) (0, 4.66973370780480401265e-01) (1, 1.83525711982269384981e-01) (2, 5.47499738025857135559e-02) (3, 1.86108962385673620821e-01) (4, 1.71249889521617987276e-01) (5, -9.12337134383221365352e-02) (6, -1.92863086625790047801e-01) (7, -8.33533072978748096338e-02) (8, -3.02217793252095925927e-02) (9, 6.22401263240197274995e-02) (10, 4.30177816531366445929e+01) (11, 7.72738885992843016481e-02) (12, -1.00679769856334822009e+00) (13, -2.40373132779383158475e-01) (14, 4.60213227188905546483e-02) (15, 6.04984135001253794939e-02) (0, -7.97421678978417480810e-02) (1, -2.79803211180127964219e-01) (2, -3.01199199942506656846e-01) (3, -2.63807939676202640733e-01) (4, -2.93677242783464298448e-01) (5, 7.34881059015039944660e-02) (6, 1.13357682339665366555e-04) (7, -2.65305201206463836527e-02) (8, -1.51376701389815352533e-02) (9, 1.83103072700096319858e-01) (10, 1.83078581211616975288e+00) (11, -2.05511439164888398690e-01) (12, -1.17348054378718069657e+00) (13, -1.84495107336300673273e-01) (14, 9.14222320732517440556e-02) (15, -5.51907405033905340552e-01) (0, 2.06241377655450919271e-01) (1, -6.87448068080449004036e-02) (2, -5.86707426724935032780e-02) (3, -1.24442590635826605405e-01) (4, -1.16663081806709756361e-01) (5, 4.46530504334969879920e-02) (6, 3.44577964725800295342e-02) (7, 4.25415729731456054852e-02) (8, -6.66177228621632339101e-02) (9, -6.83976783481696992695e-01) (10, -1.56708520323626099291e+00) (11, 4.75621387272715748923e-03) (12, 5.63662062438269231279e+01) (13, -1.96850234285707831328e-01) (14, -3.67975445264433320691e-01) (15, -1.67453510343099111479e-02) (0, -3.83732072790034572929e-01) (1, 2.26841613137110681420e-01) (2, 1.27339038484677286034e-01) (3, 2.12774335824831933861e-01) (4, 2.49389901244028960869e-01) (5, 2.66369948311441118172e-01) (6, 4.15209161594552456087e-01) (7, 3.27728255889338460083e-01) (8, 2.96693252739084256664e-01) (9, 6.71032058076723725293e-01) (10, 1.05471176770111668475e+02) (11, 7.91120898798781807537e-02) (12, -2.31757075280462920830e+00) (13, 6.03287106156097485687e-01) (14, 4.58762819898278828568e-01) (15, 1.07309471513099604495e-02) (0, -3.20499718237246877806e-01) (1, 2.61926871168967789760e-01) (2, 2.41597783196326798549e-01) (3, 2.80746098983642222713e-01) (4, 2.20503043759223527065e-01) (5, 4.84187046497458140060e-01) (6, 5.01601292688958810828e-01) (7, 2.03234288147610603348e-01) (8, 3.35191689251434943309e-01) (9, 5.91238113121851593945e-01) (10, 1.05451449327698099978e+02) (11, 1.19249069167667295921e-01) (12, -2.26653031945740401909e+00) (13, 5.30374226867900699922e-01) (14, 5.76195384395272625078e-01) (15, -4.08056054567031423197e-02) (0, 1.00634594474022051602e-01) (1, -1.03739227982056370081e-01) (2, -1.41830306382668136500e-01) (3, -2.74439308674824578027e-01) (4, -1.17005150647652378382e-01) (5, -2.30096346092440673381e-01) (6, -1.10931622834827339763e-01) (7, -1.87936684591983108050e-02) (8, -2.99748853335863908731e-02) (9, -3.11930162352903328493e-01) (10, -7.54560189972930839275e-01) (11, -1.18372554192261683625e-01) (12, 1.36051797730293202449e+02) (13, 1.77774406117268204963e-02) (14, 2.28430266182885755022e-01) (15, -6.04053986099237008589e-02) (16, 3.78345534939813321618e-01) (17, 6.07036245729023371531e-01) (18, 2.00622110467811920476e-01) (19, 3.86100713186047550529e-01) (20, 3.21363352973508431543e-01) (21, 6.01704178120190058543e-01) (22, 6.61681881244624126026e-01) (23, 3.52056387834332462639e-01) (24, 2.91635941736481885123e-01) (25, 5.73337386326453479768e-01) (26, 3.22878665124493147154e-01)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["{hex"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{":end": 0, "de": 1, "hexadecimal": 2, "codi": 3, "un": 4, "t\u00e9": 5, "color": 6, "quin": 7}
Loading

0 comments on commit 5a6ef90

Please sign in to comment.