Skip to content

Commit 94b8dd1

Browse files
committed
Update sample after setting env vars
1 parent d47ca90 commit 94b8dd1

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

samples/mastra-nextjs/.github/workflows/deploy.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ jobs:
2424
env:
2525
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}

samples/mastra-nextjs/README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,9 @@ The password for your Postgres database. You need to set this before deploying f
5252

5353
_You can easily set this to a random string using `defang config set POSTGRES_PASSWORD --random`_
5454

55-
### `GOOGLE_VERTEX_PROJECT` (Only for GCP deployments)
56-
57-
The GCP project ID where you want to deploy the application. You can find this in the [GCP Console](https://console.cloud.google.com/). This environment variable is used in this library: [google-vertex-ai](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex).
58-
59-
### `GOOGLE_VERTEX_LOCATION` (Only for GCP deployments)
60-
61-
The GCP region where you want to deploy the application. This should typically be set to `us-central1`, but you can change it to your preferred location.This environment variable is used in this library: [google-vertex-ai](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex).
62-
6355
### `LLM_MODEL`
6456

65-
The large language model to use for the AI-powered chat. This can be set to models like `anthropic.claude-3-5-sonnet-20241022-v2:0` for AWS or `gemini-2.5-flash` for Google Cloud. Here is a list of supported models for [GCP](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#model-capabilities) and [AWS](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#model-capabilities). For AWS make sure you [request access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) to the model in the AWS Bedrock console.
66-
67-
### `DB_URL`
68-
69-
The [PostgreSQL database connection string](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING). This will be automatically configured when using BYOC managed database services. It should look something like this: `postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]`.
57+
The large language model to use for the AI-powered chat. This can be set to models like `anthropic.claude-3-5-sonnet-20241022-v2:0` for AWS or `gemini-2.5-flash` for Google Cloud. Here is a list of supported models for [GCP](https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex#model-capabilities) and [AWS](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock#model-capabilities). For AWS make sure you [request access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) to the model in AWS Bedrock console and for GCP make sure you have [request access](https://docs.cloud.google.com/marketplace/docs/enable-ai-models#get-ai-models) to the model in GCP Vertex AI console.
7058

7159
### `DB_SSL`
7260

@@ -105,6 +93,8 @@ The large context window of Gemini Flash allows the agent to hold more code in m
10593
10694
### Defang Playground
10795

96+
When deploying we only allow you to use the model `claude-3-5-haiku-20241022` due to resource constraints in the Playground environment. If you want to use other models, please use [Defang BYOC](https://docs.defang.io/docs/tutorials/deploy-to-your-cloud).
97+
10898
Deploy your application to the Defang Playground by opening up your terminal and typing:
10999

110100
```bash

samples/mastra-nextjs/compose.dev.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ services:
1515
- /app/node_modules
1616

1717
database:
18-
image: postgres:16
18+
extends:
19+
file: compose.yaml
20+
service: database
1921
environment:
2022
- POSTGRES_PASSWORD=password
21-
- POSTGRES_DB=postgres
22-
- POSTGRES_USER=postgres
2323
volumes:
2424
- postgres:/var/lib/postgresql/data
2525

samples/mastra-nextjs/compose.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ services:
77
environment:
88
- DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres
99
- DB_SSL=true # set this to false if deploying to defang playground, true otherwise
10-
- GOOGLE_VERTEX_PROJECT= # To deploy to GCP, please enter your GCP project ID
11-
- GOOGLE_VERTEX_LOCATION= # To deploy to GCP, please enter your GCP region, e.g., us-central1
12-
- LLM_MODEL # gemini-2.5-flash for GCP, anthropic.claude-3-5-sonnet-20241022-v2:0 for AWS
13-
- GITHUB_TOKEN # optional, remove this line if unused
10+
# Figure out what LLM to turn on for Playground deployment
11+
- LLM_MODEL= # gemini-2.5-flash for GCP, anthropic.claude-3-5-sonnet-20241022-v2:0 for AWS
12+
- GITHUB_TOKEN= # optional, remove this line if unused
1413
restart: unless-stopped
1514
ports:
1615
- mode: ingress

0 commit comments

Comments
 (0)