From 594b3b338f27ae160d4257bcc0988658f17592de Mon Sep 17 00:00:00 2001 From: NeonBohdan <96498856+NeonBohdan@users.noreply.github.com> Date: Mon, 13 Feb 2023 11:21:54 +0200 Subject: [PATCH 1/9] Docker server fixes (#93) * Added lang key * Fixed plugin entrypoint * Used ovos-tts-server git version * Install local coqui version --- Dockerfile | 10 ++++++---- neon_tts_plugin_coqui/__init__.py | 7 +++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7b72422..6e12243 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ FROM python:3.9-slim-bullseye AS compile-image -RUN apt-get update -y && apt-get install -y python3-pip +RUN apt-get update -y && apt-get install -y python3-pip git RUN pip3 install --user torch --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -RUN pip3 install --user neon-tts-plugin-coqui --no-cache-dir -RUN pip3 install --user ovos-tts-server==0.0.2 --no-cache-dir +COPY . /tmp/neon-tts-plugin-coqui +RUN pip3 install --user /tmp/neon-tts-plugin-coqui --no-cache-dir + +RUN pip3 install --user git+https://github.com/OpenVoiceOS/ovos-tts-server FROM python:3.9-slim-bullseye AS build-image @@ -13,4 +15,4 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends espeak-ng COPY --from=compile-image /root/.local /root/.local ENV PATH=/root/.local/bin:$PATH -ENTRYPOINT ovos-tts-server --engine neon-tts-plugin-coqui \ No newline at end of file +ENTRYPOINT ovos-tts-server --engine coqui \ No newline at end of file diff --git a/neon_tts_plugin_coqui/__init__.py b/neon_tts_plugin_coqui/__init__.py index 8a47158..898bdc8 100644 --- a/neon_tts_plugin_coqui/__init__.py +++ b/neon_tts_plugin_coqui/__init__.py @@ -69,17 +69,20 @@ def __init__(self, lang="en", config=None, *args, **kwargs): self._init_model({"lang": lang}) def get_tts(self, sentence: str, output_file: str, - speaker: Optional[dict] = None) -> (str, Optional[str]): + speaker: Optional[dict] = None, lang: Optional[str] = None) -> (str, Optional[str]): """ Get Synthesized audio Args: sentence: string to synthesize output_file: path to output audio file speaker: optional dict speaker data - + lang: optional lang override Returns: tuple wav_file, optional phonemes """ + if lang: + speaker = speaker or dict() + speaker['language'] = lang wav_data, synthesizer = self.get_audio(sentence, speaker, audio_format="internal") self._audio_to_file(wav_data, synthesizer, output_file) From 949ef484ab6c628bfa2d7d614f1a53a7761ddd4b Mon Sep 17 00:00:00 2001 From: NeonBohdan Date: Mon, 13 Feb 2023 09:22:34 +0000 Subject: [PATCH 2/9] Increment Version --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index 7680be6..c26c29e 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.7.1" +__version__ = "0.7.2a0" From 1088417db68825d8e3cc154e87a0bdbdc199baff Mon Sep 17 00:00:00 2001 From: NeonBohdan <96498856+NeonBohdan@users.noreply.github.com> Date: Mon, 13 Feb 2023 11:36:43 +0200 Subject: [PATCH 3/9] Freeze ovos-tts-server version (#95) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6e12243..0340136 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN pip3 install --user torch --no-cache-dir --extra-index-url https://download. COPY . /tmp/neon-tts-plugin-coqui RUN pip3 install --user /tmp/neon-tts-plugin-coqui --no-cache-dir -RUN pip3 install --user git+https://github.com/OpenVoiceOS/ovos-tts-server +RUN pip3 install --user git+https://github.com/OpenVoiceOS/ovos-tts-server@b9ee84c48ab6ab5655fffa032359752ab10d2c9d FROM python:3.9-slim-bullseye AS build-image From d69d3760a41083999938a0c5085ab16a3f17721d Mon Sep 17 00:00:00 2001 From: NeonBohdan Date: Mon, 13 Feb 2023 09:37:20 +0000 Subject: [PATCH 4/9] Increment Version --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index c26c29e..bcefdcf 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.7.2a0" +__version__ = "0.7.2a1" From 3214c8c648d250a4a925a230eb8d0bee02f927c4 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Tue, 14 Feb 2023 09:52:42 -0800 Subject: [PATCH 5/9] Update Docker automation (#96) * Update docker automation to tag release and dev versions with version tags * Remove 'latest' tag from Docker alpha releases --- .github/workflows/publish_docker.yml | 45 ---------------------- .github/workflows/publish_release.yml | 48 +++++++++++++++++++++++- .github/workflows/publish_test_build.yml | 47 ++++++++++++++++++++++- 3 files changed, 91 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/publish_docker.yml diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml deleted file mode 100644 index d4a5d88..0000000 --- a/.github/workflows/publish_docker.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Publish Docker Container -on: - workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: NeonGeckoCom/coqui-tts - -jobs: - build_and_publish_docker: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v2 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=raw,value=latest - type=semver,pattern={{version}} - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 9e06d3b..af34327 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -19,7 +19,7 @@ jobs: with: token: ${{secrets.GITHUB_TOKEN}} tag: ${{env.VERSION}} - build_and_publish: + build_and_publish_pypi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -35,6 +35,50 @@ jobs: run: | python setup.py sdist bdist_wheel - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{secrets.PYPI_TOKEN}} + build_and_publish_docker: + runs-on: ubuntu-latest + needs: build_and_publish_pypi + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Version + id: version + run: | + VERSION=$(sed "s/a/-a./" <<< $(python setup.py --version)) + echo ::set-output name=version::${VERSION} + env: + image_name: ${{ env.IMAGE_NAME }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v2 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=raw,value=latest + type=semver,pattern={{version}},value=${{ steps.version.outputs.version }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/publish_test_build.yml b/.github/workflows/publish_test_build.yml index 879f52b..b53daa7 100644 --- a/.github/workflows/publish_test_build.yml +++ b/.github/workflows/publish_test_build.yml @@ -9,7 +9,7 @@ on: - 'version.py' jobs: - build_and_publish: + build_and_publish_pypi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -34,6 +34,49 @@ jobs: run: | python setup.py sdist bdist_wheel - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{secrets.PYPI_TOKEN}} + build_and_publish_docker: + runs-on: ubuntu-latest + needs: build_and_publish_pypi + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Version + id: version + run: | + VERSION=$(sed "s/a/-a./" <<< $(python setup.py --version)) + echo ::set-output name=version::${VERSION} + env: + image_name: ${{ env.IMAGE_NAME }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v2 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}},value=${{ steps.version.outputs.version }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 622e5959fc260d4eff3c57b3178aa0de5545e238 Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Tue, 14 Feb 2023 17:53:30 +0000 Subject: [PATCH 6/9] Increment Version --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index bcefdcf..c25d425 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.7.2a1" +__version__ = "0.7.2a2" From 2e8463702912b8d69d8941224dad3547bf402fb3 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Tue, 14 Feb 2023 10:16:47 -0800 Subject: [PATCH 7/9] Add missing envvars to Docker automation (#97) --- .github/workflows/publish_release.yml | 4 ++++ .github/workflows/publish_test_build.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index af34327..41f0e79 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -6,6 +6,10 @@ on: branches: - master +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + jobs: tag_release: runs-on: ubuntu-latest diff --git a/.github/workflows/publish_test_build.yml b/.github/workflows/publish_test_build.yml index b53daa7..ff7dc73 100644 --- a/.github/workflows/publish_test_build.yml +++ b/.github/workflows/publish_test_build.yml @@ -8,6 +8,10 @@ on: paths-ignore: - 'version.py' +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + jobs: build_and_publish_pypi: runs-on: ubuntu-latest From ad18d037b5d8ae78fc5b8f83cf660ba179460dbe Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Tue, 14 Feb 2023 18:17:37 +0000 Subject: [PATCH 8/9] Increment Version --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index c25d425..eeb9a13 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.7.2a2" +__version__ = "0.7.2a3" From 8c48260907710b64f0e141d136aa29492387fa77 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:10:48 -0800 Subject: [PATCH 9/9] Increment version to 0.7.2 (#98) --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index eeb9a13..27362a0 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.7.2a3" +__version__ = "0.7.2"