Using Positron with the cloud

My colleague built a clear screencast working with simple Shiny apps and Positron.

https://youtu.be/97RhoCE_2rs?si=Dc9BWkoRCuOgSVt3

It shows a Positron → Posit Connect Cloud flow for a small Shiny for Python app.

Around 6:00 in, a requirements.txtfile is generated, and after that, deployment succeeds and the public URL works great.

Super smooth.

I want to confirm that I’m understanding the product split correctly:

  • Posit Cloud = hosted coding environment, but publishing there has been deprecated
  • Posit Connect Cloud = hosted publishing/sharing layer
  • Posit Workbench = enterprise development environment that typically publishes to Posit Connect Cloud

So for someone using Positron, is the usual best practice now basically:

develop locally in Positron → publish to Posit Connect Cloud

And Posit Connect Cloud the main free option for individuals who want to share small Shiny for Python apps?

This seems to be the right workflow, but I wanted to check that I’m not missing anything.

Here's a reference to similar recent post (Positron on Posit Cloud?) but it only answers part of the question about cloud services.

1 Like

This is about right, yes! If you are an individual user who wants to publish small Shiny for Python apps, we would recommend that you use Positron desktop and then publish to Posit Connect Cloud.

The only "edit" I would make to your description for those products is that users for Posit Workbench (the enterprise dev environment product) are typically publishing to Posit Connect (an enterprise publishing product that folks install on their own servers, similar to Workbench), not Posit Connect Cloud (which is a hosted product).

Let us know if you have further questions on all the products and how they work!

2 Likes

@jcasman thanks for asking this question. TBH, I was a bit confused about the product naming and features. There are actually 4 publishing services from Posit. The three you mentioned plus shinyapps.io

I have to go through the workflow in again from a clean install, but I think that Positron may connect to Posit Connect Cloud by default? I don't remember any confusion when I did the deployment of the Shiny for Python app.

However, if I look at the Posit web site, it does seem like there are multiple hosting services.

I'm going to check this again with a new Linux install in a VM, but I believe the deploy button does what is expected.

When you write the Python code, example, app.py, there's another button for deployment in the upper right of the code pane. If you have a chance, it would be great to hear your experience. I think I'm going to install Xubuntu minimal in a VM to check the deployment configuration steps. My memory is not so good, but I can't recall any problems. It's possible that the deploy to Posit Connect Cloud just worked with no hassles.

BTW, this is interesting topic for me right now as I have been thinking of focusing on a single deployment platform in teaching.

In my previous effort, I was platform-agnostic and covered Fly.io, Leapcell, Railway, GitHub Pages, and more. Recently, I've been thinking of a single workflow and using the single workflow as a way to teach common elements of deployment.

Example with Posit Cloud Connect

Log Inspection

All platforms have some type of log. By teaching log inspection, the skill can be applied to any platform.

Python Dependencies for Containers

Most systems use some type of container such as Docker. The Python dependencies are loaded by requirements.txt or less common right now, pyproject.toml. It's easy to export the pyproject.toml to requirements.txt. Some systems have uv support. I think Fly might? However, the underlying technology shouldn't matter as much as the general concept that the Python dependencies are loaded into the container automatically at time of deployment.

Status of Assessment

Posit Connect Cloud seems good enough so far and the deployment seems easier than Leapcell, my previous default. Leapcell does amazingly offer free tier PostgreSQL and an S3-like storage layer, but this is not a problem as there are other free-tier PostgreSQL database services, notably Supabase.

From what I can tell, Posit Cloud Connect does not support the following in production:

Missing Feature Comment Planned Workaround
Storing Images Like many free-tier services, the files are ephemeral. Need to use S3 or similar, which is okay for the course. Might look into Leapcell Object Storage free tier as an option
SQL storage As the files are ephemeral, the SQL data file will be deleted on reboot Can connect to supabase free-tier or similar system for data persistence
Bi-directional web sockets I can find no free service for this. Also, this is not the focus of Posit Connect Cloud. If I cover this, can use Fly (pay as you go)

Sources

Files written at runtime

For applications, additional files your application writes while it is running are only stored as long as users are visiting your application. When your app starts up or is republished, most1 files on disk are reset to match those found in your repository.

For content that renders static output files, those output files are persisted by Connect Cloud, but other files your code writes while it is running are not persisted.

Summary

I'm going forward with Posit Connect Cloud. It's simplicity and focus on a specific, narrow, use may be better for the course. Although Leapcell and Fly have more features, the complexity of Leapcell may weaken the course by making deployment more complex. The simpler feature set of Posit Connect Cloud may allow me to focus on a "General Deployment Workflow" specifically for data science.

At the current time, I don't plan on covering a machine learning pipeline with deployment. Even if I expand the course to SQL data extraction, data cleansing, transformation, vector databases, embedding, indexing, I was planning to run it locally.

1 Like

@jcasman

  • installed fresh version of Ubuntu 24.04
  • installed fresh version of Positron from Posit site
  • no other config

Publish icon works as expected. The only two options are "Posit Connect Cloud" and "Posit Connect"

The help text under the selection is clear. The Posit Connect is for the server.

The name of "Posit Connect Cloud" also suggests "hosted cloud deploy".

Thus, if the point of entry to "Posit Connect Cloud" is through Positron, it is easy and no problem.

If the point of entry is from the Posit web site, it may take more work to figure out how to host Shiny for Python apps.

As I mentioned earlier, I first encountered "Posit Connect Cloud" through Positron and thus I had no problem.

Everything about the deploy worked smoothly from Positron.

The only extra step is that since I use uv and not pip, I needed to export the requirements.txt. However, I was already prepared for this as it is common. uv is still a bit new.

Well, maybe there is one additional step with Positron, which is that I have to launch it from inside of the Python venv to call up the correct Python venv. There might be a better workflow, but that is what I'm doing now.

This clarification helps a ton @julia, thank you. For the moment, I'm going to spend more time using Positron to publish to Posit Connect Cloud, since I'm just starting to use Positron for more. I'll let you know as I get more used to the workflow.

1 Like

@jcasman , I just published a new evaluation focused on Posit Connect Cloud. You can use the beginning as a tutorial walkthrough.

summary

Finding on Free Tier Note
deployment workflow with Positron really is very nice I've only tested simple apps. I'm not sure what happens when application complexity increases
initial load time is fast compared to Fly, the service seems to be always on. apps appear to stay warm (no cold start observed so far)
limited to 5 applications this is generous. perfect for student portfolio and clubs
20 active hours This appears to be compute time when the app is actively running (user sessions, jobs, or deployments). Idle apps do not consume hours. One open browser session likely continues to count if it keeps the app process active, but I have not yet stress-tested this with longer sessions or multiple users.
ephemeral file storage Ephemeral file storage may not be a major limitation for Python apps that separate application logic from persistent infrastructure. My next test is FastAPI, to evaluate whether Posit Connect Cloud works well for API-driven backend patterns in addition to simple interactive apps.

Shiny Test with FastAPI

I'm going to work on testing this flow, piece by piece.

Browser
  ↓
Shiny app
  ↓ HTTP
FastAPI app
  ↓
JSON response
1 Like