diff --git a/samples/crewai/.github/workflows/deploy.yaml b/samples/crewai/.github/workflows/deploy.yaml index d4f0c5b9..340e947f 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,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 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" 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 diff --git a/samples/crewai/compose.yaml b/samples/crewai/compose.yaml index 2e921477..566b435d 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 # remove sslmode for Playground REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/0 CELERY_RESULT_BACKEND: redis://redis:6379/0 @@ -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 @@ -79,7 +79,7 @@ services: reservations: cpus: '0.5' memory: 512M - llm: + chat: provider: type: model options: