starburst_session: Create a Detached Starburst Session

View source: R/session-api.R

starburst_sessionR Documentation

Create a Detached Starburst Session

Description

Creates a new detached session that can run computations independently of your R session. You can close R and reattach later to collect results.

Usage

starburst_session(
  workers = 10,
  cpu = 4,
  memory = "8GB",
  region = NULL,
  timeout = 3600,
  session_timeout = 3600,
  absolute_timeout = 86400,
  launch_type = "EC2",
  instance_type = "c7g.xlarge",
  use_spot = TRUE,
  warm_pool_timeout = 3600
)

Arguments

workers

Number of parallel workers (default: 10)

cpu

vCPUs per worker (default: 4)

memory

Memory per worker, e.g., "8GB" (default: "8GB")

region

AWS region (default: from config or "us-east-1")

timeout

Task timeout in seconds (default: 3600)

session_timeout

Active timeout in seconds (default: 3600)

absolute_timeout

Maximum session lifetime in seconds (default: 86400)

launch_type

"FARGATE" or "EC2" (default: "FARGATE")

instance_type

EC2 instance type for EC2 launch (default: "c6a.large")

use_spot

Use spot instances for EC2 (default: FALSE)

warm_pool_timeout

EC2 warm pool timeout in seconds (default: 3600)

Value

A StarburstSession object with methods:

  • submit(expr, ...) - Submit a task to the session

  • status() - Get progress summary

  • collect(wait = FALSE) - Collect completed results

  • extend(seconds = 3600) - Extend timeout

  • cleanup() - Terminate and cleanup

Examples


if (starburst_is_configured()) {
  # Create detached session
  session <- starburst_session(workers = 10)

  # Submit tasks
  task_ids <- lapply(1:100, function(i) {
    session$submit(quote(expensive_computation(i)))
  })

  # Close R and come back later...
  session_id <- session$session_id

  # Reattach
  session <- starburst_session_attach(session_id)

  # Collect results
  results <- session$collect(wait = TRUE)
}


starburst documentation built on March 19, 2026, 5:08 p.m.