mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-03 20:12:55 +00:00
The backend import package is now docsgpt, the name it will carry on PyPI; application was far too generic to install into anyone's site-packages. git mv plus a mechanical rewrite of every import, dotted string and path reference: 734 Python files, the compose files, Dockerfile, workflows, docs, setup scripts, devcontainer, k8s manifests, vscode config, pytest and coverage config, .gitignore. Behaviour is unchanged. Kept for one release: - A top-level application package whose meta-path finder resolves application.x.y to the already-imported docsgpt.x.y object, so old imports and entry points (celery -A application.app.celery, uvicorn application.asgi:asgi_app) keep working with a FutureWarning. - Celery registers every application.* task name as an alias of its docsgpt.* task on start-up, so messages queued by the previous release still run. The redbeat key prefix moves to redbeat:docsgpt:v2: so schedule entries the previous release wrote are left unread instead of firing twice. The backend image builds from the repository root (docker build -f docsgpt/Dockerfile .) so it can ship the alias package; a root .dockerignore allow-lists docsgpt/ and application/ and keeps caches, local data, .env files, the sample index files and the Dockerfile out. Compose and the image workflows point at the new context.
132 lines
4.9 KiB
YAML
132 lines
4.9 KiB
YAML
name: Build and push multi-arch DocsGPT Docker image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
if: github.repository == 'arc53/DocsGPT'
|
|
# Publishing jobs run in a GitHub Actions environment so the registry
|
|
# credentials can be scoped to it and protection rules (required reviewers,
|
|
# branch restrictions) applied in the repository settings.
|
|
environment: docker-hub
|
|
env:
|
|
# Public namespace the compose files pull from; the login secret only
|
|
# authenticates the push.
|
|
DOCKERHUB_NAMESPACE: arc53
|
|
strategy:
|
|
matrix:
|
|
platform: [linux/amd64, linux/arm64]
|
|
# "" is the slim default image; "-docling" bakes the docling parser
|
|
# engine, its models and tesseract in (OCR-ready).
|
|
variant: ["", "-docling"]
|
|
runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
|
with:
|
|
driver: docker-container
|
|
install: true
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to ghcr.io
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Image metadata (OCI labels)
|
|
id: meta
|
|
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
|
|
with:
|
|
images: |
|
|
${{ env.DOCKERHUB_NAMESPACE }}/docsgpt
|
|
ghcr.io/${{ github.repository_owner }}/docsgpt
|
|
labels: |
|
|
org.opencontainers.image.title=DocsGPT${{ matrix.variant }}
|
|
org.opencontainers.image.version=develop
|
|
|
|
- name: Build and push platform-specific images
|
|
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
|
|
with:
|
|
file: './docsgpt/Dockerfile'
|
|
platforms: ${{ matrix.platform }}
|
|
context: .
|
|
push: true
|
|
build-args: |
|
|
EXTRAS=${{ matrix.variant == '-docling' && 'docling' || '' }}
|
|
INSTALL_TESSERACT=${{ matrix.variant == '-docling' && 'true' || 'false' }}
|
|
tags: |
|
|
${{ env.DOCKERHUB_NAMESPACE }}/docsgpt:develop${{ matrix.variant }}-${{ matrix.platform == 'linux/arm64' && 'arm64' || 'amd64' }}
|
|
ghcr.io/${{ github.repository_owner }}/docsgpt:develop${{ matrix.variant }}-${{ matrix.platform == 'linux/arm64' && 'arm64' || 'amd64' }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
provenance: false
|
|
sbom: false
|
|
cache-from: type=registry,ref=${{ env.DOCKERHUB_NAMESPACE }}/docsgpt:develop${{ matrix.variant }}
|
|
cache-to: type=inline
|
|
|
|
manifest:
|
|
if: github.repository == 'arc53/DocsGPT'
|
|
# Publishing jobs run in a GitHub Actions environment so the registry
|
|
# credentials can be scoped to it and protection rules (required reviewers,
|
|
# branch restrictions) applied in the repository settings.
|
|
environment: docker-hub
|
|
env:
|
|
# Public namespace the compose files pull from; the login secret only
|
|
# authenticates the push.
|
|
DOCKERHUB_NAMESPACE: arc53
|
|
needs: build
|
|
strategy:
|
|
matrix:
|
|
variant: ["", "-docling"]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
packages: write
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
|
with:
|
|
driver: docker-container
|
|
install: true
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to ghcr.io
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create and push multi-arch manifests
|
|
env:
|
|
TAG: develop${{ matrix.variant }}
|
|
run: |
|
|
set -e
|
|
for repo in "$DOCKERHUB_NAMESPACE/docsgpt" "ghcr.io/${{ github.repository_owner }}/docsgpt"; do
|
|
docker manifest create "$repo:$TAG" \
|
|
--amend "$repo:$TAG-amd64" \
|
|
--amend "$repo:$TAG-arm64"
|
|
docker manifest push "$repo:$TAG"
|
|
done
|