From 48b62166e05744e14edf6078f93392842f94a854 Mon Sep 17 00:00:00 2001 From: jordanstephens Date: Tue, 27 Jan 2026 08:05:30 -0800 Subject: [PATCH 1/9] set SSL_MODE=require for crewai --- samples/crewai/compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/crewai/compose.yaml b/samples/crewai/compose.yaml index 2e921477..e6bd2c1e 100644 --- a/samples/crewai/compose.yaml +++ b/samples/crewai/compose.yaml @@ -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 REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/0 CELERY_RESULT_BACKEND: redis://redis:6379/0 @@ -70,7 +70,7 @@ services: - 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 REDIS_URL: redis://redis:6379/0 OPENAI_API_KEY: defang DJANGO_SECRET_KEY: null From 843f6e58178449f20b1bc1cd1a97cabb2ff391ca Mon Sep 17 00:00:00 2001 From: jordanstephens Date: Tue, 27 Jan 2026 08:07:39 -0800 Subject: [PATCH 2/9] print deployment summary in new step --- samples/crewai/.github/workflows/deploy.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/crewai/.github/workflows/deploy.yaml b/samples/crewai/.github/workflows/deploy.yaml index d4f0c5b9..e1c2ad00 100644 --- a/samples/crewai/.github/workflows/deploy.yaml +++ b/samples/crewai/.github/workflows/deploy.yaml @@ -25,3 +25,7 @@ jobs: 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 From 61530e5c9a70f16cfaf800c341e93a59737952f9 Mon Sep 17 00:00:00 2001 From: jordanstephens Date: Tue, 27 Jan 2026 08:06:07 -0800 Subject: [PATCH 3/9] crewai set config-vars-init-random --- samples/crewai/.github/workflows/deploy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/crewai/.github/workflows/deploy.yaml b/samples/crewai/.github/workflows/deploy.yaml index e1c2ad00..96f5bde2 100644 --- a/samples/crewai/.github/workflows/deploy.yaml +++ b/samples/crewai/.github/workflows/deploy.yaml @@ -21,6 +21,7 @@ jobs: uses: DefangLabs/defang-github-action@v1.3.2 with: config-env-vars: DJANGO_SECRET_KEY POSTGRES_PASSWORD SSL_MODE + config-vars-init-random: DJANGO_SECRET_KEY POSTGRES_PASSWORD env: DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }} POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} From ce3ad90ed000053abd2aa852ea86c0422784e016 Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Tue, 27 Jan 2026 10:53:09 -0800 Subject: [PATCH 4/9] Update samples/crewai/compose.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lio李歐 --- samples/crewai/compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/crewai/compose.yaml b/samples/crewai/compose.yaml index e6bd2c1e..3ddc2b90 100644 --- a/samples/crewai/compose.yaml +++ b/samples/crewai/compose.yaml @@ -38,7 +38,7 @@ services: - redis environment: DJANGO_SETTINGS_MODULE: config.settings - DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=require + 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 From 58a80f1a0a0311c53549f4129725c1e1cebee31f Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Tue, 27 Jan 2026 10:53:19 -0800 Subject: [PATCH 5/9] Update samples/crewai/compose.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lio李歐 --- samples/crewai/compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/crewai/compose.yaml b/samples/crewai/compose.yaml index 3ddc2b90..54703c6a 100644 --- a/samples/crewai/compose.yaml +++ b/samples/crewai/compose.yaml @@ -70,7 +70,7 @@ services: - embedding environment: DJANGO_SETTINGS_MODULE: config.settings - DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=require + 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 From fe5cdd0dad22d3136cd1e1e4a17cf6bd2bf14539 Mon Sep 17 00:00:00 2001 From: jordanstephens Date: Tue, 27 Jan 2026 22:14:38 -0500 Subject: [PATCH 6/9] support down from deploy workflow --- samples/crewai/.github/workflows/deploy.yaml | 18 ++++++++++++++--- samples/crewai/.github/workflows/down.yaml | 21 -------------------- 2 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 samples/crewai/.github/workflows/down.yaml diff --git a/samples/crewai/.github/workflows/deploy.yaml b/samples/crewai/.github/workflows/deploy.yaml index 96f5bde2..7e0099e0 100644 --- a/samples/crewai/.github/workflows/deploy.yaml +++ b/samples/crewai/.github/workflows/deploy.yaml @@ -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: @@ -17,11 +28,12 @@ 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@main with: config-env-vars: DJANGO_SECRET_KEY POSTGRES_PASSWORD SSL_MODE 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 }} diff --git a/samples/crewai/.github/workflows/down.yaml b/samples/crewai/.github/workflows/down.yaml deleted file mode 100644 index b0f09300..00000000 --- a/samples/crewai/.github/workflows/down.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Down - -on: - workflow_dispatch: - -jobs: - deploy: - environment: production - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - command: "down" From 45a2c428caacfc4c700878b1a8b301fd39ac99be Mon Sep 17 00:00:00 2001 From: jordanstephens Date: Tue, 27 Jan 2026 22:14:58 -0500 Subject: [PATCH 7/9] remove 1-click button from readme --- samples/crewai/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/crewai/README.md b/samples/crewai/README.md index 0af413ea..1212b75c 100644 --- a/samples/crewai/README.md +++ b/samples/crewai/README.md @@ -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 From fbc35aaf78fba0a461cf1f46ee957a7027754959 Mon Sep 17 00:00:00 2001 From: jordanstephens Date: Tue, 27 Jan 2026 22:16:31 -0500 Subject: [PATCH 8/9] generate random secrets automatically --- samples/crewai/.github/workflows/deploy.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/crewai/.github/workflows/deploy.yaml b/samples/crewai/.github/workflows/deploy.yaml index 7e0099e0..340e947f 100644 --- a/samples/crewai/.github/workflows/deploy.yaml +++ b/samples/crewai/.github/workflows/deploy.yaml @@ -29,15 +29,14 @@ jobs: uses: actions/checkout@v4 - name: Defang ${{ github.event.inputs.action }} - uses: DefangLabs/defang-github-action@main + 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: From d3f67817f3c9c7c620b850f8806ca9266591d046 Mon Sep 17 00:00:00 2001 From: jordanstephens Date: Tue, 27 Jan 2026 22:17:48 -0500 Subject: [PATCH 9/9] rename llm service to chat --- samples/crewai/compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/crewai/compose.yaml b/samples/crewai/compose.yaml index 54703c6a..566b435d 100644 --- a/samples/crewai/compose.yaml +++ b/samples/crewai/compose.yaml @@ -66,7 +66,7 @@ services: depends_on: - postgres - redis - - llm + - chat - embedding environment: DJANGO_SETTINGS_MODULE: config.settings @@ -79,7 +79,7 @@ services: reservations: cpus: '0.5' memory: 512M - llm: + chat: provider: type: model options: