From 8a741142b709f7b45d603766a1df93a1919f3dab Mon Sep 17 00:00:00 2001 From: Sooraj Sanker Date: Mon, 17 Jun 2024 14:25:06 +0530 Subject: [PATCH 1/6] RFC - Include Deployment Configurations on Hasura DDN Project Files --- rfcs/DDN_CICD.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 rfcs/DDN_CICD.md diff --git a/rfcs/DDN_CICD.md b/rfcs/DDN_CICD.md new file mode 100644 index 0000000000000..5003413e5305d --- /dev/null +++ b/rfcs/DDN_CICD.md @@ -0,0 +1,83 @@ +### RFC - Include Deployment Configurations on Hasura DDN Project Files + +### Summary + +Currently with the new DX, the deployment configurations are not defined anywhere and this makes sense because the users may want to customize and deploy their connectors and supergraph with different configuration files. This RFC is about applying the same level of configurability to the deployments as well. + +### Motivation + +The idea is to have a file (deployment-config.yaml) in the project directory to provide a place to define where to look for the connector deployments and what connectors need to be deployed for a particular supergraph build. + +### Background + +The current deployment process lacks a defined configuration, leading to customization and deployment challenges for users. Providing a standard configuration file will streamline and standardize deployment processes. + +### Proposal + +Introduce a deployment-config.yaml file in the project directory with the following structure: + +```yaml +connectors: + - file: "app/connector/mypg/connector.cloud.yaml" + subgraph: "app" + connectorLink: "mypg" + supergraph: "./supergraph.cloud.yaml" + - file: "app/connector/my_mongo/connector.cloud.yaml" + subgraph: "app" + connectorLink: "my_mongo" + supergraph: "./supergraph.cloud.yaml" + - file: "app/connector/myts/connector.cloud.yaml" + subgraph: "app" + connectorLink: "myts" + supergraph: "./supergraph.cloud.yaml" + +supergraphs: + - file: "supergraph.cloud.yaml"` +``` + +### Detailed Design + +1. **Deployment Configuration**: Define a deployment-config.yaml file in the project directory to specify the connectors and supergraphs for deployment. + +2. **Deployment Process**: + + - **With GitHub Actions**: Extend the existing DDN Deployment GitHub Action repository to support connector and supergraph deployments. Users will configure the action with a Hasura Personal Access Token and Hasura DDN Cloud Project Name. Each commit on an open PR (or other configurable logic) will trigger a supergraph build. + + Once a valid deployment configuration is added to the project directory, a sample GitHub Action workflow would look like: + + ```yaml + on: + push: + branches: + - main + jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Hasura DDN Build + uses: hasura/ddn-deployment@0.0.2 + with: + hasura-pat: ${{ secrets.HASURA_PAT }} + build_description: "This build was created using CI/CD"` + ``` + + Hasura project name and path to deployment configuration can be added as optional inputs. + + + - **Custom CI/CD Implementations**: Provide documentation and GitHub Action examples to enable users to create custom CI/CD pipelines following Hasura best practices. + +### Impact + +There are around 1700 projects (approximately 320 of which are paid) currently using the GitHub deployment feature, demonstrating the demand among serious users. This proposal highlights several key impacts: + +- **Readiness for Production**: The widespread adoption indicates that Hasura DDN is ready for production environments. +- **Ease of Collaboration**: The use of GitHub Actions for deployment simplifies collaboration among team members. +- **Enhanced PR Review**: The GitHub Action allows for easier review of pull requests, both functionally and in terms of code quality. +- **Commit-Level Builds**: The ability to create immutable builds at the commit level facilitates easier and more reliable collaboration. + +### Unresolved Questions + +1. Should we make the path to deployment-config.yaml an optional input? This would allow users to set up multiple deployment configurations and reuse the GitHub action with branch conditions. +2. Where should we keep the project name? Should it be inside the deployment config or as a GitHub action input? + +This completes the RFC draft. If you have any further details or modifications to add, please let me know! \ No newline at end of file From a2bda7e0a878945ba51934a88196540bf0ce344d Mon Sep 17 00:00:00 2001 From: Sooraj Sanker Date: Mon, 17 Jun 2024 15:05:44 +0530 Subject: [PATCH 2/6] remove draft text --- rfcs/DDN_CICD.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rfcs/DDN_CICD.md b/rfcs/DDN_CICD.md index 5003413e5305d..c93c651ba4843 100644 --- a/rfcs/DDN_CICD.md +++ b/rfcs/DDN_CICD.md @@ -78,6 +78,4 @@ There are around 1700 projects (approximately 320 of which are paid) currently u ### Unresolved Questions 1. Should we make the path to deployment-config.yaml an optional input? This would allow users to set up multiple deployment configurations and reuse the GitHub action with branch conditions. -2. Where should we keep the project name? Should it be inside the deployment config or as a GitHub action input? - -This completes the RFC draft. If you have any further details or modifications to add, please let me know! \ No newline at end of file +2. Where should we keep the project name? Should it be inside the deployment config or as a GitHub action input? \ No newline at end of file From 79299eb15ac44c686e6003d3a82970155fdf4342 Mon Sep 17 00:00:00 2001 From: Sooraj Sanker Date: Mon, 17 Jun 2024 15:06:18 +0530 Subject: [PATCH 3/6] Header --- rfcs/DDN_CICD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/DDN_CICD.md b/rfcs/DDN_CICD.md index c93c651ba4843..66fb9fde51132 100644 --- a/rfcs/DDN_CICD.md +++ b/rfcs/DDN_CICD.md @@ -1,4 +1,4 @@ -### RFC - Include Deployment Configurations on Hasura DDN Project Files +# RFC - Include Deployment Configurations on Hasura DDN Project Files ### Summary From 7584cb14847068c7984976d81fa12c039c3a4cd6 Mon Sep 17 00:00:00 2001 From: Sooraj Sanker Date: Mon, 17 Jun 2024 21:33:22 +0530 Subject: [PATCH 4/6] ++ --- rfcs/DDN_CICD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/DDN_CICD.md b/rfcs/DDN_CICD.md index 66fb9fde51132..0a3c985e78614 100644 --- a/rfcs/DDN_CICD.md +++ b/rfcs/DDN_CICD.md @@ -2,7 +2,7 @@ ### Summary -Currently with the new DX, the deployment configurations are not defined anywhere and this makes sense because the users may want to customize and deploy their connectors and supergraph with different configuration files. This RFC is about applying the same level of configurability to the deployments as well. +Currently with the new DX, the list of connectors and subgraphs are not defined anywhere (otherwise will need to scan the fs) and this makes sense because the users may want to customize and deploy their connectors and supergraph with different configuration files. This RFC is about applying the same level of configurability to the deployments as well. ### Motivation From 0560b295fc94759549e507d93d7aca43826bd571 Mon Sep 17 00:00:00 2001 From: Sooraj Sanker Date: Mon, 17 Jun 2024 21:38:01 +0530 Subject: [PATCH 5/6] qn + --- rfcs/DDN_CICD.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rfcs/DDN_CICD.md b/rfcs/DDN_CICD.md index 0a3c985e78614..8bc75d9440ad0 100644 --- a/rfcs/DDN_CICD.md +++ b/rfcs/DDN_CICD.md @@ -78,4 +78,5 @@ There are around 1700 projects (approximately 320 of which are paid) currently u ### Unresolved Questions 1. Should we make the path to deployment-config.yaml an optional input? This would allow users to set up multiple deployment configurations and reuse the GitHub action with branch conditions. -2. Where should we keep the project name? Should it be inside the deployment config or as a GitHub action input? \ No newline at end of file +2. Where should we keep the project name? Should it be inside the deployment config or as a GitHub action input? +3. Should CLI help generating deployment-confiig.yaml in the future? \ No newline at end of file From 887a5481e470ce37fe91bdb1dde53e31872b6cce Mon Sep 17 00:00:00 2001 From: Sooraj Date: Mon, 17 Jun 2024 22:16:57 +0530 Subject: [PATCH 6/6] Update DDN_CICD.md --- rfcs/DDN_CICD.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rfcs/DDN_CICD.md b/rfcs/DDN_CICD.md index 8bc75d9440ad0..aab8ff06e9c42 100644 --- a/rfcs/DDN_CICD.md +++ b/rfcs/DDN_CICD.md @@ -79,4 +79,6 @@ There are around 1700 projects (approximately 320 of which are paid) currently u 1. Should we make the path to deployment-config.yaml an optional input? This would allow users to set up multiple deployment configurations and reuse the GitHub action with branch conditions. 2. Where should we keep the project name? Should it be inside the deployment config or as a GitHub action input? -3. Should CLI help generating deployment-confiig.yaml in the future? \ No newline at end of file +3. Should CLI help generating deployment-confiig.yaml in the future? +4. How to do federation? +5. Can we not have additional configuration and suggest using raw CLI commands?