diff --git a/samples/agentic-autogen/.github/workflows/deploy.yaml b/samples/agentic-autogen/.github/workflows/deploy.yaml index 4a1f6224..dd64ec1d 100644 --- a/samples/agentic-autogen/.github/workflows/deploy.yaml +++ b/samples/agentic-autogen/.github/workflows/deploy.yaml @@ -4,22 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-agentic-autogen-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: MISTRAL_API_KEY + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: MISTRAL_API_KEY - env: - MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/agentic-autogen/compose.yaml b/samples/agentic-autogen/compose.yaml index 1dc22e36..4dc40a24 100644 --- a/samples/agentic-autogen/compose.yaml +++ b/samples/agentic-autogen/compose.yaml @@ -5,21 +5,21 @@ services: context: ./src dockerfile: Dockerfile ports: - - 3000:3000 + - 3000:3000 environment: - - MISTRAL_API_KEY=${MISTRAL_API_KEY} + - MISTRAL_API_KEY=${MISTRAL_API_KEY} restart: unless-stopped healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/health + - CMD + - curl + - -f + - http://localhost:3000/health interval: 30s timeout: 10s retries: 3 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/agentic-langgraph/.github/workflows/deploy.yaml b/samples/agentic-langgraph/.github/workflows/deploy.yaml index 48cda604..1880dbfe 100644 --- a/samples/agentic-langgraph/.github/workflows/deploy.yaml +++ b/samples/agentic-langgraph/.github/workflows/deploy.yaml @@ -4,22 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-agentic-langgraph-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: TAVILY_API_KEY + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: TAVILY_API_KEY - env: - TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }} + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/agentic-langgraph/compose.yaml b/samples/agentic-langgraph/compose.yaml index d11c64ac..c4dd39e2 100644 --- a/samples/agentic-langgraph/compose.yaml +++ b/samples/agentic-langgraph/compose.yaml @@ -5,30 +5,30 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 3000 - published: 3000 - mode: ingress + - target: 3000 + published: 3000 + mode: ingress environment: TAVILY_API_KEY: null LLM_URL: http://llm/api/v1/ LLM_MODEL: default OPENAI_API_KEY: FAKE_TOKEN depends_on: - - llm + - llm deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M llm: environment: - - OPENAI_API_KEY=FAKE_TOKEN + - OPENAI_API_KEY=FAKE_TOKEN image: defangio/openai-access-gateway:latest ports: - - target: 80 - published: 80 - protocol: tcp - mode: host + - target: 80 + published: 80 + protocol: tcp + mode: host x-defang-llm: true deploy: resources: diff --git a/samples/agentic-strands/.github/workflows/deploy.yaml b/samples/agentic-strands/.github/workflows/deploy.yaml index 13bd872a..6ff858be 100644 --- a/samples/agentic-strands/.github/workflows/deploy.yaml +++ b/samples/agentic-strands/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-agentic-strands-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/agentic-strands/compose.yaml b/samples/agentic-strands/compose.yaml index f9b145ef..3b1eb67b 100644 --- a/samples/agentic-strands/compose.yaml +++ b/samples/agentic-strands/compose.yaml @@ -4,40 +4,40 @@ services: build: context: ./app ports: - - target: 5001 - published: 5001 - mode: ingress + - target: 5001 + published: 5001 + mode: ingress environment: LLM_URL: http://llm/api/v1/ LLM_MODEL: default OPENAI_API_KEY: SAMPLE_TOKEN healthcheck: test: - - CMD - - python3 - - -c - - import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:5001/health').status - == 200 else exit(1) + - CMD + - python3 + - -c + - import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:5001/health').status + == 200 else exit(1) interval: 30s timeout: 5s retries: 3 start_period: 10s depends_on: - - llm + - llm deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M llm: environment: OPENAI_API_KEY: SAMPLE_TOKEN image: defangio/openai-access-gateway ports: - - target: 80 - published: 80 - protocol: tcp - mode: host + - target: 80 + published: 80 + protocol: tcp + mode: host x-defang-llm: true deploy: resources: diff --git a/samples/angular-express/.github/workflows/deploy.yaml b/samples/angular-express/.github/workflows/deploy.yaml index 2a70f343..e724d51d 100644 --- a/samples/angular-express/.github/workflows/deploy.yaml +++ b/samples/angular-express/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-angular-express-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/angular-express/compose.yaml b/samples/angular-express/compose.yaml index dfc59827..17df9a28 100644 --- a/samples/angular-express/compose.yaml +++ b/samples/angular-express/compose.yaml @@ -4,25 +4,25 @@ services: build: context: ./frontend ports: - - target: 80 - published: 80 - mode: ingress + - target: 80 + published: 80 + mode: ingress restart: unless-stopped deploy: resources: reservations: memory: 64M depends_on: - - backend + - backend backend: build: context: ./backend ports: - - target: 3000 - published: 3000 - mode: ingress + - target: 3000 + published: 3000 + mode: ingress environment: - - PORT=3000 + - PORT=3000 restart: unless-stopped deploy: resources: diff --git a/samples/arduino-wifi/.github/workflows/deploy.yaml b/samples/arduino-wifi/.github/workflows/deploy.yaml index 13bd872a..6676a741 100644 --- a/samples/arduino-wifi/.github/workflows/deploy.yaml +++ b/samples/arduino-wifi/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-arduino-wifi-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/arduino-wifi/compose.yaml b/samples/arduino-wifi/compose.yaml index 4f363fe7..b4311914 100644 --- a/samples/arduino-wifi/compose.yaml +++ b/samples/arduino-wifi/compose.yaml @@ -8,16 +8,16 @@ services: deploy: resources: reservations: - cpus: '1.0' + cpus: "1.0" memory: 512M ports: - - mode: ingress - target: 8081 - published: 8081 + - mode: ingress + target: 8081 + published: 8081 healthcheck: test: - - CMD - - python3 - - -c - - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() - - http://localhost:8081/ + - CMD + - python3 + - -c + - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() + - http://localhost:8081/ diff --git a/samples/bullmq-bullboard-redis/.github/workflows/deploy.yaml b/samples/bullmq-bullboard-redis/.github/workflows/deploy.yaml index 2a70f343..c933c947 100644 --- a/samples/bullmq-bullboard-redis/.github/workflows/deploy.yaml +++ b/samples/bullmq-bullboard-redis/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-bullmq-bullboard-redis-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/bullmq-bullboard-redis/compose.yaml b/samples/bullmq-bullboard-redis/compose.yaml index b7969095..ee5f6ccf 100644 --- a/samples/bullmq-bullboard-redis/compose.yaml +++ b/samples/bullmq-bullboard-redis/compose.yaml @@ -6,25 +6,25 @@ services: context: ./board dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 environment: - - REDIS=redis://redisx:6379 - - BOARD_PASSWORD - - QUEUE + - REDIS=redis://redisx:6379 + - BOARD_PASSWORD + - QUEUE healthcheck: test: - - CMD - - curl - - -f - - 127.0.0.1:3000 + - CMD + - curl + - -f + - 127.0.0.1:3000 depends_on: - - redisx + - redisx deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M api: restart: unless-stopped @@ -32,24 +32,24 @@ services: context: ./api dockerfile: Dockerfile ports: - - mode: ingress - target: 3001 - published: 3001 + - mode: ingress + target: 3001 + published: 3001 environment: - - REDIS=redis://redisx:6379 - - QUEUE + - REDIS=redis://redisx:6379 + - QUEUE healthcheck: test: - - CMD - - curl - - -f - - 127.0.0.1:3001 + - CMD + - curl + - -f + - 127.0.0.1:3001 depends_on: - - redisx + - redisx deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M worker: restart: unless-stopped @@ -57,25 +57,25 @@ services: replicas: 1 resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M build: context: ./worker dockerfile: Dockerfile environment: - - REDIS=redis://redisx:6379 - - QUEUE + - REDIS=redis://redisx:6379 + - QUEUE depends_on: - - redisx + - redisx redisx: image: redis:6.2 x-defang-redis: true restart: unless-stopped ports: - - mode: host - target: 6379 + - mode: host + target: 6379 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/crewai/.github/workflows/deploy.yaml b/samples/crewai/.github/workflows/deploy.yaml index 48a0db5a..8c19923c 100644 --- a/samples/crewai/.github/workflows/deploy.yaml +++ b/samples/crewai/.github/workflows/deploy.yaml @@ -4,24 +4,56 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-crewai-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + cli-version: nightly # for config-vars-init-random + # Defang will initialize these config vars with random secrets + # If you wish to provide your own secrets: + # 1. Set them in the repo secrets, + # 2. Remove them from the `config-vars-init-random` list + # 3. Add them to the `config-env-vars` list below + config-vars-init-random: DJANGO_SECRET_KEY POSTGRES_PASSWORD + config-env-vars: SSL_MODE + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }} + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + SSL_MODE: require - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: DJANGO_SECRET_KEY POSTGRES_PASSWORD SSL_MODE - env: - DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }} - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - SSL_MODE: ${{ secrets.SSL_MODE }} \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services 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/app/core/ai_clients.py b/samples/crewai/app/core/ai_clients.py index f93e520f..9326ebd2 100644 --- a/samples/crewai/app/core/ai_clients.py +++ b/samples/crewai/app/core/ai_clients.py @@ -1,14 +1,16 @@ -from openai import OpenAI import os +from openai import OpenAI + + def get_llm_client(): - url = os.getenv("LLM_URL") - model = os.getenv("LLM_MODEL") + url = os.getenv("CHAT_URL") + model = os.getenv("CHAT_MODEL") # we check for url and model because these come together # with the docker runner if not url or not model: - raise ValueError("LLM_URL and LLM_MODEL must be set") + raise ValueError("CHAT_URL and CHAT_MODEL must be set") client = OpenAI(base_url=url) return client @@ -23,4 +25,3 @@ def get_embedding_client(): raise ValueError("EMBEDDING_URL and EMBEDDING_MODEL must be set") client = OpenAI(base_url=url) return client - \ No newline at end of file diff --git a/samples/crewai/app/core/custom_llm.py b/samples/crewai/app/core/custom_llm.py index 4d232343..a9884864 100644 --- a/samples/crewai/app/core/custom_llm.py +++ b/samples/crewai/app/core/custom_llm.py @@ -1,19 +1,21 @@ +import os from typing import Any, Dict, List, Optional, Union + from crewai.llms.base_llm import BaseLLM -import os + from .ai_clients import get_llm_client -LLM_MODEL = os.getenv("LLM_MODEL") +CHAT_MODEL = os.getenv("CHAT_MODEL") class DockerRunnerLLM(BaseLLM): """ Custom LLM that uses the OpenAI-compatible API. - Implements CrewAI's BaseLLM interface. We create this because the + Implements CrewAI's BaseLLM interface. We create this because the Docker Model Runner is not yet supported by CrewAI, because LiteLLM doesn't recognize the format in which the Docker Model Runner names the models. """ - def __init__(self, model: str = LLM_MODEL): + def __init__(self, model: str = CHAT_MODEL): super().__init__(model=model) if not model or not isinstance(model, str): raise ValueError("Invalid model: must be a non-empty string") diff --git a/samples/crewai/app/core/templates/core/home.html b/samples/crewai/app/core/templates/core/home.html index 6067db58..24951c8e 100644 --- a/samples/crewai/app/core/templates/core/home.html +++ b/samples/crewai/app/core/templates/core/home.html @@ -2,7 +2,7 @@ - Defang WebSocket Demo + Defang CrewAI Demo {% load static %} diff --git a/samples/crewai/compose.local.yaml b/samples/crewai/compose.local.yaml index e6f7ba35..e18c116b 100644 --- a/samples/crewai/compose.local.yaml +++ b/samples/crewai/compose.local.yaml @@ -36,7 +36,7 @@ services: DATABASE_URL: postgres://postgres:password@postgres:5432/postgres DJANGO_SECRET_KEY: 5k6qi_gzy65bz2soxl6k(rsrw)0z3ws!zmjzsbe+wkp1ovfayg - llm: + chat: provider: type: model options: diff --git a/samples/crewai/compose.yaml b/samples/crewai/compose.yaml index 2e921477..56cfb8d7 100644 --- a/samples/crewai/compose.yaml +++ b/samples/crewai/compose.yaml @@ -6,25 +6,25 @@ services: POSTGRES_PASSWORD: null x-defang-postgres: true ports: - - mode: host - target: 5432 - published: 5432 + - mode: host + target: 5432 + published: 5432 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M redis: image: redis:6.2 x-defang-redis: true ports: - - mode: host - target: 6379 - published: 6379 + - mode: host + target: 6379 + published: 6379 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M app: build: @@ -32,10 +32,10 @@ services: dockerfile: Dockerfile command: ./run.sh ports: - - 8000:8000 + - 8000:8000 depends_on: - - postgres - - redis + - postgres + - redis environment: DJANGO_SETTINGS_MODULE: config.settings DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=${SSL_MODE} @@ -43,20 +43,21 @@ services: CELERY_BROKER_URL: redis://redis:6379/0 CELERY_RESULT_BACKEND: redis://redis:6379/0 DJANGO_SECRET_KEY: null + SSL_MODE: null healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8000/ - interval: 30s - timeout: 10s + - CMD + - curl + - -f + - http://localhost:8000/ + interval: 5s + timeout: 2s retries: 10 - start_period: 60s + start_period: 10s deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M worker: build: @@ -64,22 +65,23 @@ services: dockerfile: Dockerfile command: celery -A config worker -l info depends_on: - - postgres - - redis - - llm - - embedding + - postgres + - redis + - chat + - embedding environment: DJANGO_SETTINGS_MODULE: config.settings DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=${SSL_MODE} REDIS_URL: redis://redis:6379/0 OPENAI_API_KEY: defang DJANGO_SECRET_KEY: null + SSL_MODE: null deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M - llm: + chat: provider: type: model options: @@ -87,11 +89,10 @@ services: x-defang-llm: true environment: OPENAI_API_KEY: defang - DEBUG: 'true' deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M embedding: provider: @@ -101,9 +102,8 @@ services: x-defang-llm: true environment: OPENAI_API_KEY: defang - DEBUG: 'true' deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/csharp-dotnet/.github/workflows/deploy.yaml b/samples/csharp-dotnet/.github/workflows/deploy.yaml index 2a70f343..b899355d 100644 --- a/samples/csharp-dotnet/.github/workflows/deploy.yaml +++ b/samples/csharp-dotnet/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-csharp-dotnet-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/csharp-dotnet/compose.yaml b/samples/csharp-dotnet/compose.yaml index 2cebac4a..4a495396 100644 --- a/samples/csharp-dotnet/compose.yaml +++ b/samples/csharp-dotnet/compose.yaml @@ -6,11 +6,11 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 80 - published: 8080 - mode: ingress + - target: 80 + published: 8080 + mode: ingress deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/django-celery/.github/workflows/deploy.yaml b/samples/django-celery/.github/workflows/deploy.yaml index 09614864..64d49660 100644 --- a/samples/django-celery/.github/workflows/deploy.yaml +++ b/samples/django-celery/.github/workflows/deploy.yaml @@ -4,23 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-django-celery-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: POSTGRES_PASSWORD SECRET_KEY + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: POSTGRES_PASSWORD SECRET_KEY - env: - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - SECRET_KEY: ${{ secrets.SECRET_KEY }} \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/django-celery/compose.yaml b/samples/django-celery/compose.yaml index 016f6651..0d145065 100644 --- a/samples/django-celery/compose.yaml +++ b/samples/django-celery/compose.yaml @@ -6,23 +6,23 @@ services: context: ./app dockerfile: Dockerfile environment: - - SECRET_KEY - - REDIS_URL=redis://broker:6379/0 - - POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres + - SECRET_KEY + - REDIS_URL=redis://broker:6379/0 + - POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres depends_on: - - database - - migrate - - broker + - database + - migrate + - broker ports: - - mode: ingress - target: 8000 - published: 8000 + - mode: ingress + target: 8000 + published: 8000 healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8000/health/ + - CMD + - curl + - -f + - http://localhost:8000/health/ interval: 30s timeout: 10s retries: 3 @@ -30,24 +30,24 @@ services: deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M migrate: - restart: 'no' + restart: "no" build: context: ./app dockerfile: Dockerfile environment: - - SECRET_KEY - - REDIS_URL=redis://broker:6379/0 - - POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres + - SECRET_KEY + - REDIS_URL=redis://broker:6379/0 + - POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres depends_on: - - database + - database command: python manage.py migrate deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M worker: restart: unless-stopped @@ -55,57 +55,57 @@ services: context: ./app dockerfile: Dockerfile environment: - - SECRET_KEY - - REDIS_URL=redis://broker:6379/0 - - POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres + - SECRET_KEY + - REDIS_URL=redis://broker:6379/0 + - POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres depends_on: - - database - - broker - - migrate + - database + - broker + - migrate command: celery -A django_celery worker --loglevel=info deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M database: image: postgres:16 x-defang-postgres: true ports: - - mode: host - target: 5432 - published: 5432 + - mode: host + target: 5432 + published: 5432 environment: - - POSTGRES_PASSWORD + - POSTGRES_PASSWORD healthcheck: test: - - CMD-SHELL - - pg_isready -U postgres + - CMD-SHELL + - pg_isready -U postgres interval: 10s timeout: 5s retries: 5 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M broker: image: redis:7.1 x-defang-redis: true ports: - - mode: host - target: 6379 - published: 6379 + - mode: host + target: 6379 + published: 6379 healthcheck: test: - - CMD - - redis-cli - - ping + - CMD + - redis-cli + - ping interval: 10s timeout: 5s retries: 5 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/django-postgres/.github/workflows/deploy.yaml b/samples/django-postgres/.github/workflows/deploy.yaml index 173777c3..319f12cf 100644 --- a/samples/django-postgres/.github/workflows/deploy.yaml +++ b/samples/django-postgres/.github/workflows/deploy.yaml @@ -4,24 +4,49 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-django-postgres-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: POSTGRES_PASSWORD SECRET_KEY ALLOWED_HOSTS + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + SECRET_KEY: ${{ secrets.SECRET_KEY }} + ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: POSTGRES_PASSWORD SECRET_KEY ALLOWED_HOSTS - env: - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - SECRET_KEY: ${{ secrets.SECRET_KEY }} - ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }} \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/django-postgres/compose.yaml b/samples/django-postgres/compose.yaml index 77ce6eab..92dcde90 100644 --- a/samples/django-postgres/compose.yaml +++ b/samples/django-postgres/compose.yaml @@ -5,37 +5,37 @@ services: image: postgres:16 x-defang-postgres: true environment: - - POSTGRES_DB=django - - POSTGRES_USER=django - - POSTGRES_PASSWORD + - POSTGRES_DB=django + - POSTGRES_USER=django + - POSTGRES_PASSWORD ports: - - mode: host - target: 5432 - published: 5432 + - mode: host + target: 5432 + published: 5432 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M django: restart: unless-stopped build: ./app ports: - - mode: ingress - target: 8000 - published: 8000 + - mode: ingress + target: 8000 + published: 8000 environment: - - DB_HOST=db - - DEBUG=False - - POSTGRES_USER=django - - POSTGRES_DB=django - - POSTGRES_PASSWORD - - SECRET_KEY - - ALLOWED_HOSTS + - DB_HOST=db + - DEBUG=False + - POSTGRES_USER=django + - POSTGRES_DB=django + - POSTGRES_PASSWORD + - SECRET_KEY + - ALLOWED_HOSTS depends_on: - - db + - db deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/django-railpack/.github/workflows/deploy.yaml b/samples/django-railpack/.github/workflows/deploy.yaml index 2a70f343..1619077d 100644 --- a/samples/django-railpack/.github/workflows/deploy.yaml +++ b/samples/django-railpack/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-django-railpack-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/django-railpack/compose.yaml b/samples/django-railpack/compose.yaml index 5130c432..50cc5d80 100644 --- a/samples/django-railpack/compose.yaml +++ b/samples/django-railpack/compose.yaml @@ -5,15 +5,15 @@ services: build: context: ./app ports: - - mode: ingress - target: 8000 + - mode: ingress + target: 8000 environment: - - DEBUG=False + - DEBUG=False command: - - python manage.py migrate && python manage.py createsuperauto && gunicorn defang_sample.wsgi:application - --bind 0.0.0.0:8000 + - python manage.py migrate && python manage.py createsuperauto && gunicorn defang_sample.wsgi:application + --bind 0.0.0.0:8000 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/django-redis-postgres/.github/workflows/deploy.yaml b/samples/django-redis-postgres/.github/workflows/deploy.yaml index 2befba4a..206839f6 100644 --- a/samples/django-redis-postgres/.github/workflows/deploy.yaml +++ b/samples/django-redis-postgres/.github/workflows/deploy.yaml @@ -4,22 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-django-redis-postgres-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: SECRET_KEY POSTGRES_PASSWORD + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + SECRET_KEY: ${{ secrets.SECRET_KEY }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: SECRET_KEY POSTGRES_PASSWORD - env: - SECRET_KEY: ${{ secrets.SECRET_KEY }} - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/django-redis-postgres/compose.yaml b/samples/django-redis-postgres/compose.yaml index cda82f6d..ab05a6c5 100644 --- a/samples/django-redis-postgres/compose.yaml +++ b/samples/django-redis-postgres/compose.yaml @@ -5,67 +5,67 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 8000 - published: 8000 - mode: ingress + - target: 8000 + published: 8000 + mode: ingress environment: - - REDIS_URL=redis://redis-service:6379 - - POSTGRES_URL=postgres://djangouser:${POSTGRES_PASSWORD}@postgres-service:5432/djangodatabase? - - SECRET_KEY + - REDIS_URL=redis://redis-service:6379 + - POSTGRES_URL=postgres://djangouser:${POSTGRES_PASSWORD}@postgres-service:5432/djangodatabase? + - SECRET_KEY healthcheck: test: - - CMD - - python3 - - -c - - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() - - http://localhost:8000/ + - CMD + - python3 + - -c + - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() + - http://localhost:8000/ interval: 10s depends_on: - - redis-service - - postgres-service - - migrate + - redis-service + - postgres-service + - migrate deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M redis-service: image: redis:6.2 ports: - - mode: host - target: 6379 + - mode: host + target: 6379 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M migrate: - restart: 'no' + restart: "no" build: context: ./app dockerfile: Dockerfile command: python manage.py migrate depends_on: - - postgres-service + - postgres-service environment: - - POSTGRES_URL=postgres://djangouser:${POSTGRES_PASSWORD}@postgres-service:5432/djangodatabase? - - SECRET_KEY + - POSTGRES_URL=postgres://djangouser:${POSTGRES_PASSWORD}@postgres-service:5432/djangodatabase? + - SECRET_KEY deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M postgres-service: image: postgres:16.4 ports: - - mode: host - target: 5432 + - mode: host + target: 5432 environment: - - POSTGRES_PASSWORD - - POSTGRES_DB=djangodatabase - - POSTGRES_USER=djangouser + - POSTGRES_PASSWORD + - POSTGRES_DB=djangodatabase + - POSTGRES_USER=djangouser deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/django/.github/workflows/deploy.yaml b/samples/django/.github/workflows/deploy.yaml index 2a70f343..8c940c5c 100644 --- a/samples/django/.github/workflows/deploy.yaml +++ b/samples/django/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-django-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/django/compose.yaml b/samples/django/compose.yaml index 6712e279..9b4bb227 100644 --- a/samples/django/compose.yaml +++ b/samples/django/compose.yaml @@ -6,12 +6,12 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 8000 + - mode: ingress + target: 8000 environment: - - DEBUG=False + - DEBUG=False deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/elysia/.github/workflows/deploy.yaml b/samples/elysia/.github/workflows/deploy.yaml index 2a70f343..91c9571c 100644 --- a/samples/elysia/.github/workflows/deploy.yaml +++ b/samples/elysia/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-elysia-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/elysia/compose.yaml b/samples/elysia/compose.yaml index 0c2251a8..cff51c3b 100644 --- a/samples/elysia/compose.yaml +++ b/samples/elysia/compose.yaml @@ -7,11 +7,11 @@ services: dockerfile: Dockerfile target: production ports: - - target: 3000 - mode: ingress - published: 3000 + - target: 3000 + mode: ingress + published: 3000 deploy: resources: reservations: - cpus: '0.50' + cpus: "0.50" memory: 512M diff --git a/samples/fastapi-postgres-pubsub/.github/workflows/deploy.yaml b/samples/fastapi-postgres-pubsub/.github/workflows/deploy.yaml index 02aebc91..43d9bcd0 100644 --- a/samples/fastapi-postgres-pubsub/.github/workflows/deploy.yaml +++ b/samples/fastapi-postgres-pubsub/.github/workflows/deploy.yaml @@ -4,23 +4,48 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-fastapi-postgres-pubsub-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: SSL_MODE + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + SSL_MODE: require - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: POSTGRES_PASSWORD SSL_MODE - env: - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - SSL_MODE: ${{ secrets.SSL_MODE }} \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/fastapi-postgres-pubsub/compose.yaml b/samples/fastapi-postgres-pubsub/compose.yaml index 38c4f0e4..4b4a8854 100644 --- a/samples/fastapi-postgres-pubsub/compose.yaml +++ b/samples/fastapi-postgres-pubsub/compose.yaml @@ -11,13 +11,13 @@ services: DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=${SSL_MODE} SSL_MODE: null ports: - - 8000:8000 + - 8000:8000 healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8000/healthz + - CMD + - curl + - -f + - http://localhost:8000/healthz interval: 30s timeout: 5s retries: 3 @@ -25,7 +25,7 @@ services: deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M app_b: build: @@ -37,13 +37,13 @@ services: environment: DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=${SSL_MODE} ports: - - 8001:8000 + - 8001:8000 healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8000/healthz + - CMD + - curl + - -f + - http://localhost:8000/healthz interval: 30s timeout: 5s retries: 3 @@ -51,7 +51,7 @@ services: deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M postgres: image: postgres:16 @@ -59,14 +59,14 @@ services: environment: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} ports: - - mode: host - target: 5432 - published: 5432 + - mode: host + target: 5432 + published: 5432 x-defang-postgres: true healthcheck: test: - - CMD-SHELL - - pg_isready -U postgres -d postgres + - CMD-SHELL + - pg_isready -U postgres -d postgres interval: 10s timeout: 5s retries: 5 @@ -74,5 +74,5 @@ services: deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/fastapi-postgres/.github/workflows/deploy.yaml b/samples/fastapi-postgres/.github/workflows/deploy.yaml index 2a70f343..095863da 100644 --- a/samples/fastapi-postgres/.github/workflows/deploy.yaml +++ b/samples/fastapi-postgres/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-fastapi-postgres-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/fastapi-postgres/compose.yaml b/samples/fastapi-postgres/compose.yaml index ab670dd1..7f09364c 100644 --- a/samples/fastapi-postgres/compose.yaml +++ b/samples/fastapi-postgres/compose.yaml @@ -6,30 +6,30 @@ services: context: ./fastapi dockerfile: Dockerfile ports: - - mode: ingress - target: 8000 - published: 8000 + - mode: ingress + target: 8000 + published: 8000 environment: - - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres + - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres depends_on: - - db + - db deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M db: image: postgres:15 restart: unless-stopped environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD - - POSTGRES_DB=postgres + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD + - POSTGRES_DB=postgres ports: - - mode: host - target: 5432 + - mode: host + target: 5432 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/fastapi/.github/workflows/deploy.yaml b/samples/fastapi/.github/workflows/deploy.yaml index 2a70f343..053268ae 100644 --- a/samples/fastapi/.github/workflows/deploy.yaml +++ b/samples/fastapi/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-fastapi-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/fastapi/compose.yaml b/samples/fastapi/compose.yaml index 628c2046..a7868307 100644 --- a/samples/fastapi/compose.yaml +++ b/samples/fastapi/compose.yaml @@ -6,11 +6,11 @@ services: context: ./fastapi dockerfile: Dockerfile ports: - - mode: ingress - target: 8000 - published: 8000 + - mode: ingress + target: 8000 + published: 8000 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/feathersjs/.github/workflows/deploy.yaml b/samples/feathersjs/.github/workflows/deploy.yaml index 2a70f343..8534711e 100644 --- a/samples/feathersjs/.github/workflows/deploy.yaml +++ b/samples/feathersjs/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-feathersjs-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/feathersjs/compose.yaml b/samples/feathersjs/compose.yaml index c1363424..1befd236 100644 --- a/samples/feathersjs/compose.yaml +++ b/samples/feathersjs/compose.yaml @@ -5,14 +5,14 @@ services: context: ./src dockerfile: Dockerfile ports: - - target: 3030 - published: 3030 - protocol: tcp - mode: ingress + - target: 3030 + published: 3030 + protocol: tcp + mode: ingress environment: - - NODE_ENV=production + - NODE_ENV=production deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/flask-railpack/.github/workflows/deploy.yaml b/samples/flask-railpack/.github/workflows/deploy.yaml index 2a70f343..80a4e622 100644 --- a/samples/flask-railpack/.github/workflows/deploy.yaml +++ b/samples/flask-railpack/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-flask-railpack-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/flask-railpack/compose.yaml b/samples/flask-railpack/compose.yaml index 6e9fd956..afdbdc8d 100644 --- a/samples/flask-railpack/compose.yaml +++ b/samples/flask-railpack/compose.yaml @@ -7,16 +7,16 @@ services: deploy: resources: reservations: - cpus: '1.0' + cpus: "1.0" memory: 512M ports: - - mode: ingress - target: 5000 - published: 5000 + - mode: ingress + target: 5000 + published: 5000 healthcheck: test: - - CMD - - python3 - - -c - - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() - - http://localhost:5000/ + - CMD + - python3 + - -c + - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() + - http://localhost:5000/ diff --git a/samples/flask/.github/workflows/deploy.yaml b/samples/flask/.github/workflows/deploy.yaml index 2a70f343..319fa721 100644 --- a/samples/flask/.github/workflows/deploy.yaml +++ b/samples/flask/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-flask-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/flask/compose.yaml b/samples/flask/compose.yaml index adde5097..08f74f86 100644 --- a/samples/flask/compose.yaml +++ b/samples/flask/compose.yaml @@ -8,16 +8,16 @@ services: deploy: resources: reservations: - cpus: '1.0' + cpus: "1.0" memory: 512M ports: - - mode: ingress - target: 5000 - published: 5000 + - mode: ingress + target: 5000 + published: 5000 healthcheck: test: - - CMD - - python3 - - -c - - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() - - http://localhost:5000/ + - CMD + - python3 + - -c + - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() + - http://localhost:5000/ diff --git a/samples/golang-http-form/.github/workflows/deploy.yaml b/samples/golang-http-form/.github/workflows/deploy.yaml index 2a70f343..3165fb80 100644 --- a/samples/golang-http-form/.github/workflows/deploy.yaml +++ b/samples/golang-http-form/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-golang-http-form-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/golang-http-form/compose.yaml b/samples/golang-http-form/compose.yaml index 84e33c54..a7fabd14 100644 --- a/samples/golang-http-form/compose.yaml +++ b/samples/golang-http-form/compose.yaml @@ -6,15 +6,15 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 8080 + - mode: ingress + target: 8080 deploy: resources: reservations: memory: 50M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ diff --git a/samples/golang-http/.github/workflows/deploy.yaml b/samples/golang-http/.github/workflows/deploy.yaml index 2a70f343..510a64df 100644 --- a/samples/golang-http/.github/workflows/deploy.yaml +++ b/samples/golang-http/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-golang-http-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/golang-http/compose.yaml b/samples/golang-http/compose.yaml index 30d58a03..1d6702bb 100644 --- a/samples/golang-http/compose.yaml +++ b/samples/golang-http/compose.yaml @@ -6,15 +6,15 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 8080 + - mode: ingress + target: 8080 deploy: resources: reservations: memory: 50M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ diff --git a/samples/golang-mongodb/.github/workflows/deploy.yaml b/samples/golang-mongodb/.github/workflows/deploy.yaml index 2a70f343..de80de78 100644 --- a/samples/golang-mongodb/.github/workflows/deploy.yaml +++ b/samples/golang-mongodb/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-golang-mongodb-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/golang-mongodb/compose.yaml b/samples/golang-mongodb/compose.yaml index a122170a..46f4a47d 100644 --- a/samples/golang-mongodb/compose.yaml +++ b/samples/golang-mongodb/compose.yaml @@ -6,40 +6,40 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 8080 - published: 8080 + - mode: ingress + target: 8080 + published: 8080 environment: - - MONGO_URI=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@db:27017/taskmanager + - MONGO_URI=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@db:27017/taskmanager healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ depends_on: - - db + - db deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M db: image: mongo:5 restart: unless-stopped ports: - - mode: host - target: 27017 + - mode: host + target: 27017 environment: - - MONGO_INITDB_ROOT_USERNAME - - MONGO_INITDB_ROOT_PASSWORD + - MONGO_INITDB_ROOT_USERNAME + - MONGO_INITDB_ROOT_PASSWORD volumes: - - db_data:/data/db + - db_data:/data/db x-defang-mongodb: true deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M volumes: db_data: diff --git a/samples/golang-openai/.github/workflows/deploy.yaml b/samples/golang-openai/.github/workflows/deploy.yaml index 2a70f343..69a9d053 100644 --- a/samples/golang-openai/.github/workflows/deploy.yaml +++ b/samples/golang-openai/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-golang-openai-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/golang-openai/compose.yaml b/samples/golang-openai/compose.yaml index b60f94a9..62351f19 100644 --- a/samples/golang-openai/compose.yaml +++ b/samples/golang-openai/compose.yaml @@ -6,17 +6,17 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 8080 + - mode: ingress + target: 8080 environment: - - OPENAI_KEY + - OPENAI_KEY deploy: resources: reservations: memory: 50M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ diff --git a/samples/golang-railpack/.github/workflows/deploy.yaml b/samples/golang-railpack/.github/workflows/deploy.yaml index 2a70f343..c8c30101 100644 --- a/samples/golang-railpack/.github/workflows/deploy.yaml +++ b/samples/golang-railpack/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-golang-railpack-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/golang-railpack/compose.yaml b/samples/golang-railpack/compose.yaml index 6c6fc6f7..88eea774 100644 --- a/samples/golang-railpack/compose.yaml +++ b/samples/golang-railpack/compose.yaml @@ -5,8 +5,8 @@ services: build: context: ./app ports: - - mode: ingress - target: 8080 + - mode: ingress + target: 8080 deploy: resources: reservations: diff --git a/samples/golang-rest-api/.github/workflows/deploy.yaml b/samples/golang-rest-api/.github/workflows/deploy.yaml index 2a70f343..fb39ba12 100644 --- a/samples/golang-rest-api/.github/workflows/deploy.yaml +++ b/samples/golang-rest-api/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-golang-rest-api-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/golang-rest-api/compose.yaml b/samples/golang-rest-api/compose.yaml index 1e8cec7a..3e5345b8 100644 --- a/samples/golang-rest-api/compose.yaml +++ b/samples/golang-rest-api/compose.yaml @@ -6,15 +6,15 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 8080 + - mode: ingress + target: 8080 deploy: resources: reservations: memory: 50M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ diff --git a/samples/golang-s3/.github/workflows/deploy.yaml b/samples/golang-s3/.github/workflows/deploy.yaml index 2a70f343..a2ac3b59 100644 --- a/samples/golang-s3/.github/workflows/deploy.yaml +++ b/samples/golang-s3/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-golang-s3-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/golang-s3/compose.yaml b/samples/golang-s3/compose.yaml index bb1803d7..8ecd7e71 100644 --- a/samples/golang-s3/compose.yaml +++ b/samples/golang-s3/compose.yaml @@ -6,18 +6,18 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 8080 + - mode: ingress + target: 8080 environment: - - AWS_ACCESS_KEY - - AWS_SECRET_KEY + - AWS_ACCESS_KEY + - AWS_SECRET_KEY deploy: resources: reservations: memory: 50M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ diff --git a/samples/golang-slackbot/.github/workflows/deploy.yaml b/samples/golang-slackbot/.github/workflows/deploy.yaml index 2a70f343..84b109fe 100644 --- a/samples/golang-slackbot/.github/workflows/deploy.yaml +++ b/samples/golang-slackbot/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-golang-slackbot-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/golang-slackbot/compose.yaml b/samples/golang-slackbot/compose.yaml index d3c1e146..df58ce5e 100644 --- a/samples/golang-slackbot/compose.yaml +++ b/samples/golang-slackbot/compose.yaml @@ -6,19 +6,19 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 8080 + - mode: ingress + target: 8080 environment: - - SLACK_TOKEN - - SLACK_CHANNEL_ID + - SLACK_TOKEN + - SLACK_CHANNEL_ID healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/google-adk/compose.yaml b/samples/google-adk/compose.yaml index bc3ebaa1..ba43e0f2 100644 --- a/samples/google-adk/compose.yaml +++ b/samples/google-adk/compose.yaml @@ -3,19 +3,19 @@ services: agent: build: . ports: - - 8080:8080 + - 8080:8080 healthcheck: test: - - CMD - - python3 - - -c - - import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:8080/').status==200 - else exit(1) + - CMD + - python3 + - -c + - import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:8080/').status==200 + else exit(1) interval: 30s timeout: 10s retries: 5 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/hasura/.github/workflows/deploy.yaml b/samples/hasura/.github/workflows/deploy.yaml index 2a70f343..95acd884 100644 --- a/samples/hasura/.github/workflows/deploy.yaml +++ b/samples/hasura/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-hasura-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/hasura/compose.yaml b/samples/hasura/compose.yaml index b5e5956f..46b5e707 100644 --- a/samples/hasura/compose.yaml +++ b/samples/hasura/compose.yaml @@ -6,36 +6,36 @@ services: dockerfile: Dockerfile context: ./hasura ports: - - target: 8080 - published: 8080 - mode: ingress + - target: 8080 + published: 8080 + mode: ingress environment: - - HASURA_GRAPHQL_ADMIN_SECRET - - HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - - HASURA_GRAPHQL_ENABLE_CONSOLE=true - - HASURA_GRAPHQL_UNAUTHORIZED_ROLE=public - - HASURA_GRAPHQL_EXPERIMENTAL_FEATURES=naming_convention - - HASURA_GRAPHQL_DEFAULT_NAMING_CONVENTION=graphql-default - - HASURA_GRAPHQL_MIGRATIONS_DIR=/hasura/migrations - - HASURA_GRAPHQL_METADATA_DIR=/hasura/metadata - - POSTGRES_PASSWORD + - HASURA_GRAPHQL_ADMIN_SECRET + - HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres + - HASURA_GRAPHQL_ENABLE_CONSOLE=true + - HASURA_GRAPHQL_UNAUTHORIZED_ROLE=public + - HASURA_GRAPHQL_EXPERIMENTAL_FEATURES=naming_convention + - HASURA_GRAPHQL_DEFAULT_NAMING_CONVENTION=graphql-default + - HASURA_GRAPHQL_MIGRATIONS_DIR=/hasura/migrations + - HASURA_GRAPHQL_METADATA_DIR=/hasura/metadata + - POSTGRES_PASSWORD deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M database: image: postgres:16 x-defang-postgres: true ports: - - target: 5432 - mode: host + - target: 5432 + mode: host environment: - - POSTGRES_USER=postgres - - POSTGRES_DB=postgres - - POSTGRES_PASSWORD + - POSTGRES_USER=postgres + - POSTGRES_DB=postgres + - POSTGRES_PASSWORD deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/html-css-js/.github/workflows/deploy.yaml b/samples/html-css-js/.github/workflows/deploy.yaml index 2a70f343..252d3421 100644 --- a/samples/html-css-js/.github/workflows/deploy.yaml +++ b/samples/html-css-js/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-html-css-js-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/html-css-js/compose.yaml b/samples/html-css-js/compose.yaml index 5e28564c..4fd7999c 100644 --- a/samples/html-css-js/compose.yaml +++ b/samples/html-css-js/compose.yaml @@ -6,16 +6,16 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 8080 - published: 8080 - mode: ingress + - target: 8080 + published: 8080 + mode: ingress deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ diff --git a/samples/huginn/.github/workflows/deploy.yaml b/samples/huginn/.github/workflows/deploy.yaml index 2a70f343..7d9fe09d 100644 --- a/samples/huginn/.github/workflows/deploy.yaml +++ b/samples/huginn/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-huginn-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/huginn/compose.yaml b/samples/huginn/compose.yaml index 70b10366..1263e08c 100644 --- a/samples/huginn/compose.yaml +++ b/samples/huginn/compose.yaml @@ -4,43 +4,43 @@ services: image: ghcr.io/huginn/huginn restart: unless-stopped ports: - - target: 3000 - published: 3000 - mode: ingress + - target: 3000 + published: 3000 + mode: ingress deploy: resources: reservations: - cpus: '1.0' + cpus: "1.0" memory: 1G healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ interval: 1m30s timeout: 30s retries: 10 environment: - - DATABASE_ADAPTER=postgresql - - DATABASE_NAME=huginn - - DATABASE_USERNAME=huginn - - DATABASE_HOST=db - - DATABASE_PASSWORD="${POSTGRES_PASSWORD}" + - DATABASE_ADAPTER=postgresql + - DATABASE_NAME=huginn + - DATABASE_USERNAME=huginn + - DATABASE_HOST=db + - DATABASE_PASSWORD="${POSTGRES_PASSWORD}" depends_on: - - db + - db db: image: postgres:16 environment: - - POSTGRES_USER=huginn - - POSTGRES_DB=huginn - - POSTGRES_PASSWORD + - POSTGRES_USER=huginn + - POSTGRES_DB=huginn + - POSTGRES_PASSWORD ports: - - mode: host - target: 5432 - published: 5432 + - mode: host + target: 5432 + published: 5432 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/imgproxy/.github/workflows/deploy.yaml b/samples/imgproxy/.github/workflows/deploy.yaml index 2a70f343..4f3aa71e 100644 --- a/samples/imgproxy/.github/workflows/deploy.yaml +++ b/samples/imgproxy/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-imgproxy-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/imgproxy/compose.yaml b/samples/imgproxy/compose.yaml index 9c89556c..dcc9f18f 100644 --- a/samples/imgproxy/compose.yaml +++ b/samples/imgproxy/compose.yaml @@ -4,10 +4,10 @@ services: restart: unless-stopped image: darthsim/imgproxy ports: - - mode: ingress - target: 8080 - published: 8080 - protocol: tcp + - mode: ingress + target: 8080 + published: 8080 + protocol: tcp deploy: resources: reservations: diff --git a/samples/javalin/.github/workflows/deploy.yaml b/samples/javalin/.github/workflows/deploy.yaml index 2a70f343..311e3a00 100644 --- a/samples/javalin/.github/workflows/deploy.yaml +++ b/samples/javalin/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-javalin-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/javalin/compose.yaml b/samples/javalin/compose.yaml index e02d2ca0..5c802c0c 100644 --- a/samples/javalin/compose.yaml +++ b/samples/javalin/compose.yaml @@ -4,17 +4,17 @@ services: build: context: ./app ports: - - target: 7000 - published: 7000 - mode: ingress + - target: 7000 + published: 7000 + mode: ingress healthcheck: test: - - CMD - - curl - - -f - - http://localhost:7000/ + - CMD + - curl + - -f + - http://localhost:7000/ deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/jupyter-postgres/.github/workflows/deploy.yaml b/samples/jupyter-postgres/.github/workflows/deploy.yaml index 33f28ccf..e602a25e 100644 --- a/samples/jupyter-postgres/.github/workflows/deploy.yaml +++ b/samples/jupyter-postgres/.github/workflows/deploy.yaml @@ -4,23 +4,52 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-jupyter-postgres-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 - - name: Deploy - with: - config-env-vars: POSTGRES_PASSWORD JUPYTER_TOKEN - uses: DefangLabs/defang-github-action@v1.3.2 - env: - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - JUPYTER_TOKEN: ${{ secrets.JUPYTER_TOKEN }} \ No newline at end of file + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + # Defang will initialize these config vars with random secrets + # If you wish to provide your own secrets: + # 1. Set them in the repo secrets, + # 2. Remove them from the `config-vars-init-random` list + # 3. Add them to the `config-env-vars` list below + config-vars-init-random: JUPYTER_TOKEN POSTGRES_PASSWORD + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + JUPYTER_TOKEN: ${{ secrets.JUPYTER_TOKEN }} + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/jupyter-postgres/compose.yaml b/samples/jupyter-postgres/compose.yaml index d9df7a68..488a2dd2 100644 --- a/samples/jupyter-postgres/compose.yaml +++ b/samples/jupyter-postgres/compose.yaml @@ -4,13 +4,13 @@ services: build: context: ./jupyter ports: - - mode: ingress - target: 8888 - published: 8888 + - mode: ingress + target: 8888 + published: 8888 deploy: resources: limits: - cpus: '1.0' + cpus: "1.0" memory: 1G environment: JUPYTER_TOKEN: null @@ -18,27 +18,27 @@ services: DATABASE_HOST: db healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8888/login + - CMD + - curl + - -f + - http://localhost:8888/login depends_on: - - db + - db db: image: postgres:14 x-defang-postgres: true ports: - - mode: host - target: 5432 - published: 5432 + - mode: host + target: 5432 + published: 5432 healthcheck: test: - - CMD-SHELL - - pg_isready -U postgres + - CMD-SHELL + - pg_isready -U postgres environment: POSTGRES_PASSWORD: null deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/langchain/.github/workflows/deploy.yaml b/samples/langchain/.github/workflows/deploy.yaml index 2a70f343..0080af50 100644 --- a/samples/langchain/.github/workflows/deploy.yaml +++ b/samples/langchain/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-langchain-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/langchain/compose.yaml b/samples/langchain/compose.yaml index ce7a3de7..80ab3eee 100644 --- a/samples/langchain/compose.yaml +++ b/samples/langchain/compose.yaml @@ -5,20 +5,20 @@ services: context: ./app dockerfile: Dockerfile environment: - - OPENAI_KEY + - OPENAI_KEY ports: - - target: 80 - published: 8080 - protocol: tcp - mode: ingress + - target: 80 + published: 8080 + protocol: tcp + mode: ingress healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080/ + - CMD + - curl + - -f + - http://localhost:8080/ deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/managed-llm-provider/.github/workflows/deploy.yaml b/samples/managed-llm-provider/.github/workflows/deploy.yaml index 13bd872a..2da6f5c1 100644 --- a/samples/managed-llm-provider/.github/workflows/deploy.yaml +++ b/samples/managed-llm-provider/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-managed-llm-provider-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/managed-llm-provider/compose.yaml b/samples/managed-llm-provider/compose.yaml index 6612bf8e..a5ea5e83 100644 --- a/samples/managed-llm-provider/compose.yaml +++ b/samples/managed-llm-provider/compose.yaml @@ -5,25 +5,25 @@ services: context: ./app dockerfile: Dockerfile ports: - - 8000:8000 + - 8000:8000 restart: always environment: - - LLM_URL=http://llm/api/v1/ - - LLM_MODEL=default - - OPENAI_API_KEY=FAKE_TOKEN + - LLM_URL=http://llm/api/v1/ + - LLM_MODEL=default + - OPENAI_API_KEY=FAKE_TOKEN healthcheck: test: - - CMD - - python3 - - -c - - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() - - http://localhost:8000/health + - CMD + - python3 + - -c + - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() + - http://localhost:8000/health interval: 30s timeout: 5s retries: 3 start_period: 5s depends_on: - - llm + - llm deploy: resources: reservations: @@ -36,7 +36,7 @@ services: model: ai/smollm2 x-defang-llm: true environment: - - OPENAI_API_KEY=FAKE_TOKEN + - OPENAI_API_KEY=FAKE_TOKEN deploy: resources: reservations: diff --git a/samples/managed-llm/.github/workflows/deploy.yaml b/samples/managed-llm/.github/workflows/deploy.yaml index dff2e86f..f1975e9a 100644 --- a/samples/managed-llm/.github/workflows/deploy.yaml +++ b/samples/managed-llm/.github/workflows/deploy.yaml @@ -4,22 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-managed-llm-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: MODEL + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + MODEL: ${{ secrets.MODEL }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: MODEL - env: - MODEL: ${{ secrets.MODEL }} \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/managed-llm/compose.yaml b/samples/managed-llm/compose.yaml index f2285add..c89e8597 100644 --- a/samples/managed-llm/compose.yaml +++ b/samples/managed-llm/compose.yaml @@ -5,49 +5,49 @@ services: context: ./app dockerfile: Dockerfile ports: - - 8000:8000 + - 8000:8000 restart: always environment: - - LLM_URL=http://llm/api/v1/ - - LLM_MODEL=default - - OPENAI_API_KEY=FAKE_TOKEN + - LLM_URL=http://llm/api/v1/ + - LLM_MODEL=default + - OPENAI_API_KEY=FAKE_TOKEN healthcheck: test: - - CMD - - python3 - - -c - - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() - - http://localhost:8000/ + - CMD + - python3 + - -c + - import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read() + - http://localhost:8000/ interval: 30s timeout: 5s retries: 3 start_period: 5s depends_on: - - llm + - llm networks: - - default - - private + - default + - private deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M llm: x-defang-llm: true image: docker.io/defangio/openai-access-gateway:latest ports: - - target: 80 - published: 80 - protocol: tcp - mode: host + - target: 80 + published: 80 + protocol: tcp + mode: host networks: - - private + - private environment: - - OPENAI_API_KEY=FAKE_TOKEN + - OPENAI_API_KEY=FAKE_TOKEN deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M networks: default: null diff --git a/samples/mastra-nextjs/.github/workflows/deploy.yaml b/samples/mastra-nextjs/.github/workflows/deploy.yaml index 3b4a5136..5dc4b38e 100644 --- a/samples/mastra-nextjs/.github/workflows/deploy.yaml +++ b/samples/mastra-nextjs/.github/workflows/deploy.yaml @@ -4,25 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-mastra-nextjs-${{ github.event.inputs.stack || 'default' }} + steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 with: config-env-vars: DB_SSL POSTGRES_PASSWORD LLM_MODEL GITHUB_TOKEN + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} env: DB_SSL: ${{ secrets.DB_SSL }} - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - LLM_MODEL: ${{ secrets.LLM_MODEL }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/mastra-nextjs/compose.yaml b/samples/mastra-nextjs/compose.yaml index d057b190..b63f1d11 100644 --- a/samples/mastra-nextjs/compose.yaml +++ b/samples/mastra-nextjs/compose.yaml @@ -6,48 +6,48 @@ services: context: ./app dockerfile: Dockerfile environment: - - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres - - DB_SSL - - LLM_MODEL - - GITHUB_TOKEN + - DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres + - DB_SSL + - LLM_MODEL + - GITHUB_TOKEN restart: unless-stopped ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000 + - CMD + - curl + - -f + - http://localhost:3000 depends_on: - - database + - database deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M database: image: postgres:16 x-defang-postgres: true restart: always environment: - - POSTGRES_PASSWORD - - POSTGRES_DB=postgres - - POSTGRES_USER=postgres + - POSTGRES_PASSWORD + - POSTGRES_DB=postgres + - POSTGRES_USER=postgres ports: - - mode: host - target: 5432 + - mode: host + target: 5432 healthcheck: test: - - CMD-SHELL - - pg_isready -h localhost -U postgres -d postgres + - CMD-SHELL + - pg_isready -h localhost -U postgres -d postgres interval: 5s timeout: 5s retries: 10 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/mcp/.github/workflows/deploy.yaml b/samples/mcp/.github/workflows/deploy.yaml index 3ed8a4dc..72aae8da 100644 --- a/samples/mcp/.github/workflows/deploy.yaml +++ b/samples/mcp/.github/workflows/deploy.yaml @@ -4,22 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-mcp-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: ANTHROPIC_API_KEY + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: ANTHROPIC_API_KEY - env: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/mcp/compose.yaml b/samples/mcp/compose.yaml index 3893995d..6e60a5e6 100644 --- a/samples/mcp/compose.yaml +++ b/samples/mcp/compose.yaml @@ -5,35 +5,35 @@ services: context: ./service-1 dockerfile: Dockerfile ports: - - target: 3000 - published: 3000 - mode: ingress + - target: 3000 + published: 3000 + mode: ingress deploy: resources: reservations: memory: 256M environment: - - MCP_SERVICE_URL=http://service-2:8000 + - MCP_SERVICE_URL=http://service-2:8000 healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ depends_on: - - service-2 + - service-2 service-2: build: context: ./service-2 dockerfile: Dockerfile ports: - - target: 8000 - published: 8000 - mode: host + - target: 8000 + published: 8000 + mode: host environment: - - ANTHROPIC_API_KEY + - ANTHROPIC_API_KEY deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/metabase/.github/workflows/deploy.yaml b/samples/metabase/.github/workflows/deploy.yaml index 2a70f343..453139cf 100644 --- a/samples/metabase/.github/workflows/deploy.yaml +++ b/samples/metabase/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-metabase-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/metabase/compose.yaml b/samples/metabase/compose.yaml index a8f1e116..9cab01b6 100644 --- a/samples/metabase/compose.yaml +++ b/samples/metabase/compose.yaml @@ -4,27 +4,27 @@ services: restart: unless-stopped image: metabase/metabase:latest ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/api/health + - CMD + - curl + - -f + - http://localhost:3000/api/health interval: 1m30s timeout: 30s retries: 5 environment: - - MB_DB_TYPE=postgres - - MB_DB_DBNAME - - MB_DB_PORT - - MB_DB_USER - - MB_DB_PASS - - MB_DB_HOST + - MB_DB_TYPE=postgres + - MB_DB_DBNAME + - MB_DB_PORT + - MB_DB_USER + - MB_DB_PASS + - MB_DB_HOST deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 1024M diff --git a/samples/n8n/.github/workflows/deploy.yaml b/samples/n8n/.github/workflows/deploy.yaml index ca4e0698..653f6682 100644 --- a/samples/n8n/.github/workflows/deploy.yaml +++ b/samples/n8n/.github/workflows/deploy.yaml @@ -4,25 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-n8n-${{ github.event.inputs.stack || 'default' }} + steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 with: - config-env-vars: POSTGRES_USER N8N_ENCRYPTION_KEY DB_POSTGRESDB_SSL_ENABLED DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED + config-env-vars: POSTGRES_USER N8N_ENCRYPTION_KEY DB_POSTGRESDB_SSL_ENABLED + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} env: POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - N8N_ENCRYPTION_KEY: ${{ secrets.N8N_ENCRYPTION_KEY }} - DB_POSTGRESDB_SSL_ENABLED: ${{ secrets.DB_POSTGRESDB_SSL_ENABLED }} - DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED: ${{ secrets.DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED }} + + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/n8n/compose.yaml b/samples/n8n/compose.yaml index 0fd59ca6..bbfe4ab9 100644 --- a/samples/n8n/compose.yaml +++ b/samples/n8n/compose.yaml @@ -5,54 +5,54 @@ services: x-defang-postgres: true restart: always environment: - - POSTGRES_USER=n8nuser - - POSTGRES_DB=n8ndatabase - - POSTGRES_PASSWORD + - POSTGRES_USER=n8nuser + - POSTGRES_DB=n8ndatabase + - POSTGRES_PASSWORD healthcheck: test: - - CMD-SHELL - - pg_isready -h localhost -U n8nuser -d n8ndatabase + - CMD-SHELL + - pg_isready -h localhost -U n8nuser -d n8ndatabase interval: 5s timeout: 5s retries: 10 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M n8n: image: docker.n8n.io/n8nio/n8n restart: always environment: - - DB_TYPE=postgresdb - - DB_POSTGRESDB_HOST=postgres - - DB_POSTGRESDB_PORT=5432 - - DB_POSTGRESDB_DATABASE=n8ndatabase - - DB_POSTGRESDB_USER=n8nuser - - N8N_RUNNERS_ENABLED=true - - N8N_HOST=n8n - - N8N_PORT=5678 - - N8N_PROTOCOL=https - - N8N_PROXY_HOPS=1 - - NODE_ENV=production - - WEBHOOK_URL=https://n8n - - DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED - - DB_POSTGRESDB_SSL_ENABLED - - N8N_ENCRYPTION_KEY - - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD} + - DB_TYPE=postgresdb + - DB_POSTGRESDB_HOST=postgres + - DB_POSTGRESDB_PORT=5432 + - DB_POSTGRESDB_DATABASE=n8ndatabase + - DB_POSTGRESDB_USER=n8nuser + - N8N_RUNNERS_ENABLED=true + - N8N_HOST=n8n + - N8N_PORT=5678 + - N8N_PROTOCOL=https + - N8N_PROXY_HOPS=1 + - NODE_ENV=production + - WEBHOOK_URL=https://n8n + - DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED + - DB_POSTGRESDB_SSL_ENABLED + - N8N_ENCRYPTION_KEY + - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD} ports: - - 5678:5678 + - 5678:5678 links: - - postgres + - postgres depends_on: postgres: condition: service_healthy healthcheck: test: - - CMD-SHELL - - node --eval "const r = await fetch('http://localhost:5678/healthz'); if(r.status - === 200 || r.status === 201) { process.exit(0); } else { process.exit(1); - };" + - CMD-SHELL + - node --eval "const r = await fetch('http://localhost:5678/healthz'); if(r.status + === 200 || r.status === 201) { process.exit(0); } else { process.exit(1); + };" interval: 10s timeout: 5s retries: 5 @@ -60,5 +60,5 @@ services: deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/nextjs-blog/.github/workflows/deploy.yaml b/samples/nextjs-blog/.github/workflows/deploy.yaml index 2a70f343..f5de4fd1 100644 --- a/samples/nextjs-blog/.github/workflows/deploy.yaml +++ b/samples/nextjs-blog/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nextjs-blog-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nextjs-blog/compose.yaml b/samples/nextjs-blog/compose.yaml index bcb964a2..017c122d 100644 --- a/samples/nextjs-blog/compose.yaml +++ b/samples/nextjs-blog/compose.yaml @@ -6,9 +6,9 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: diff --git a/samples/nextjs-claude/.github/workflows/deploy.yaml b/samples/nextjs-claude/.github/workflows/deploy.yaml index 3ed8a4dc..0adcfd35 100644 --- a/samples/nextjs-claude/.github/workflows/deploy.yaml +++ b/samples/nextjs-claude/.github/workflows/deploy.yaml @@ -4,22 +4,47 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nextjs-claude-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + config-env-vars: ANTHROPIC_API_KEY + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: ANTHROPIC_API_KEY - env: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nextjs-claude/compose.yaml b/samples/nextjs-claude/compose.yaml index 2040b107..af0a95dc 100644 --- a/samples/nextjs-claude/compose.yaml +++ b/samples/nextjs-claude/compose.yaml @@ -5,18 +5,18 @@ services: context: ./ui dockerfile: Dockerfile ports: - - target: 3000 - published: 3000 - mode: ingress + - target: 3000 + published: 3000 + mode: ingress deploy: resources: reservations: memory: 256M environment: - - ANTHROPIC_API_KEY + - ANTHROPIC_API_KEY healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ diff --git a/samples/nextjs-cv/.github/workflows/deploy.yaml b/samples/nextjs-cv/.github/workflows/deploy.yaml index 13bd872a..60cd3adc 100644 --- a/samples/nextjs-cv/.github/workflows/deploy.yaml +++ b/samples/nextjs-cv/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nextjs-cv-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nextjs-cv/compose.yaml b/samples/nextjs-cv/compose.yaml index 7a404999..7b5bfdf7 100644 --- a/samples/nextjs-cv/compose.yaml +++ b/samples/nextjs-cv/compose.yaml @@ -6,19 +6,19 @@ services: dockerfile: Dockerfile restart: unless-stopped ports: - - target: 3000 - published: 3000 - mode: ingress + - target: 3000 + published: 3000 + mode: ingress environment: - - NODE_ENV=production + - NODE_ENV=production healthcheck: test: - - CMD - - wget - - --spider - - http://localhost:3000/ + - CMD + - wget + - --spider + - http://localhost:3000/ deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/nextjs-documentation/.github/workflows/deploy.yaml b/samples/nextjs-documentation/.github/workflows/deploy.yaml index 2a70f343..bc019537 100644 --- a/samples/nextjs-documentation/.github/workflows/deploy.yaml +++ b/samples/nextjs-documentation/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nextjs-documentation-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nextjs-documentation/compose.yaml b/samples/nextjs-documentation/compose.yaml index eeaceae6..ede196c7 100644 --- a/samples/nextjs-documentation/compose.yaml +++ b/samples/nextjs-documentation/compose.yaml @@ -6,9 +6,9 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: diff --git a/samples/nextjs-postgres/.github/workflows/deploy.yaml b/samples/nextjs-postgres/.github/workflows/deploy.yaml index 3af9b0a6..293b646e 100644 --- a/samples/nextjs-postgres/.github/workflows/deploy.yaml +++ b/samples/nextjs-postgres/.github/workflows/deploy.yaml @@ -4,23 +4,54 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nextjs-postgres-${{ github.event.inputs.stack || 'default' }} + steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 with: - config-env-vars: POSTGRES_PASSWORD POSTGRES_SSL + # Defang will initialize these config vars with random secrets + # If you wish to provide your own secrets: + # 1. Set them in the repo secrets, + # 2. Remove them from the `config-vars-init-random` list + # 3. Add them to the `config-env-vars` list below + config-vars-init-random: POSTGRES_PASSWORD + config-env-vars: POSTGRES_SSL + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} env: POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - POSTGRES_SSL: ${{ secrets.POSTGRES_SSL }} + POSTGRES_SSL: require + + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nextjs-postgres/compose.yaml b/samples/nextjs-postgres/compose.yaml index bf374bb0..7a2d87b3 100644 --- a/samples/nextjs-postgres/compose.yaml +++ b/samples/nextjs-postgres/compose.yaml @@ -5,9 +5,9 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 3000 - published: 3000 - mode: ingress + - target: 3000 + published: 3000 + mode: ingress environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: null @@ -17,16 +17,16 @@ services: POSTGRES_SSL: null healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000 + - CMD + - curl + - -f + - http://localhost:3000 depends_on: - - database + - database deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M database: image: postgres:16 @@ -34,11 +34,11 @@ services: environment: POSTGRES_PASSWORD: null ports: - - target: 5432 - published: 5432 - mode: host + - target: 5432 + published: 5432 + mode: host deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/nextjs-railpack/.github/workflows/deploy.yaml b/samples/nextjs-railpack/.github/workflows/deploy.yaml index 2a70f343..72fb9a64 100644 --- a/samples/nextjs-railpack/.github/workflows/deploy.yaml +++ b/samples/nextjs-railpack/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nextjs-railpack-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nextjs-railpack/compose.yaml b/samples/nextjs-railpack/compose.yaml index 377d8901..73026fa9 100644 --- a/samples/nextjs-railpack/compose.yaml +++ b/samples/nextjs-railpack/compose.yaml @@ -5,13 +5,13 @@ services: build: context: ./app ports: - - target: 3000 - mode: ingress - published: 3000 + - target: 3000 + mode: ingress + published: 3000 environment: PORT: 3000 deploy: resources: reservations: - cpus: '0.25' + cpus: "0.25" memory: 256M diff --git a/samples/nextjs/.github/workflows/deploy.yaml b/samples/nextjs/.github/workflows/deploy.yaml index 2a70f343..a9163fab 100644 --- a/samples/nextjs/.github/workflows/deploy.yaml +++ b/samples/nextjs/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nextjs-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nextjs/compose.yaml b/samples/nextjs/compose.yaml index e12d0248..5c281403 100644 --- a/samples/nextjs/compose.yaml +++ b/samples/nextjs/compose.yaml @@ -6,13 +6,13 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 3000 - mode: ingress - published: 3000 + - target: 3000 + mode: ingress + published: 3000 healthcheck: test: wget -q --spider http://localhost:3000/ || exit 1 deploy: resources: reservations: - cpus: '0.25' + cpus: "0.25" memory: 256M diff --git a/samples/nocodb/.github/workflows/deploy.yaml b/samples/nocodb/.github/workflows/deploy.yaml index 0f5f1d58..4deb1a66 100644 --- a/samples/nocodb/.github/workflows/deploy.yaml +++ b/samples/nocodb/.github/workflows/deploy.yaml @@ -4,27 +4,58 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nocodb-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + # Defang will initialize these config vars with random secrets + # If you wish to provide your own secrets: + # 1. Set them in the repo secrets, + # 2. Remove them from the `config-vars-init-random` list + # 3. Add them to the `config-env-vars` list below + config-vars-init-random: NC_S3_ACCESS_KEY NC_S3_ACCESS_SECRET + config-env-vars: NC_DB NC_S3_ENDPOINT NC_S3_BUCKET_NAME NC_S3_REGION + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + NC_DB: ${{ secrets.NC_DB }} + NC_S3_ACCESS_KEY: ${{ secrets.NC_S3_ACCESS_KEY }} + NC_S3_ACCESS_SECRET: ${{ secrets.NC_S3_ACCESS_SECRET }} + NC_S3_ENDPOINT: ${{ secrets.NC_S3_ENDPOINT }} + NC_S3_BUCKET_NAME: ${{ secrets.NC_S3_BUCKET_NAME }} + NC_S3_REGION: ${{ secrets.NC_S3_REGION }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: NC_DB NC_S3_ENDPOINT NC_S3_BUCKET_NAME NC_S3_REGION NC_S3_ACCESS_KEY NC_S3_ACCESS_SECRET - env: - NC_DB: ${{ secrets.NC_DB }} - NC_S3_ENDPOINT: ${{ secrets.NC_S3_ENDPOINT }} - NC_S3_BUCKET_NAME: ${{ secrets.NC_S3_BUCKET_NAME }} - NC_S3_REGION: ${{ secrets.NC_S3_REGION }} - NC_S3_ACCESS_KEY: ${{ secrets.NC_S3_ACCESS_KEY }} - NC_S3_ACCESS_SECRET: ${{ secrets.NC_S3_ACCESS_SECRET }} \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nocodb/compose.yaml b/samples/nocodb/compose.yaml index 7fd8c35d..dfc44e8d 100644 --- a/samples/nocodb/compose.yaml +++ b/samples/nocodb/compose.yaml @@ -10,11 +10,11 @@ services: NC_S3_ACCESS_KEY: null NC_S3_ACCESS_SECRET: null ports: - - target: 8080 - published: 8080 - mode: ingress + - target: 8080 + published: 8080 + mode: ingress deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/nodejs-chatroom/.github/workflows/deploy.yaml b/samples/nodejs-chatroom/.github/workflows/deploy.yaml index 2a70f343..a76c7710 100644 --- a/samples/nodejs-chatroom/.github/workflows/deploy.yaml +++ b/samples/nodejs-chatroom/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nodejs-chatroom-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nodejs-chatroom/compose.yaml b/samples/nodejs-chatroom/compose.yaml index f1c7a3a1..46167c8d 100644 --- a/samples/nodejs-chatroom/compose.yaml +++ b/samples/nodejs-chatroom/compose.yaml @@ -6,16 +6,16 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ diff --git a/samples/nodejs-express/.github/workflows/deploy.yaml b/samples/nodejs-express/.github/workflows/deploy.yaml index 2a70f343..41a7a775 100644 --- a/samples/nodejs-express/.github/workflows/deploy.yaml +++ b/samples/nodejs-express/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nodejs-express-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nodejs-express/compose.yaml b/samples/nodejs-express/compose.yaml index 661568f6..d641862c 100644 --- a/samples/nodejs-express/compose.yaml +++ b/samples/nodejs-express/compose.yaml @@ -5,16 +5,16 @@ services: build: context: ./app ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ diff --git a/samples/nodejs-form/.github/workflows/deploy.yaml b/samples/nodejs-form/.github/workflows/deploy.yaml index 2a70f343..ef038762 100644 --- a/samples/nodejs-form/.github/workflows/deploy.yaml +++ b/samples/nodejs-form/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nodejs-form-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nodejs-form/compose.yaml b/samples/nodejs-form/compose.yaml index dbe75f01..e42bc4b8 100644 --- a/samples/nodejs-form/compose.yaml +++ b/samples/nodejs-form/compose.yaml @@ -6,16 +6,16 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ diff --git a/samples/nodejs-http/.github/workflows/deploy.yaml b/samples/nodejs-http/.github/workflows/deploy.yaml index 2a70f343..b2571f4e 100644 --- a/samples/nodejs-http/.github/workflows/deploy.yaml +++ b/samples/nodejs-http/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nodejs-http-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nodejs-http/compose.yaml b/samples/nodejs-http/compose.yaml index 3af87db7..c47ac4e7 100644 --- a/samples/nodejs-http/compose.yaml +++ b/samples/nodejs-http/compose.yaml @@ -6,16 +6,16 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ diff --git a/samples/nodejs-openai/.github/workflows/deploy.yaml b/samples/nodejs-openai/.github/workflows/deploy.yaml index 2a70f343..055677ec 100644 --- a/samples/nodejs-openai/.github/workflows/deploy.yaml +++ b/samples/nodejs-openai/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nodejs-openai-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nodejs-openai/compose.yaml b/samples/nodejs-openai/compose.yaml index 84122290..92271117 100644 --- a/samples/nodejs-openai/compose.yaml +++ b/samples/nodejs-openai/compose.yaml @@ -6,18 +6,18 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 environment: - - OPENAI_KEY + - OPENAI_KEY deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ diff --git a/samples/nodejs-react-postgres/.github/workflows/deploy.yaml b/samples/nodejs-react-postgres/.github/workflows/deploy.yaml index 2a70f343..173246a4 100644 --- a/samples/nodejs-react-postgres/.github/workflows/deploy.yaml +++ b/samples/nodejs-react-postgres/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nodejs-react-postgres-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nodejs-react-postgres/compose.yaml b/samples/nodejs-react-postgres/compose.yaml index 5e262cb6..a3865e4f 100644 --- a/samples/nodejs-react-postgres/compose.yaml +++ b/samples/nodejs-react-postgres/compose.yaml @@ -6,30 +6,30 @@ services: context: ./client dockerfile: Dockerfile args: - - REACT_APP_API_URL=https://-server--3010.prod1.defang.dev + - REACT_APP_API_URL=https://-server--3010.prod1.defang.dev ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 1g depends_on: - - server + - server server: restart: unless-stopped build: context: ./server dockerfile: Dockerfile ports: - - target: 3010 - mode: ingress - published: 3010 + - target: 3010 + mode: ingress + published: 3010 environment: - - DATABASE_URL + - DATABASE_URL deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/nodejs-rest-api/.github/workflows/deploy.yaml b/samples/nodejs-rest-api/.github/workflows/deploy.yaml index 2a70f343..78d2b62f 100644 --- a/samples/nodejs-rest-api/.github/workflows/deploy.yaml +++ b/samples/nodejs-rest-api/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nodejs-rest-api-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nodejs-rest-api/compose.yaml b/samples/nodejs-rest-api/compose.yaml index d14d31f7..6690a56b 100644 --- a/samples/nodejs-rest-api/compose.yaml +++ b/samples/nodejs-rest-api/compose.yaml @@ -6,16 +6,16 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ diff --git a/samples/nodejs-s3/.github/workflows/deploy.yaml b/samples/nodejs-s3/.github/workflows/deploy.yaml index 2a70f343..562e4874 100644 --- a/samples/nodejs-s3/.github/workflows/deploy.yaml +++ b/samples/nodejs-s3/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nodejs-s3-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nodejs-s3/compose.yaml b/samples/nodejs-s3/compose.yaml index e6280485..8d6e2c67 100644 --- a/samples/nodejs-s3/compose.yaml +++ b/samples/nodejs-s3/compose.yaml @@ -6,19 +6,19 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 environment: - - AWS_ACCESS_KEY - - AWS_SECRET_KEY + - AWS_ACCESS_KEY + - AWS_SECRET_KEY deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ diff --git a/samples/nounly/.github/workflows/deploy.yaml b/samples/nounly/.github/workflows/deploy.yaml index a2767561..be9ad1a3 100644 --- a/samples/nounly/.github/workflows/deploy.yaml +++ b/samples/nounly/.github/workflows/deploy.yaml @@ -4,23 +4,53 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-nounly-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: PROJECT_HONEYPOT_KEY SHARED_SECRETS - env: - PROJECT_HONEYPOT_KEY: ${{ secrets.PROJECT_HONEYPOT_KEY }} - SHARED_SECRETS: ${{ secrets.SHARED_SECRETS }} \ No newline at end of file + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + # Defang will initialize these config vars with random secrets + # If you wish to provide your own secrets: + # 1. Set them in the repo secrets, + # 2. Remove them from the `config-vars-init-random` list + # 3. Add them to the `config-env-vars` list below + config-vars-init-random: PROJECT_HONEYPOT_KEY + config-env-vars: SHARED_SECRETS + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + PROJECT_HONEYPOT_KEY: ${{ secrets.PROJECT_HONEYPOT_KEY }} + SHARED_SECRETS: ${{ secrets.SHARED_SECRETS }} + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/nounly/compose.yaml b/samples/nounly/compose.yaml index 7bbcde15..64e267e0 100644 --- a/samples/nounly/compose.yaml +++ b/samples/nounly/compose.yaml @@ -10,20 +10,20 @@ services: memory: 512M healthcheck: test: - - CMD - - wget - - --spider - - -qO- - - http://localhost:2345/v1/status + - CMD + - wget + - --spider + - -qO- + - http://localhost:2345/v1/status ports: - - 2345:2345 + - 2345:2345 environment: PORT: 2345 REDIS: redis:6379 PROJECT_HONEYPOT_KEY: null - SHARED_SECRETS: '{}' + SHARED_SECRETS: "{}" depends_on: - - redis + - redis redis: restart: always image: redis:alpine @@ -32,9 +32,9 @@ services: reservations: memory: 512M ports: - - target: 6379 - published: 6379 - protocol: tcp - mode: host + - target: 6379 + published: 6379 + protocol: tcp + mode: host platform: linux/arm64 x-defang-redis: true diff --git a/samples/ollama/.github/workflows/deploy.yaml b/samples/ollama/.github/workflows/deploy.yaml index 2a70f343..c01debdd 100644 --- a/samples/ollama/.github/workflows/deploy.yaml +++ b/samples/ollama/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-ollama-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/ollama/compose.yaml b/samples/ollama/compose.yaml index b1652ac7..74bcde93 100644 --- a/samples/ollama/compose.yaml +++ b/samples/ollama/compose.yaml @@ -6,41 +6,41 @@ services: dockerfile: Dockerfile shm_size: 16gb ports: - - target: 8000 - mode: host + - target: 8000 + mode: host deploy: resources: reservations: - cpus: '2.0' + cpus: "2.0" memory: 8192M environment: - - LOAD_MODEL=llama3.2:1b + - LOAD_MODEL=llama3.2:1b healthcheck: test: - - CMD - - curl - - -s - - http://localhost:8000/ + - CMD + - curl + - -s + - http://localhost:8000/ ui: build: context: ui dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -s - - http://localhost:3000/ + - CMD + - curl + - -s + - http://localhost:3000/ environment: - - OLLAMA_ENDPOINT=http://ollama:8000 - - LOAD_MODEL=llama3.2:1b + - OLLAMA_ENDPOINT=http://ollama:8000 + - LOAD_MODEL=llama3.2:1b depends_on: - - ollama + - ollama diff --git a/samples/phoenix-postgres/.github/workflows/deploy.yaml b/samples/phoenix-postgres/.github/workflows/deploy.yaml index 2a70f343..13cc5327 100644 --- a/samples/phoenix-postgres/.github/workflows/deploy.yaml +++ b/samples/phoenix-postgres/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-phoenix-postgres-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/phoenix-postgres/compose.yaml b/samples/phoenix-postgres/compose.yaml index 8b58b231..f32ebdec 100644 --- a/samples/phoenix-postgres/compose.yaml +++ b/samples/phoenix-postgres/compose.yaml @@ -6,15 +6,15 @@ services: context: ./server dockerfile: Dockerfile ports: - - target: 4000 - mode: ingress - published: 4000 + - target: 4000 + mode: ingress + published: 4000 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 1024M environment: - - PORT=4000 - - SECRET_KEY_BASE - - DATABASE_URL + - PORT=4000 + - SECRET_KEY_BASE + - DATABASE_URL diff --git a/samples/platformatic/.github/workflows/deploy.yaml b/samples/platformatic/.github/workflows/deploy.yaml index 326b10d9..4918ab4c 100644 --- a/samples/platformatic/.github/workflows/deploy.yaml +++ b/samples/platformatic/.github/workflows/deploy.yaml @@ -4,17 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-platformatic-${{ github.event.inputs.stack || 'default' }} + steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/platformatic/compose.yaml b/samples/platformatic/compose.yaml index 8c3fd80b..0367cdef 100644 --- a/samples/platformatic/compose.yaml +++ b/samples/platformatic/compose.yaml @@ -5,9 +5,9 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 3042 - published: 3042 - mode: ingress + - target: 3042 + published: 3042 + mode: ingress environment: NODE_ENV: production PLT_SERVER_HOSTNAME: 0.0.0.0 @@ -19,5 +19,5 @@ services: deploy: resources: limits: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/python-form/.github/workflows/deploy.yaml b/samples/python-form/.github/workflows/deploy.yaml index 2a70f343..9836cca5 100644 --- a/samples/python-form/.github/workflows/deploy.yaml +++ b/samples/python-form/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-python-form-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/python-form/compose.yaml b/samples/python-form/compose.yaml index 2be8922e..111e8948 100644 --- a/samples/python-form/compose.yaml +++ b/samples/python-form/compose.yaml @@ -6,15 +6,15 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 5000 + - mode: ingress + target: 5000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:5000/ + - CMD + - curl + - -f + - http://localhost:5000/ diff --git a/samples/python-implicit-gpu/.github/workflows/deploy.yaml b/samples/python-implicit-gpu/.github/workflows/deploy.yaml index 2a70f343..14cad1a6 100644 --- a/samples/python-implicit-gpu/.github/workflows/deploy.yaml +++ b/samples/python-implicit-gpu/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-python-implicit-gpu-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/python-implicit-gpu/compose.yaml b/samples/python-implicit-gpu/compose.yaml index a230b72e..397592aa 100644 --- a/samples/python-implicit-gpu/compose.yaml +++ b/samples/python-implicit-gpu/compose.yaml @@ -8,17 +8,17 @@ services: deploy: resources: reservations: - cpus: '1.0' + cpus: "1.0" memory: 2048M devices: - - capabilities: - - gpu + - capabilities: + - gpu ports: - - mode: ingress - target: 5000 + - mode: ingress + target: 5000 healthcheck: test: - - CMD - - curl - - -f - - http://localhost:5000/ + - CMD + - curl + - -f + - http://localhost:5000/ diff --git a/samples/python-minimal/.github/workflows/deploy.yaml b/samples/python-minimal/.github/workflows/deploy.yaml index 2a70f343..2081d9e0 100644 --- a/samples/python-minimal/.github/workflows/deploy.yaml +++ b/samples/python-minimal/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-python-minimal-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/python-minimal/compose.yaml b/samples/python-minimal/compose.yaml index dccb7992..d6f4c9b7 100644 --- a/samples/python-minimal/compose.yaml +++ b/samples/python-minimal/compose.yaml @@ -6,15 +6,15 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 5000 + - mode: ingress + target: 5000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:5000/ + - CMD + - curl + - -f + - http://localhost:5000/ diff --git a/samples/python-openai/.github/workflows/deploy.yaml b/samples/python-openai/.github/workflows/deploy.yaml index 2a70f343..9b27a99d 100644 --- a/samples/python-openai/.github/workflows/deploy.yaml +++ b/samples/python-openai/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-python-openai-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/python-openai/compose.yaml b/samples/python-openai/compose.yaml index 88ad047d..9d131ec2 100644 --- a/samples/python-openai/compose.yaml +++ b/samples/python-openai/compose.yaml @@ -6,17 +6,17 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 5000 + - mode: ingress + target: 5000 environment: - - OPENAI_KEY + - OPENAI_KEY deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:5000/ + - CMD + - curl + - -f + - http://localhost:5000/ diff --git a/samples/python-rest-api/.github/workflows/deploy.yaml b/samples/python-rest-api/.github/workflows/deploy.yaml index 2a70f343..d7c658b4 100644 --- a/samples/python-rest-api/.github/workflows/deploy.yaml +++ b/samples/python-rest-api/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-python-rest-api-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/python-rest-api/compose.yaml b/samples/python-rest-api/compose.yaml index 272809b4..765ce6ab 100644 --- a/samples/python-rest-api/compose.yaml +++ b/samples/python-rest-api/compose.yaml @@ -6,15 +6,15 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 5000 + - mode: ingress + target: 5000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:5000/ + - CMD + - curl + - -f + - http://localhost:5000/ diff --git a/samples/python-s3/.github/workflows/deploy.yaml b/samples/python-s3/.github/workflows/deploy.yaml index 2a70f343..46dc2924 100644 --- a/samples/python-s3/.github/workflows/deploy.yaml +++ b/samples/python-s3/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-python-s3-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/python-s3/compose.yaml b/samples/python-s3/compose.yaml index aa78a355..455ec785 100644 --- a/samples/python-s3/compose.yaml +++ b/samples/python-s3/compose.yaml @@ -6,18 +6,18 @@ services: context: ./app dockerfile: Dockerfile ports: - - mode: ingress - target: 5000 + - mode: ingress + target: 5000 environment: - - AWS_ACCESS_KEY - - AWS_SECRET_KEY + - AWS_ACCESS_KEY + - AWS_SECRET_KEY deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:5000/ + - CMD + - curl + - -f + - http://localhost:5000/ diff --git a/samples/rails/.github/workflows/deploy.yaml b/samples/rails/.github/workflows/deploy.yaml index 2811f979..fee8802b 100644 --- a/samples/rails/.github/workflows/deploy.yaml +++ b/samples/rails/.github/workflows/deploy.yaml @@ -4,22 +4,53 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-rails-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + # Defang will initialize these config vars with random secrets + # If you wish to provide your own secrets: + # 1. Set them in the repo secrets, + # 2. Remove them from the `config-vars-init-random` list + # 3. Add them to the `config-env-vars` list below + config-vars-init-random: POSTGRES_PASSWORD + config-env-vars: "" + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - with: - config-env-vars: POSTGRES_PASSWORD - env: - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/rails/compose.yaml b/samples/rails/compose.yaml index bca98c0c..d96fea67 100644 --- a/samples/rails/compose.yaml +++ b/samples/rails/compose.yaml @@ -6,48 +6,48 @@ services: context: ./app dockerfile: Dockerfile env_file: - - .env + - .env environment: POSTGRES_PASSWORD: null ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 1GB healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000 + - CMD + - curl + - -f + - http://localhost:3000 interval: 10s timeout: 5s retries: 5 depends_on: - - db - - migrate + - db + - migrate migrate: - restart: 'no' + restart: "no" build: context: ./app dockerfile: Dockerfile env_file: - - .env + - .env environment: POSTGRES_PASSWORD: null command: - - bin/rails - - db:prepare + - bin/rails + - db:prepare depends_on: db: condition: service_healthy deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M db: restart: unless-stopped @@ -56,12 +56,12 @@ services: environment: POSTGRES_PASSWORD: null ports: - - mode: host - target: 5432 + - mode: host + target: 5432 healthcheck: test: - - CMD-SHELL - - pg_isready -U postgres + - CMD-SHELL + - pg_isready -U postgres interval: 10s timeout: 5s retries: 5 diff --git a/samples/react-vite-railpack/.github/workflows/deploy.yaml b/samples/react-vite-railpack/.github/workflows/deploy.yaml index 179979b8..61fa0040 100644 --- a/samples/react-vite-railpack/.github/workflows/deploy.yaml +++ b/samples/react-vite-railpack/.github/workflows/deploy.yaml @@ -4,17 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-react-vite-railpack-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/react-vite-railpack/compose.yaml b/samples/react-vite-railpack/compose.yaml index fae2b1dd..72d406d6 100644 --- a/samples/react-vite-railpack/compose.yaml +++ b/samples/react-vite-railpack/compose.yaml @@ -7,9 +7,9 @@ services: environment: PORT: 5173 ports: - - target: 5173 - published: 5173 - mode: ingress + - target: 5173 + published: 5173 + mode: ingress deploy: resources: reservations: diff --git a/samples/react/.github/workflows/deploy.yaml b/samples/react/.github/workflows/deploy.yaml index 179979b8..8cfe4276 100644 --- a/samples/react/.github/workflows/deploy.yaml +++ b/samples/react/.github/workflows/deploy.yaml @@ -4,17 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-react-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/react/compose.yaml b/samples/react/compose.yaml index 059aaa4d..9ab76924 100644 --- a/samples/react/compose.yaml +++ b/samples/react/compose.yaml @@ -6,16 +6,16 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 5173 - published: 5173 - mode: ingress + - target: 5173 + published: 5173 + mode: ingress deploy: resources: reservations: memory: 512M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:5173/ + - CMD + - curl + - -f + - http://localhost:5173/ diff --git a/samples/redis-js/.github/workflows/deploy.yaml b/samples/redis-js/.github/workflows/deploy.yaml index 13bd872a..3ee1e033 100644 --- a/samples/redis-js/.github/workflows/deploy.yaml +++ b/samples/redis-js/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-redis-js-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/redis-js/compose.yaml b/samples/redis-js/compose.yaml index 4ebd6c94..df229d5d 100644 --- a/samples/redis-js/compose.yaml +++ b/samples/redis-js/compose.yaml @@ -3,27 +3,27 @@ services: app: build: ./app ports: - - 3000:3000 + - 3000:3000 environment: - - REDISX_URL=redis://redisx:6379 + - REDISX_URL=redis://redisx:6379 depends_on: - - redisx + - redisx deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M redisx: image: redis:latest x-defang-redis: true restart: unless-stopped ports: - - target: 6379 - published: 6379 - protocol: tcp - mode: host + - target: 6379 + published: 6379 + protocol: tcp + mode: host deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/rocket/.github/workflows/deploy.yaml b/samples/rocket/.github/workflows/deploy.yaml index 2a70f343..643c45c3 100644 --- a/samples/rocket/.github/workflows/deploy.yaml +++ b/samples/rocket/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-rocket-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/rocket/compose.yaml b/samples/rocket/compose.yaml index df1dfdf5..83b1d50a 100644 --- a/samples/rocket/compose.yaml +++ b/samples/rocket/compose.yaml @@ -5,17 +5,17 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 8080 - published: 8080 - mode: ingress + - target: 8080 + published: 8080 + mode: ingress healthcheck: test: - - CMD - - curl - - -f - - http://localhost:8080 + - CMD + - curl + - -f + - http://localhost:8080 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/sailsjs-postgres/.github/workflows/deploy.yaml b/samples/sailsjs-postgres/.github/workflows/deploy.yaml index 2a70f343..8a3c7660 100644 --- a/samples/sailsjs-postgres/.github/workflows/deploy.yaml +++ b/samples/sailsjs-postgres/.github/workflows/deploy.yaml @@ -4,18 +4,52 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-sailsjs-postgres-${{ github.event.inputs.stack || 'default' }} steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + # Defang will initialize these config vars with random secrets + # If you wish to provide your own secrets: + # 1. Set them in the repo secrets, + # 2. Remove them from the `config-vars-init-random` list + # 3. Add them to the `config-env-vars` list below + config-vars-init-random: DATABASE_URL SESSION_SECRET + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + SESSION_SECRET: ${{ secrets.SESSION_SECRET }} + + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/sailsjs-postgres/compose.yaml b/samples/sailsjs-postgres/compose.yaml index 67f60e51..8b53588c 100644 --- a/samples/sailsjs-postgres/compose.yaml +++ b/samples/sailsjs-postgres/compose.yaml @@ -4,28 +4,28 @@ services: restart: unless-stopped build: ./app ports: - - target: 1337 - published: 1337 - mode: ingress + - target: 1337 + published: 1337 + mode: ingress environment: DATABASE_URL: null SESSION_SECRET: null command: - - sails - - lift - - --prod + - sails + - lift + - --prod networks: - - app-network + - app-network healthcheck: test: - - CMD - - curl - - -f - - http://localhost:1337/ + - CMD + - curl + - -f + - http://localhost:1337/ deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M networks: app-network: diff --git a/samples/sailsjs/.github/workflows/deploy.yaml b/samples/sailsjs/.github/workflows/deploy.yaml index 2a70f343..31d3f59d 100644 --- a/samples/sailsjs/.github/workflows/deploy.yaml +++ b/samples/sailsjs/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-sailsjs-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/sailsjs/compose.yaml b/samples/sailsjs/compose.yaml index f37b6002..2f35fc52 100644 --- a/samples/sailsjs/compose.yaml +++ b/samples/sailsjs/compose.yaml @@ -5,18 +5,18 @@ services: build: context: ./sails ports: - - target: 1337 - published: 1337 - protocol: tcp - mode: ingress + - target: 1337 + published: 1337 + protocol: tcp + mode: ingress volumes: - - ./sails:/usr/src/app - - /usr/src/app/node_modules + - ./sails:/usr/src/app + - /usr/src/app/node_modules environment: - - NODE_ENV=production + - NODE_ENV=production command: sails lift --prod deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M diff --git a/samples/svelte-mysql/.github/workflows/deploy.yaml b/samples/svelte-mysql/.github/workflows/deploy.yaml index 2a70f343..28fc5c2c 100644 --- a/samples/svelte-mysql/.github/workflows/deploy.yaml +++ b/samples/svelte-mysql/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-svelte-mysql-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/svelte-mysql/compose.yaml b/samples/svelte-mysql/compose.yaml index 5095b703..bcc2aa2a 100644 --- a/samples/svelte-mysql/compose.yaml +++ b/samples/svelte-mysql/compose.yaml @@ -9,14 +9,14 @@ services: MYSQL_USER: admin MYSQL_PASSWORD: Defang12345 volumes: - - mysql_data:/var/lib/mysql + - mysql_data:/var/lib/mysql ports: - - mode: host - target: 3306 + - mode: host + target: 3306 deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M app: restart: unless-stopped @@ -27,19 +27,19 @@ services: DATABASE_PASSWORD: Defang12345 DATABASE_NAME: todoApp ports: - - 3001:3001 + - 3001:3001 depends_on: - - db + - db healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3001/ + - CMD + - curl + - -f + - http://localhost:3001/ deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M volumes: mysql_data: null diff --git a/samples/sveltekit-mongodb/.github/workflows/deploy.yaml b/samples/sveltekit-mongodb/.github/workflows/deploy.yaml index 2a70f343..8efc4aed 100644 --- a/samples/sveltekit-mongodb/.github/workflows/deploy.yaml +++ b/samples/sveltekit-mongodb/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-sveltekit-mongodb-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/sveltekit-mongodb/compose.yaml b/samples/sveltekit-mongodb/compose.yaml index d387c954..76e406b9 100644 --- a/samples/sveltekit-mongodb/compose.yaml +++ b/samples/sveltekit-mongodb/compose.yaml @@ -13,35 +13,35 @@ services: PORT: 3000 MONGODB_URI: mongodb://mongo:27017/musicdb ports: - - 3000:3000 + - 3000:3000 depends_on: - - mongo + - mongo healthcheck: test: - - CMD - - curl - - -f - - http://localhost:3000/ + - CMD + - curl + - -f + - http://localhost:3000/ deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M mongo: restart: unless-stopped image: mongo:latest ports: - - mode: host - target: 27017 + - mode: host + target: 27017 volumes: - - mongo-data:/data/db + - mongo-data:/data/db environment: MONGO_INITDB_DATABASE: musicdb x-defang-mongodb: true deploy: resources: reservations: - cpus: '0.5' + cpus: "0.5" memory: 512M volumes: mongo-data: null diff --git a/samples/sveltekit/.github/workflows/deploy.yaml b/samples/sveltekit/.github/workflows/deploy.yaml index 2a70f343..1ba1c618 100644 --- a/samples/sveltekit/.github/workflows/deploy.yaml +++ b/samples/sveltekit/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-sveltekit-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/sveltekit/compose.yaml b/samples/sveltekit/compose.yaml index 47641e93..93cc1baf 100644 --- a/samples/sveltekit/compose.yaml +++ b/samples/sveltekit/compose.yaml @@ -6,11 +6,11 @@ services: context: ./sveltekit dockerfile: Dockerfile ports: - - target: 3000 - mode: ingress - published: 3000 + - target: 3000 + mode: ingress + published: 3000 deploy: resources: reservations: - cpus: '0.50' + cpus: "0.50" memory: 512M diff --git a/samples/vllm/.github/workflows/deploy.yaml b/samples/vllm/.github/workflows/deploy.yaml index 2a70f343..62df00f3 100644 --- a/samples/vllm/.github/workflows/deploy.yaml +++ b/samples/vllm/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-vllm-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 \ No newline at end of file + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/vllm/compose.yaml b/samples/vllm/compose.yaml index 3cc399f3..659c61ea 100644 --- a/samples/vllm/compose.yaml +++ b/samples/vllm/compose.yaml @@ -4,65 +4,65 @@ services: restart: unless-stopped image: ghcr.io/mistralai/mistral-src/vllm:latest ports: - - mode: host - target: 8000 + - mode: host + target: 8000 command: - - --host - - 0.0.0.0 - - --model - - TheBloke/Mistral-7B-Instruct-v0.2-AWQ - - --quantization - - awq - - --dtype - - auto - - --tensor-parallel-size - - '1' - - --gpu-memory-utilization - - '.95' - - --max-model-len - - '8000' + - --host + - 0.0.0.0 + - --model + - TheBloke/Mistral-7B-Instruct-v0.2-AWQ + - --quantization + - awq + - --dtype + - auto + - --tensor-parallel-size + - "1" + - --gpu-memory-utilization + - ".95" + - --max-model-len + - "8000" deploy: resources: reservations: - cpus: '2.0' + cpus: "2.0" memory: 8192M devices: - - capabilities: - - gpu - count: 1 + - capabilities: + - gpu + count: 1 healthcheck: test: - - CMD - - python3 - - -c - - import sys, urllib.request;urllib.request.urlopen(sys.argv[1]).read() - - http://localhost:8000/health + - CMD + - python3 + - -c + - import sys, urllib.request;urllib.request.urlopen(sys.argv[1]).read() + - http://localhost:8000/health interval: 1m environment: - - HF_TOKEN + - HF_TOKEN ui: restart: unless-stopped build: context: ui dockerfile: Dockerfile ports: - - mode: ingress - target: 3000 - published: 3000 + - mode: ingress + target: 3000 + published: 3000 deploy: resources: reservations: memory: 256M healthcheck: test: - - CMD - - wget - - --spider - - http://localhost:3000 + - CMD + - wget + - --spider + - http://localhost:3000 interval: 10s timeout: 2s retries: 10 environment: - - OPENAI_BASE_URL=http://mistral:8000/v1/ + - OPENAI_BASE_URL=http://mistral:8000/v1/ depends_on: - - mistral + - mistral diff --git a/samples/vuejs/.github/workflows/deploy.yaml b/samples/vuejs/.github/workflows/deploy.yaml index 13bd872a..1f15b36f 100644 --- a/samples/vuejs/.github/workflows/deploy.yaml +++ b/samples/vuejs/.github/workflows/deploy.yaml @@ -4,18 +4,44 @@ on: push: branches: - main + workflow_dispatch: + inputs: + action: + description: "Whether to deploy up or down" + required: true + default: "up" + type: choice + options: + - up + - down + stack: + description: "The stack to deploy up or down. (Leave blank for default)" + default: "" jobs: - deploy: - environment: playground + defang: + name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write + concurrency: + cancel-in-progress: false + group: deploy-vuejs-${{ github.event.inputs.stack || 'default' }} + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ github.event.inputs.stack || 'default stack' }} + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: ${{ github.event.inputs.action || 'up' }} + stack: ${{ github.event.inputs.stack || '' }} - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 + - name: Deployment Summary + uses: DefangLabs/defang-github-action@v1.4.0 + with: + command: services diff --git a/samples/vuejs/compose.yaml b/samples/vuejs/compose.yaml index d4f8f8e2..ff98764d 100644 --- a/samples/vuejs/compose.yaml +++ b/samples/vuejs/compose.yaml @@ -6,16 +6,16 @@ services: context: ./app dockerfile: Dockerfile ports: - - target: 5173 - published: 5173 - mode: ingress + - target: 5173 + published: 5173 + mode: ingress deploy: resources: reservations: memory: 512M healthcheck: test: - - CMD - - curl - - -f - - http://localhost:5173/ + - CMD + - curl + - -f + - http://localhost:5173/ diff --git a/starter-sample/.github/workflows/deploy.yaml b/starter-sample/.github/workflows/deploy.yaml index 56d47b90..b0e582fc 100644 --- a/starter-sample/.github/workflows/deploy.yaml +++ b/starter-sample/.github/workflows/deploy.yaml @@ -7,22 +7,22 @@ on: jobs: deploy: - environment: playground + environment: production runs-on: ubuntu-latest permissions: contents: read id-token: write steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - name: Checkout Repo + uses: actions/checkout@v4 - - name: Deploy - uses: DefangLabs/defang-github-action@v1.3.2 - #REMOVE_ME_AFTER_EDITING - Replace the following line with the list of environment variables you want to pass to the action - # or remove the lines if you don't need to pass any environment variables/secrets to the action - with: - config-env-vars: ENV1 ENV2 - env: - ENV1: ${{ secrets.ENV1 }} - ENV2: ${{ secrets.ENV2 }} \ No newline at end of file + - name: Deploy + uses: DefangLabs/defang-github-action@v1.3.2 + #REMOVE_ME_AFTER_EDITING - Replace the following line with the list of environment variables you want to pass to the action + # or remove the lines if you don't need to pass any environment variables/secrets to the action + with: + config-env-vars: ENV1 ENV2 + env: + ENV1: ${{ secrets.ENV1 }} + ENV2: ${{ secrets.ENV2 }}