Skip to content

Commit

Permalink
Merge pull request #315 from Genez-io/dev
Browse files Browse the repository at this point in the history
Release v3.2.2
  • Loading branch information
andreia-oca authored Feb 19, 2025
2 parents 80cbac2 + 30f582c commit 1815017
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 16 deletions.
6 changes: 3 additions & 3 deletions docs/cli-tool/cli-commands/genezio-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ These options work with any `genezio create` subcommand

`--region <project-region>`: Region of the project
- Required, asked interactively if not provided
- Choices: `us-east-1`, `eu-central-1`

- Choices: `us-east-1`, `eu-central-1`, `eu-west-1`

`--path <project-path>`: The path where the new project will be created

- Default: `current-directory + project-name`
Expand Down
60 changes: 60 additions & 0 deletions docs/deploy/persistent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
description: Genezio offers seamless application deployments. Deploy a long-running backend service with a single command `genezio deploy`.
---

# Persistent (Long-Running) Server

Genezio supports deploying persistent or long-running servers, ensuring that your application remains active without scaling down to zero.
This is particularly useful for applications that require continuous processing or stateful operations.


## What is a Persistent Server?

A persistent or long-running server is an application that stays active and does not automatically scale down to zero when there are no incoming requests.
Unlike serverless functions that are event-driven and ephemeral, persistent servers allow for stateful operations and long-running tasks.

## Deploy Persistent Server in Genezio

To deploy a persistent server on Genezio, you need to define the function type as persistent in your genezio.yaml configuration file.

Here's an example of a genezio.yaml configuration file with a persistent function:

```yaml
name: my-project
region: us-east-1
yamlVersion: 2
backend:
path: .
language:
name: js
functions:
- name: persistent-server
path: .
entry: server.mjs
handler: handler
type: persistent
```
Once you have configured the `genezio.yaml` file, you can either commit it to your GitHub repository or deploy it directly using the Genezio CLI:

```bash
genezio deploy
```

Genezio will provision the necessary resources to ensure that your server remains running continuously.

After deploying, you can send requests to your server using the generated endpoint URL available in the Genezio dashboard or in the CLI output.

:::tip info
To send requests to your persistent server, do not forget to prepend `compute-` to the endpoint URL.
The format should be `https://compute-<server-uuid>.<region>.cloud.genez.io`.
:::

Note: Sending requests to the URL `https://<server-uuid>.<region>.cloud.genez.io` will trigger a serverless call instead of a persistent server call.

## Enterprise Support

Persistent servers are available as an Enterprise-only feature.
If you are interested in deploying a persistent server on Genezio, please [contact us](mailto:[email protected]) for more information.

For further details on server types and configurations, refer to the [Genezio Configuration File](/docs/project-structure/genezio-configuration-file.md).
4 changes: 2 additions & 2 deletions docs/frameworks/django.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ This file will contain the configuration needed to deploy your backend using Gen
```yaml title="genezio.yaml"
# The name of the project.
name: django-app
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1
region: us-east-1
# The version of the Genezio YAML configuration to parse.
yamlVersion: 2
Expand Down Expand Up @@ -313,7 +313,7 @@ Run the following command in your terminal:
<TabItem className="tab-item" value="windows" label="Windows">
<div id="windows">
```
python manage.py runserver
python manage.py runserver
```
</div>
</TabItem>
Expand Down
2 changes: 1 addition & 1 deletion docs/frameworks/expressjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ This command will analyze your project and create the genezio.yaml file in the r
```yaml title="genezio.yaml"
# The name of the project.
name: express-app
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1
region: us-east-1
# The version of the Genezio YAML configuration to parse.
yamlVersion: 2
Expand Down
4 changes: 2 additions & 2 deletions docs/frameworks/fastapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ app = FastAPI()
@app.get("/")
def home():
return {"Hello": "World"}

