Skip to content

Commit 4a4cdcc

Browse files
committed
feat: companion Docker/Podman image, auto-built and published on release (closes #23)
Built and locally verified (podman build + run --help) before committing, not just written and assumed correct. Dockerfile: python:3.11-slim base, builds from local source (COPY + pip install .) rather than from PyPI - the release workflow tags and builds this image from the SAME commit that gets published to PyPI, avoiding any race between "is the new version live on PyPI yet" and "the image build already started". Non-root user (no reason to run as root, and the safer default for a container that may eventually have the Docker/Podman socket mounted into it for #21). Unlike every other OVOS container (background services), this one needs a TTY attached (-it) since it's an interactive terminal tool, not a daemon - noted clearly in both the Dockerfile and the new README section. New .github/workflows/docker-publish.yml: mirrors publish.yml's own structure exactly (same v* tag trigger, same test-first dependency via test.yml's workflow_call, so neither release artifact ships without tests passing) - builds and pushes to ghcr.io/andlo/ovos-tui-client, tagged both by version and :latest. README: new "Docker/Podman companion image" section covering how to actually reach a messagebus from inside the container (--network host for a simple local case, joining an ovos-docker install's own compose network as the better long-term fit), and the elegant case this enables - if the SAME volumes ovos_core uses get mounted into this container too, it sees real files at normal paths with none of this project's own host-side workarounds (--mycroft-conf, log-bridging) needed at all. 224 tests passing (no code changes to the Python package itself, just new build/packaging infrastructure); version bumped to 0.1.16 for release.
1 parent 6587a1a commit 4a4cdcc

4 files changed

Lines changed: 109 additions & 1 deletion

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Docker image
2+
3+
# Companion image for ovos-tui-client - see issue #23 and the README's
4+
# "Docker/Podman companion image" section. Mirrors publish.yml's own
5+
# trigger/test-first structure so both release artifacts (PyPI package,
6+
# container image) get built from the exact same tagged commit and
7+
# neither ships without tests passing first.
8+
9+
on:
10+
push:
11+
tags:
12+
- 'v*'
13+
14+
jobs:
15+
test:
16+
uses: ./.github/workflows/test.yml
17+
18+
build-and-push:
19+
needs: test
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Log in to GitHub Container Registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract version from tag
35+
id: version
36+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
37+
38+
- name: Build and push
39+
uses: docker/build-push-action@v6
40+
with:
41+
context: .
42+
push: true
43+
tags: |
44+
ghcr.io/${{ github.repository_owner }}/ovos-tui-client:${{ steps.version.outputs.version }}
45+
ghcr.io/${{ github.repository_owner }}/ovos-tui-client:latest

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Companion Docker/Podman image for ovos-tui-client - see issue #23 and
2+
# the README's "Docker/Podman companion image" section.
3+
#
4+
# Unlike every other OVOS Docker image (audio, listener, messagebus,
5+
# each skill, etc), this one is NOT a background service - it's an
6+
# interactive terminal tool. Run it with `docker run -it` (or
7+
# `stdin_open: true` + `tty: true` in compose) - without a TTY
8+
# attached, Textual has no terminal to actually draw into.
9+
#
10+
# Built from local source (COPY + pip install .), not from PyPI - the
11+
# release workflow tags and builds this image from the SAME commit
12+
# that gets published to PyPI, avoiding any race between "is the new
13+
# version live on PyPI yet" and "the image build already started".
14+
FROM python:3.11-slim
15+
16+
WORKDIR /app
17+
18+
# Only what's needed to resolve/install dependencies copied first, so
19+
# this layer caches across rebuilds where only application code
20+
# changed, not dependencies.
21+
COPY setup.py version.py requirements.txt README.md ./
22+
COPY ovos_tui_client/ ./ovos_tui_client/
23+
24+
RUN pip install --no-cache-dir .
25+
26+
# Non-root user - no reason this needs root, and it's the safer
27+
# default for a container that (in a future iteration) may have the
28+
# Docker/Podman socket mounted into it for service management (#21).
29+
RUN useradd --create-home --shell /bin/bash ovos
30+
USER ovos
31+
32+
ENTRYPOINT ["ovos-tui"]

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ None of this requires working audio hardware, a wake word, or STT accuracy getti
6060
pip install ovos-tui-client
6161
```
6262

63+
A container image is also published on every release - see
64+
[Docker/Podman companion image](#dockerpodman-companion-image) below
65+
if that fits your setup better.
66+
6367
## Usage
6468

6569
```bash
@@ -130,6 +134,33 @@ documentation directly, not guessed at:
130134
rather than a file - if a `bus` source never shows up even though
131135
everything else does, that's likely why, not a bug here.
132136

137+
### Docker/Podman companion image
138+
139+
Unlike every other OVOS container (audio, listener, messagebus, each
140+
skill), this one isn't a background service - it's an interactive
141+
terminal tool, so it needs a TTY attached to actually draw anything:
142+
143+
```bash
144+
docker run -it --rm --network host ghcr.io/andlo/ovos-tui-client:latest
145+
```
146+
147+
`--network host` is the simplest way to reach a messagebus already
148+
listening on the host's `127.0.0.1:8181`; on an `ovos-docker` install
149+
specifically, joining that stack's own compose network and pointing
150+
`--host` at the messagebus container's name instead works too, and is
151+
usually the better fit if this is meant to run alongside it long-term.
152+
Pass this tool's own flags after the image name, same as the pip
153+
install - e.g. `docker run -it --rm --network host
154+
ghcr.io/andlo/ovos-tui-client:latest --lang da-dk`.
155+
156+
If the same volumes `ovos_core` uses for config/logs are mounted into
157+
this container too (`-v`/compose `volumes:`, matching whatever paths
158+
that install already uses), this tool sees the real files directly at
159+
their normal locations - no `--mycroft-conf` override or log-bridging
160+
needed at all in that case, the same as a native install would.
161+
Images are tagged by version (`:0.1.16`) and `:latest`, built and
162+
published automatically on every release.
163+
133164
## Why not just fix ovos-cli-client / neon-cli-client?
134165

135166
`ovos-cli-client` (last released March 2022) installs cleanly via pip,

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VERSION_MAJOR = 0
22
VERSION_MINOR = 1
3-
VERSION_BUILD = 15
3+
VERSION_BUILD = 16
44
VERSION_ALPHA = 0
55
# END_VERSION_BLOCK

0 commit comments

Comments
 (0)