Skip to content

๐Ÿง‘โ€๐Ÿ’ป 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 โ€‹

FeatureDescription
Interactive AccessUser can interact with the container while it is running
Short-Lived ServerRuns with a specified timeout
Live URL EndpointA socket is exposed and a live URL is provided in the logs
Uses Same Routine FrameworkUses WKubeTask like all other routines
GUI + CLI SupportCan be launched from GUI or with accli dispatch

๐Ÿง  How It Works โ€‹

  1. You define a routine using the same WKubeTask interface.
  2. You specify the server launch command in the command field.
  3. You add an interactive_socket entry to the conf dictionary.
  4. After dispatch, the platform exposes a public or secure link to access the running server.

๐Ÿงช Example: RStudio Server as an Interactive Routine โ€‹

python
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:

TypeExampleNotes
TCP Socket0.0.0.0:8787Common for web services
Unix Socketunix:///tmp/service.sockAdvanced 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_socket in 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 timeout expires.
  • 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.