Deploy with Render: a Step-by-step Guide.
With its full compatibility with Python, deploying with Pathway is as easy as deploying any Python project. New tools have made deploying on the cloud effortless. For instance, Render allows you to deploy your Python-based web services in one click.
In this article, you will learn how to deploy your Pathway web service using Render. You will see, step by step, how to deploy a Pathway web service hosted on a public GitHub repository. As an example, this tutorial will show you how to deploy Pathway chatbot answering questions about documents.
What this guide is about
This guide will show you how to deploy a Pathway web service using Render. It relies on the free offer of Render. Here are the requirements for the project:
- Contains a
Dockerfile
at the root. - It must bind to a port on host
0.0.0.0
to receive HTTP requests from external connections on port10000
. - Ports
18012
,18013
, and19099
are reserved by Render and cannot be used.
You can learn more about the free offer on the official documentation.
Note that we are going to use to deploy from a public repository, but you can easily deploy from a private one by connecting to your GitHub/GitLab by connecting to your account from Render.
Create an account on Render
The first step is to create an account at Render.
- Click on the "Sign In" button:
- Choose your favorite way of logging. You can either use a GitHub, GitLab, or Google account. You can also create an account with an email and password.
You now have a Render's account.
Create and deploy your Pathway web service
Now that you have an account, you need to deploy your app. Render allows you to deploy service types for hosting your app. In our case, we want to deploy a web service as it is available in the free offer.
- Let's create a new project by clicking on "New Web Service":
- Select "Build and deploy from a Git repository" and click on "Next":
- Enter the Git repository that you wish to deploy. In our case, this is the following public repository:
https://github.com/pathway-labs/realtime-indexer-qa-chat
Note: you can deploy a private repository if you are logged in with your GitHub account.
- Enter the parameters. Everything should be already filled by default value. Select a region near you as some or your data will be processed in this region:
- Select the "Free" instance type:
You can start most projects with the free instance of Render. However, this free offer comes with limitations. You can learn more on the free offer on Render documentation.
- Enter the environment variables. In our example, you need to enter the OpenAI key by using the variable
OPENAI_API_KEY
:
You can directly load a .env
file.
- Click on "Create Web Service":
That's it! Your app is being deployed by Render and will be soon available. The process takes around 5 minutes.
You should have the message "Your service is live" once it is ready:
Access your project
Once your app has been deployed, you can access the web service by clicking on the URL:
It will open your web service:
You can then use your app. You can ask the chatbot the question "Can I build an LLM app with Pathway?":
You can learn more about this example on GitHub.
Stop and delete your web service
To stop and delete the service, you have to go to the settings.
- Go to the dashboard:
- Click on the three-dot button then on "Settings":
- Click on "Delete Web Service" at the end of the page:
- Copy the delete command and validate:
Conclusions
By being fully Python-compatible, Pathway allows you to use all the available tools to deploy your app. Using tools like Render, deploying your Pathway web service app is doable in a few clicks! Don't hesitate to check out the other ways to deploy Pathway in our dedicated article.