if __name__ == "__main__":
import uvicorn
uvicorn.run(app)
Expand Down Expand Up @@ -203,7 +203,7 @@ This file will contain the configuration needed to deploy your backend using Gen
```yaml title="genezio.yaml"
# The name of the project.
name: fastapi-app
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1
region: us-east-1
# The version of the Genezio YAML configuration to parse.
yamlVersion: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/frameworks/fastify.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ This command will analyze your project and create the genezio.yaml file in the r
```yaml title="genezio.yaml"
# The name of the project.
name: fastify-app
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1
region: us-east-1
# The version of the Genezio YAML configuration to parse.
yamlVersion: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/frameworks/flask.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ This file will contain the configuration needed to deploy your backend using Gen
```yaml title="genezio.yaml"
# The name of the project.
name: flask-app
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1
region: us-east-1
# The version of the Genezio YAML configuration to parse.
yamlVersion: 2
Expand Down
22 changes: 18 additions & 4 deletions docs/project-structure/genezio-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ The supported regions are:
| -------------- | ------------------ |
| `us-east-1` | US, North Virginia |
| `eu-central-1` | Europe, Frankfurt |
| `eu-west-1` | Europe, London |

```yaml
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1, eu-west-1
region: us-east-1
```

Expand Down Expand Up @@ -112,7 +113,7 @@ The supported regions are:
| ---------------- | ----------------------- | ---------- | ------- |
| `us-east-1` | US, North Virginia | ✅ | ✅ |
| `eu-central-1` | Europe, Frankfurt | ✅ | ✅ |
| `eu-east-2` | US, Ohio | ✅ | ❌ |
| `us-east-2` | US, Ohio | ✅ | ❌ |
| `us-west-2` | US, Oregon | ✅ | ❌ |
| `ap-southeast-1` | Asia Pacific, Singapore | ✅ | ❌ |
| `ap-southeast-2` | Asia Pacific, Sidney | ✅ | ❌ |
Expand Down Expand Up @@ -434,10 +435,11 @@ This resource exposes `url` as an output expression: `${{backend.functions.<func

- `type`: `string` **Optional**

The type of the function. This can be `aws` or `httpServer`. If this field is not specified, the default value is `aws`.
The type of the function. This can be: `aws`, `httpServer`, or `persistent`. If this field is not specified, the default value is `aws`.

- `aws` indicates that the function will be deployed as an AWS Lambda handler. This means that the function is either a Lambda event handler or it uses [`serverless-http`](https://www.npmjs.com/package/serverless-http) to convert an Express app to a Lambda event handler.
- `httpServer` indicates that the function will be deployed as a standalone HTTP server, such as those built with frameworks like `express`, `fastify`, `flask`, `django`, etc.
- `persistent` indicates that the function will be deployed as a long-running server that will not be scaled down to 0. This is an Enterprise-only feature, please [contact us](mailto:[email protected]) for more information.

Note 1: The recommended way to deploy your app is to use the `httpServer` type unless you are explicitly migrating from an existing AWS Lambda function or using `serverless-http`.
Note 2: Websocket are supported only for `httpServer` functions.
Expand Down Expand Up @@ -551,7 +553,7 @@ This resource exposes `url` as an output expression: `${{backend.functions.<func
```yaml title="genezio.yaml
# The name of the project.
name: express-app
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1
region: us-east-1
# The version of the Genezio YAML configuration to parse.
yamlVersion: 2
Expand Down Expand Up @@ -864,6 +866,12 @@ The Docker container configuration. This field can be omitted if the project is

For larger values, [contact us](mailto:[email protected]).

- `type`: `string` **Optional**

The type of the container can be set to `persistent`. If this field is not specified, the container will be deployed in a serverless manner.

- `persistent` indicates that the container will be deployed as a long-running server that will not be scaled down to 0. This is an Enterprise-only feature, please [contact us](mailto:[email protected]) for more information.

### Example of `container` deployment configuration

```yaml
Expand Down Expand Up @@ -1007,6 +1015,12 @@ Variables can be used in the scripts. Check the [Usage](#variables) section for

For custom runtimes, please [contact us](mailto:[email protected]).

- `type`: `string` **Optional**

The type of the server can be set to `persistent`. If this field is not specified, the server will be deployed in a serverless manner.

- `persistent` indicates that the server will be deployed as long-running and it will not be scaled down to 0. This is an Enterprise-only feature, please [contact us](mailto:[email protected]) for more information.

### Example of `nextjs` deployment configuration

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`.
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/how-to-deploy-a-serverless-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ This file will contain the configuration needed to deploy your backend using Gen
```yaml title="genezio.yaml"
# The name of the project.
name: functions-app
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1
region: us-east-1
# The version of the Genezio YAML configuration to parse.
yamlVersion: 2
Expand Down Expand Up @@ -204,7 +204,7 @@ This file will contain the configuration needed to deploy your backend using Gen
```yaml title="genezio.yaml"
# The name of the project.
name: functions-app
# The region where the project is deployed. Available regions: us-east-1, eu-central-1
# The region where the project is deployed. Available regions: us-east-1, eu-central-1, eu-west-1
region: us-east-1
# The version of the Genezio YAML configuration to parse.
yamlVersion: 2
Expand Down
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const sidebars = {
items: [
"deploy/backend",
"deploy/frontend",
"deploy/persistent",
"deploy/serverless-containers",
],
},
Expand Down

0 comments on commit 1815017

Please sign in to comment.