6 Commits

Author SHA1 Message Date
359044eb21 fix: use type=raw for Docker tags to preserve v prefix
Some checks failed
CI / Release (push) Successful in 1m26s
CI / Lint (push) Successful in 2m41s
CI / Docker Build & Push (push) Failing after 2m42s
CI / Test (push) Successful in 2m45s
CI / Notify (push) Successful in 1s
docker/metadata-action type=semver strips the v prefix, causing
tag mismatch between git tags (v0.1.3) and Docker tags (0.1.3).
Switch to type=raw to pass through the version as-is.
2026-02-22 09:58:45 -05:00
165dbd5f34 fix: switch Docker build to plain docker build/push with insecure registry
All checks were successful
CI / Docker Build & Push (push) Successful in 3m14s
CI / Release (push) Successful in 1m31s
CI / Test (push) Successful in 3m3s
CI / Lint (push) Successful in 2m51s
CI / Notify (push) Successful in 2s
- Drop buildx (setup-buildx-action, build-push-action)
- Use insecure HTTP registry with SIGHUP daemon reload
- Use org-level PAT secrets for registry auth
2026-02-21 22:38:03 -05:00
8f7ffa41d1 fix: use docker login CLI instead of login-action for Gitea compat
Some checks failed
CI / Lint (push) Successful in 2m55s
CI / Test (push) Successful in 2m55s
CI / Release (push) Successful in 1m40s
CI / Docker Build & Push (push) Has been cancelled
CI / Notify (push) Has been cancelled
docker/login-action@v3 fails with 'Username and password required' on
Gitea Actions — secrets not passed to action with: inputs. Switch to
direct docker login CLI which reliably interpolates secrets in run: steps.
2026-02-21 19:34:31 -05:00
c20a2f8097 fix: switch Docker registry to HTTPS endpoint with login-action
Some checks failed
CI / Lint (push) Successful in 3m16s
CI / Test (push) Successful in 2m55s
CI / Release (push) Successful in 1m39s
CI / Docker Build & Push (push) Failing after 8m25s
CI / Notify (push) Successful in 2s
- Replace gitea-http.gitea.svc.cluster.local:3000 with registry.lab.daviestechlabs.io
- Use docker/login-action@v3 for Gitea registry auth (proper buildx integration)
- Remove manual base64 auth to ~/.docker/config.json (not picked up by buildkit)
- Remove insecure registry daemon.json config and Docker restart
- Remove buildkitd insecure registry config
- Remove cache-from/cache-to type=gha (not supported on Gitea Actions)

Fixes 401 Unauthorized: reqPackageAccess on Docker push
2026-02-21 18:05:44 -05:00
0df27901c9 feat: migrate from msgpack to protobuf (handler-base v1.0.0)
Some checks failed
CI / Test (push) Successful in 3m0s
CI / Lint (push) Successful in 2m59s
CI / Release (push) Successful in 1m27s
CI / Docker Build & Push (push) Failing after 7m31s
CI / Notify (push) Successful in 2s
- Replace msgpack.Marshal with proto.Marshal
- Update field names to proto convention (SessionId, SpeakerId)
- Cast Sequence to int32 for proto compatibility
2026-02-21 15:30:43 -05:00
a5b66c09c3 chore: bump handler-base to v0.1.5, add netrc secret mount to Dockerfile
Some checks failed
CI / Lint (push) Successful in 3m4s
CI / Test (push) Successful in 3m3s
CI / Release (push) Successful in 1m34s
CI / Docker Build & Push (push) Failing after 7m35s
CI / Notify (push) Successful in 1s
2026-02-20 18:18:55 -05:00
5 changed files with 45 additions and 65 deletions

View File

