Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a15e76e
FAQs
jordanstephens Nov 26, 2024
c7abd51
rough pass on deployment modes
jordanstephens Nov 26, 2024
96083f4
rough provider tutorials
jordanstephens Nov 26, 2024
f405164
fix links
jordanstephens Nov 26, 2024
8aead43
add a video to the intro page
jordanstephens Nov 26, 2024
d1eacb6
tighten up the sidebar
jordanstephens Nov 26, 2024
02f2395
rewording
commit111 Nov 26, 2024
5c37f43
capitalize tutorial titles
commit111 Nov 26, 2024
765bc78
keep steps using hypen instead of colon + vllm link
commit111 Nov 26, 2024
cca6b71
fix tip for aws sts caller identity
commit111 Nov 26, 2024
b876ec2
fix digital ocean wording
commit111 Nov 26, 2024
26f6c93
fix digital ocean wording
commit111 Nov 27, 2024
e401be2
Merge branch 'jordan/launch-prep' of https://github.com/DefangLabs/de…
commit111 Nov 27, 2024
4a44e8d
more typo fixes
commit111 Nov 27, 2024
379c7e3
faq cloud support question
commit111 Nov 27, 2024
de382d9
change ai assistant to ai agent
commit111 Nov 27, 2024
a76c421
faq aws question
commit111 Nov 27, 2024
1ab2232
better version of faq aws question
commit111 Nov 27, 2024
98f39d0
omit postgres upgrade section
commit111 Nov 27, 2024
534cad3
data stores mention managed postgres/redis
commit111 Nov 28, 2024
9bed739
better version of data store section
commit111 Nov 28, 2024
776d5c7
refined data store again
commit111 Nov 28, 2024
3f16324
remove distracting notes about deployment modes
jordanstephens Nov 28, 2024
9a41dab
reword data stores
commit111 Nov 28, 2024
119acc8
Merge branch 'jordan/launch-prep' of https://github.com/DefangLabs/de…
commit111 Nov 28, 2024
8185c3e
links to object storage in data stores
commit111 Nov 28, 2024
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
3 changes: 1 addition & 2 deletions docs/concepts/_category_.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"label": "Concepts",
"position": 300,
"position": 500,
"link": {
"type": "generated-index",
"description": "Some concepts to help explain how the Defang system is organized and tooling that will help you manage your applications."
}
}

26 changes: 26 additions & 0 deletions docs/concepts/deployment-modes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Defang Deployment Modes
description: Defang provides three deployment modes which allow you to balance cost and resiliency.
sidebar_position: 501
---

# Defang Deployment Modes

Defang provides three deployment modes: development, staging, and production. These modes allow you to balance cost and resiliency according to your needs.

* **Development**: This mode is used for development and testing purposes. It typically involves less stringent resource allocations and may include debugging tools and verbose logging to aid in development.
* **Staging**: This mode serves as a pre-production environment where applications are tested in conditions that closely mimic production. It helps in identifying issues that might not be apparent in the development environment.
* **Production**: This mode is used for live deployments. It involves optimized configurations for performance, security, and reliability. Resource allocations are typically higher, and debugging tools are minimized to ensure stability.

## Deployment Mode Comparison

| Feature | Development | Staging | Production |
|-|-|-|-|
| Build Resources | Builds will be run with 2x vCPUs | Builds will be run with 2x vCPUs | Builds will be run with 4x vCPUs |
| Databases | Defang will provision resources optimized for burstable memory | | Defang will provision resources optimized for production |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we say something about behavior on 'compose down'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I think we should create a Databases concept topic where we can discuss the subtlety more carefully 👍

| Static Resources | | | Defang will provision a CDN |
| Object Storage | S3 contents will be lost when deprovisioned. | | S3 contents will be retained if the bucket is deprovisioned. |
| Deployment | Previous deployments will be spun down before new deployments are spun up. | | Rolling updates will be used to deploy new versions. |
| Logging | Logs retained for 1 day to save costs. | | Logs retained for 30 days for compliance. |
| Networking | Defang will provision a bastion box. | | Defang will provision a NAT gateway. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we define "bastion box" anywhere.

