We only support custom runtimes for Python and JavaScript/TypeScript.
Set up
Before getting started, you’ll need an API key from the Riza Dashboard. Export it as an environment variable within your shell:Create a Python custom runtime
In this example, we’ll create a custom Riza runtime environment with the Markdown Python package, which converts Markdown to HTML. The required parameters are “name”, “language” and “manifest_file”, which is a simple PyPi requirements file declaring your dependencies.id
and revision_id
parameters, which we’ll use in future steps.
revision_id
each time you update your dependencies, while the runtime id
will remain the same.
Create a JavaScript custom runtime
In this example, we’ll create a custom Riza JavaScript runtime environment with the marked package.Wait for the custom runtime to build
Building a custom runtime is not instant. It will likely take a few seconds, and could take more than a minute. To check a build’s status, use the Riza API to fetch the custom runtime. The runtime object’sstatus
parameter indicates whether the latest build is complete and whether it succeeded or failed.
To monitor progress, periodically call the API until the status is either "succeeded"
or "failed"
. The code below demonstrates this approach.
Use the custom runtime
If the custom runtime build succeeds, you can now use it to run code that imports the Markdown package. You’ll need the runtime revision ID from the first step to use the runtime with the Execute Code endpoint. Now, you can execute Python code with themarkdown
package using the custom runtime from the previous step.
marked
package using the custom runtime from the previous step.