Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docker-image-backend-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
paths:
- 'scripts/images/datamate-python/**'
- '.github/workflows/docker-image-backend-python.yml'
- '.github/workflows/docker-images-reusable.yml'
pull_request:
branches: [ "main" ]
paths:
- 'scripts/images/datamate-python/**'
- '.github/workflows/docker-image-backend-python.yml'
- '.github/workflows/docker-images-reusable.yml'
workflow_dispatch:
workflow_call:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-image-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
- 'backend/**'
- 'scripts/images/backend/**'
- '.github/workflows/docker-image-backend.yml'
- '.github/workflows/docker-images-reusable.yml'
pull_request:
branches: [ "main" ]
paths:
- 'backend/**'
- 'scripts/images/backend/**'
- '.github/workflows/docker-image-backend.yml'
- '.github/workflows/docker-images-reusable.yml'
workflow_dispatch:
workflow_call:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-image-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
- 'scripts/db/**'
- 'scripts/images/database/**'
- '.github/workflows/docker-image-database.yml'
- '.github/workflows/docker-images-reusable.yml'
pull_request:
branches: [ "main" ]
paths:
- 'scripts/db/**'
- 'scripts/images/database/**'
- '.github/workflows/docker-image-database.yml'
- '.github/workflows/docker-images-reusable.yml'
workflow_dispatch:
workflow_call:

Expand Down
106 changes: 97 additions & 9 deletions .github/workflows/docker-image-deer-flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
workflow_call:

jobs:
build-and-push:
build-and-push-amd:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -41,26 +41,114 @@ jobs:
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=$TAG" >> $GITHUB_OUTPUT
echo "TAGS=amd64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=latest" >> $GITHUB_OUTPUT
echo "TAGS=amd64" >> $GITHUB_OUTPUT
else
echo "TAGS=temp" >> $GITHUB_OUTPUT
echo "TAGS=amd64-temp" >> $GITHUB_OUTPUT
fi

- name: Build Docker Image
run: |
make build-deer-flow VERSION=latest
cp -n runtime/deer-flow/.env.example runtime/deer-flow/.env
cp -n runtime/deer-flow/conf.yaml.example runtime/deer-flow/conf.yaml
docker build -t deer-flow-backend:amd64 . -f scripts/images/deer-flow-backend/Dockerfile
docker build -t deer-flow-frontend:amd64 . -f scripts/images/deer-flow-frontend/Dockerfile

- name: Tag Docker Image
- name: Tag & Push Docker Image
if: github.event_name != 'pull_request'
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
docker tag deer-flow-backend:latest ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker tag deer-flow-frontend:latest ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
docker tag deer-flow-backend:amd64 ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker tag deer-flow-frontend:amd64 ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}


- name: Push Docker Image
build-and-push-arm:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Docker Image Tag
id: set-tag
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=arm64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=arm64" >> $GITHUB_OUTPUT
else
echo "TAGS=arm64-temp" >> $GITHUB_OUTPUT
fi

- name: Build Docker Image
run: |
cp -n runtime/deer-flow/.env.example runtime/deer-flow/.env
cp -n runtime/deer-flow/conf.yaml.example runtime/deer-flow/conf.yaml
docker build -t deer-flow-backend:arm64 . -f scripts/images/deer-flow-backend/Dockerfile
docker build -t deer-flow-frontend:arm64 . -f scripts/images/deer-flow-frontend/Dockerfile

- name: Tag & Push Docker Image
if: github.event_name != 'pull_request'
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
docker tag deer-flow-backend:arm64 ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker tag deer-flow-frontend:arm64 ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker push ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}

manifest:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs: [ build-and-push-amd, build-and-push-arm ]
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Docker Image Tag
id: set-tag
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
BASE_IMAGE=ghcr.io/$LOWERCASE_REPO/datamate-${{ inputs.service_name }}
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=$TAG" >> $GITHUB_OUTPUT
echo "ARM_TAGS=arm64-$TAG" >> $GITHUB_OUTPUT
echo "AMD_TAGS=amd64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=latest" >> $GITHUB_OUTPUT
echo "ARM_TAGS=arm64" >> $GITHUB_OUTPUT
echo "AMD_TAGS=amd64" >> $GITHUB_OUTPUT
else
echo "TAGS=temp" >> $GITHUB_OUTPUT
echo "ARM_TAGS=arm64-temp" >> $GITHUB_OUTPUT
echo "AMD_TAGS=amd64-temp" >> $GITHUB_OUTPUT
fi

- name: Manifest Docker Image
run: |
docker manifest create ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }} \
ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.AMD_TAGS }} \
ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.ARM_TAGS }}
docker manifest push ghcr.io/$LOWERCASE_REPO/deer-flow-backend:${{ steps.set-tag.outputs.TAGS }}
docker manifest create ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }} \
ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.AMD_TAGS }} \
ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.ARM_TAGS }}
docker manifest push ghcr.io/$LOWERCASE_REPO/deer-flow-frontend:${{ steps.set-tag.outputs.TAGS }}
2 changes: 2 additions & 0 deletions .github/workflows/docker-image-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
- 'frontend/**'
- 'scripts/images/frontend/**'
- '.github/workflows/docker-image-frontend.yml'
- '.github/workflows/docker-images-reusable.yml'
pull_request:
branches: [ "main" ]
paths:
- 'frontend/**'
- 'scripts/images/frontend/**'
- '.github/workflows/docker-image-frontend.yml'
- '.github/workflows/docker-images-reusable.yml'
workflow_dispatch:
workflow_call:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-image-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
- 'runtime/python-executor/**'
- 'scripts/images/runtime/**'
- '.github/workflows/docker-image-runtime.yml'
- '.github/workflows/docker-images-reusable.yml'
pull_request:
branches: [ "main" ]
paths:
- 'runtime/ops/**'
- 'runtime/python-executor/**'
- 'scripts/images/runtime/**'
- '.github/workflows/docker-image-runtime.yml'
- '.github/workflows/docker-images-reusable.yml'
workflow_dispatch:
workflow_call:

