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
26 changes: 21 additions & 5 deletions samples/crewai/.github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ on:
push:
branches:
- main
workflow_dispatch:
inputs:
action:
description: "Whether to deploy up or down"
required: true
default: "up"
type: choice
options:
- up
- down

jobs:
deploy:
defang:
name: Defang ${{ github.event.inputs.action }}
environment: production
runs-on: ubuntu-latest
permissions:
Expand All @@ -17,11 +28,16 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Deploy
uses: DefangLabs/defang-github-action@v1.3.2
- name: Defang ${{ github.event.inputs.action }}
uses: DefangLabs/defang-github-action@v1.4.0
with:
config-env-vars: DJANGO_SECRET_KEY POSTGRES_PASSWORD SSL_MODE
cli-version: nightly # for config-vars-init-random
config-vars-init-random: DJANGO_SECRET_KEY POSTGRES_PASSWORD
command: ${{ github.event.inputs.action }}
env:
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
SSL_MODE: ${{ secrets.SSL_MODE }}
- name: Deployment Summary
uses: DefangLabs/defang-github-action@v1.3.2
with:
command: services
21 changes: 0 additions & 21 deletions samples/crewai/.github/workflows/down.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions samples/crewai/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Crew.ai Django Sample

[![1-click-deploy](https://raw.githubusercontent.com/DefangLabs/defang-assets/main/Logos/Buttons/SVG/deploy-with-defang.svg)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-crew-django-redis-postgres-template%26template_owner%3DDefangSamples)

This sample shows how to use Crew.ai with a Django application. It provides a simple web interface that allows users to input text and receive a summary of the text in real-time using Django Channels with a Redis broker. It uses Celery to handle the Crew.ai tasks in the background with Redis as a broker. It uses Postgres as the database for Django.

## Prerequisites
Expand Down
8 changes: 4 additions & 4 deletions samples/crewai/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
- redis
environment:
DJANGO_SETTINGS_MODULE: config.settings
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=${SSL_MODE}
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=require # remove sslmode for Playground
REDIS_URL: redis://redis:6379/0
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
Expand Down Expand Up @@ -66,11 +66,11 @@ services:
depends_on:
- postgres
- redis
- llm
- chat
- embedding
environment:
DJANGO_SETTINGS_MODULE: config.settings
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=${SSL_MODE}
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=require # remove sslmode for Playground
REDIS_URL: redis://redis:6379/0
OPENAI_API_KEY: defang
DJANGO_SECRET_KEY: null
Expand All @@ -79,7 +79,7 @@ services:
reservations:
cpus: '0.5'
memory: 512M
llm:
chat:
provider:
type: model
options:
Expand Down
Loading