mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Create khoj computer via cloud build. Add computer to docker-compose.yml
This commit is contained in:
29
.github/workflows/dockerize.yml
vendored
29
.github/workflows/dockerize.yml
vendored
@@ -12,6 +12,7 @@ on:
|
|||||||
- pyproject.toml
|
- pyproject.toml
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- prod.Dockerfile
|
- prod.Dockerfile
|
||||||
|
- computer.Dockerfile
|
||||||
- docker-compose.yml
|
- docker-compose.yml
|
||||||
- .github/workflows/dockerize.yml
|
- .github/workflows/dockerize.yml
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -27,6 +28,10 @@ on:
|
|||||||
description: 'Build Khoj cloud docker image'
|
description: 'Build Khoj cloud docker image'
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
|
khoj-computer:
|
||||||
|
description: 'Build computer for Khoj'
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Tag Image with tag name on release
|
# Tag Image with tag name on release
|
||||||
@@ -115,6 +120,21 @@ jobs:
|
|||||||
org.opencontainers.image.description=Khoj AI Cloud - Your second brain powered by LLMs and Neural Search
|
org.opencontainers.image.description=Khoj AI Cloud - Your second brain powered by LLMs and Neural Search
|
||||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||||
|
|
||||||
|
- name: 📦️️💻 Build and Push Computer for Khoj
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
if: github.event_name == 'workflow_dispatch' && github.event.inputs.khoj-computer == 'true'
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: computer.Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ghcr.io/${{ github.repository }}-computer:${{ env.DOCKER_IMAGE_TAG }}-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
|
||||||
|
cache-from: type=gha,scope=computer-${{ matrix.platform }}
|
||||||
|
cache-to: type=gha,mode=max,scope=computer-${{ matrix.platform }}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.description=Khoj AI Computer - A computer for your second brain to operate
|
||||||
|
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||||
|
|
||||||
manifest:
|
manifest:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -147,3 +167,12 @@ jobs:
|
|||||||
-t ghcr.io/${{ github.repository }}-cloud:${{ github.ref_type == 'tag' && 'latest' || env.DOCKER_IMAGE_TAG }} \
|
-t ghcr.io/${{ github.repository }}-cloud:${{ github.ref_type == 'tag' && 'latest' || env.DOCKER_IMAGE_TAG }} \
|
||||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
||||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
||||||
|
|
||||||
|
- name: Create and Push Computer Manifest
|
||||||
|
if: github.event.inputs.khoj-computer == 'true'
|
||||||
|
run: |
|
||||||
|
docker buildx imagetools create \
|
||||||
|
-t ghcr.io/${{ github.repository }}-computer:${{ env.DOCKER_IMAGE_TAG }} \
|
||||||
|
-t ghcr.io/${{ github.repository }}-computer:${{ github.ref_type == 'tag' && 'latest' || env.DOCKER_IMAGE_TAG }} \
|
||||||
|
ghcr.io/${{ github.repository }}-computer:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
||||||
|
ghcr.io/${{ github.repository }}-computer:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
||||||
|
|||||||
@@ -25,6 +25,14 @@ services:
|
|||||||
- khoj_search:/etc/searxng
|
- khoj_search:/etc/searxng
|
||||||
environment:
|
environment:
|
||||||
- SEARXNG_BASE_URL=http://localhost:8080/
|
- SEARXNG_BASE_URL=http://localhost:8080/
|
||||||
|
# Creates Computer for Khoj to use.
|
||||||
|
# Set KHOJ_OPERATOR_ENABLED=True in the server service environment variable to enable.
|
||||||
|
computer:
|
||||||
|
image: ghcr.io/khoj-ai/computer:latest
|
||||||
|
ports:
|
||||||
|
- "5900:5900"
|
||||||
|
volumes:
|
||||||
|
- khoj_computer:/home/operator
|
||||||
server:
|
server:
|
||||||
depends_on:
|
depends_on:
|
||||||
database:
|
database:
|
||||||
@@ -75,6 +83,8 @@ services:
|
|||||||
# - GEMINI_API_KEY=your_gemini_api_key
|
# - GEMINI_API_KEY=your_gemini_api_key
|
||||||
# - ANTHROPIC_API_KEY=your_anthropic_api_key
|
# - ANTHROPIC_API_KEY=your_anthropic_api_key
|
||||||
#
|
#
|
||||||
|
# Uncomment line below to enable Khoj to use its computer.
|
||||||
|
# - KHOJ_OPERATOR_ENABLED=True
|
||||||
# Uncomment appropriate lines below to enable web results with Khoj
|
# Uncomment appropriate lines below to enable web results with Khoj
|
||||||
# Ensure you set your provider specific API keys.
|
# Ensure you set your provider specific API keys.
|
||||||
# ---
|
# ---
|
||||||
@@ -112,3 +122,4 @@ volumes:
|
|||||||
khoj_db:
|
khoj_db:
|
||||||
khoj_models:
|
khoj_models:
|
||||||
khoj_search:
|
khoj_search:
|
||||||
|
khoj_computer:
|
||||||
|
|||||||
Reference in New Issue
Block a user