| DNS | Defang will provision shorter TTLs | | Defang will provision longer TTLs |
34 changes: 29 additions & 5 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: Frequently asked questions about Defang.

### Can I bring my own AWS or other cloud account?

- Yes! Please check out the [Defang BYOC](./concepts/defang-byoc.md) documentation for more information.
- Yes! Defang makes it easy to deploy your application to your own cloud account. Please check out the [Defang BYOC](./concepts/defang-byoc.md) documentation for more information.

### On AWS, can I deploy to services such as EC2, EKS, or Lambda?

Expand All @@ -23,13 +23,37 @@ description: Frequently asked questions about Defang.

- Yes, you can access whatever other resources exist in the cloud account you are using as a [Defang BYOC](./concepts/defang-byoc.md) Provider.

### Do you plan to support other clouds?
### Can I run production apps with Defang?

- While we currently support AWS as a [Defang BYOC](./concepts/defang-byoc.md) Provider, we plan to support other clouds in future releases, such as [Azure](./providers/azure.md) and [GCP](./providers/gcp.md).
- Yes! Defang makes it easy to deploy your app on production-ready infrastructure in your own cloud account. For example, you can deploy your app to AWS with `defang up --provider=aws --mode=production`. Check out your preferred cloud provider on [Defang BYOC](./concepts/defang-byoc.md).

### Can I run production apps with Defang?
### Does Defang support blue/green deployments?

- Defang does not currently support Blue/Green deploys, but it does support rolling updates with the `production` deployment mode. `defang up --mode=production`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment about explaining rolling updates in more detail.


### Does Defang support rolling deployments?

- Yes! Defang supports rolling updates with the `production` deployment mode. `defang up --mode=production`.

### Can I cancel a deployment once it has started?

- No. Once a deployment has started, it cannot be canceled. However, you can always deploy a new version of your app which will replace the current deployment.

### Will deploying a new version of my app cause downtime?

- If you have deployed your application with the `--mode=production` flag, Defang will use the _production_ deployment mode. This mode will provision your app with multiple replicas and will perform a rolling update to ensure zero downtime. If you use another deployment mode, you may experience downtime during the deployment, as defang will not provision multiple replicas to save cost.

### Can I deploy multiple services at once?

- Yes! You can deploy multiple services at once by defining them in a single compose.yaml file. When you run `defang compose up`, Defang will deploy all the services defined in the file at once.

### Can I deploy a service that depends on another service?

- Defang does not currently support service dependencies. All services will be deployed simultaneously. Defang will however run multiple healthchecks before marking a service as healthy and spinning down any previously deployed services when using the `production` deployment mode.

### Do you plan to support other clouds?