Expand Down
94 changes: 87 additions & 7 deletions .github/workflows/docker-images-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
type: string

jobs:
build-and-push:
build-and-push-amd:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -35,19 +35,99 @@ jobs:
BASE_IMAGE=ghcr.io/$LOWERCASE_REPO/datamate-${{ inputs.service_name }}
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=$BASE_IMAGE:$TAG" >> $GITHUB_OUTPUT
echo "TAGS=$BASE_IMAGE:amd64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=$BASE_IMAGE:latest" >> $GITHUB_OUTPUT
echo "TAGS=$BASE_IMAGE:amd64" >> $GITHUB_OUTPUT
else
echo "TAGS=$BASE_IMAGE:temp" >> $GITHUB_OUTPUT
echo "TAGS=$BASE_IMAGE:amd64-temp" >> $GITHUB_OUTPUT
fi

- name: Build Docker Image
run: |
make build-${{ inputs.service_name }} VERSION=latest
docker build -t datamate-${{ inputs.service_name }}:amd64 . -f scripts/images/${{ inputs.service_name }}/Dockerfile --platform amd64

- name: Tag & Push Docker Image
if: github.event_name != 'pull_request'
run: |
docker tag datamate-${{ inputs.service_name }}:latest ${{ steps.set-tag.outputs.TAGS }}
docker push ${{ steps.set-tag.outputs.TAGS }}
docker tag datamate-${{ inputs.service_name }}:amd64 ${{ steps.set-tag.outputs.TAGS }}
docker push ${{ steps.set-tag.outputs.TAGS }}

build-and-push-arm:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Docker Image Tag
id: set-tag
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
BASE_IMAGE=ghcr.io/$LOWERCASE_REPO/datamate-${{ inputs.service_name }}
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=$BASE_IMAGE:arm64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=$BASE_IMAGE:arm64" >> $GITHUB_OUTPUT
else
echo "TAGS=$BASE_IMAGE:arm64-temp" >> $GITHUB_OUTPUT
fi

- name: Build Docker Image
run: |
docker build -t datamate-${{ inputs.service_name }}:arm64 . -f scripts/images/${{ inputs.service_name }}/Dockerfile --platform arm64

- name: Tag & Push Docker Image
if: github.event_name != 'pull_request'
run: |
docker tag datamate-${{ inputs.service_name }}:arm64 ${{ steps.set-tag.outputs.TAGS }}
docker push ${{ steps.set-tag.outputs.TAGS }}

manifest:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs: [ build-and-push-amd, build-and-push-arm ]
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Docker Image Tag
id: set-tag
run: |
LOWERCASE_REPO=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
BASE_IMAGE=ghcr.io/$LOWERCASE_REPO/datamate-${{ inputs.service_name }}
if [[ $GITHUB_REF == refs/tags/v* ]]; then
TAG=${GITHUB_REF#refs/tags/v}
echo "TAGS=$BASE_IMAGE:$TAG" >> $GITHUB_OUTPUT
echo "ARM_TAGS=$BASE_IMAGE:arm64-$TAG" >> $GITHUB_OUTPUT
echo "AMD_TAGS=$BASE_IMAGE:amd64-$TAG" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "TAGS=$BASE_IMAGE:latest" >> $GITHUB_OUTPUT
echo "ARM_TAGS=$BASE_IMAGE:arm64" >> $GITHUB_OUTPUT
echo "AMD_TAGS=$BASE_IMAGE:amd64" >> $GITHUB_OUTPUT
else
echo "TAGS=$BASE_IMAGE:temp" >> $GITHUB_OUTPUT
echo "ARM_TAGS=$BASE_IMAGE:arm64-temp" >> $GITHUB_OUTPUT
echo "AMD_TAGS=$BASE_IMAGE:amd64-temp" >> $GITHUB_OUTPUT
fi

- name: Manifest Docker Image
run: |
docker manifest create ${{ steps.set-tag.outputs.TAGS }} \
${{ steps.set-tag.outputs.AMD_TAGS }} \
${{ steps.set-tag.outputs.ARM_TAGS }}
docker manifest push ${{ steps.set-tag.outputs.TAGS }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ runtime-docker-build:

.PHONY: backend-python-docker-build
backend-python-docker-build:
docker build -t datamate-backend-python:$(VERSION) . -f scripts/images/datamate-python/Dockerfile
docker build -t datamate-backend-python:$(VERSION) . -f scripts/images/backend-python/Dockerfile

.PHONY: deer-flow-docker-build
deer-flow-docker-build:
Expand Down