From e60732418f085e4af36441ae4b90ca5327a3cb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreia=20Oc=C4=83noaia?= Date: Tue, 21 Jan 2025 18:12:21 +0200 Subject: [PATCH 01/12] Update the supported frameworks and languages page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreia Ocănoaia --- docs/learn-more/supported-languages.md | 28 ++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/learn-more/supported-languages.md b/docs/learn-more/supported-languages.md index da1d52e5..6a250cba 100644 --- a/docs/learn-more/supported-languages.md +++ b/docs/learn-more/supported-languages.md @@ -10,6 +10,29 @@ description: Learn about the supported languages and frameworks that you can dep Ready to deploy your project on Genezio? We've got you covered! Whether it's a simple frontend or a complex backend system, Genezio makes the process smooth and straightforward. Here’s a rundown of the types of projects you can easily deploy with us. +## Supported Frameworks + +Genezio supports a wide range of languages and frameworks, including: + - Angular: Build powerful single-page applications. + - Django: Deploy robust backend applications using Python. + - Express.js: Integrate with serverless HTTP while maintaining your familiar setup. + - FastAPI: Deploy modern, high-performance Python APIs. + - Fastify: Benefit from a fast and lightweight backend framework. + - Flask: Deploy lightweight Python web applications. + - NestJS: Scale your backend applications with a modular architecture. + - Next.js: Seamlessly deploy static and server-rendered content. + - Nitro: Take advantage of the powerful Nuxt 3 server engine. + - Nuxt: Deploy performant Vue.js applications. + - React: Build and deploy interactive user interfaces. + - React-Admin: Create powerful admin panels and dashboards. + - Refine: Develop advanced React-based admin panels with ease. + - Remix: Build modern, server-rendered React applications. + - Svelte: Deploy lightweight and fast applications. + - TypeSafe Projects: Ensure maintainable and error-free applications. + - Vue: Deploy flexible and easy-to-integrate applications. + +You can check tutorials and examples for each framework in the [`Frameworks` section of our documentation](/docs/frameworks/). + ## Genezio Typesafe Projects We offer full support for typesafe projects, ensuring that your code is robust and maintainable. You can develop your application written in TypeScript or Go. @@ -47,9 +70,6 @@ Genezio supports a wide range of frontend frameworks, making it easy to deploy y Explore our [examples here](https://genezio.com/docs/examples/). -## Conclusion - -Genezio Cloud supports a wide range of technology stacks, providing a flexible and comprehensive deployment solution. Focus on building your application while we take care of deployment and scaling. +## Support If you need to deploy another type of project, please contact us at contact@genezio.com. - From 11b2727a4a5dc20fa7b2e82f80ca564c6d4258d6 Mon Sep 17 00:00:00 2001 From: Virgil993 Date: Wed, 22 Jan 2025 13:29:29 +0200 Subject: [PATCH 02/12] add-max-concurrent-instances --- .../genezio-configuration-file.md | 56 +++++++++++++++---- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/docs/project-structure/genezio-configuration-file.md b/docs/project-structure/genezio-configuration-file.md index 57630641..57f545ac 100644 --- a/docs/project-structure/genezio-configuration-file.md +++ b/docs/project-structure/genezio-configuration-file.md @@ -319,6 +319,18 @@ If scripts are declared in the `scripts` field, they will be executed from this Note: Setting this value to 1 disables concurrent requests served within the same execution environment. In this case, 2 or more incoming concurrent requests will be automatically distributed across separate execution environments, which are scaled up dynamically by Genezio. +- `maxConcurrentInstances`: `number` **Optional** + + Specifies the number of concurrent instances that can be served simultaneously for a class. + The default value for this setting is 3 concurrent instances per class. + + To increase the maximum value up to 10 concurrent instances, you [can upgrade to a Pro Subscription](https://app.genez.io/billing). + Afterwards, you can adjust this in increments of 1 up to a maximum value of 10 concurrent instances per class. + + For larger values, [contact us](mailto:contact@genez.io). + + Note: Setting this value to 1 disables concurrent instances served. In this case, your class will open only one instance. Any traffic trying to access the instance when it has reached the maximum number of concurrent requests will be dropped. THIS IS NOT RECOMMENDED. + - `cooldownTime`: `number` **Optional** Specifies the time in milliseconds that the execution environment will be kept alive after the response is sent. @@ -483,6 +495,18 @@ This resource exposes `url` as an output expression: `${{backend.functions. Date: Wed, 22 Jan 2025 14:44:19 +0200 Subject: [PATCH 03/12] specify the python version --- docs/frameworks/django.md | 5 +++++ docs/frameworks/fastapi.md | 4 ++++ docs/frameworks/flask.md | 4 ++++ docs/tutorials/how-to-deploy-a-serverless-function.md | 3 +++ 4 files changed, 16 insertions(+) diff --git a/docs/frameworks/django.md b/docs/frameworks/django.md index 6e32a5d6..ccb4e9c9 100644 --- a/docs/frameworks/django.md +++ b/docs/frameworks/django.md @@ -336,6 +336,7 @@ Open a web browser and navigate to [http://localhost:8000](http://localhost:8000 Finally, deploy your project. A browser window will open, and you will be prompted to log in to your Genezio account and authorize the CLI to make the deployment. + Run the following command in your terminal: ```bash @@ -355,6 +356,10 @@ After that, you can deploy your project without the `--env` flag. For more information about environment variables, you can check the [official documentation](/docs/project-structure/backend-environment-variables.md). +:::note +During deployment, Genezio will automatically install all dependencies specified in your `requirements.txt` file using the correct architecture (Linux x86) and Python 3.11 runtime environment. This ensures compatibility with our serverless infrastructure. +::: + ## See your app in Genezio Dashboard After deploying your application, you can test it to ensure it's running correctly. To verify that your Django app is diff --git a/docs/frameworks/fastapi.md b/docs/frameworks/fastapi.md index 2db59ead..1613ea83 100644 --- a/docs/frameworks/fastapi.md +++ b/docs/frameworks/fastapi.md @@ -286,6 +286,10 @@ After that, you can deploy your project without the `--env` flag. For more information about environment variables, you can check the [official documentation](/docs/project-structure/backend-environment-variables.md). +:::note +During deployment, Genezio will automatically install all dependencies specified in your `requirements.txt` file using the correct architecture (Linux x86) and Python 3.11 runtime environment. This ensures compatibility with our serverless infrastructure. +::: + ## See your app in Genezio Dashboard After deploying your application, you can test it to ensure it's running correctly. To verify that your FastAPI app is diff --git a/docs/frameworks/flask.md b/docs/frameworks/flask.md index 1ff34bcb..e68540c5 100644 --- a/docs/frameworks/flask.md +++ b/docs/frameworks/flask.md @@ -287,6 +287,10 @@ After that, you can deploy your project without the `--env` flag. For more information about environment variables, you can check the [official documentation](/docs/project-structure/backend-environment-variables.md). +:::note +During deployment, Genezio will automatically install all dependencies specified in your `requirements.txt` file using the correct architecture (Linux x86) and Python 3.11 runtime environment. This ensures compatibility with our serverless infrastructure. +::: + ## See your app in Genezio Dashboard After deploying your application, you can test it to ensure it's running correctly. To verify that your Flask app is diff --git a/docs/tutorials/how-to-deploy-a-serverless-function.md b/docs/tutorials/how-to-deploy-a-serverless-function.md index 85d7e403..6435e26b 100644 --- a/docs/tutorials/how-to-deploy-a-serverless-function.md +++ b/docs/tutorials/how-to-deploy-a-serverless-function.md @@ -231,6 +231,9 @@ backend: This configuration file specifies the project name, deployment region, and details about the backend. +:::note +During deployment, Genezio will automatically install all dependencies specified in your `requirements.txt` file using the correct architecture (Linux x86) and Python 3.11 runtime environment. This ensures compatibility with our serverless infrastructure. +::: From 57fc80d7f2f31840cbcb78cca34e7206c859f331 Mon Sep 17 00:00:00 2001 From: Cristi Miloiu Date: Tue, 28 Jan 2025 17:21:06 +0200 Subject: [PATCH 04/12] Add --name param | genezio deploy --- docs/cli-tool/cli-commands/deploy.md | 2 ++ docs/deploy/frontend.md | 29 ++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/cli-tool/cli-commands/deploy.md b/docs/cli-tool/cli-commands/deploy.md index 54181349..979055e3 100644 --- a/docs/cli-tool/cli-commands/deploy.md +++ b/docs/cli-tool/cli-commands/deploy.md @@ -34,6 +34,8 @@ If you executed this command with the `--frontend` option, the frontend code spe `--frontend`: Deploy only the frontend application. +`--name `: Deploy a specific frontend application. This is useful when you have multiple frontends in your project. [Learn more](../../deploy/frontend.md). + `--install-deps`: Automatically install missing dependencies. By default, this behavior is turned off. `--disable-optimization`: Disable dependency optimization. By default, optimization is enabled. diff --git a/docs/deploy/frontend.md b/docs/deploy/frontend.md index 07bb4b87..2e2cdc2f 100644 --- a/docs/deploy/frontend.md +++ b/docs/deploy/frontend.md @@ -23,7 +23,7 @@ We recommend you to: ## Supported Frameworks Genezio supports a wide range of popular frameworks, making it easy to integrate and deploy your existing projects or start new ones with familiar tools. -Here’s a look at some of the frameworks you can use with Genezio: +Here's a look at some of the frameworks you can use with Genezio: - **Genezio Functions**: AWS Lambda-compatible functions that run code and handle requests without managing servers. - [**Genezio Typesafe Classes**](/docs/genezio-typesafe/typesafety.md): Classes that can be deployed as functions with guaranteed client typesafe communication. @@ -55,7 +55,32 @@ You can deploy your project by running the following command: genezio deploy ``` -Note: You can deploy a frontend-only or backend-only project by adding the `--frontend` or `--backend` flags respectively. +:::tip +You can deploy a frontend-only or backend-only project by adding the `--frontend` or `--backend` flags respectively. +::: + +When working with multiple frontends in your project, you can use the `--name` flag to specify which frontend to deploy: + +```bash +genezio deploy --frontend --name frontend1 +``` + +This is particularly useful when your `genezio.yaml` contains multiple frontend configurations. For example: + +```yaml +name: my-project +region: us-east-1 +yamlVersion: 2 +frontend: + - name: frontend1 + path: ./frontend1 + publish: dist + - name: frontend2 + path: ./frontend2 + publish: dist +``` + +In this case, you can choose to deploy `frontend1` or `frontend2` individually using the `--name` flag. # Frontend deployments From 296f6f2df391e060ec0372a05511720f74e86fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreia=20Oc=C4=83noaia?= Date: Wed, 29 Jan 2025 18:00:35 +0200 Subject: [PATCH 05/12] Update information about frontend.environtment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreia Ocănoaia --- .../genezio-configuration-file.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/docs/project-structure/genezio-configuration-file.md b/docs/project-structure/genezio-configuration-file.md index 57f545ac..02073e02 100644 --- a/docs/project-structure/genezio-configuration-file.md +++ b/docs/project-structure/genezio-configuration-file.md @@ -651,6 +651,8 @@ Learn more about rewrites in the [Redirects and Rewrites](/docs/deploy/frontend/ The environment variables that will be injected at build time. The variables can be accessed in the code using `process.env`. +You can use expression to define the environment variables. Check the [Usage](#expressions) section for more information. + :::tip Each frontend framework will require a specific prefix for environment variables. For example, in Vite, you can access environment variables using `import.meta.env.VITE_MY_ENV_VAR`. @@ -670,6 +672,10 @@ frontend: These environment variables are injected at build time when `scripts.build` are run. +Note: Frontend environment variables cannot use constructs like `VITE_TEST_ENV_VAR: ${{ env.TEST }}`. +This syntax is meant for the backend, where sensitive values (like API keys) are read from a local-only .env file and kept hidden. +In `frontend.environment`, you can directly use the value of the environment variable as a string - `VITE_TEST_ENV_VAR: "test"` or manage them in a `.env` file. + #### `scripts`: `Object` **Optional** The scripts that run before special frontend events occur. If a list is provided to any of the fields, the scripts will be executed sequentially and in case one fails, the execution will be stopped. @@ -736,6 +742,17 @@ The Docker container configuration. This field can be omitted if the project is You can use expression to define the environment variables. Check the [Usage](#expressions) section for more information. + ```yaml + name: my-project + yamlVersion: 2 + + backend: + environment: + MY_ENV_VAR: my-value + MY_DATABASE_NAME: ${{services.databases..name}} + MY_SECRET: ${{env.SECRET}} + ``` + - `timeout`: `number` **Optional** Specifies how long a request should wait for a response, in seconds. Timeout is the maximum amount of time in seconds that a request can take to complete. @@ -829,6 +846,17 @@ You can use the `nextjs`, `nuxt`, `nitro`, `nestjs`, `remix` field to deploy a N You can use expression to define the environment variables. Check the [Usage](#expressions) section for more information. + ```yaml + name: my-project + yamlVersion: 2 + + backend: + environment: + MY_ENV_VAR: my-value + MY_DATABASE_NAME: ${{services.databases..name}} + MY_SECRET: ${{env.SECRET}} + ``` + - `packageManager`: `npm` | `pnpm` | `yarn` **Optional** The package manager used to install the project's dependencies. The default value is `npm`. @@ -892,6 +920,7 @@ Expressions can be used in the following YAML fields: You can concatenate expressions with strings - e.g. `prefix-${{env.ENV_KEY}}-suffix`. +For frontend environment variables, you can use expressions like (not limited to): ```yaml name: my-project region: us-east-1 @@ -906,6 +935,24 @@ frontend: VITE_MY_FUNCTION_URL: ${{backend.functions..url}} #... ``` +Note: Frontend environment variables cannot use constructs like `VITE_TEST_ENV_VAR: ${{ env.TEST }}`. +This syntax is meant for the backend, where sensitive values (like API keys) are read from a local-only .env file and kept hidden. +In `frontend.environment`, you can directly use the value of the environment variable as a string - `VITE_TEST_ENV_VAR: "test"` or manage them in a `.env` file. + +For backend environment variables, you can use expressions like (not limited to): +```yaml +name: my-project +region: us-east-1 +yamlVersion: 2 +# ... +backend: + # ... + environment: + NODE_ENV: production + MY_DATABASE_URI: ${{services.databases..uri}} + MY_SECRET: ${{env.SECRET}} + #... +``` ## Variables From 1cacb513e32cbe7f0e5738ba83453badca2d3474 Mon Sep 17 00:00:00 2001 From: Cristi Miloiu Date: Wed, 5 Feb 2025 14:55:19 +0200 Subject: [PATCH 06/12] feat: add streamlit documentation --- docs/frameworks/streamlit.md | 188 +++++++++++++++++++++++++++++++++++ sidebars.js | 1 + 2 files changed, 189 insertions(+) create mode 100644 docs/frameworks/streamlit.md diff --git a/docs/frameworks/streamlit.md b/docs/frameworks/streamlit.md new file mode 100644 index 00000000..3c2e3e66 --- /dev/null +++ b/docs/frameworks/streamlit.md @@ -0,0 +1,188 @@ +--- +description: Learn how to deploy a Streamlit application with Genezio. +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Streamlit + + + Streamlit | Genezio Documentation + + +Streamlit is a Python framework for building data science and machine learning web applications, making it easy to create interactive dashboards and visualizations. + +:::tip +Get started in no time with the [Streamlit template](https://app.genez.io/auth/signup?redirect=streamlit-getting-started). +::: + +# Deployment + +Learn how to deploy an existing Streamlit app using Genezio, a serverless deployment platform that simplifies app management and reduces costs. + +## Prerequisites + +### 1. Install genezio + +Use your preferred package manager to install Genezio: + + + +
+ ``` + npm install genezio -g + ``` +
+
+ +
+ ``` + pnpm add -g genezio + ``` +
+
+ +
+ ``` + yarn add global genezio + ``` +
+
+
+ +### 2. Ensure you have a Streamlit App + +If you don't have a Streamlit app, you can create one using the following steps: + +
+ **Create a Hello World Streamlit App** + +

