Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

feat(ci): add prerelease Docker image workflow for pre-release testing (#3761)

LearningCircuitc245a27090c4
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index 01fe0d397f..3f618135c3 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -392,3 +392,65 @@ jobs:
- name: Clean up temporary tags
run: |
echo "Manifest creation complete. Temporary platform-specific tags can be removed manually if desired."
+
+ - name: Clean up prerelease tags
+ continue-on-error: true
+ env:
+ DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
+ DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
+ RELEASE_VERSION: ${{ steps.version.outputs.version }}
+ run: |
+ set +e # Best-effort: never fail the workflow
+ # Scope deletion to prereleases of THIS version only, so concurrent
+ # prereleases for other versions (and any unrelated prerelease-* tags)
+ # are left untouched.
+ PREFIX="prerelease-v${RELEASE_VERSION}-"
+ echo "Cleaning up ${PREFIX}* tags from Docker Hub..."
+
+ # Authenticate with Docker Hub API (password-based JWT)
+ TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/users/login/" \
+ -H "Content-Type: application/json" \
+ -d "{\"username\": \"${DOCKER_USERNAME}\", \"password\": \"${DOCKER_PASSWORD}\"}" | jq -r '.token')
+
+ if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
+ echo "WARNING: Failed to authenticate with Docker Hub API. Skipping cleanup."
+ exit 0
+ fi
+
+ REPO="${DOCKER_USERNAME}/local-deep-research"
+ PAGE=1
+ DELETED=0
+
+ while true; do
+ RESPONSE=$(curl -s -H "Authorization: JWT ${TOKEN}" \
+ "https://hub.docker.com/v2/repositories/${REPO}/tags/?page=${PAGE}&page_size=100")
+
+ RESULTS=$(echo "$RESPONSE" | jq -r '.results[]?.name // empty')
+ if [ -z "$RESULTS" ]; then
+ break
+ fi
+
+ while IFS= read -r tag; do
+ if [[ "$tag" == "${PREFIX}"* ]]; then
+ echo "Deleting tag: ${tag}"
+ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE \
+ -H "Authorization: JWT ${TOKEN}" \
+ "https://hub.docker.com/v2/repositories/${REPO}/tags/${tag}/")
+ if [ "$HTTP_CODE" -eq 204 ] || [ "$HTTP_CODE" -eq 200 ]; then
+ echo " Deleted: ${tag}"
+ DELETED=$((DELETED + 1))
+ else
+ echo " WARNING: Failed to delete ${tag} (HTTP ${HTTP_CODE})"
+ fi
+ fi
+ done <<< "$RESULTS"
+
+ # Check if there are more pages
+ NEXT=$(echo "$RESPONSE" | jq -r '.next // empty')
+ if [ -z "$NEXT" ]; then
+ break
+ fi
+ PAGE=$((PAGE + 1))
+ done
+
+ echo "Prerelease tag cleanup complete. Deleted ${DELETED} tag(s) matching ${PREFIX}*."
diff --git a/.github/workflows/prerelease-docker.yml b/.github/workflows/prerelease-docker.yml
new file mode 100644
index 0000000000..504150ee52
--- /dev/null
+++ b/.github/workflows/prerelease-docker.yml
@@ -0,0 +1,227 @@
+name: Prerelease Docker Image
+
+# Build a prerelease Docker image for local testing before the official
+# release is published. Triggered exclusively via repository_dispatch from
+# release.yml (after all gates pass and approval is granted).
+#
+# NO workflow_dispatch — security is enforced upstream in release.yml.
+
+on:
+ repository_dispatch:
+ types: [publish-prerelease-docker]
+
+permissions: {} # Minimal top-level for OSSF Scorecard Token-Permissions
+
+jobs:
+ build-amd64:
+ name: Build AMD64 Prerelease Image
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
+ with:
+ egress-policy: audit
+
+ - name: Check out the repo
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+ fetch-depth: 0
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
+
+ - name: Log in to Docker Hub
+ uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - name: Build and push AMD64 image
+ id: build
+ uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
+ with:
+ context: .
+ platforms: linux/amd64
+ push: true
+ tags: ${{ secrets.DOCKER_USERNAME }}/local-deep-research:prerelease-v${{ github.event.client_payload.version }}-${{ github.event.client_payload.short_sha }}-amd64
+ cache-from: type=gha,scope=linux-amd64
+ cache-to: type=gha,mode=max,scope=linux-amd64
+ build-args: |
+ DEPS_HASH=${{ hashFiles('pdm.lock') }}
+
+ build-arm64:
+ name: Build ARM64 Prerelease Image
+ runs-on: ubuntu-24.04-arm
+ permissions:
+ contents: read
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
+ with:
+ egress-policy: audit
+
+ - name: Check out the repo
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+ fetch-depth: 0
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
+
+ - name: Log in to Docker Hub
+ uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - name: Build and push ARM64 image
+ id: build
+ uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
+ with:
+ context: .
+ platforms: linux/arm64
+ push: true
+ tags: ${{ secrets.DOCKER_USERNAME }}/local-deep-research:prerelease-v${{ github.event.client_payload.version }}-${{ github.event.client_payload.short_sha }}-arm64
+ cache-from: type=gha,scope=linux-arm64
+ cache-to: type=gha,mode=max,scope=linux-arm64
+ build-args: |
+ DEPS_HASH=${{ hashFiles('pdm.lock') }}
+
+ security-scan:
+ name: Security Scan
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
+ with:
+ egress-policy: audit
+
+ - name: Check out the repo
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+ fetch-depth: 0
+
+ - name: Free disk space
+ run: |
+ sudo rm -rf /usr/share/dotnet || true
+ sudo rm -rf /usr/local/lib/android || true
+ sudo rm -rf /opt/ghc || true
+ sudo rm -rf /opt/hostedtoolcache/CodeQL || true
+ sudo docker image prune --all --force || true
+ df -h
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
+
+ - name: Build Docker image for security scan
+ uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
+ with:
+ context: .
+ platforms: linux/amd64
+ push: false
+ load: true
+ tags: local-deep-research:security-scan
+ cache-from: type=gha,scope=linux-amd64
+ cache-to: type=gha,mode=max,scope=linux-amd64
+ build-args: |
+ DEPS_HASH=${{ hashFiles('pdm.lock') }}
+
+ # Generate Trivy SARIF for archival as a workflow artifact (all severities, never fails).
+ # Severity-gating happens in the next step.
+ - name: Generate Trivy SARIF report
+ uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
+ with:
+ image-ref: local-deep-research:security-scan
+ format: 'sarif'
+ output: 'trivy-prerelease-scan.sarif'
+ ignore-unfixed: true
+ exit-code: '0'
+ version: 'v0.69.2'
+
+ # Separate scan that fails build only on fixable HIGH/CRITICAL vulnerabilities
+ - name: Check for fixable HIGH/CRITICAL vulnerabilities
+ uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
+ with:
+ image-ref: local-deep-research:security-scan
+ severity: 'CRITICAL,HIGH'
+ ignore-unfixed: true
+ trivyignores: '.trivyignore'
+ exit-code: '1'
+ version: 'v0.69.2'
+
+ - name: Upload Trivy scan results
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ if: always()
+ with:
+ name: trivy-prerelease-scan
+ path: trivy-prerelease-scan.sarif
+ retention-days: 7
+
+ create-manifest:
+ name: Create Multi-Platform Prerelease Manifest
+ needs: [build-amd64, build-arm64, security-scan]
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
+ with:
+ egress-policy: audit
+
+ - name: Check out the repo
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+ fetch-depth: 0
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
+
+ - name: Log in to Docker Hub
+ uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - name: Create and push multi-platform manifest
+ env:
+ DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
+ VERSION: ${{ github.event.client_payload.version }}
+ SHORT_SHA: ${{ github.event.client_payload.short_sha }}
+ run: |
+ set -euo pipefail
+ TAG="prerelease-v${VERSION}-${SHORT_SHA}"
+ echo "Creating manifest for: ${DOCKER_USERNAME}/local-deep-research:${TAG}"
+ docker buildx imagetools create -t "${DOCKER_USERNAME}/local-deep-research:${TAG}" \
+ "${DOCKER_USERNAME}/local-deep-research:${TAG}-amd64" \
+ "${DOCKER_USERNAME}/local-deep-research:${TAG}-arm64"
+ echo "Manifest created successfully"
+
+ - name: Summary
+ env:
+ DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
+ VERSION: ${{ github.event.client_payload.version }}
+ SHORT_SHA: ${{ github.event.client_payload.short_sha }}
+ run: |
+ TAG="prerelease-v${VERSION}-${SHORT_SHA}"
+ {
+ echo "## Prerelease Docker Image"
+ echo ""
+ echo "**Tag:** \`${TAG}\`"
+ echo ""
+ echo '```'
+ echo "docker pull ${DOCKER_USERNAME}/local-deep-research:${TAG}"
+ echo '```'
+ } >> "$GITHUB_STEP_SUMMARY"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f75b4f4715..415bbcb7ea 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -199,6 +199,7 @@ jobs:
outputs:
version: ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.tag }}
+ short_sha: ${{ steps.version.outputs.short_sha }}
release_exists: ${{ steps.check_release.outputs.exists }}
hashes: ${{ steps.hash.outputs.hashes }}
permissions:
@@ -233,6 +234,8 @@ jobs:
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
+ SHORT_SHA="${GITHUB_SHA:0:7}"
+ echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
- name: Check if release already exists
id: check_release
@@ -595,6 +598,40 @@ jobs:
Keep it dense: a short opening paragraph plus bullets, or 2–3 short paragraphs —
whichever fits the material better. Aim for something a user can read in 30 seconds.
+ trigger-prerelease-docker:
+ needs: [build, provenance]
+ if: ${{ !cancelled() && needs.build.result == 'success' && needs.provenance.result == 'success' && needs.build.outputs.release_exists == 'false' }}
+ runs-on: ubuntu-latest
+ environment: release
+ permissions:
+ contents: read
+
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
+ with:
+ egress-policy: audit
+
+ - name: Trigger prerelease Docker build
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ env:
+ RELEASE_VERSION: ${{ needs.build.outputs.version }}
+ SHORT_SHA: ${{ needs.build.outputs.short_sha }}
+ with:
+ # PAT_TOKEN: repository_dispatch requires a PAT (GITHUB_TOKEN cannot trigger workflows)
+ github-token: ${{ secrets.PAT_TOKEN }}
+ script: |
+ await github.rest.repos.createDispatchEvent({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ event_type: 'publish-prerelease-docker',
+ client_payload: {
+ version: process.env.RELEASE_VERSION,
+ short_sha: process.env.SHORT_SHA
+ }
+ });
+ console.log('Triggered prerelease Docker build');
+
trigger-workflows:
needs: [build, create-release]
if: ${{ !cancelled() && needs.build.result == 'success' && needs.create-release.result == 'success' && needs.build.outputs.release_exists == 'false' }}