modal-js and modal-go.
The SDKs migrated from
github.com/modal-labs/libmodal to github.com/modal-labs/modal-client in the unreleased version.modal-js/v0.7.2, modal-go/v0.7.2
- Updated
Sandboxmethods to wait for newly created sandboxes to be ready and not error immediately when it’s not available yet - Fixed a bug in
modal-jsso that cancelingsandbox.stdoutorsandbox.stderrcleans up background resources - Updated
Sandbox(JS) to raise a better error when the sandbox was terminated
modal-js/v0.7.1, modal-go/v0.7.1
- Fixed regression in
Sandbox.exec(JS) where it threw aChannelCredentialstype error
modal-js/v0.7.0, modal-go/v0.7.0
Sandbox improvements:- Added
Sandbox.MountImage(Go) andSandbox.mountImage(JS) that mounts an Image to a path in the Sandbox’s filesystem - Added
Sandbox.SnapshotDirectory(Go) andSandbox.snapshotDirectory(JS) that snapshots and creates a new image from a directory in the running sandbox - Upgraded
Sandbox.Exec(Go) andSandbox.exec(JS) bringing improved performance and reliability - Added a
Sandbox.Detach(Go) orsandbox.detach(JS) to disconnect your client from the sandbox and clean up any resources associated with the connection- Strongly recommend calling
Detachafter you are done interacting with the sandbox Detachdoes not close streams fromSandbox.Stdout(Go) orSandbox.stdout(JS). These streams should be closed using theirClose(Go) orclose(JS) methods
- Strongly recommend calling
Sandbox.Terminate(Go) andSandbox.terminate(JS) detaches by default- To interact with a running sandbox after terminating, use
Sandboxes.FromID(Go) orsandboxes.fromId(JS) to create a new Sandbox object
- To interact with a running sandbox after terminating, use
Sandbox.Terminatenow accepts awaitparameter to wait for the sandbox to terminate and return the exit code
modal-js/v0.6.3, modal-go/v0.6.3
- Fixed a bug where deleting a Volume, Queue, or Secret with
allowMissing=truecould still raise aNOT_FOUNDerror - Improved handling of degraded HTTP/2 connections, which addresses intermittent RST_STREAM errors
modal-js/v0.6.2, modal-go/v0.6.2
- In JS, improves reliability for reading streams from
sandbox.stdoutandsandbox.stderr
modal-js/v0.6.1, modal-go/v0.6.1
- Added custom domains to
Sandboxes.Createin Go andsandboxes.createin JS- Note that Sandbox custom domains work differently from Function custom domains and must currently be set up manually by Modal; please get in touch if this feature interests you
modal-js/v0.6.0, modal-go/v0.6.0
- Added
enable_dockerexperimental option toSandbox.Createto Go andSandbox.createto JS
modal-js/v0.5.6, modal-go/v0.5.6
- Added
Sandbox.CreateConnectTokento Go andSandbox.createConnectTokento JS
modal-js/v0.5.5, modal-go/v0.5.5
- Enabled goroutine leak detection for all tests by default
- Fixed a few remaining goroutine leaks
- Test clean-ups: ensure we always terminate Sandboxes, close ephemeral objects, etc.
- Added debug logging to
CloudBucketMountcreation in Go, bringing it in line with the JS SDK - Updated the API for creating
CloudBucketMounts in JS, using the samemodal.cloudBucketMounts.create()pattern as other Modal objects, bringing it in line with the Go SDK - Aligned the way the JS/Go SDKs handle empty/missing fields in gRPC messages, so the behavior is identical to the Python SDK
modal-js/v0.5.4, modal-go/v0.5.4
- Enabled goleak for goroutine leak detection in tests
- Fixed all detected goroutine leaks in Sandboxes and Images
- Added deletion methods for
VolumeandSecretobjects and updated the deletion methods onQueueobjects to support idempotent deletion via theallowMissingparameter
modal-js/v0.5.3, modal-go/v0.5.3
- Fixed a bug in modal-go where
Sandbox.Execwould leak goroutines
modal-js/v0.5.2, modal-go/v0.5.2
- Allow adding custom gRPC interceptors when creating a Modal client, to allow instrumentation, custom telemetry, etc.
modal-js/v0.5.1, modal-go/v0.5.1
- All Go SDK functions that take a Context will respect the timeout of the context
- Improved the error message when calling a webhook Function as a normal Function
- Allow customizing the config file path via
MODAL_CONFIG_PATHenvironment variable (defaults to~/.modal.toml) - Added support for passing
MODAL_LOGLEVEL=debugenvironment variable to also log debug logs, incl. all gRPC calls, etc.
modal-js/v0.5.0, modal-go/v0.5.0
The first beta release of the Modal SDKs for JS and Go (graduating from alpha). See the Migration Guide for a detailed list of breaking changes.
- The SDKs now expose a central Modal Client object as the main entry point for interacting with Modal resources
- The interface for working with Modal object instances (Functions, Sandboxes, Images, etc.) is largely the same as before, with some naming changes
- Calling deployed Functions and classes now uses a new protocol for payload serialization which requires the deployed apps to use the Modal Python SDK 1.2 or newer
- Internally removed the global client (and config/profile data in global scope), moving all that to the Client type
- Consistent parameter naming across both SDKs: all
Optionsstructs/interfaces renamed toParams
- Added explicit unit suffixes to all parameters that represent durations (in milliseconds, suffixed with
Ms) or memory amounts (in MiB, suffixed withMiB)
- Changed how we do context passing, so contexts now only affect the current operation and are not used for lifecycle management of the created resources
- All
Paramsstructs are now passed as pointers for consistency and to support optional parameters - Field names follow Go casing conventions (e.g.,
Id→ID,Url→URL,TokenId→TokenID) - Added explicit unit suffixes to all parameters that represent memory amounts (in MiB, suffixed with
MiB)
- Added support for setting CPU and memory limits when creating Sandboxes and Cls instances
modal-js/v0.3.25, modal-go/v0.0.25
- Fixed a bug in modal-js related to unpickling objects from Python (Function calls, Queues, etc.), where integers between 32678 and 65535 were incorrectly decoded as signed integers
- Internal updates for how authentication tokens are handled for input plane clients
modal-js/v0.3.24, modal-go/v0.0.24
- Added
envparameters to several methods, as a convenience for passing environment variables into Sandboxes, etc. - Added
Sandbox.getTags()(JS) andSandbox.GetTags()(Go)
modal-js/v0.3.23, modal-go/v0.0.23
- Added support for PTYs in Sandboxes
modal-js/v0.3.22, modal-go/v0.0.22
- Added
Image.dockerfileCommands()(JS) andImageDockerfileCommands()(Go)
modal-js/v0.3.21, modal-go/v0.0.21
- Added support for setting idle timeout when creating Sandboxes
modal-js/v0.3.20, modal-go/v0.0.20
- Added
Image.delete()(JS) andImageDelete()(Go) - Changed
Image.fromId()(JS) andNewImageFromId()(Go) to throw aNotFoundErrorif the Image does not exist- Note that the signature of
NewImageFromId()has changed
- Note that the signature of
modal-js/v0.3.19, modal-go/v0.0.19
Sandbox.execin JS now correctly accepts a list of Secrets
modal-js/v0.3.18, modal-go/v0.0.18
New features:- Added
Image.build(JS) andImage.Build(Go) - Added
Image.fromId(JS) /NewImageFromId(Go) - Added support for instantiating a Cls with custom options, using
Cls.withOptions()/.withConcurrency()/.withBatching()(JS) /Cls.WithOptions()/.WithConcurrency()/.WithBatching()(Go) - Added support for Named Sandboxes
- Added support for
Volume.ephemeral()(JS) /VolumeEphemeral()(Go) - Operations on an ephemeral Queue after having called
CloseEphemeral()will now explicitly fail in Go
modal-js/v0.3.17, modal-go/v0.0.17
Sandbox enhancements: Added support for more parameters toSandbox.create():
blockNetwork: Whether to block all network access from the SandboxcidrAllowlist: List of CIDRs the Sandbox is allowed to accessgpu: GPU reservation for the Sandbox (e.g. “A100”, “T4:2”, “A100-80GB:4”)cloud: Cloud provider to run the Sandbox onregions: Region(s) to run the Sandbox onverbose: Enable verbose loggingproxy: Connect a Modal Proxy to a Sandboxworkdir: Set the working directory
- Added support for mounting
CloudBucketMounts to Sandboxes - Added top level for Image objects that are lazy. The Images are built when creating a Sandbox:
Image.fromRegistryin typescript andNewImageFromRegistryin golangImage.fromAwsEcrin typescript andNewImageFromAwsEcrin golangImage.fromGcpArtifactRegistryin typescript andNewImageFromGcpArtifactRegistryin golang
- Added
Secret.fromObject()(JS) /SecretFromMap()(Go) to create a Secret from key-value pairs (likefrom_dict()in Python) - Added
namefield toApps,Sandboxes,Secrets,Volumes, andQueues - Added support for
Function.getCurrentStats()(JS) /Function.GetCurrentStats()(Go) - Added support for
Function.updateAutoscaler()(JS) /Function.UpdateAutoscaler()(Go) - Added support for
Function.getWebURL()(JS) /Function.GetWebURL()(Go) - Added support for
Volume.readOnly()(JS) /Volume.ReadOnly()(Go) - Added support for setting tags on Sandboxes, and for listing Sandboxes (by tag)
modal-js/v0.3.16, modal-go/v0.0.16
- Added support for getting Sandboxes from an ID
modal-js/v0.3.15, modal-go/v0.0.15
- Added support for snapshotting the filesystem of a Sandbox
- Added support for polling Sandboxes to check if they are still running, or get the exit code
- Added support to execute commands in Sandboxes with Secrets
- Added support for creating Sandboxes with Secrets
modal-js/v0.3.14, modal-go/v0.0.14
- Added support for setting up Tunnels to expose live TCP ports for Sandboxes
modal-js/v0.3.13, modal-go/v0.0.13
- Fixed calls of Cls with experimental
input_plane_regionoption - (Go) Removed
Function.InputPlaneURLfrom being exposed as public API
modal-js/v0.3.12, modal-go/v0.0.12
- Added support for passing a Secret to
imageFromRegistry()(JS) /ImageFromRegistry()(Go) to pull images from private registries - Added support for creating Images from Google Artifact Registry with
imageFromGcpArtifactRegistry()(JS) /ImageFromGcpArtifactRegistry()(Go) - Added experimental support for calling remote Functions deployed with the
input_plane_regionoption in Python
modal-js/v0.3.11, modal-go/v0.0.11
- Added
InitializeClient()(Go) /initializeClient()(JS) to initialize the client at runtime with credentials - Client libraries no longer panic at startup if no token ID / Secret is provided. Instead, they will throw an error when trying to use the client
modal-js/v0.3.10, modal-go/v0.0.10
- Added
workdirandtimeoutoptions toExecOptionsfor Sandbox processes
modal-js/v0.3.9, modal-go/v0.0.9
- Added support for Sandbox filesystem
modal-js/v0.3.8
- Added support for CommonJS format /
require(). Previously, modal-js only supported ESMimport
modal-js/v0.3.7, modal-go/v0.0.8
- Added support for creating Images from AWS ECR with
App.imageFromAwsEcr()(JS) /App.ImageFromAwsEcr()(Go) - Added support for accessing Modal Secrets with
Secret.fromName()(JS) /modal.SecretFromName()(Go) - Fixed serialization of some pickled objects (negative ints, dicts) in modal-js
modal-js/v0.3.6, modal-go/v0.0.7
Queue support:- Added support for the
Queueobject to manage distributed FIFO queues- Queues have a similar interface as Python, with
put()andget()being the primary methods - You can put structured objects onto Queues, with limited support for the pickle format
- Queues have a similar interface as Python, with
- Added
InvalidError,QueueEmptyError, andQueueFullErrorto support Queues - Fixed a bug in
modal-jsthat produced incorrect bytecode for bytes objects - Options in the Go SDK now take pointer types, and can be
nilfor default values
modal-js/v0.3.5, modal-go/v0.0.6
- Added support for spawning Functions with
Function_.spawn()(JS) /Function.Spawn()(Go)
modal-js/v0.3.4, modal-go/v0.0.5
- Added feature for looking up and calling remote classes via the
Clsobject - (Go) Removed the initial
ctx context.Contextargument fromFunction.Remote()
modal-js/v0.3.3, modal-go/v0.0.4
- Support calling remote Functions with arguments greater than 2 MiB in byte payload size
modal-js/v0.3.2, modal-go/v0.0.3
First public release with basic
Function, Sandbox, Image, and ContainerProcess support.