System Architecture
Core Features
Data Management
Frontend Components
Backend Systems
The following files were used as context for generating this wiki page:
This document outlines the cloud deployment strategy for an Embedchain application, specifically focusing on deployment to Render.com. Render.com is a unified cloud platform that allows developers to host web services, databases, and other applications. The provided configuration details how to set up a Python-based web service on Render.com, including build commands, start commands, scaling parameters, and environment variable management.
The deployment configuration defines a single web service, ec-render-app, designed to run a Python application. It specifies the runtime, repository source, commands for building and starting the application, and parameters for automatic scaling to ensure efficient resource utilization.
The deployment is configured via a render.yaml file, which is a declarative way to define infrastructure on Render.com. This file specifies a web service type, indicating that the application will be an internet-facing web server. The service is named ec-render-app and is set to use a Python runtime environment.
The deployment process involves fetching the code from a specified GitHub repository, installing dependencies, and then starting the application using a uvicorn command. Scaling parameters are defined to manage the number of running instances based on resource usage, and environment variables can be securely injected into the application's runtime.
Sources: embedchain/embedchain/deployment/render.com/render.yaml:1-17
The following diagram illustrates the high-level steps involved in deploying the web service to Render.com based on the configuration.
The core of the deployment is defined within the services block, which contains a list of services to be deployed. For the ec-render-app, a single web service is configured.
The web service type is used for applications that serve HTTP traffic. Key properties for this service include:
name: A unique identifier for the service on Render.com.runtime: Specifies the programming language environment.repo: The URL of the Git repository containing the application code. This is a placeholder that needs to be updated with the actual repository.buildCommand: The command executed to install dependencies or build the application before it starts.startCommand: The command executed to launch the application.envVars: A list of environment variables to be made available to the application.autoDeploy: A boolean flag indicating whether changes to the repository should automatically trigger a new deployment.The repo field is a placeholder (https://github.com/<your-username>/<repo-name>) and must be updated with the actual GitHub repository URL for the deployment to function correctly.
Sources: embedchain/embedchain/deployment/render.com/render.yaml:2-17
The buildCommand and startCommand are crucial for preparing and launching the application.
buildCommand: pip install -r requirements.txt
This command installs all Python dependencies listed in the requirements.txt file. This ensures that the application has all necessary libraries before starting.startCommand: uvicorn app:app --host 0.0.0.0
This command starts the web application using uvicorn, an ASGI server. It specifies that the application object app within the app.py module should be served, and it binds to all available network interfaces (0.0.0.0).Sources: embedchain/embedchain/deployment/render.com/render.yaml:10-11
The scaling block defines how the web service will automatically adjust its number of instances based on demand.
minInstances: The minimum number of instances that will always be running.maxInstances: The maximum number of instances the service can scale up to.targetMemoryPercent: An optional target for memory utilization. If the average memory usage across instances exceeds this percentage, Render.com may scale up.targetCPUPercent: An optional target for CPU utilization. If the average CPU usage across instances exceeds this percentage, Render.com may scale up.In this configuration, the service will maintain at least 1 instance and can scale up to a maximum of 3 instances. Scaling decisions will be influenced by both memory and CPU utilization, with a target of 60% for each.
Sources: embedchain/embedchain/deployment/render.com/render.yaml:6-9
Environment variables are used to inject configuration values into the application at runtime without hardcoding them in the source code.
The envVars block lists the variables. Each variable has a key and a value.
| Key | Value | Description
The autoDeploy property is set to false, meaning that new deployments will not be automatically triggered by code changes in the repository. Manual intervention will be required to initiate a new deployment.
Sources: embedchain/embedchain/deployment/render.com/render.yaml:16