- The [Defang Playground](./concepts/defang-playground.md) is meant for testing and trial purposes only. Deployment of productions apps with [Defang BYOC](./concepts/defang-byoc.md) is not yet supported and disallowed by the [Terms of Service](https://defang.io/terms-service.html). If you are interested in running production apps, please [contact us](https://defang.io/#Contact-us).
- While we currently support [AWS](./concepts/defang-byoc#aws) and [Digital Ocean](./concepts/defang-byoc#digitalocean), we plan to support other clouds in future releases, such [GCP](./providers/gcp.md) and [Azure](./providers/azure.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update our docs to say we support AWS for production, while DigitalOcean is in Preview.
Typo: "Digital Ocean" should be "DigitalOcean"
Typo: missing "as" before GCP.

Copy link
Contributor

@commit111 commit111 Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed this one


### I'm having trouble running the binary on my Mac. What should I do?

Expand Down
10 changes: 5 additions & 5 deletions docs/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ Congratulations! You've successfully deployed your first service with Defang. No

Defang supports various ways of creating and deploying services to the cloud. The following tutorials dive into each one in more detail:

1. [Deploy to your own cloud](/docs/tutorials/deploy-to-your-cloud)
1. [Update the code and redeploy](/docs/getting-started/build-and-deploy)
2. [Monitor your services](/docs/getting-started/monitor)
3. [Deploy an outline using AI](/docs/tutorials/generate-new-code-using-ai)
4. [Build and deploy your code](/docs/tutorials/deploy-code-compose)
5. [Deploy existing containers](/docs/tutorials/deploy-container-using-the-cli)
6. [Deploy using Pulumi](/docs/tutorials/deploy-using-pulumi)
1. [Monitor your services](/docs/getting-started/monitor)
1. [Deploy an outline using AI](/docs/tutorials/generate-new-code-using-ai)
1. [Deploy existing containers](/docs/tutorials/deploy-container-using-the-cli)
1. [Deploy using Pulumi](/docs/tutorials/deploy-using-pulumi)

Choose the direction that seems the most interesting. If you have any questions, join the [Defang Discord](https://discord.gg/defang) and we'll be happy to help you out.
2 changes: 1 addition & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Overview
description: Overview of Defang, a radically simpler way to build, deploy, and optimize production-ready cloud apps.
---

<iframe width="560" height="315" src="https://www.youtube.com/embed/afglsBYieuc?si=iKgUX4ejz7AixxqQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

### What is Defang?

Expand Down Expand Up @@ -31,4 +32,3 @@ Defang provides a streamlined experience to develop, deploy, observe, and update
- [One-command deployments](./getting-started/installing.md)
- Support for [GPUs](./concepts/resources.md)
- Support for Infra-as-Code via the [Defang Pulumi provider](./concepts/pulumi.md)

4 changes: 2 additions & 2 deletions docs/providers/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"label": "Providers",
"position": 350,
"position": 400,
"link": {
"type": "generated-index",
"description": "Defang allows you to use your own cloud accounts to deploy your applications. Click on a link below to read documentation about specific providers."
}
}
}
26 changes: 21 additions & 5 deletions docs/providers/digitalocean/digitalocean.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,33 @@ This feature is available for Public Preview as of October 2024. This page will
Why should you use Defang with DigitalOcean? Defang allows you to easily create and manage full, scalable applications with DigitalOcean. Defang aims to make it easier to deploy your services to the cloud. DigitalOcean is one of the most popular cloud providers in the world and with Defang, you dont have to waste your time understanding the complexities and challenges of the DigitalOcean platform. Let Defang do it for you and spend more time working on whats important to you!

## Getting Started
To get started with the Defang BYOC DigitalOcean Provider, first [install the latest version of the Defang CLI](../getting-started#authenticate-with-defang). Next make sure you have signed up for a [DigitalOcean account](https://try.digitalocean.com/freetrialoffer/).

After signing up for your account, be sure to setup your [personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/) as well as your [Spaces access key](https://docs.digitalocean.com/products/spaces/how-to/manage-access/). Next, save these values as environment variables with the names `DIGITALOCEAN_TOKEN`, `SPACES_ACCESS_KEY_ID`, and `SPACES_SECRET_ACCESS_KEY`.
### Install Defang

To get started with the Defang BYOC DigitalOcean Provider, first [install the latest version of the Defang CLI](../getting-started#authenticate-with-defang).

### Sign up for DigitalOcean
Next make sure you have signed up for a [DigitalOcean account](https://try.digitalocean.com/freetrialoffer/).

### Authenticate with DigitalOcean
After signing up for your account, be sure to setup your [personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/). Defang will need to find this value in your shell as the `DIGITALOCEAN_TOKEN` environment variable.

### Authenticate with DigitalOcean Spaces
You will also need a [Digital Ocean Spaces access key](https://docs.digitalocean.com/products/spaces/how-to/manage-access/). Defang will need to find this value in your shell as the `SPACES_ACCESS_KEY_ID`, and `SPACES_SECRET_ACCESS_KEY` environment variables.

### Configure your shell environment

```bash
export DIGITALOCEAN_TOKEN=<your-token>
export SPACES_ACCESS_KEY_ID=<your-key-id>
export SPACES_SECRET_ACCESS_KEY=<your-key>
```

The Defang CLI will automatically check if they are set before running. Once you are ready to go, add the `--provider=digitalocean` to your command to tell the Defang CLI to use the DigitalOcean provider.
The Defang CLI will automatically check if these envinonment variables are set before running.

### Deploy your project to DigitalOcean

Once you are ready to go, add the `--provider=digitalocean` to your command to tell the Defang CLI to use the DigitalOcean provider.

```bash
$ defang up --provider=digitalocean
Expand All @@ -33,7 +49,7 @@ $ export DEFANG_PROVIDER=digitalocean

## Region

The Defang BYOC DigitalOcean Provider will use the region specified in the `REGION` environment variable. For a list of regions available in DigitalOcean, see the [region documentation](https://docs.digitalocean.com/platform/regional-availability/#app-platform-availability).
The Defang BYOC DigitalOcean Provider will use the region specified in the `REGION` environment variable. For a list of regions available in DigitalOcean, see the [region documentation](https://docs.digitalocean.com/platform/regional-availability/#app-platform-availability).

## Architecture

Expand All @@ -45,7 +61,7 @@ To deploy your services, the Defang CLI packages your code and uploads it to a [

### Runtime

The Provider runs your workloads using the [DigitalOcean App Platform](https://docs.digitalocean.com/products/app-platform/).
The Provider runs your workloads using the [DigitalOcean App Platform](https://docs.digitalocean.com/products/app-platform/).

### Secrets

Expand Down
4 changes: 2 additions & 2 deletions docs/samples.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Samples
description: Sample projects to help you launch services faster with Defang.
sidebar_position: 500
sidebar_position: 600
---

import {Button, ButtonGroup, FormGroup, FormLabel} from "@mui/material"
Expand All @@ -12,4 +12,4 @@ Check out our sample projects here to get some inspiration and get a sense of ho

import Samples from "../src/components/Samples";

<Samples />
<Samples />
3 changes: 1 addition & 2 deletions docs/tutorials/_category_.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"label": "Tutorials",
"position": 400,
"position": 300,
"link": {
"type": "generated-index",
"description": "Check out these tutorials to learn more about the Defang platform."
}
}

49 changes: 49 additions & 0 deletions docs/tutorials/deploy-to-aws.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Deploy to AWS
description: Defang allows you deploy to your own Amazon Web Services (AWS) account.
sidebar_position: 10
---

# Deploying to Amazon Web Services (AWS) with Defang

This tutorial will show you how to deploy your services to your own AWS account using Defang.

## Pre-requisites
* [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/)
* [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)
* [A Defang Account](/docs/getting-started/authenticating)
* [The Defang CLI](/docs/getting-started/installing)
* [AWS Account Credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html)

## Deploy your project to AWS

1. Navigate to the directory where your project is located:
```bash
$ cd path/to/your/project
```

2. Authenticate Defang to use your AWS Account

Defang will look for your AWS credentials in your shell environment.

Defang will expect to find one of the following credential sets:
* the `AWS_PROFILE` environment variable
* or, the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables

3. Deploy

Invoke the `defang up` CLI command with the `--provider=aws` flag or set the `DEFANG_PROVIDER=aws` environment variable.

For example:

```bash
$ defang up --provider=aws
```

4. Inspect your deployment

Defang will provision resources in your AWS account and deploy your services. You can inspect the resources created in your AWS dashboard.

***

For a deeper discussion of the Defang AWS Architecture, including a list of the resources we provision in your account, see our [AWS Provider docs](/docs/providers/aws).
50 changes: 50 additions & 0 deletions docs/tutorials/deploy-to-digitalocean.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: Deploy to Digital Ocean
description: Defang allows you deploy to your own Digital Ocean account.
sidebar_position: 10
---

# Deploying to Digital Ocean with Defang

This tutorial will show you how to deploy your services to your own Digital Ocean account using Defang.

## Pre-requisites
* [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/)
* [A `compose.yaml` file in your project](https://docs.docker.com/compose/gettingstarted/)
* [A Defang Account](/docs/getting-started/authenticating)
* [The Defang CLI](/docs/getting-started/installing)
* [Digital Ocean Account Credentials](/docs/providers/digitalocean#getting-started)
* [Digital Ocean Spaces Access Keys](/docs/providers/digitalocean#getting-started)

## Deploy your project to Digital Ocean

1. Navigate to the directory where your project is located:
```bash
$ cd path/to/your/project
```

2. Authenticate Defang to use your Digital Ocean Account

Defang will look for your Digital Ocean credentials in your shell environment.

Defang will expect to find the following credentials:
* the `DIGITALOCEAN_TOKEN` environment variable
* and, the `SPACES_ACCESS_KEY_ID` and `SPACES_SECRET_ACCESS_KEY` environment variables

3. Deploy

Invoke the `defang up` CLI command with the `--provider=do` flag or set the `DEFANG_PROVIDER=do` environment variable.

For example:

```bash
$ defang up --provider=do
```

4. Inspect your deployment

Defang will provision resources in your Digital Ocean account and deploy your services. You can inspect the resources created in your Digital Ocean dashboard.

***

For a deeper discussion of the Defang Digital Ocean Architecture, see our [Digital Ocean Provider docs](/docs/providers/digitalocean).
9 changes: 9 additions & 0 deletions docs/tutorials/deploy-to-gcp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Deploy to GCP
description: Defang allows you deploy to your own Google Cloud Platform (GCP) account.
sidebar_position: 10
---

# Deploying to Google Cloud Platform (GCP) with Defang

Coming soon!
22 changes: 22 additions & 0 deletions docs/tutorials/deploy-to-your-cloud.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Deploy to your cloud
description: Defang allows you deploy to your own cloud account.
sidebar_position: 10
---

# Deploying to your cloud with Defang

This tutorial will show you how to deploy your services to your own cloud account using Defang.

::: tip
::: Defang makes it easier to deploy to any cloud—in your *own* cloud accounts. We refer to this as bring-your-own-cloud (BYOC).
:::
::: If you aren't ready to deploy to your own cloud account, you can use the Defang Playground to get a feel for how Defang works for free.

## Choose your cloud

The first step is to choose which cloud provider you want to deploy to. Defang supports the following cloud providers:

* [AWS](/docs/tutorials/deploy-to-aws)
* [DigitalOcean](/docs/tutorials/deploy-to-digitalocean)
* [GCP](/docs/tutorials/deploy-to-gcp)
3 changes: 1 addition & 2 deletions docs/use-cases/_category_.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"label": "Use Cases",
"position": 275,
"position": 500,
"link": {
"type": "doc",
"id": "use-cases"
}
}

4 changes: 2 additions & 2 deletions docs/use-cases/use-cases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 100
sidebar_position: 400
title: Use Cases
description: Use cases for Defang.
---
Expand Down Expand Up @@ -34,4 +34,4 @@ Some applications are designed to run in stateful environments. For example, a C

## Data Stores

Defang is not a good fit for data stores like databases, caches, and message queues. These types of services are designed to be long-lived and to store data. Defang is primarily designed for stateless workloads, and it's not a good fit for stateful workloads: if a container is replaced, all the data in it is lost. You could probably coerce a data store to work in a stateless environment with certain replication strategies, but it's not a good fit.
Defang is not a good fit for data stores like databases, caches, and message queues. These types of services are designed to be long-lived and to store data. Defang is primarily designed for stateless workloads, and it's not a good fit for stateful workloads: if a container is replaced, all the data in it is lost. You could probably coerce a data store to work in a stateless environment with certain replication strategies, but it's not a good fit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not accurate. We should mention the issue with stateful services and then point to Defang's support for managed storage options - https://docs.defang.io/docs/concepts/managed-storage

Copy link
Contributor

@raphaeltm raphaeltm Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Prakash-Sundaresan I think you're right. This is no longer accurate because we support managed storage. I do think we should have a place where we caution people against trying to run unsupported data stores until we support volume mounts, though. Like, at the moment people shouldn't be using Defang to run Mongo, or ElasticSearch or anything like that.