From 8e5ad9192c2016e7a6e0390d323cf50dab130e14 Mon Sep 17 00:00:00 2001 From: Edward J Date: Tue, 3 Dec 2024 11:26:29 -0800 Subject: [PATCH 01/10] Add GCP doc --- docs/providers/gcp.md | 61 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/docs/providers/gcp.md b/docs/providers/gcp.md index 2a9de67ac..8286e8c64 100644 --- a/docs/providers/gcp.md +++ b/docs/providers/gcp.md @@ -4,10 +4,65 @@ description: Defang will allow you to easily create and manage full, scalable ap sidebar_position: 3000 --- -# GCP +# Google Cloud Platform (GCP) :::info -Google Cloud Platform (GCP) support is coming soon to Defang. Stay tuned for updates! +This feature is available for Public Preview as of December 2024. This page will be updated when it is GA. ::: -This page will be updated soon. In the meantime, you can learn more about other cloud [providers](/docs/category/providers/). \ No newline at end of file +Why should you use Defang with Google Cloud Platform (GCP)? Defang enables you to effortlessly create and manage full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities and challenges of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you! + +## Getting Started +To get started with the Defang BYOC GCP Provider, first [install the latest version of the Defang CLI](../getting-started#authenticate-with-defang). Next make sure you have signed up for a [Google Cloud Platform](https://cloud.google.com/). + +After signing up for your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project), make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project) and note down the project ID and set it as environment variable `GCP_PROJECT_ID`. + +```bash +export GCP_PROJECT_ID= +``` + +Next step is to [authenticate your local environment with GCP](https://cloud.google.com/docs/authentication), our preferred method is to setup [Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc) with the google cloud CLI. Once the [google cloud CLI is installed](https://cloud.google.com/sdk/docs/install), run the following command to authenticate: + +```bash +gcloud init +gcloud auth application-default login +``` + +The Defang CLI will automatically check if they are set before running. Once you are ready to go, add the `--provider=gcp` to your command to tell the Defang CLI to use the GCP provider. + +```bash +$ defang up --provider=gcp +# or +$ export DEFANG_PROVIDER=gcp +``` + +## Location + +The Defang BYOC GCP Provider will use the location specified in the `GCP_LOCATION` environment variable. For a list of locations available in GCP, see the [location documentation](https://cloud.google.com/about/locations). If the `GCP_LOCATION` environment variable is not set, the default location `us-central1` (Iowa) will be used. + +## Architecture + +Defang uses GCP cloud run to build, deploy and run your services. The following describes the current state of Defang's support for GCP, the specific resources that Defang uses, and the roadmap for future support. + +### Deployment + +To deploy your services, the Defang CLI will setup some basic resources needed, including enabled required APIs in the project, create service accounts used to build and deploy your service with required permissions, and a [Google Cloud Storage](https://cloud.google.com/storage) bucket where Defang CLI packages your code and uploads it to. The CLI then deploys a Cloud Run Job that uses Pulumi to build your container image and run your services. + +### Runtime + +The Provider build and deploy your services using the [Google Cloud Run](https://cloud.google.com/run) jobs, and runs your workloads using the [Google Cloud Run](https://cloud.google.com/run) service. + +### Secrets + +The GCP provider does not currently support storing sensitive config values. + +### Future Improvements + +THe following features are in active development for GCP: +- [Configuration and management of secrets](/docs/concepts//configuration.md) +- [Networking and Load Balancing](/docs/concepts//networking.mdx) +- [Custom Domains](/docs/concepts//domains.mdx) +- [Managed Redis](/docs/concepts//managed-storage/managed-redis.md) +- [Managed Postgres](/docs/concepts/managed-storage/managed-postgres.md) + +Stayed tuned for future updates! From b237ed79a84bfad78259bd7a0734602a76a686a2 Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Tue, 3 Dec 2024 14:48:50 -0500 Subject: [PATCH 02/10] specify the feature --- docs/providers/gcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/providers/gcp.md b/docs/providers/gcp.md index 8286e8c64..b5470fbf6 100644 --- a/docs/providers/gcp.md +++ b/docs/providers/gcp.md @@ -7,7 +7,7 @@ sidebar_position: 3000 # Google Cloud Platform (GCP) :::info -This feature is available for Public Preview as of December 2024. This page will be updated when it is GA. +The Defang GCP provider is available for Public Preview as of December 2024. This page will be updated when it is GA. ::: Why should you use Defang with Google Cloud Platform (GCP)? Defang enables you to effortlessly create and manage full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities and challenges of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you! From 94b62d8e5ac1709658e77856d4cb12121ae24630 Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Tue, 3 Dec 2024 14:49:13 -0500 Subject: [PATCH 03/10] avoid tee-ing up the pitch we can just jump straight into it --- docs/providers/gcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/providers/gcp.md b/docs/providers/gcp.md index b5470fbf6..67d65c7cb 100644 --- a/docs/providers/gcp.md +++ b/docs/providers/gcp.md @@ -10,7 +10,7 @@ sidebar_position: 3000 The Defang GCP provider is available for Public Preview as of December 2024. This page will be updated when it is GA. ::: -Why should you use Defang with Google Cloud Platform (GCP)? Defang enables you to effortlessly create and manage full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities and challenges of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you! +Defang enables you to effortlessly create and manage full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities and challenges of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you! ## Getting Started To get started with the Defang BYOC GCP Provider, first [install the latest version of the Defang CLI](../getting-started#authenticate-with-defang). Next make sure you have signed up for a [Google Cloud Platform](https://cloud.google.com/). From 10293230443a4822dc0b99125b32c349f499f601 Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Tue, 3 Dec 2024 14:49:44 -0500 Subject: [PATCH 04/10] assume the reader has a GCP account and the defang CLI --- docs/providers/gcp.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/providers/gcp.md b/docs/providers/gcp.md index 67d65c7cb..8b2dd5fe6 100644 --- a/docs/providers/gcp.md +++ b/docs/providers/gcp.md @@ -13,9 +13,8 @@ The Defang GCP provider is available for Public Preview as of December 2024. Thi Defang enables you to effortlessly create and manage full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities and challenges of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you! ## Getting Started -To get started with the Defang BYOC GCP Provider, first [install the latest version of the Defang CLI](../getting-started#authenticate-with-defang). Next make sure you have signed up for a [Google Cloud Platform](https://cloud.google.com/). -After signing up for your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project), make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project) and note down the project ID and set it as environment variable `GCP_PROJECT_ID`. +After signing in to your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project), make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project) and note down the project ID and set it as environment variable `GCP_PROJECT_ID`. ```bash export GCP_PROJECT_ID= From 6f3649f0c154e82f75b6b5c7ae92f6b6bb13e3a8 Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Tue, 3 Dec 2024 14:50:13 -0500 Subject: [PATCH 05/10] make sure `defang up` appears in both options --- docs/providers/gcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/providers/gcp.md b/docs/providers/gcp.md index 8b2dd5fe6..a982f1855 100644 --- a/docs/providers/gcp.md +++ b/docs/providers/gcp.md @@ -32,7 +32,7 @@ The Defang CLI will automatically check if they are set before running. Once you ```bash $ defang up --provider=gcp # or -$ export DEFANG_PROVIDER=gcp +$ DEFANG_PROVIDER=gcp defang up ``` ## Location From 288a6f12f0685854528b4c11dce1c4e4b7e4d9f3 Mon Sep 17 00:00:00 2001 From: Jordan Stephens Date: Tue, 3 Dec 2024 14:50:22 -0500 Subject: [PATCH 06/10] write the GCP tutorial --- docs/tutorials/deploy-to-gcp.mdx | 36 +++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/deploy-to-gcp.mdx b/docs/tutorials/deploy-to-gcp.mdx index f57c4159a..d5fde8d0e 100644 --- a/docs/tutorials/deploy-to-gcp.mdx +++ b/docs/tutorials/deploy-to-gcp.mdx @@ -6,9 +6,39 @@ sidebar_position: 11 # Deploying to Google Cloud Platform (GCP) With Defang -This tutorial is coming soon. +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/concepts/authentication) +* [The Defang CLI](/docs/getting-started#install-the-defang-cli) +* [GCP Account Credentials](https://cloud.google.com/docs/authentication) -For a deeper discussion of the Defang GCP Architecture, see our [GCP docs](/docs/providers/gcp). +## Step 1 - Navigate to your project directory +Head to the folder where your project is located. +```bash +$ cd path/to/your/project +``` + +## Step 2 - Authenticate Defang to use your GCP Account + +After signing up for your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID and set it as environment variable `GCP_PROJECT_ID`. + +## Step 3 - Deploy + +Invoke the `defang up` CLI command with the `--provider=gcp` flag or set the `DEFANG_PROVIDER=gcp` environment variable. +For example: + +```bash +$ defang up --provider=gcp +``` + +## Step 4 - Inspect your deployment + +Defang will provision resources in your GCP account and deploy your services. You can inspect the resources created in your GCP dashboard. + +*** + +For a deeper discussion of the Defang GCP Architecture, see our [GCP docs](/docs/providers/gcp). From 936ddf05f144219d060c16f7d144b9bde45a60f8 Mon Sep 17 00:00:00 2001 From: edwardrf Date: Tue, 3 Dec 2024 14:17:28 -0800 Subject: [PATCH 07/10] Apply suggestions from code review --- docs/providers/gcp.md | 14 +++++++------- docs/tutorials/deploy-to-gcp.mdx | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/providers/gcp.md b/docs/providers/gcp.md index a982f1855..6e958a3b9 100644 --- a/docs/providers/gcp.md +++ b/docs/providers/gcp.md @@ -7,27 +7,27 @@ sidebar_position: 3000 # Google Cloud Platform (GCP) :::info -The Defang GCP provider is available for Public Preview as of December 2024. This page will be updated when it is GA. +The Defang GCP provider is available for Public Preview as of December 2024. ::: Defang enables you to effortlessly create and manage full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities and challenges of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you! ## Getting Started -After signing in to your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project), make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project) and note down the project ID and set it as environment variable `GCP_PROJECT_ID`. +After signing in to your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project), make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project), and note down the project ID and set it as environment variable `GCP_PROJECT_ID`. ```bash export GCP_PROJECT_ID= ``` -Next step is to [authenticate your local environment with GCP](https://cloud.google.com/docs/authentication), our preferred method is to setup [Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc) with the google cloud CLI. Once the [google cloud CLI is installed](https://cloud.google.com/sdk/docs/install), run the following command to authenticate: +Next step is to [authenticate your local environment with GCP](https://cloud.google.com/docs/authentication). Our preferred method is to setup [Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc) with the Google Cloud CLI. Once the [Google Cloud CLI is installed](https://cloud.google.com/sdk/docs/install), run the following command to authenticate: ```bash gcloud init gcloud auth application-default login ``` -The Defang CLI will automatically check if they are set before running. Once you are ready to go, add the `--provider=gcp` to your command to tell the Defang CLI to use the GCP provider. +The Defang CLI will automatically check if `GCP_PROJECT_ID` environment variable is set and correctly authenticated with GCP before running. Once you are ready to go, add the `--provider=gcp` to your command to tell the Defang CLI to use the GCP provider. ```bash $ defang up --provider=gcp @@ -41,15 +41,15 @@ The Defang BYOC GCP Provider will use the location specified in the `GCP_LOCATIO ## Architecture -Defang uses GCP cloud run to build, deploy and run your services. The following describes the current state of Defang's support for GCP, the specific resources that Defang uses, and the roadmap for future support. +Defang uses GCP cloud run to build, deploy, and run your services. The following describes the current state of Defang's support for GCP, the specific resources that Defang uses, and the roadmap for future support. ### Deployment -To deploy your services, the Defang CLI will setup some basic resources needed, including enabled required APIs in the project, create service accounts used to build and deploy your service with required permissions, and a [Google Cloud Storage](https://cloud.google.com/storage) bucket where Defang CLI packages your code and uploads it to. The CLI then deploys a Cloud Run Job that uses Pulumi to build your container image and run your services. +To deploy your services, the Defang CLI sets up some basic resources needed, including enabling required APIs in the project, creating service accounts used to build and deploy your service with the required permissions, and creating a [Google Cloud Storage](https://cloud.google.com/storage) bucket where the Defang CLI uploads your source code to. The CLI then deploys a GCP Cloud Run Job that uses Pulumi to build your container image and run your services. ### Runtime -The Provider build and deploy your services using the [Google Cloud Run](https://cloud.google.com/run) jobs, and runs your workloads using the [Google Cloud Run](https://cloud.google.com/run) service. +The Provider builds and deploys your services using [Google Cloud Run](https://cloud.google.com/run) jobs, and runs your workloads using the [Google Cloud Run](https://cloud.google.com/run) service. ### Secrets diff --git a/docs/tutorials/deploy-to-gcp.mdx b/docs/tutorials/deploy-to-gcp.mdx index d5fde8d0e..e6b72c933 100644 --- a/docs/tutorials/deploy-to-gcp.mdx +++ b/docs/tutorials/deploy-to-gcp.mdx @@ -6,7 +6,7 @@ sidebar_position: 11 # Deploying to Google Cloud Platform (GCP) With Defang -This tutorial will show you how to deploy your services to your own AWS account using Defang. +This tutorial will show you how to deploy your services to your own GCP project using Defang. ## Pre-requisites * [A Dockerfile in your project](https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/) @@ -23,7 +23,7 @@ $ cd path/to/your/project ## Step 2 - Authenticate Defang to use your GCP Account -After signing up for your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID and set it as environment variable `GCP_PROJECT_ID`. +After signing in for your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID and set it as environment variable `GCP_PROJECT_ID`. ## Step 3 - Deploy @@ -37,7 +37,7 @@ $ defang up --provider=gcp ## Step 4 - Inspect your deployment -Defang will provision resources in your GCP account and deploy your services. You can inspect the resources created in your GCP dashboard. +Defang will provision resources in your GCP account and deploy your services. You can inspect the resources created in your [GCP Dashboard](https://console.cloud.google.com/). *** From 2da89967889ef8682e7a1955bf2516eb72bac14b Mon Sep 17 00:00:00 2001 From: edwardrf Date: Tue, 3 Dec 2024 14:18:48 -0800 Subject: [PATCH 08/10] Update docs/providers/gcp.md --- docs/providers/gcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/providers/gcp.md b/docs/providers/gcp.md index 6e958a3b9..cb86afd81 100644 --- a/docs/providers/gcp.md +++ b/docs/providers/gcp.md @@ -10,7 +10,7 @@ sidebar_position: 3000 The Defang GCP provider is available for Public Preview as of December 2024. ::: -Defang enables you to effortlessly create and manage full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities and challenges of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you! +Defang enables you to effortlessly develop and deploy full, scalable applications with GCP. It is designed to simplify deploying your services to the cloud. As one of the leading cloud providers globally, GCP offers powerful tools and resources, and with Defang, you can bypass the complexities of the GCP platform. Let Defang handle the heavy lifting so you can focus on what matters most to you! ## Getting Started From c09d47ef8f26eac9c64eec58fb971eaf9da986e1 Mon Sep 17 00:00:00 2001 From: edwardrf Date: Tue, 3 Dec 2024 16:50:17 -0800 Subject: [PATCH 09/10] Update deploy-to-gcp.mdx --- docs/tutorials/deploy-to-gcp.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/deploy-to-gcp.mdx b/docs/tutorials/deploy-to-gcp.mdx index e6b72c933..d61023b76 100644 --- a/docs/tutorials/deploy-to-gcp.mdx +++ b/docs/tutorials/deploy-to-gcp.mdx @@ -23,7 +23,7 @@ $ cd path/to/your/project ## Step 2 - Authenticate Defang to use your GCP Account -After signing in for your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID and set it as environment variable `GCP_PROJECT_ID`. +After signing in to your GCP account, select an existing project or [create a new project](https://developers.google.com/workspace/guides/create-project). Make sure [billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project). Then, note down the project ID and set it as environment variable `GCP_PROJECT_ID`. ## Step 3 - Deploy From a5b3927f73166bdf9c30d9ed791cdd5c6f02144f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Titsworth-Morin?= Date: Wed, 4 Dec 2024 04:54:00 -0800 Subject: [PATCH 10/10] Fix typo --- docs/providers/gcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/providers/gcp.md b/docs/providers/gcp.md index cb86afd81..19ba5d48d 100644 --- a/docs/providers/gcp.md +++ b/docs/providers/gcp.md @@ -57,7 +57,7 @@ The GCP provider does not currently support storing sensitive config values. ### Future Improvements -THe following features are in active development for GCP: +The following features are in active development for GCP: - [Configuration and management of secrets](/docs/concepts//configuration.md) - [Networking and Load Balancing](/docs/concepts//networking.mdx) - [Custom Domains](/docs/concepts//domains.mdx)