1. Set up your project

+ +Create a new directory and install Streamlit: + +```bash +mkdir my-streamlit-app +cd my-streamlit-app +pip install streamlit +``` + +Create a new file called `app.py` with this basic example: + +```python +import streamlit as st + +st.title('Hello World!') +st.write('Welcome to my Streamlit app!') +``` + +

2. Create requirements.txt

+ +To ensure all dependencies are properly tracked and installed during deployment, create a `requirements.txt` file by running: + +```bash +pip freeze > requirements.txt +``` + +Alternatively, you can manually create a `requirements.txt` file with just the necessary dependencies: + +```text +streamlit +``` + +

3. Test the Streamlit App

+ +Run the following command to start the Streamlit app: + +```bash +streamlit run app.py +``` + +Open a web browser and navigate to [http://localhost:8501](http://localhost:8501) to see the app running. + +
+ +## Deployment Guide + +## 1. Create configuration file + +First, you need to create the configuration file in the root directory of your Streamlit app, run the following command: + +```bash +genezio analyze +``` + +This command will analyze your project and create the `genezio.yaml` file in the root directory of your Streamlit app, with the following content: + +```yaml +# The name of your project, which also influences the subdomain of the project. +name: genezio-project +# Select a region closest to your user base for optimal performance. +region: us-east-1 +# Specifies the version of the YAML configuration syntax being used. +yamlVersion: 2 +# Configuration specific to the Streamlit project setup. +streamlit: + # The path to the directory containing your Streamlit app. + path: . + # The package manager used to install dependencies. + packageManager: pip + # The entry file of your Streamlit app. + entryFile: app.py + # The runtime to use for your Streamlit app. + runtime: python3.11.x +``` + +:::info Supported Python Runtimes +Genezio supports the following Python runtime values: +- `python3.9.x` +- `python3.10.x` +- `python3.11.x` +- `python3.12.x` +- `python3.13.x` + +Use these exact values in your `genezio.yaml` configuration file, at the `runtime` field. +::: + + +## 2. Deploy your project + +Finally, deploy your project. A browser window will open, and you will be prompted to log in to your Genezio account and authorize the CLI to make the deployment. +Run the following command in your terminal: + +```bash +genezio deploy +``` + +:::warning +The `requirements.txt` file is required for the deployment to work. +::: + +## Local Development + +To develop and test your app locally, run: + +```bash +genezio local +``` + +This command starts a local development server on port 8501 by default. You can specify a custom port by setting the `GENEZIO_PORT_STREAMLIT` environment variable using one of these methods: + +- Add `GENEZIO_PORT_STREAMLIT=` to your `.env` file +- Windows: Run `set GENEZIO_PORT_STREAMLIT= && genezio local` +- macOS/Linux: Run `GENEZIO_PORT_STREAMLIT= genezio local` + +## See your app in Genezio Dashboard + +After deploying your application, you can test it to ensure it's running correctly. To verify that your Streamlit app is working, open a web browser and navigate to the URL provided for your deployed app. + +Additionally, you can monitor and manage your app through the [Genezio App Dashboard](https://app.genez.io/dashboard). The dashboard URL, also provided after deployment, allows you to access comprehensive views of your project's status and logs. + +You can find this URL in the deployment output under the `App Dashboard URL` section. + +## Support + +We invite you to join our community on [Discord](https://discord.gg/uc9H5YKjXv) for further information and help. + +**Happy Learning!** diff --git a/sidebars.js b/sidebars.js index f2d9a3eb..35353dd6 100644 --- a/sidebars.js +++ b/sidebars.js @@ -48,6 +48,7 @@ const sidebars = { "frameworks/react-admin", "frameworks/refine", "frameworks/remix", + "frameworks/streamlit", "frameworks/svelte", "frameworks/typesafe-project", "frameworks/vue", From 127d496f2578cdcef399c453582ef71a1f5111b6 Mon Sep 17 00:00:00 2001 From: Cristi Miloiu <65810476+cristim67@users.noreply.github.com> Date: Wed, 5 Feb 2025 15:08:47 +0200 Subject: [PATCH 07/12] Update docs/frameworks/streamlit.md Co-authored-by: Andreia Ocanoaia --- docs/frameworks/streamlit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/frameworks/streamlit.md b/docs/frameworks/streamlit.md index 3c2e3e66..c42614af 100644 --- a/docs/frameworks/streamlit.md +++ b/docs/frameworks/streamlit.md @@ -131,7 +131,7 @@ streamlit: # The entry file of your Streamlit app. entryFile: app.py # The runtime to use for your Streamlit app. - runtime: python3.11.x + runtime: python3.13.x ``` :::info Supported Python Runtimes From bb62b9c9b5048caa3ee5e88e885652473a30d30d Mon Sep 17 00:00:00 2001 From: Cristi Miloiu Date: Wed, 5 Feb 2025 15:26:17 +0200 Subject: [PATCH 08/12] cristim67/choose-python-version --- docs/frameworks/django.md | 9 ++++++++- docs/frameworks/fastapi.md | 9 ++++++++- docs/frameworks/flask.md | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/frameworks/django.md b/docs/frameworks/django.md index ccb4e9c9..bef23029 100644 --- a/docs/frameworks/django.md +++ b/docs/frameworks/django.md @@ -266,6 +266,7 @@ This file will contain the configuration needed to deploy your backend using Gen 3. You might need to replace the `entry` field with the name of your wsgi application file. 4. You might need to replace the `path` field with the path relative at **genezio.yaml** file. 5. This example configuration works if **genezio.yaml** is in the same directory as your `manage.py` file and the Django app is named `project_name`. +6. The `runtime` field is the Python runtime to use for your Django app, currently, the supported runtimes are: [python3.9.x, python3.10.x, python3.11.x, python3.12.x, python3.13.x] ::: ```yaml title="genezio.yaml" @@ -284,6 +285,8 @@ backend: name: python # The package manager used by the backend. packageManager: pip + # The runtime to use for your Django app. + runtime: python3.13.x # Information about the backend's functions. functions: # The name (label) of the function. @@ -357,7 +360,11 @@ For more information about environment variables, you can check the [official documentation](/docs/project-structure/backend-environment-variables.md). :::note -During deployment, Genezio will automatically install all dependencies specified in your `requirements.txt` file using the correct architecture (Linux x86) and Python 3.11 runtime environment. This ensures compatibility with our serverless infrastructure. +During the deployment process, Genezio automatically installs all dependencies specified in your `requirements.txt` file using: +- The correct architecture (Linux x86) +- The Python runtime specified in `genezio.yaml` + +This process ensures compatibility with our serverless infrastructure, defaulting to the latest Python 3.13.x version. ::: ## See your app in Genezio Dashboard diff --git a/docs/frameworks/fastapi.md b/docs/frameworks/fastapi.md index 1613ea83..48105f91 100644 --- a/docs/frameworks/fastapi.md +++ b/docs/frameworks/fastapi.md @@ -197,6 +197,7 @@ This file will contain the configuration needed to deploy your backend using Gen 3. You might need to replace the `entry` field with the name of your main application file. 4. You might need to replace the `path` field with the path relative at **genezio.yaml** file. 5. This example configuration works if **genezio.yaml** is in the same directory as your main application file. +6. The `runtime` field is the Python runtime to use for your FastAPI app, currently, the supported runtimes are: [python3.9.x, python3.10.x, python3.11.x, python3.12.x, python3.13.x] ::: ```yaml title="genezio.yaml" @@ -215,6 +216,8 @@ backend: name: python # The package manager used by the backend. packageManager: pip + # The runtime to use for your FastAPI app. + runtime: python3.13.x # Information about the backend's functions. functions: # The name (label) of the function. @@ -287,7 +290,11 @@ For more information about environment variables, you can check the [official documentation](/docs/project-structure/backend-environment-variables.md). :::note -During deployment, Genezio will automatically install all dependencies specified in your `requirements.txt` file using the correct architecture (Linux x86) and Python 3.11 runtime environment. This ensures compatibility with our serverless infrastructure. +During the deployment process, Genezio automatically installs all dependencies specified in your `requirements.txt` file using: +- The correct architecture (Linux x86) +- The Python runtime specified in `genezio.yaml` + +This process ensures compatibility with our serverless infrastructure, defaulting to the latest Python 3.13.x version. ::: ## See your app in Genezio Dashboard diff --git a/docs/frameworks/flask.md b/docs/frameworks/flask.md index e68540c5..96afc2fb 100644 --- a/docs/frameworks/flask.md +++ b/docs/frameworks/flask.md @@ -198,6 +198,7 @@ This file will contain the configuration needed to deploy your backend using Gen 3. You might need to replace the `entry` field with the name of your main application file. 4. You might need to replace the `path` field with the path relative at **genezio.yaml** file. 5. This example configuration works if **genezio.yaml** is in the same directory as your main application file. +6. The `runtime` field is the Python runtime to use for your Flask app, currently, the supported runtimes are: [python3.9.x, python3.10.x, python3.11.x, python3.12.x, python3.13.x] ::: ```yaml title="genezio.yaml" @@ -216,6 +217,8 @@ backend: name: python # The package manager used by the backend. packageManager: pip + # The runtime to use for your Flask app. + runtime: python3.13.x # Information about the backend's functions. functions: # The name (label) of the function. @@ -288,7 +291,11 @@ For more information about environment variables, you can check the [official documentation](/docs/project-structure/backend-environment-variables.md). :::note -During deployment, Genezio will automatically install all dependencies specified in your `requirements.txt` file using the correct architecture (Linux x86) and Python 3.11 runtime environment. This ensures compatibility with our serverless infrastructure. +During the deployment process, Genezio automatically installs all dependencies specified in your `requirements.txt` file using: +- The correct architecture (Linux x86) +- The Python runtime specified in `genezio.yaml` + +This process ensures compatibility with our serverless infrastructure, defaulting to the latest Python 3.13.x version. ::: ## See your app in Genezio Dashboard From ae9a3f4277994d69619f705bcbfa4e0b394b0d2c Mon Sep 17 00:00:00 2001 From: Cristi Miloiu Date: Wed, 5 Feb 2025 16:09:22 +0200 Subject: [PATCH 09/12] feat: add ember in documentation --- docs/frameworks/ember.md | 151 +++++++++++++++++++++++++++++++++++++++ sidebars.js | 1 + 2 files changed, 152 insertions(+) create mode 100644 docs/frameworks/ember.md diff --git a/docs/frameworks/ember.md b/docs/frameworks/ember.md new file mode 100644 index 00000000..fa61e1ed --- /dev/null +++ b/docs/frameworks/ember.md @@ -0,0 +1,151 @@ +--- +description: Learn how to deploy an Ember application with Genezio. +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Ember + + + Ember | Genezio Documentation + + +[Ember.js](https://emberjs.com/) is a productive, battle-tested JavaScript framework for building modern web applications. It includes everything you need to build rich user interfaces that work on any device. + +:::tip +Get started in no time with the [Ember template](https://app.genez.io/start/deploy?repository=https://github.com/Genez-io/ember-getting-started). +::: + +# Deployment + +Learn how to deploy an existing Ember app using Genezio, a serverless deployment platform that simplifies app management and reduces costs. + +## Prerequisites + +### 1. Install genezio + +Use your preferred package manager to install Genezio: + + + +
+ ``` + npm install genezio -g + ``` +
+
+ +
+ ``` + pnpm add -g genezio + ``` +
+
+ +
+ ``` + yarn add global genezio + ``` +
+
+
+ +### 2. Start from an existing Ember template + +Create an Ember app using the following steps: + +
+ **Create an Ember App** + +

1. Fork our Ember template repository on GitHub

+ +Go to https://github.com/Genez-io/ember-getting-started/fork and fork the repo. + + +

2. Clone the newly created repository locally

+ + +```bash +git clone YOUR_REPO_URL +cd ember-getting-started +``` + +

3. Run the Ember App locally

+ +Run the following command to start the Ember.js app locally: + +
+ ```bash + ember serve + ``` +
+ +

4. Test the Ember App locally

+ +Open a web browser and navigate to http://localhost:4200/ to see the app running. + +
+ +## Create the Genezio Configuration File + +Now, create a `genezio.yaml` file in the root directory of your project. + +This file will contain the configuration needed to deploy your backend using Genezio. Here is an example configuration. + +:::info +1. This example configuration works if **genezio.yaml** is in the same directory as your main application file. +2. You might need to replace the `publish` directory value if it is different in your project. +::: + +```yaml title="genezio.yaml" +# Learn more about Genezio YAML at https://genezio.com/docs/project-structure/genezio-configuration-file/ +name: genezio-project +region: us-east-1 +yamlVersion: 2 +frontend: + path: . + publish: dist + scripts: + deploy: + - npm install + build: + - npm run build + start: + - npm install + - npm run start +``` + +This configuration file specifies the project name, deployment region, and details about the frontend. + +## Deploy the app + +In your terminal run the following command to deploy your app to the Genezio cloud: + +
+ ```bash + genezio deploy + ``` +
+ +You should now see 2 URLs in the terminal window with the following format: + +```bash +$ App Dashboard URL: https://app.genez.io/project// +$ Frontend URL: https://.app.genez.io +``` + +## Next Steps + +After setting up the template, here are some recommended next steps: + + + +## Support + +We invite you to join our community on [Discord](https://discord.gg/uc9H5YKjXv) for further information and help. + +**Happy Learning!** diff --git a/sidebars.js b/sidebars.js index 35353dd6..8aac98cb 100644 --- a/sidebars.js +++ b/sidebars.js @@ -36,6 +36,7 @@ const sidebars = { items: [ "frameworks/angular", "frameworks/django", + "frameworks/ember", "frameworks/expressjs", "frameworks/fastapi", "frameworks/fastify", From 78fa6211eb46b98802121d0838310a9b3ab69cc4 Mon Sep 17 00:00:00 2001 From: Cristi Miloiu Date: Thu, 6 Feb 2025 13:57:03 +0200 Subject: [PATCH 10/12] feat: extend SSR schema --- .../genezio-configuration-file.md | 88 +++++++++++++++++-- 1 file changed, 82 insertions(+), 6 deletions(-) diff --git a/docs/project-structure/genezio-configuration-file.md b/docs/project-structure/genezio-configuration-file.md index 02073e02..2ca49a68 100644 --- a/docs/project-structure/genezio-configuration-file.md +++ b/docs/project-structure/genezio-configuration-file.md @@ -832,17 +832,17 @@ container: MY_ENV_VAR: my-value ``` -## nextjs | nuxt | nitro | nestjs | remix +## nextjs | nuxt | nitro | nestjs | remix | streamlit -You can use the `nextjs`, `nuxt`, `nitro`, `nestjs`, `remix` field to deploy a Next.js, Nuxt.js, Nitro, Nestjs, or Remix project. +You can use the `nextjs`, `nuxt`, `nitro`, `nestjs`, `remix`, or `streamlit` field to deploy a Next.js, Nuxt.js, Nitro, Nestjs, Remix, or Streamlit project. - path: `string` **Required** - The path to the Dockerfile. It is relative to the `genezio.yaml` file. + The path to the project. It is relative to the `genezio.yaml` file. - environment: `Object` **Optional** - The environment variables that will be set for the server inside the Docker container. + The environment variables that will be set for the server inside the project execution environment. You can use expression to define the environment variables. Check the [Usage](#expressions) section for more information. @@ -857,7 +857,7 @@ You can use the `nextjs`, `nuxt`, `nitro`, `nestjs`, `remix` field to deploy a N MY_SECRET: ${{env.SECRET}} ``` -- `packageManager`: `npm` | `pnpm` | `yarn` **Optional** +- `packageManager`: `npm` | `pnpm` | `yarn` | `pip` **Optional** The package manager used to install the project's dependencies. The default value is `npm`. @@ -876,9 +876,82 @@ Variables can be used in the scripts. Check the [Usage](#variables) section for The subdomain where the project will be deployed. If not specified, a random subdomain will be generated. The full format of the domain will be `https://.app.genezio.com`. +- `timeout`: `number` **Optional** + + Specifies how long a request should wait for a response, in seconds. Timeout is the maximum amount of time in seconds that a request can take to complete. + The default value for this setting is 60 seconds. You can adjust this in increments of 1 second up to a maximum value of 900 seconds (15 minutes). + + To increase the maximum threshold up to 3600 seconds (1 hour), you [can upgrade to a Pro Subscription](https://app.genez.io/billing). + + For larger values, [contact us](mailto:contact@genez.io). + +- `storageSize`: `number` **Optional** + + By default a partition of 128MB is mounted to the execution environment. This can be used to store temporary files or cache data. Check the [Temporary Storage](/docs/features/temporary-storage.md) page for more information and usage examples. + + To increase the maximum value up to 512MB, you [can upgrade to a Pro Subscription](https://app.genez.io/billing). + Afterwards, you can adjust this in increments of 1MB up to a maximum value of 512MB. + + For larger values, [contact us](mailto:contact@genez.io). + + Note 1: This storage is not persistent across requests. It is not recommend to use it for stateful operations. + Note 2: Changing the storage size will affect cold start times. + +- `instanceSize`: `tiny` | `medium` | `large` **Optional** + + Determines the amount of RAM allocated to the execution environment. The default value for this setting is `tiny`. + To increase the amount of RAM allocated, you can set the value to `medium` or `large`. A [Pro Subscription](https://app.genez.io/billing) is required to change this configuration. + + tiny = 256MB RAM, 1 VCPU + + medium = 384MB RAM, 1 VCPU + + large = 512MB RAM, 1 VCPU + + For larger instance sizes, [contact us](mailto:contact@genez.io). + +- `maxConcurrentRequestsPerInstance`: `number` **Optional** + + Specifies the number of concurrent requests that can be served simultaneously by an execution environment. + The default value for this setting is 5 concurrent requests per execution environment. + + To increase the maximum value up to 10 concurrent requests, you [can upgrade to a Pro Subscription](https://app.genez.io/billing). + Afterwards, you can adjust this in increments of 1 up to a maximum value of 10 concurrent requests. + + For larger values, [contact us](mailto:contact@genez.io). + + Note: Setting this value to 1 disables concurrent requests served within the same execution environment. In this case, 2 or more incoming concurrent requests will be automatically distributed across separate execution environments, which are scaled up dynamically by Genezio. + +- `maxConcurrentInstances`: `number` **Optional** + + Specifies the number of concurrent instances that can be served simultaneously for a function. + The default value for this setting is 3 concurrent instances per function. + + To increase the maximum value up to 10 concurrent instances, you [can upgrade to a Pro Subscription](https://app.genez.io/billing). + Afterwards, you can adjust this in increments of 1 up to a maximum value of 10 concurrent instances per function. + + For larger values, [contact us](mailto:contact@genez.io). + + Note: Setting this value to 1 disables concurrent instances served. In this case, your function will open only one instance. Any traffic trying to access the instance when it has reached the maximum number of concurrent requests will be dropped. THIS IS NOT RECOMMENDED. + +- `cooldownTime`: `number` **Optional** + + Specifies the time in milliseconds that the execution environment will be kept alive after the response is sent. + The default value for this setting is 0 milliseconds. You can adjust this up to a maximum value of 3000 milliseconds (3 seconds). + + To increase the maximum threshold up to 5 minutes, you [can upgrade to a Pro Subscription](https://app.genez.io/billing). + + For larger values, [contact us](mailto:contact@genez.io). + +- `runtime`: `nodejs20.x` | `python9.x` | `python10.x` | `python3.11.x` | `python3.12.x` | `python3.13.x` **Optional** + + The runtime to be used for the project. The default value is `nodejs20.x` for Node.js projects and `python3.13.x` for Python projects. + + For custom runtimes, please [contact us](mailto:contact@genez.io). + ### Example of `nextjs` deployment configuration -This example can be easily used for Nuxt.js, Nitro, Nestjs, or Remix projects by changing the `nextjs` field to `nuxt`, `nitro`, `nestjs`, or `remix`. +This example can be easily used for Nuxt.js, Nitro, Nestjs, Remix, or Streamlit projects by changing the `nextjs` field to `nuxt`, `nitro`, `nestjs`, `remix`, or `streamlit`. ```yaml name: genezio-project @@ -921,6 +994,7 @@ Expressions can be used in the following YAML fields: You can concatenate expressions with strings - e.g. `prefix-${{env.ENV_KEY}}-suffix`. For frontend environment variables, you can use expressions like (not limited to): + ```yaml name: my-project region: us-east-1 @@ -935,11 +1009,13 @@ frontend: VITE_MY_FUNCTION_URL: ${{backend.functions..url}} #... ``` + Note: Frontend environment variables cannot use constructs like `VITE_TEST_ENV_VAR: ${{ env.TEST }}`. This syntax is meant for the backend, where sensitive values (like API keys) are read from a local-only .env file and kept hidden. In `frontend.environment`, you can directly use the value of the environment variable as a string - `VITE_TEST_ENV_VAR: "test"` or manage them in a `.env` file. For backend environment variables, you can use expressions like (not limited to): + ```yaml name: my-project region: us-east-1 From f44c9e72d8f0005403881faa405ecc66ee5182bb Mon Sep 17 00:00:00 2001 From: Bogdan Vlad Date: Mon, 10 Feb 2025 13:25:11 +0200 Subject: [PATCH 11/12] Update documentation to reflect the new limits --- docs/project-structure/genezio-configuration-file.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/project-structure/genezio-configuration-file.md b/docs/project-structure/genezio-configuration-file.md index 57630641..df499006 100644 --- a/docs/project-structure/genezio-configuration-file.md +++ b/docs/project-structure/genezio-configuration-file.md @@ -310,10 +310,10 @@ If scripts are declared in the `scripts` field, they will be executed from this - `maxConcurrentRequestsPerInstance`: `number` **Optional** Specifies the number of concurrent requests that can be served simultaneously by an execution environment. - The default value for this setting is 5 concurrent requests per execution environment. + The default value for this setting is 10 concurrent requests per execution environment. - To increase the maximum value up to 10 concurrent requests, you [can upgrade to a Pro Subscription](https://app.genez.io/billing). - Afterwards, you can adjust this in increments of 1 up to a maximum value of 10 concurrent requests. + To increase the maximum value up to 20 concurrent requests, you [can upgrade to a Pro Subscription](https://app.genez.io/billing). + Afterwards, you can adjust this in increments of 1 up to a maximum value of 20 concurrent requests. For larger values, [contact us](mailto:contact@genez.io). From 0ac524ff277efedc575c120de2c02734ed633ae4 Mon Sep 17 00:00:00 2001 From: Bogdan Vlad Date: Mon, 10 Feb 2025 13:49:46 +0200 Subject: [PATCH 12/12] Update genezio-configuration-file.md --- .../genezio-configuration-file.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/project-structure/genezio-configuration-file.md b/docs/project-structure/genezio-configuration-file.md index 23e1b4b5..a02bec9e 100644 --- a/docs/project-structure/genezio-configuration-file.md +++ b/docs/project-structure/genezio-configuration-file.md @@ -322,7 +322,7 @@ If scripts are declared in the `scripts` field, they will be executed from this - `maxConcurrentInstances`: `number` **Optional** Specifies the number of concurrent instances that can be served simultaneously for a class. - The default value for this setting is 3 concurrent instances per class. + The default value for this setting is 5 concurrent instances per class. To increase the maximum value up to 10 concurrent instances, you [can upgrade to a Pro Subscription](https://app.genez.io/billing). Afterwards, you can adjust this in increments of 1 up to a maximum value of 10 concurrent instances per class. @@ -486,10 +486,10 @@ This resource exposes `url` as an output expression: `${{backend.functions.