@@ -121,42 +121,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config-inline: |
[registry."gitea-http.gitea.svc.cluster.local:3000"]
http = true
insecure = true
- name: Login to Docker Hub
if: vars.DOCKERHUB_USERNAME != ''
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Configure Docker for insecure registry
- name: Configure insecure registry
run: |
sudo mkdir -p /etc/docker
echo '{"insecure-registries": ["${{ env.REGISTRY_HOST }}"]}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker || sudo service docker restart || true
sleep 2
sudo kill -SIGHUP "$(pidof dockerd)" || true
sleep 3
- name: Login to Gitea Registry
run: |
AUTH=$(echo -n "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_TOKEN }}" | base64 -w0)
mkdir -p ~/.docker
cat > ~/.docker/config.json << EOF
{
"auths": {
"${{ env.REGISTRY_HOST }}": {
"auth": "$AUTH"
}
}
}
EOF
echo "Auth configured for ${{ env.REGISTRY_HOST }}"
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "${{ env.REGISTRY_HOST }}" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
- name: Login to Docker Hub
if: vars.DOCKERHUB_USERNAME != ''
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ vars.DOCKERHUB_USERNAME }}" --password-stdin
- name: Extract metadata
id: meta
@@ -164,19 +141,25 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=${{ needs.release.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.version }}
type=raw,value=${{ needs.release.outputs.version }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
run: |
# Build with all tags
TAGS=""
while IFS= read -r tag; do
[ -n "$tag" ] && TAGS="$TAGS -t $tag"
done <<< "${{ steps.meta.outputs.tags }}"
docker build $TAGS \
--label "org.opencontainers.image.source=${{ gitea.server_url }}/${{ gitea.repository }}" \
--label "org.opencontainers.image.revision=${{ gitea.sha }}" \
.
# Push each tag
while IFS= read -r tag; do
[ -n "$tag" ] && docker push "$tag"
done <<< "${{ steps.meta.outputs.tags }}"
notify:
name: Notify

View File

@@ -3,10 +3,13 @@ FROM golang:1.25-alpine AS builder
WORKDIR /app
RUN apk add --no-cache ca-certificates
RUN apk add --no-cache ca-certificates git
ENV GOPRIVATE=git.daviestechlabs.io
ENV GONOSUMCHECK=git.daviestechlabs.io
COPY go.mod go.sum ./
RUN go mod download
RUN --mount=type=secret,id=netrc,target=/root/.netrc go mod download
COPY . .

6
go.mod
View File

@@ -3,9 +3,9 @@ module git.daviestechlabs.io/daviestechlabs/stt-module
go 1.25.1
require (
git.daviestechlabs.io/daviestechlabs/handler-base v0.1.3
git.daviestechlabs.io/daviestechlabs/handler-base v1.0.0
github.com/nats-io/nats.go v1.48.0
github.com/vmihailenco/msgpack/v5 v5.4.1
google.golang.org/protobuf v1.36.11
)
require (
@@ -19,7 +19,6 @@ require (
github.com/klauspost/compress v1.18.0 // indirect
github.com/nats-io/nkeys v0.4.11 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.40.0 // indirect
@@ -37,5 +36,4 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect
google.golang.org/grpc v1.78.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
)

8
go.sum
View File

@@ -1,5 +1,5 @@
git.daviestechlabs.io/daviestechlabs/handler-base v0.1.3 h1:uYog8B839ulqrWoht3qqCvT7CnR3e2skpaLZc2Pg3GI=
git.daviestechlabs.io/daviestechlabs/handler-base v0.1.3/go.mod h1:M3HgvUDWnRn7cX3BE8l+HvoCUYtmRr5OoumB+hnRHoE=
git.daviestechlabs.io/daviestechlabs/handler-base v1.0.0 h1:pB3ehOKaDYQfbyRBKQXrB9curqSFteLrDveoElRKnBY=
git.daviestechlabs.io/daviestechlabs/handler-base v1.0.0/go.mod h1:zocOHFt8yY3cW4+Xi37sNr5Tw7KcjGFSZqgWYxPWyqA=
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
@@ -33,10 +33,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms=

24
main.go
View File

@@ -20,7 +20,7 @@ import (
"time"
"github.com/nats-io/nats.go"
"github.com/vmihailenco/msgpack/v5"
"google.golang.org/protobuf/proto"
"git.daviestechlabs.io/daviestechlabs/handler-base/config"
"git.daviestechlabs.io/daviestechlabs/handler-base/health"
@@ -324,17 +324,17 @@ func main() {
if transcript != "" {
result := &messages.STTTranscription{
SessionID: sessionID,
SessionId: sessionID,
Transcript: transcript,
Sequence: seq,
Sequence: int32(seq),
IsPartial: !complete,
IsFinal: complete,
Timestamp: time.Now().Unix(),
SpeakerID: speakerID,
SpeakerId: speakerID,
HasVoiceActivity: hasVoice,
State: state,
}
packed, _ := msgpack.Marshal(result)
packed, _ := proto.Marshal(result)
_ = nc.Conn().Publish(fmt.Sprintf("%s.%s", transcriptionSubjectPrefix, sessionID), packed)
slog.Info("published transcription", "session", sessionID, "seq", seq)
}
@@ -378,8 +378,8 @@ func main() {
}
sessionID := parts[3]
streamMsg, err := natsutil.Decode[messages.STTStreamMessage](natMsg.Data)
if err != nil {
var streamMsg messages.STTStreamMessage
if err := natsutil.Decode(natMsg.Data, &streamMsg); err != nil {
slog.Error("decode error", "error", err)
return
}
@@ -391,8 +391,8 @@ func main() {
if streamMsg.State != "" {
buf.setState(streamMsg.State)
}
if streamMsg.SpeakerID != "" {
buf.speakerID = streamMsg.SpeakerID
if streamMsg.SpeakerId != "" {
buf.speakerID = streamMsg.SpeakerId
}
sessionsMu.Lock()
sessions[sessionID] = buf
@@ -442,12 +442,12 @@ func main() {
// Check for interrupt
if buffer.checkInterrupt(streamMsg.Audio, enableInterrupt, audioLevelThreshold, interruptDuration) {
interruptMsg := &messages.STTInterrupt{
SessionID: sessionID,
SessionId: sessionID,
Type: "interrupt",
Timestamp: time.Now().Unix(),
SpeakerID: buffer.speakerID,
SpeakerId: buffer.speakerID,
}
packed, _ := msgpack.Marshal(interruptMsg)
packed, _ := proto.Marshal(interruptMsg)
_ = nc.Conn().Publish(fmt.Sprintf("%s.%s", transcriptionSubjectPrefix, sessionID), packed)
slog.Info("published interrupt", "session", sessionID)
buffer.setState(stateListening)