You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blog/2024-03-20-dev-environments.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ We want it to be easy for you to try Defang with as little friction as possible,
15
15
16
16
## Codespaces
17
17
18
-
If you want to get started with Codespaces, you can just fork [this repo](https://github.com/DefangLabs/github-codespace). It comes with the Defang CLI pre-installed so you can start playing with it immediately. It's setup using the Defang CLI [Dev Container Feature](https://github.com/DefangLabs/devcontainer-feature/pkgs/container/devcontainer-feature%2Fdefang-cli).
18
+
If you want to get started with Codespaces, you can just fork [this repo](https://github.com/DefangLabs/github-codespace). It comes with the Defang CLI pre-installed so you can start playing with it immediately. It's set up using the Defang CLI [Dev Container Feature](https://github.com/DefangLabs/devcontainer-feature/pkgs/container/devcontainer-feature%2Fdefang-cli).
Copy file name to clipboardExpand all lines: blog/2024-11-12-hard-lessons-from-hardware.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ This is what the Flask server looked like on my computer as it got pinged:
41
41
42
42
Hooray! Once everything was working, It was time to deploy my Flask code as a cloud service so I could access it from any computer, not just my own. Deployment usually takes several hours due to configuring a ton of cloud provider settings. But I ain’t got time for that. Instead, I used Defang to deploy it within minutes, which took care of all that for me. Saved me a lot of time and tears.
43
43
44
-
Here’s the Flask deployment on Defang’s portal view:
44
+
Here’s the Flask deployment on Defang’s Portal view:
Copy file name to clipboardExpand all lines: docs/concepts/configuration.md
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,9 @@ sidebar_position: 225
6
6
7
7
# Configuration
8
8
9
-
Defang allows you to configure your application using environment variables. You can set environment variables in your [`compose.yaml` file](./compose.md), or in your [Pulumi program](./pulumi.md). Using Pulumi gives you the advantage of being able to manage your environment variables across different environments using Pulumi stacks.
9
+
Defang allows you to configure your application using environment variables. You can set environment variables in your [`compose.yaml` file](./compose.md), or in your [Pulumi program](#using-config-with-pulumi).
10
10
11
-
:::tip Sample
12
-
You can find a sample of how to set environment variables with Pulumi [here](https://github.com/DefangLabs/defang/tree/main/samples/nodejs/remix-aiven-postgres).
13
-
:::
14
-
15
-
# Sensitive Config aka Secrets
11
+
# Sensitive Config (aka Secrets)
16
12
17
13
The Defang CLI allows you to securely store sensitive information such as API keys, passwords, and other credentials. To do so, run:
18
14
@@ -44,6 +40,10 @@ services:
44
40
45
41
Use the `defang config` command of the Defang CLI to manage the values.
46
42
43
+
:::tip
44
+
You can find a sample of how to set sensitive config values [here](https://github.com/DefangLabs/samples/tree/main/samples/nodejs-openai).
45
+
:::
46
+
47
47
## Interpolation
48
48
49
49
Environment variables are set within the *environment* section of a service in a `compose.yaml` file. Any variables declared here will become available within the service container.
@@ -62,18 +62,24 @@ In the example above, if we assume the value of the configuration variable ***US
62
62
63
63
During `defang compose up` all variable references will be replaced with the actual value and made available in the container. If any referenced variable is not found the `defang compose up` command will be canceled.
64
64
65
+
## Using Config with Pulumi
66
+
In Defang, using config with [Pulumi](./pulumi.md) gives you the advantage of being able to manage your environment variables across different environments using Pulumi stacks.
67
+
68
+
:::tip
69
+
You can find a sample of how to set environment variables with Pulumi [here](https://github.com/DefangLabs/samples/tree/main/samples/pulumi-remix-postgres).
70
+
:::
71
+
65
72
## Connecting Services
66
73
67
74
If you have created a service before a secret you can connect it by running the `defang compose start` command if using the [`defang compose` workflow](./compose.md). If you are using the [Pulumi-based workflow](./pulumi.md) you will need to redeploy using Pulumi.
68
75
69
-
:::tip Sample
70
-
You can find a sample of how to set sensitive config values [here](https://github.com/DefangLabs/defang/tree/main/samples/nodejs/ChatGPT%20API).
71
-
:::
72
-
73
76
## Providers
74
77
75
78
Here are the different ways sensitive config values are stored depending on the provider you are using:
Copy file name to clipboardExpand all lines: docs/concepts/debug.md
+20-6Lines changed: 20 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,16 +6,30 @@ sidebar_position: 650
6
6
7
7
# Debug
8
8
9
-
Defang includes an AI-driven tool to help you debug your cloud applications. The AI agent will use your service logs as well as the files in your project to help you identify and resolve issues.
9
+
Defang includes an AI-driven tool in the CLI (command-line interface) to help you debug your cloud applications. The AI agent will use your service logs as well as the files in your project to help you identify and resolve issues.
10
10
11
-
:::warning
12
-
The AI debugging agent is currently in preview and is currently limited in its capabilities. We plan to expand the capabilities of the AI agent in the future.
11
+
:::info
12
+
Defang has another AI-driven tool called [`generate`](/docs/concepts/generate).
13
13
:::
14
14
15
-
## How it works
15
+
## How It Works
16
+
17
+
Here is a typical workflow in the [Defang CLI](/docs/getting-started) that will automatically run the AI debugger tool:
18
+
19
+
1. When you deploy a project with Defang (i.e. `defang compose up`), the CLI will wait for all services' statuses to switch to healthy.
20
+
21
+
2. If any service fails to deploy, the AI debugger will kick in and ask for permission.
22
+
23
+
3. The AI agent will analyze the logs and files in your project to identify the issue(s).
24
+
25
+
4. Then, it will provide you with the suggested fix(es) in the terminal.
26
+
27
+
:::tip
28
+
The AI debugger will not change your files. Instead, it will show you a suggestion, and it is up to you if you want to use it in your code.
29
+
:::
16
30
17
-
When you deploy a project with Defang, the CLI will wait for all services' statuses to switch to healthy. If any service fails to deploy, the AI debugger will kick in. It will analyze the logs and files in your project to identify the issue and provide you with a suggested fix. **The AI debugger will not change your files.**
31
+
The AI debugger only kicks in when any service in a project fails to deploy. This could be because of a build failure, healthchecks failing, or a variety of other issues.
18
32
19
33
:::info
20
-
The AI debugger only kicks in when any service in a project fails to deploy. This could be because of a build failure, healthchecks failing, or a variety of other issues. At the moment, we do not offer any way to trigger the AI debugger manually.
34
+
The AI debugger only kicks in when any service in a project fails to deploy. At the moment, we do not offer any way to trigger the AI debugger manually.
Copy file name to clipboardExpand all lines: docs/concepts/defang-byoc.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ sidebar_position: 50
8
8
9
9
Defang aims to make it easier to deploy your services to the cloud. Specifically, Defang's goal is to make it easier to deploy your workloads to your *own* cloud accounts. We refer to this as bring-your-own-cloud (BYOC). We also provide Defang Playground, but it is only intended for non-production workloads so you can get a feel for how Defang works.
10
10
11
-
Defang provisions and configures the necessary native managed services from your cloud provider to get your services up and running. For example, on AWS, Defang will configure an [ALB](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/), setup[ECR](https://aws.amazon.com/ecr/), configure [CloudWatch](https://aws.amazon.com/cloudwatch/?nc2=type_a), and run your service on [ECS](https://aws.amazon.com/ecs/?nc2=type_a) and more. The following lists the existing and planned support for cloud providers.
11
+
Defang provisions and configures the necessary native managed services from your cloud provider to get your services up and running. For example, on AWS, Defang will configure an [ALB](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/), set up[ECR](https://aws.amazon.com/ecr/), configure [CloudWatch](https://aws.amazon.com/cloudwatch/?nc2=type_a), and run your service on [ECS](https://aws.amazon.com/ecs/?nc2=type_a) and more. The following lists the existing and planned support for cloud providers.
12
12
13
13
:::info
14
14
Defang does not install or run any Defang or third party services at runtime.
Copy file name to clipboardExpand all lines: docs/concepts/generate.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,12 @@ sidebar_position: 100
8
8
9
9
Defang includes an AI-driven agent that translates natural language prompts to an outline for your project that you can then refine. The AI agent is available through the [Defang CLI](../getting-started#install-the-defang-cli.md).
10
10
11
+
We are working on expanding the range of supported prompts and improving the accuracy of the AI agent. If you have any feedback or suggestions, please let us know by [opening an issue](https://github.com/DefangLabs/defang/issues/new).
12
+
11
13
:::info
12
-
The AI agent is currently in preview and only supports a limited set of prompts, varying in complexity. We plan to expand the capabilities of the AI agent in the future.
14
+
This page is about Defang's AI tool for project outline generation. We also have an AI tool for [debugging](/docs/concepts/debug).
13
15
:::
14
16
15
-
We are working on expanding the range of supported prompts and improving the accuracy of the AI agent. If you have any feedback or suggestions, please let us know by [opening an issue](https://github.com/DefangLabs/defang/issues/new).
16
-
17
17
## Example Prompts
18
18
19
19
Here are some example prompts that the AI agent can help you with:
@@ -45,5 +45,5 @@ An HTTP GET endpoint that returns an HTML with a random meme from the imgflip AP
45
45
**An example of a more complex prompt**
46
46
47
47
```
48
-
A service that uses bullmq and redis. The compose file should also include a redis service. The code should setup a queue. It should also expose three endpoints with express: one to add a job to the queue, another to check how many tasks are in the queue, and a last one that runs on / which is just a healthcheck. The code should also include a worker that processes the queue by logging what's in each task. Use environment variables to configure the redis connection. No password.
49
-
```
48
+
A service that uses bullmq and redis. The compose file should also include a redis service. The code should set up a queue. It should also expose three endpoints with express: one to add a job to the queue, another to check how many tasks are in the queue, and a last one that runs on / which is just a healthcheck. The code should also include a worker that processes the queue by logging what's in each task. Use environment variables to configure the redis connection. No password.
Copy file name to clipboardExpand all lines: docs/concepts/observability.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ sidebar_position: 600
8
8
9
9
You can easily monitor and debug your Defang services at build and runtime using the Defang CLI and portal.
10
10
11
-
When you deploy a service using the `defang compose up` the CLI will automatically start tailing the build and runtime logs for your service. You can also view the logs for your service in the portal, or by using the `defang tail` command.
11
+
When you deploy a service using the `defang compose up`, the CLI will automatically start tailing the build and runtime logs for your service. You can also view the logs for your service in the portal, or by using the `defang tail` command.
12
12
13
13
:::warning
14
14
Keep in mind that the Defang Portal only displays services deployed to Defang Playground.
0 commit comments