How many custom-packaged environments can an account have?

I need to create a custom environment for an app that is already in production with the standard environment.

In order to minimize downtime and other surprises, I played with custom environments with two new test apps, and I noticed that:

  • The first time you add a package to a custom environment, the environment is built, and it can take some time
  • If you remove and add the same package, the previously built environment is used, and it takes no time
  • The app is not available while new packages are installed in a custom environment (bad)
  • You can use a dummy app to configure the environment you need for your production app, so you get downtime on the dummy app, then configure the production app to use the same environment (copy/paste the requirements.txt), and it takes zero downtime (good)

So i learned two things:

  • Custom environments are created once per account, not per app
  • You can avoid downtime by first creating a custom environment on a dummy app, then use it in the production app

Here is the question: how many custom environments can an account have?
Is there a way to see the list and, maybe, to purge the unused ones?
Or will the unused environments eventually expire and be automatically purged?

2 Likes

Great summary, and great questions. (I’m betting on expiry. I.e., when the reference count drops to zero, the environment gets reclaimed.)

I haven’t created a custom Server-Side Python Virtual Environment yet, so I haven’t seen its requirements.txt file yet. Out of curiosity, where did you find this file? In Assets?

At first, I thought you were writing about Deployment Environments. To reduce confusion, do we need longer terms? Acronyms? SSPVE, DE? A DE would contain [a reference to] an SSPVE. (A hash of requirements.txt would make a nice key.)

1 Like

You can click here and edit requirements.txt:
image

You are right, I had used the word environment because that’s what I would use on my computer when dealing with packages. I had not noticed the conflict with the concept of environment in Anvil.

I changed “custom environments” into “custom-packaged environments” in the subject.

1 Like