Skip to content
ricochet

Julia

This page covers the requirements and internals of deploying Julia content to ricochet.

Every Julia deployment requires a Manifest.toml file in the project root. This lockfile is generated by Julia’s built-in package manager (Pkg) and records all package dependencies and their versions.

[content]
name = "My Dash.jl App"
entrypoint = "app.jl"
access_type = "external"
content_type = "julia-service"
[language]
name = "julia"
packages = "Manifest.toml"
[serve]
min_instances = 0
max_instances = 5

Julia content items can be deployed as apps or tasks.

Content TypeDescription
julia-serviceA web app or API using a Julia runtime such as Dash.jl.
Content TypeDescription
juliaA Julia script.
quarto-jlA Quarto document using a Julia runtime. Can be served as a static site.

Julia must be installed via juliaup. Only juliaup-managed Julia installations are supported. Ricochet vendors juliaup at $RICOCHET_HOME/vendor.

Terminal window
juliaup add <version>

When a deployment is received, ricochet uses juliaup to discover installed Julia channels and selects the appropriate version.

When a bundle is deployed, ricochet restores Julia package dependencies from the Manifest.toml file using Julia’s built-in package manager.

You can deploy and manage Julia content programmatically using the ricochet REST API. The examples below use HTTP.jl. API keys are created in the ricochet UI under Credentials → API Keys.

Bundle your project as a .tar.gz archive and upload it with the _ricochet.toml config.

using HTTP, JSON3, Tar, CodecZlib
server = "https://try.ricochet.rs"
api_key = ENV["RICOCHET_API_KEY"]
headers = ["Authorization" => "Key $api_key"]
# Create a tar.gz bundle of the project directory
bundle_path = tempname() * ".tar.gz"
open(bundle_path, "w") do io
gz = GzipCompressorStream(io)
Tar.create(".", gz)
close(gz)
end
# Deploy new content
body = HTTP.Form(Dict(
"bundle" => HTTP.Multipart("bundle.tar.gz", open(bundle_path), "application/gzip"),
"config" => HTTP.Multipart("_ricochet.toml", open("_ricochet.toml"), "application/toml"),
))
resp = HTTP.post("$server/api/v0/content/upload", headers, body)
result = JSON3.read(resp.body)
result.id
#> "01JSZAXZ3TSTAYXP56ARDVFJCJ"

To redeploy existing content, pass id instead of config:

body = HTTP.Form(Dict(
"bundle" => HTTP.Multipart("bundle.tar.gz", open(bundle_path), "application/gzip"),
"id" => "01JSZAXZ3TSTAYXP56ARDVFJCJ",
))
resp = HTTP.post("$server/api/v0/content/upload", headers, body)
content_id = "01JSZAXZ3TSTAYXP56ARDVFJCJ"
resp = HTTP.post(
"$server/api/v0/content/$content_id/invoke",
["Authorization" => "Key $api_key", "Content-Type" => "application/json"],
JSON3.write(Dict("params" => Dict("n" => 100))),
)
JSON3.read(resp.body)
resp = HTTP.get("$server/api/v0/user/items", headers)
items = JSON3.read(resp.body)