GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Guide
  • Examples
  • Log in
  • Sign up

This view

  • Original page
  • New address

GeezerVison is showing modal.com — Environments

Guide Introduction to Modal Getting started Functions Functions Invocation methods Function lookups Container lifecycle management Parametrized Functions Dynamic configuration Sandboxes Sandboxes Running commands Networking and security File access Snapshots Exit Snapshots BetaPricing and resources Sidecars BetaSecret injection BetaModel APIs Model APIs Models and pricing Agent integrations Endpoints Endpoints Supported models Candidates Training Quickstart Tinker-compatible API BetaMulti-node training Images Defining Images Using existing container images Named images Fast pull from registry GPUs and other resources GPU acceleration Using CUDA on Modal Configuring CPU, memory, and disk Scaling out Scaling out Input concurrency Batch processing Job queues Dynamic batching Multi-node Clusters Deployment Apps, Functions, and entrypoints Managing deployments Continuous deployment Scheduled Functions Observability HTTP Applications Servers Sticky Sessions Web Functions Streaming endpoints Web Function URLs Request timeouts Proxy Tokens Networking Tunnels Proxies BetaCluster networking Data sharing and storage Passing local data Volumes Storing model weights Cloud bucket mounts Dicts Queues Dataset ingestion Secrets and environment variables Secrets Environment variables Performance Cold start performance Memory Snapshots High-performance LLM inference Reliability and robustness Failures and retries Preemption Timeouts GPU health Troubleshooting Security and privacy Security and privacy Data residency Customer-supplied encryption keys AlphaAudit logs Integrations Using OIDC to authenticate with external services Connecting Modal to your Datadog account Connecting Modal to your OpenTelemetry provider Slack notifications Workspace & account settings Workspaces Environments Service users User groups Role-Based Access Control (RBAC) Billing Network egress billing Budgets Identity and provisioning Okta SSO Microsoft Entra SSO Google Workspace SSO Custom SAML SSO SCIM Integration Other topics Feature maturity Restricted Functions JavaScript/Go SDKs BetaModal 1.0 migration guide File and project structure Developing and debugging Jupyter notebooks Asynchronous API usage Global variables Region selection Localized placement GPU Metrics Search syntax

Environments

Modal Environments isolate Modal applications and resources from one another.

Environments are sub-divisions of Workspaces, allowing you to deploy the same App (or set of Apps) in multiple instances for different purposes without changing code.

Typical use cases for Environments include having one dev Environment and one prod Environment. Production Apps are protected from overwriting when developing new features, but you can still deploy and test changes with a “live” and potentially complex structure of Apps.

Each Environment has its own set of Secrets and any object lookups, say for Dicts or Volumes, performed from an App in an Environment will by default look for objects in the same Environment.

By default, every Workspace has a single Environment called “main”. New Environments can be created on the CLI:

modal environment create dev

Run modal environment --help for more info.

Workspaces can have up to 1500 Environments.

Once created, Environments show up as a dropdown menu in the navbar of the Modal dashboard, letting you set browse all Modal Apps, Secrets, and Storage filtered by which Environment they were deployed to.

Most CLI commands also support an --env flag letting you specify which Environment you intend to interact with, e.g.:

modal run --env=dev app.py
modal volume create --env=dev storage

To set a default Environment for your current CLI profile you can use modal config set-environment, e.g.:

modal config set-environment dev

Alternatively, you can set the MODAL_ENVIRONMENT environment variable.

Environment web suffixes 

Environments have a ‘web suffix’ which is used to make Web Function URLs unique across your workspace. One Environment is allowed to have no suffix ("").

Cross environment lookups 

It’s possible to explicitly look up objects in Environments other than the Environment your App runs within:

production_secret = modal.Secret.from_name(
    "my-secret",
    environment_name="main",
)
modal.Function.from_name(
    "my_app",
    "some_function",
    environment_name="dev"
)

However, the environment_name argument is optional and omitting it will use the Environment from the object’s associated App or calling context.

EnvironmentsEnvironment web suffixesCross environment lookups
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.