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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/.gitignore

This file was deleted.

46 changes: 46 additions & 0 deletions examples/crewai/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: crewai
runtime: go
description: Example of using defang-aws to deploy the CrewAI sample to AWS
plugins:
providers:
- name: defang-aws
path: ../../bin
config:
pulumi:autonaming:
value:
pattern: Defang-${project}-${stack}-${name}-${hex(7)}
providers:
aws:
resources:
aws:lb/loadBalancer:LoadBalancer:
pattern: ${project}-${stack}-${hex(4)}
aws:lb/targetGroup:TargetGroup:
pattern: ${name}-${hex(4)}
aws:ecs/service:Service:
pattern: ${name}-${hex(4)} # scoped by ecs.Cluster
aws:elasticache/subnetGroup:SubnetGroup:
pattern: defang-${project}-${stack}-${name}-${hex(7)} # lowercase
aws:ecr/repository:Repository:
pattern: defang-${project}-${stack}-${name}-${hex(7)} # lowercase
aws:rds/subnetGroup:SubnetGroup:
pattern: defang-${project}-${stack}-${name}-${hex(7)} # lowercase
azure-native:
resources:
azure-native:containerregistry:Registry:
pattern: ${name}${stack}${hex(7)} # name = sanitized project nam
azure-native:containerregistry:Task:
pattern: ${name}-${hex(7)}
azure-native:app:ManagedEnvironment:
pattern: Defang-${project}-${stack}-${hex(7)}
gcp:
resources:
gcp:serviceaccount/account:Account:
pattern: ${name}-${hex(4)}
gcp:cloudrunv2/service:Service:
pattern: ${project}-${stack}-${name}-${hex(7)} # TODO: sanitize project name
gcp:redis/instance:Instance:
pattern: ${project}-${name}-${hex(7)} # TODO: sanitize project name
pulumi:disable-default-providers:
- eks
- kubernetes
- aws
109 changes: 109 additions & 0 deletions examples/crewai/compose.orig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: crewai
services:
postgres:
image: pgvector/pgvector:pg16
environment:
POSTGRES_PASSWORD: null
x-defang-postgres: true
ports:
- mode: host
target: 5432
published: 5432
deploy:
resources:
reservations:
cpus: "0.5"
memory: 512M
redis:
image: redis:6.2
x-defang-redis: true
ports:
- mode: host
target: 6379
published: 6379
deploy:
resources:
reservations:
cpus: "0.5"
memory: 512M
app:
build:
context: ./app
dockerfile: Dockerfile
command: ./run.sh
ports:
- 8000:8000
depends_on:
- postgres
- redis
environment:
DJANGO_SETTINGS_MODULE: config.settings
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=require # remove sslmode for Playground
REDIS_URL: redis://redis:6379/0
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
DJANGO_SECRET_KEY: null
SSL_MODE: null
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8000/
interval: 5s
timeout: 2s
retries: 10
start_period: 10s
deploy:
resources:
reservations:
cpus: "0.5"
memory: 512M
worker:
build:
context: ./app
dockerfile: Dockerfile
command: celery -A config worker -l info
depends_on:
- postgres
- redis
- chat
- embedding
environment:
DJANGO_SETTINGS_MODULE: config.settings
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres?sslmode=require # remove sslmode for Playground
REDIS_URL: redis://redis:6379/0
OPENAI_API_KEY: defang
DJANGO_SECRET_KEY: null
SSL_MODE: null
deploy:
resources:
reservations:
cpus: "0.5"
memory: 512M
chat:
provider:
type: model
options:
model: chat-default
x-defang-llm: true
environment:
OPENAI_API_KEY: defang
deploy:
resources:
reservations:
cpus: "0.5"
memory: 512M
embedding:
provider:
type: model
options:
model: embedding-default
x-defang-llm: true
environment:
OPENAI_API_KEY: defang
deploy:
resources:
reservations:
cpus: "0.5"
memory: 512M
127 changes: 127 additions & 0 deletions examples/crewai/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
module defang-aws-crewai

go 1.25.9

replace (
github.com/DefangLabs/pulumi-defang/sdk/v2/go/defang-aws => ../../sdk/v2/go/defang-aws
gopkg.in/yaml.v3 => go.yaml.in/yaml/v3 v3.0.1
)

require (
github.com/DefangLabs/pulumi-defang/sdk/v2/go/defang-aws v0.0.0-00010101000000-000000000000
github.com/aws/smithy-go v1.20.2
github.com/pulumi/pulumi-aws/sdk/v7 v7.14.0
github.com/pulumi/pulumi/sdk/v3 v3.231.0
)

require (
dario.cat/mergo v1.0.2 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.4.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/bubbles v1.0.0 // indirect
github.com/charmbracelet/bubbletea v1.3.10 // indirect
github.com/charmbracelet/colorprofile v0.4.3 // indirect
github.com/charmbracelet/lipgloss v1.1.0 // indirect
github.com/charmbracelet/x/ansi v0.11.6 // indirect
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
github.com/charmbracelet/x/term v0.2.2 // indirect
github.com/cheggaaa/pb v1.0.29 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
github.com/djherbis/times v1.6.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.8.0 // indirect
github.com/go-git/go-git/v5 v5.17.2 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.5 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-version v1.8.0 // indirect
github.com/hashicorp/hcl/v2 v2.24.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.6.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.21 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/opentracing/basictracer-go v1.1.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pgavlin/fx v0.1.6 // indirect
github.com/pgavlin/fx/v2 v2.0.12 // indirect
github.com/pjbgf/sha1cd v0.5.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
github.com/pulumi/esc v0.23.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/skeema/knownhosts v1.3.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/zclconf/go-cty v1.18.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/collector/featuregate v1.53.0 // indirect
go.opentelemetry.io/collector/pdata v1.53.0 // indirect
go.opentelemetry.io/otel v1.43.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.41.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.41.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
go.opentelemetry.io/otel/trace v1.43.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
golang.org/x/mod v0.34.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/term v0.41.0 // indirect
golang.org/x/text v0.35.0 // indirect
golang.org/x/tools v0.43.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect
google.golang.org/grpc v1.80.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/frand v1.5.1 // indirect
)
Loading
Loading