๐งโ๐ป Interactive Routines โ
Interactive routines are a special category of routines that allow users to interact with a live, temporary server process running on the cluster. Unlike traditional routines that execute to completion with no intervention, interactive routines enable exploratory work such as launching RStudio Server, Jupyter, or SSH sessions.
๐ Key Characteristics โ
| Feature | Description |
|---|---|
| Interactive Access | User can interact with the container while it is running |
| Short-Lived Server | Runs with a specified timeout |
| Live URL Endpoint | A socket is exposed and a live URL is provided in the logs |
| Uses Same Routine Framework | Uses WKubeTask like all other routines |
| GUI + CLI Support | Can be launched from GUI or with accli dispatch |
๐ง How It Works โ
- You define a routine using the same
WKubeTaskinterface. - You specify the server launch command in the
commandfield. - You add an
interactive_socketentry to theconfdictionary. - After dispatch, the platform exposes a public or secure link to access the running server.
๐งช Example: RStudio Server as an Interactive Routine โ
from accli import WKubeTask
rstudio_server = WKubeTask(
name="RStudio Server Interactive",
docker_image="rocker/rstudio:4.3.1",
command="/init", # assumes /init launches rstudio-server
required_cores=2,
required_ram=1024 * 1024 * 1024,
required_storage_local=1024 * 1024 * 1024,
required_storage_workflow=1024,
timeout=3600, # 1-hour session
conf={
"interactive_socket": "0.0.0.0:8787"
}
)๐ Accessing the Session โ
Once the routine is dispatched:
- A log entry appears with a URL, e.g.:
[INFO] Interactive session available at: https://cluster.domain.com/interactive/routine-1234 - Open this in your browser to connect to the service (e.g., RStudio IDE).
๐งฐ Socket Options โ
The interactive_socket key in conf supports:
| Type | Example | Notes |
|---|---|---|
| TCP Socket | 0.0.0.0:8787 | Common for web services |
| Unix Socket | unix:///tmp/service.sock | Advanced use; requires container support |
๐ฅ๏ธ GUI Support โ
Interactive routines can also be created and managed through the Accelerator GUI:
- Create a routine entity and specify the
interactive_socketin the advanced conf section. - After launching, a live session link appears in the routine logs panel.
- Can also be configured for launch from file explorer for reusable remote workspaces.
โ Use Cases โ
- Spin up RStudio or Jupyter for data exploration
- Launch a temporary SSH container for compute-intensive tasks
- Host a lightweight API server for testing inside a controlled cluster context
๐ Notes โ
- These routines are not meant for indefinite hosting โ they automatically terminate after the
timeoutexpires. - Make sure the container image includes all necessary services and starts them reliably via the
command.
๐ฆ Summary โ
Interactive routines bridge the gap between compute automation and human-in-the-loop analysis by letting users deploy short-lived interactive services with controlled resources and tight security. They're as easy to define and launch as any routine โ with the added power of live access.