Get desktop application:
View/edit binary Protocol Buffers messages
Apps
Human readable label for the app
True starting with 0.67.x clients, which don't create method placeholder functions
Additional metadata to identify a deployment
Published app will be in this state
function_name -> function_id
class_name -> class_id
function_id -> definition_id
Unused by client, but used internally
Unused by client, but used internally
Git information for deployment tracking
signed as we support negative "roll back n versions" requests
promotes an app from initializing to this new state
Input Plane These RPCs are experimental, not deployed to production, and can be changed / removed without needing to worry about backwards compatibility.
Used for waypoints.
Blobs
TODO(erikbern): how are these garbage collected? Shouldn't they belong to an app?
Classes
True starting with 0.67.x clients, which don't create method placeholder functions
Lookup class on app published by another workspace
True starting with 0.67.x clients, which don't create method placeholder functions
Clients
Deprecated, no longer used in client
Clusters
Container
If pty_info is provided, open a PTY, but also this container exec is treated an "interactive shell" request, and it will be terminated if messages are not periodically sent on the stdin stream on some interval (currently 40 seconds).
Send SIGTERM to running container on exit of exec command.
For internal debugging use only.
Old clients (up to 0.65.39) expect string output. Newer clients stream raw bytes
if an exit code is given, this is the final message that will be sent.
only set when the request opens a new file, i.e., ContainerFileOpenRequest
Bad client version.
(message has no fields)
Dicts
Setting these to True will populate the corresponding field in the response, otherwise it will be null This lets us support the keys/values/items SDK API through one RPC without unnecessary data transfer
Domains
(message has no fields)
Environments
Functions
Deprecated: now passed in the Function definition
supersedes 'function' field above
Used up until 0.62.212
TODO: use input_id once we switch client submit API to return those.
For containers to request next call
Container aims to fetch multiple inputs at the same time
Maximum number of inputs to fetch at once
Miliseconds to block before a response is needed
How long to sleep before requesting another input.
Returns the next result(s) for an entire function call (FunctionMap)
expires *any* remaining outputs soon after this call, not just the returned ones
Used for waypoints.
The jwts the client expects the server to be processing. This is optional and used for sync inputs only.
for class methods - use this function id instead for invocations - the *referenced* function should have is_class=True
for class methods - this method name needs to be included in the FunctionInput
Mapping of method names to method definitions, only non-empty for class service functions
For containers to return result
Used for waypoints.
(message has no fields)
Images
ignored
Only admins can publish global images, but this provides an extra failsafe
Force the Image to build but don't clobber any Images with the same recipe in the cache
image_id is set regardless if the image is built (use ImageJoinStreaming to wait for build)
result of build - only set if the image has finished building (regardless if success or not)
image metadata - only set if the image has built successfully
set on success
Mounts
only used with OBJECT_CREATION_TYPE_ANONYMOUS_OWNED_BY_APP
Notebooks
Proxies
must be UNSPECIFIED
Queues
Allow client to report a bounded total size to reduce the number of partitions that need to be checked
seconds
Sandboxes
needed for modal container exec
Legacy clients do not provide a timeout. New clients must always provide a timeout.
If true, waits until the container's postStart hook has been run before returning. Useful for detecting init failures.
This is None if the sandbox was terminated before a task could be scheduled.
If the task has already exited, this is the result.
Metadata may be empty since we may skip it for performance reasons.
(message has no fields)
Secrets
Not used atm
only used with OBJECT_CREATION_TYPE_ANONYMOUS_OWNED_BY_APP
leaving empty will assume a singular environment
the environment that was listed (useful when relying on "default" logic)
SharedVolumes
only used with OBJECT_CREATION_TYPE_ANONYMOUS_OWNED_BY_APP
remove when required client version >= 47
Tasks
All IP addresses in cluster, ordered by cluster rank
Tokens (web auth flow)
Tunnels
Volumes
NOTE(staffan): Mounting a volume in multiple locations is not supported, so volume_id alone uniquely identifies a volume mount.
0 is interpreted as 'read to end'
total file size
file position of first byte returned
number of bytes returned
0 is interpreted as 'read to end'
total file size
file position of first byte returned
number of bytes returned
only used with OBJECT_CREATION_TYPE_ANONYMOUS_OWNED_BY_APP
TODO(staffan): This is obviously unfortunately named, but provides what we need - consider renaming.
If set to true, prevent overwriting existing files. (Note that we don't allow overwriting existing directories with uploaded files regardless.)
The ID of the volume to put/upload files into.
List of files to put/upload.
If set to true, prevent overwriting existing files. (Note that we don't allow overwriting existing directories with uploaded files regardless.)
Blocks that are currently missing in the volume, because the file did not exist, or because the block checksum from `blocks_sha256` in the request did not match the current contents of the file. Values will be returned sorted by `(file_index, block_index)`. If this field is empty, it means that the files were uploaded successfully and/or that the request was an idempotent no-op.
NOTE(staffan): Mounting a volume in multiple locations is not supported, so volume_id alone uniquely identifies a volume mount.
Workspaces
Used in:
Used in:
Used in:
Used in:
Used in:
,tag -> function id
tag -> class id
Used in:
NOTE: make sure to update the frontend if we add a new state here https://github.com/modal-labs/modal/blob/main/frontend/src/routes/(dashboard)/%5B%5Bworkspace%5D%5D/apps/+page.svelte#L95
Used in:
, , ,Will be discharged when the client disconnects
Will be discharged when overwritten
Winding down app due to user termination.
Stopped
App is created and in process of deployment.
Same as stopped but prevented from being garbage collected
App is detached and local client has disconnected.
App is derived from another workspace. Acts as a static, immutable group of functions.
Used in:
A web endpoint connection-related message. Modal's internal web endpoint runtime effectively acts as a global web server that schedules requests to tasks that are spawned on-demand, so we need an internal protocol to model HTTP requests. This is that protocol. We base this protocol on Python's ASGI specification, which is a popular interface between applications and web servers. ASGI Spec: https://asgi.readthedocs.io/en/latest/specs/www.html
Message of type "http" (connection scope)
Used in:
Flat list of alternating header names and values
Message of type "http.disconnect"
Used in:
(message has no fields)
Message of type "http.request"
Used in:
Message of type "http.response.body"
Used in:
Message of type "http.response.start"
Used in:
Flat list of alternating header names and values
Message of type "http.response.trailers"
Used in:
Flat list of alternating header names and values
Message of type "websocket" (connection scope)
Used in:
We don't support RFC 8441 yet, so this will always be "1.1"
Flat list of alternating header names and values
Message of type "websocket.accept"
Used in:
Flat list of alternating header names and values
Message of type "websocket.close"
Used in:
Message of type "websocket.connect"
Used in:
(message has no fields)
Message of type "websocket.disconnect"
Used in:
Message of type "websocket.receive"
Used in:
Message of type "websocket.send"
Used in:
A collection of user-configurable settings for Function autoscaling These are used for static configuration and for dynamic autoscaler updates
Used in:
, ,Minimum containers when scale-to-zero is not deisired; pka "keep_warm" or "warm_pool_size"
Limit on the number of containers that can be running for each Function; pka "concurrency_limit"
Additional container to spin up when Function is active
Currently unused; a placeholder in case we decide to expose scaleup control to users
Maximum amount of time a container can be idle before being scaled down, in seconds; pka "container_idle_timeout"
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
, ,Used in:
,Class methods need to hydrate all functions on the class
Used in:
, ,only set for PARAM_SERIALIZATION_FORMAT_PROTO
Used in:
legacy format - pickle of (args, kwargs) tuple
new format using api.FunctionParameterSet
NOTE: adding additional *fields* here can invalidate function lookups since we use the serialized message as the bound function identifier for parameter-bound classes. Modify with *caution*
TODO: rename into NamedPayloadType or similar
Used in:
,TODO: deprecate - use full_type instead
Default *values* are only registered for class parameters
supersedes `type`
TODO: rename into NamedPayloadValue
Used in:
NOTE: adding additional *fields* here can invalidate function lookups since we use the serialized message as the bound function identifier for parameter-bound classes. Modify with *caution*
modal-client: Modal Python SDK
modal-worker
modal-client from inside containers
modal-web
kernelshim.py from notebooks
libmodal: experimental client library
Used in:
,Used in:
Used in:
, , ,Used in:
,Defined as start time of the first task in the cluster
Used in:
,Only git is supported for now
This is used to pass data from the worker to the container
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
file descriptor is hydrated when sent from server -> worker
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
, ,Used in:
,Used in:
Chunks of data that can be streamed in and out of tasks.
Used as response type in: ModalClient.FunctionCallGetDataIn, ModalClient.FunctionCallGetDataOut
Used as field type in:
Index of this data chunk in the stream.
Which data format a binary message is encoded with.
Used in:
, , ,Cloudpickle
"Asgi" protobuf message
"GeneratorDone" protobuf message
Used in:
, , , , , , , , , , ,Used as response type in: ModalClient.DictContents
Used as field type in:
,Used in:
Used in:
,Used as response type in: ModalClient.EnvironmentUpdate
Used as field type in:
Used in:
Environment-scoped settings, with workspace-level defaults. Note that we use MergeFrom to combine workspace / environment settings, which will *append* any `repeated` fields!
Used in:
Used in:
Used in:
, , , ,A file entry when listing files in a volume or network file system.
Used in:
,Used in:
Used in:
, , , ,To be replaced by autoscaler_settings.max_containers
To be replaced by autoscaler_settings.scaledown_period
Deprecated at some point
To be replaced by autoscaler_settings.min_containers
If set, overrides the runtime used by the function, either "runc" or "gvisor".
Formerly stub_name
For internal debugging use only.
For internal debugging use only.
TODO: combine into enum?
if "Function" is actually a class grouping multiple methods
for class methods use this function id instead for invocations - the *referenced* function should have is_class=True
for class methods - this method name needs to be included in the FunctionInput
Maximum number of inputs to fetch at once
Miliseconds to block before a response is needed
TODO(irfansharif): Remove, once https://github.com/modal-labs/modal/pull/15645 lands.
forces going through the new gpu-fallbacks integration path, even if no fallback options are specified
for fallback options, where the first/most-preferred "template" is derived from fields above
When the function is a "grouped" one, this records the # of tasks we want to schedule in tandem.
If set, the function will be run in an untrusted environment.
To be replaced by autoscaler_settings.buffer_containers
_experimental_proxy_ip -> ProxyInfo TODO: deprecate.
For internal debugging use only.
For internal debugging use only.
Mapping of method names to method definitions, only non-empty for class service functions
Supersedes cloud_provider
Experimental support for GPU snapshotting
Bundle of parameters related to autoscaling
For server-side experimental functionality. Prefer using this over individual _experimental_* fields. Note the value type as string. Internally we'll coerce all values to string with str(). On the server, it's necessary to convert back to the most natural type (e.g. int) when relevant.
Used in:
Used in:
, , , ,Used in:
Used as request type in: ModalClient.FunctionCallGetDataIn, ModalClient.FunctionCallGetDataOut
Used in:
when the call was created
if cron job, when run was scheduled
Used in:
,Used in:
Note: FunctionData pulls "up" a subset of fields from Function message that will get deprecated there and made authoritative here, at the top-level. All remaining fields will stay within the Function message itself and a single FunctionData will contain a list of such (ranked) Functions. The top-level fields capture data not specific to any particular underlying task (like warm-pool-size, applicable across all tasks), while fields specific to the task (like the resource request) will exist at the bottom level.
Used in:
,Scheduling related fields.
When the function is a "grouped" one, this records the # of tasks we want to schedule in tandem.
for internal debugging use only
_experimental_proxy_ip -> ProxyInfo TODO: deprecate.
Mapping of method names to method definitions, only non-empty for class service functions
if "Function" is actually a class grouping multiple methods - applies across all underlying tasks
used for methods
used for methods
If set, the function will be run in an untrusted environment.
For internal debugging use only.
For internal debugging use only.
Bundle of parameters related to autoscaling
Used in:
FunctionExtended is a union type that exists while we migrate between storage of FunctionData vs. Functions, internally. Once migrated at the storage level, we can get rid of this union type and replace with access that expects FunctionData only.
Used in:
Used in:
,for result.data_oneof
datadog function call trace tag
contains all the info about a function that is needed to trigger the right behaviour when using a FunctionHandler. Notably excludes things purely used for *executing* the function in a container entrypoint
Used in:
, , , , , ,Should be a subset and use IDs/types from `Function` above
used for methods
used for methods
Mapping of method names to their metadata, only non-empty for class service functions
Used in:
, , , ,serialized (args, kwargs).
For args_oneof.
specifies which method to call when calling a class/object function
Used in:
Currently not supported
Used in:
, , ,Used in:
,Used in:
for result.data_oneof
Used in:
Used in:
, , ,NOTE: two-byte field number not used for special reason. copy-paste error. Ref: PR #2542
Used in:
, , , ,allows easy disambiguation between empty schema and no schema collection etc.
Used in:
Used in:
,Deprecated, at some point
Used in:
Note: this enum is no longer used by current clients - don't add new types Old clients still send it, so we use it server-side for compatibility
Sent as the output when a generator finishes running.
Used in:
,sub-type for generic types like lists
Used for both tasks and function outputs
Used in:
, , , , , , , , , , , ,Status of the task or function output.
Exception message for failures, if available.
Status code of the container entrypoint or builder process if it terminates unexpectedly.
String value of the Python traceback.
Pickled traceback object.
Pickled line cache for traceback object.
Inline data of the result.
Blob ID for large data.
(?)
Used in:
,Used when a task was killed using an external signal.
Used when the user's function fails to initialize (ex. S3 mount failed due to invalid credentials). Terminates the function and all remaining inputs.
Used in:
Part of Image definition, because presence of GPU drivers affects the image that's built.
deprecated after 0.58.96
deprecated after 0.58.96
If set, overrides the runtime used by the function. Specify either "runc" or "gvisor".
Not included in image definition checksum as debug features do not affect built image.
Used in:
Used in:
, , ,The output of `python -VV. Not set if missing
Installed python packages, as listed by by `pip list`. package name -> version. Empty if missing
The work directory of the image, defaulting to "/". Not set if missing
Used in:
Used in:
Used in:
Used in:
Used in:
, ,Used in:
,SHA-256 checksum of the file.
Size of the file in bytes — ignored in MountBuild().
Unix file permission bits `st_mode`.
Used in:
,Used in:
split upload based on this part length - all except the last part must have this length
Used in:
Used in:
IOPub message or reply received from the kernel for a cell.
Used in:
Persistent output that is saved in the notebook.
Clear all previous outputs of the cell.
Cell has finished executing, return the kernel's execute_reply.
See kernelshim.py for the differences between this and `ExecuteResult`. https://jupyter-client.readthedocs.io/en/stable/messaging.html#execution-results
Used in:
A single output from a notebook. When you execute a cell, it produces an array of these outputs as the code runs. https://github.com/jupyter/nbformat/blob/v5.10.4/nbformat/v4/nbformat.v4.schema.json#L301-L309
Used in:
Data displayed as a result of code cell execution.
Used in:
mimebundle
This should not be included in saved notebook.
Output of an error that occurred during code cell execution.
Used in:
Result of executing a code cell.
Used in:
mimebundle
Stream output from a code cell (stdout / stderr).
Used in:
stdout | stderr
multiline_string
Used in:
,Used in:
, , , , , , , ,just lookup
deprecate at some point
Used in:
Used in:
, ,Soon deprecated
Used in:
Nothing
Run function in PTY
Replace function with shell
Used in:
, ,currently unused
used in schemas to signify unrecognized or un-annotated types
Used in:
Used in:
Used in:
TODO(erikbern): shouldn't be zero, and needs prefix
TODO(erikbern): needs_prefix
Used in:
, ,Used in:
Used in:
,Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Older clients send this instead of "public".
Used in:
, , ,MiB
milli CPU cores
MiB
MiB
milli CPU cores
Whether to use RDMA interfaces
Used in:
Used for `modal container exec`, `modal shell`, and Sandboxes
Used in:
only stdout / stderr is used
Used in:
,Used in:
Deprecated at some point
For internal debugging use only.
for internal debugging use only
Network access configuration beyond simple allow/block.
Enable snapshotting the sandbox (both memory and filesystem). This doesn't need to be enabled to save the filesystem as an image (i.e. a filesystem-only snapshot).
Used to pin gVisor version for memory-snapshottable sandboxes. This field is set by the server, not the client.
Supersedes cloud_provider
Specifies container runtime behavior for sandboxes which are restored from a snapshot. Set by the backend at snapshot creation time.
If set, overrides the runtime used by the function, either "runc" or "gvisor".
Used in:
Used in:
Used in:
,Used in:
, ,Used in:
Used in:
TODO(irfansharif): - Fold in cloud, resource needs here too. - Allow specifying list of zones, cloud, fallback and alternative GPU types.
Used in:
,TODO(irfansharif): Make these two repeated.
admin-only
admin-only, "on-demand" or "spot", else ignored
admin-only
Not used by client anymore
todo: not used?
Not used by client anymore
Used in:
Used in:
Used as request type in: ModalClient.SharedVolumeListFiles, ModalClient.SharedVolumeListFilesStream
Used as response type in: ModalClient.SharedVolumeListFiles, ModalClient.SharedVolumeListFilesStream
Used in:
app name of object entity app
Used in:
,Used in:
EPERM: Operation not permitted
ENOENT: No such file or directory
EIO: Input/output error
ENXIO: No such device or address
ENOMEM: Out of memory
EACCES: Permission denied
EEXIST: File exists
ENOTDIR: Not a directory
EISDIR: Is a directory
EINVAL: Invalid argument
EMFILE: Too many open files
EFBIG: File too large
ENOSPC: No space left on device
Used in:
Used in:
Used in:
, ,Used as response type in: ModalClient.AppGetLogs, ModalClient.SandboxGetLogs
Used for image logs
Used for interactive functions
Used in:
Used in:
Used in:
Used in:
TODO(irfansharif): Just move this into a column in the task table instead? Deprecate all above fields and get rid of this message altogether
pointer into FunctionData, if using that as the underlying definition type
Used in:
Used in:
, ,Used in:
app name of object entity app
Used in:
,Used in:
, ,Used in:
The SHA256 digest of the contents of this block, in raw (ie. 32 bytes) form for compactness.
From a previous call to `VolumePutFiles2`, we might have gotten a response indicating that this block was missing. For such a block, this field contains the raw bytes of the body that was returned from the HTTP PUT request when the client made a request for the `put_url` returned in the previous `VolumePutFiles2Response`.
Used in:
Destination path of the file to be uploaded, including any parent dirs etc.; for example "foo/bar/baz.txt"
The total size of the file, in bytes.
The blocks, in units of 8MiB, that this file consists of.
Unix file permission bits `st_mode`.
Used in:
Index of the file in the original `files` field of the request.
The index of the block in the original `files[file_index].blocks` of the request.
Make a HTTP PUT request to this endpoint with the blocks' contents as the body.
Used in:
, , , ,Used in:
Used in:
, ,Used in:
No longer used by client
No longer used by client (previously used when wait_for_response=False)
The default
Used in:
, , ,Used in: