initial commit: FastAPI translator proxying to Ollama on radagast
- app.py: /api/models filtered to gemma+aya, /api/translate streams NDJSON from Ollama with stream:true, /healthz for k8s probes - static/index.html: dark-mode UI, three dropdowns (source/target/model), live token streaming with spinner+pulse+timer indicators - Dockerfile: two-stage uv build, slim Python 3.13 runtime - .gitea/workflows/build.yml: multi-arch (amd64+arm64) build, push to Scaleway registry on push to main - build.sh: manual fallback if Gitea Actions isn't available
This commit is contained in:
34
build.sh
Executable file
34
build.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
# Manual multi-arch build + push fallback when Gitea Actions isn't available.
|
||||
#
|
||||
# One-time setup:
|
||||
# docker buildx create --name multi --use
|
||||
# docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
#
|
||||
# Auth:
|
||||
# docker login rg.nl-ams.scw.cloud -u nologin -p <SCW_SECRET_KEY>
|
||||
#
|
||||
# Usage:
|
||||
# ./build.sh # tags :latest and :<short-sha>
|
||||
# TAG=v0.2.0 ./build.sh # additional explicit tag
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REGISTRY="${REGISTRY:-rg.nl-ams.scw.cloud/valinor}"
|
||||
IMAGE="${REGISTRY}/finrod"
|
||||
SHA="$(git rev-parse --short HEAD)"
|
||||
TAGS=(-t "${IMAGE}:latest" -t "${IMAGE}:${SHA}")
|
||||
if [[ -n "${TAG:-}" ]]; then
|
||||
TAGS+=(-t "${IMAGE}:${TAG}")
|
||||
fi
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
"${TAGS[@]}" \
|
||||
--push \
|
||||
.
|
||||
|
||||
echo
|
||||
echo "Pushed: ${IMAGE}:{latest,${SHA}${TAG:+,${TAG}}}"
|
||||
Reference in New Issue
Block a user