cloudos-cli 2.84.0__tar.gz → 2.86.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/PKG-INFO +338 -96
  2. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/README.md +337 -95
  3. cloudos_cli-2.86.0/cloudos_cli/_version.py +1 -0
  4. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/clos.py +121 -1
  5. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/interactive_session/cli.py +559 -116
  6. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/interactive_session/interactive_session.py +323 -249
  7. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli.egg-info/PKG-INFO +338 -96
  8. cloudos_cli-2.84.0/cloudos_cli/_version.py +0 -1
  9. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/LICENSE +0 -0
  10. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/__init__.py +0 -0
  11. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/__main__.py +0 -0
  12. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/bash/__init__.py +0 -0
  13. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/bash/cli.py +0 -0
  14. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/configure/__init__.py +0 -0
  15. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/configure/cli.py +0 -0
  16. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/configure/configure.py +0 -0
  17. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/constants.py +0 -0
  18. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/cost/__init__.py +0 -0
  19. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/cost/cost.py +0 -0
  20. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/cromwell/__init__.py +0 -0
  21. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/cromwell/cli.py +0 -0
  22. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/datasets/__init__.py +0 -0
  23. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/datasets/cli.py +0 -0
  24. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/datasets/datasets.py +0 -0
  25. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/import_wf/__init__.py +0 -0
  26. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/import_wf/import_wf.py +0 -0
  27. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/interactive_session/__init__.py +0 -0
  28. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/jobs/__init__.py +0 -0
  29. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/jobs/cli.py +0 -0
  30. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/jobs/job.py +0 -0
  31. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/link/__init__.py +0 -0
  32. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/link/cli.py +0 -0
  33. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/link/link.py +0 -0
  34. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/logging/__init__.py +0 -0
  35. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/logging/logger.py +0 -0
  36. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/procurement/__init__.py +0 -0
  37. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/procurement/cli.py +0 -0
  38. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/procurement/images.py +0 -0
  39. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/projects/__init__.py +0 -0
  40. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/projects/cli.py +0 -0
  41. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/queue/__init__.py +0 -0
  42. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/queue/cli.py +0 -0
  43. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/queue/queue.py +0 -0
  44. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/related_analyses/__init__.py +0 -0
  45. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/related_analyses/related_analyses.py +0 -0
  46. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/__init__.py +0 -0
  47. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/array_job.py +0 -0
  48. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/cli_helpers.py +0 -0
  49. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/cloud.py +0 -0
  50. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/details.py +0 -0
  51. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/errors.py +0 -0
  52. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/last_wf.py +0 -0
  53. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/requests.py +0 -0
  54. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/utils/resources.py +0 -0
  55. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/workflows/__init__.py +0 -0
  56. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli/workflows/cli.py +0 -0
  57. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli.egg-info/SOURCES.txt +0 -0
  58. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli.egg-info/dependency_links.txt +0 -0
  59. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli.egg-info/entry_points.txt +0 -0
  60. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli.egg-info/requires.txt +0 -0
  61. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/cloudos_cli.egg-info/top_level.txt +0 -0
  62. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/setup.cfg +0 -0
  63. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/setup.py +0 -0
  64. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/__init__.py +0 -0
  65. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/functions_for_pytest.py +0 -0
  66. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_cli_project_create.py +0 -0
  67. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_cost/__init__.py +0 -0
  68. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_cost/test_job_cost.py +0 -0
  69. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_error_messages.py +0 -0
  70. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_interactive_session/__init__.py +0 -0
  71. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_interactive_session/test_create_session.py +0 -0
  72. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_interactive_session/test_list_sessions.py +0 -0
  73. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_logging/__init__.py +0 -0
  74. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_logging/test_logger.py +0 -0
  75. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_related_analyses/__init__.py +0 -0
  76. {cloudos_cli-2.84.0 → cloudos_cli-2.86.0}/tests/test_related_analyses/test_related_analyses.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudos_cli
3
- Version: 2.84.0
3
+ Version: 2.86.0
4
4
  Summary: Python package for interacting with CloudOS
5
5
  Home-page: https://github.com/lifebit-ai/cloudos-cli
6
6
  Author: David Piñeyro
@@ -100,8 +100,10 @@ Python package for interacting with CloudOS
100
100
  - [Use multiple projects for files in `--parameter` option](#use-multiple-projects-for-files-in---parameter-option)
101
101
  - [Interactive Sessions](#interactive-sessions)
102
102
  - [List Interactive Sessions](#list-interactive-sessions)
103
- - [Get Interactive Session Status](#get-interactive-session-status)
104
103
  - [Create Interactive Session](#create-interactive-session)
104
+ - [Get Interactive Session Status](#get-interactive-session-status)
105
+ - [Pause Interactive Session](#pause-interactive-session)
106
+ - [Resume Interactive Session](#resume-interactive-session)
105
107
  - [Datasets](#datasets)
106
108
  - [List Files](#list-files)
107
109
  - [Move Files](#move-files)
@@ -2004,13 +2006,13 @@ The table displays sessions with pagination controls (press `n` for next page, `
2004
2006
 
2005
2007
  ```console
2006
2008
  Interactive Sessions
2007
- ┏━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┓
2008
- ┃ Status ┃ Name ┃ Type ┃ ID ┃ Owner ┃
2009
- ┡━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━┩
2010
- stopped │ cloudosR │ awsRstudio │ 69aee0dba197… │ Leila │
2011
- │ running │ analysis-dev │ awsJupyterNotebook │ 69ae972a18f0… │ John │
2012
- stopped │ test_session │ awsVSCode │ 69a996c098ab… │ James │
2013
- └─────────┴──────────────┴────────────────────┴───────────────┴────────┘
2009
+ ┏━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┓
2010
+ ┃ Status ┃ Name ┃ Type ┃ ID ┃ Owner ┃
2011
+ ┡━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━┩
2012
+ paused │ cloudosR │ RStudio │ 69aee0dba197… │ Leila │
2013
+ │ running │ analysis-dev │ Jupyter │ 69ae972a18f0… │ John │
2014
+ paused │ test_session │ VS Code │ 69a996c098ab… │ James │
2015
+ └─────────┴──────────────┴────────────────┴───────────────┴────────┘
2014
2016
 
2015
2017
  Total sessions: 15
2016
2018
  Page: 1 of 3
@@ -2047,7 +2049,7 @@ Interactive session list saved to interactive_sessions_list.json
2047
2049
  You can filter sessions by status and other criteria:
2048
2050
 
2049
2051
  ```bash
2050
- # Filter by status (setup, initialising, running, scheduled, stopped)
2052
+ # Filter by status (setup, initialising, running, scheduled, paused)
2051
2053
  cloudos interactive-session list --profile my_profile --filter-status running
2052
2054
 
2053
2055
  # Show only your own sessions
@@ -2071,6 +2073,172 @@ cloudos interactive-session list --profile my_profile --table-columns "status,na
2071
2073
 
2072
2074
  Available columns: `backend`, `cost`, `cost_limit`, `created_at`, `id`, `instance`, `name`, `owner`, `project`, `resources`, `runtime`, `saved_at`, `spot`, `status`, `time_left`, `type`, `version`
2073
2075
 
2076
+ #### Create Interactive Session
2077
+
2078
+ You can create and start a new interactive session using the `cloudos interactive-session create` command. This command provisions a new virtual environment with your specified configuration.
2079
+
2080
+ The command automatically loads API credentials and workspace information from your profile configuration, so you only need to specify the session-specific details.
2081
+
2082
+ **Basic Usage**
2083
+
2084
+ Create a simple Jupyter notebook session:
2085
+
2086
+ ```bash
2087
+ cloudos interactive-session create \
2088
+ --profile my_profile \
2089
+ --name "My Analysis" \
2090
+ --session-type jupyter
2091
+ ```
2092
+
2093
+ Create an RStudio session with specific R version:
2094
+
2095
+ ```bash
2096
+ cloudos interactive-session create \
2097
+ --profile my_profile \
2098
+ --name "R Analysis" \
2099
+ --session-type rstudio \
2100
+ --r-version 4.4.2
2101
+ ```
2102
+
2103
+ Create a VS Code session (AWS only):
2104
+
2105
+ ```bash
2106
+ cloudos interactive-session create \
2107
+ --profile my_profile \
2108
+ --name "Development" \
2109
+ --session-type vscode
2110
+ ```
2111
+
2112
+ Create a Spark cluster session with custom instance types (AWS only):
2113
+
2114
+ ```bash
2115
+ cloudos interactive-session create \
2116
+ --profile my_profile \
2117
+ --name "Spark Analysis" \
2118
+ --session-type spark \
2119
+ --spark-master c5.2xlarge \
2120
+ --spark-core c5.xlarge \
2121
+ --spark-workers 3
2122
+ ```
2123
+
2124
+ **Configuration Options**
2125
+
2126
+ You can customize your session with various options:
2127
+
2128
+ ```bash
2129
+ cloudos interactive-session create \
2130
+ --profile my_profile \
2131
+ --name "Advanced Session" \
2132
+ --session-type jupyter \
2133
+ --instance c5.2xlarge \
2134
+ --storage 1000 \
2135
+ --spot \
2136
+ --shared \
2137
+ --cost-limit 50.0 \
2138
+ --shutdown-in 8h
2139
+ ```
2140
+
2141
+ **Required for Each Session:**
2142
+ - `--name`: Session name (1-100 characters)
2143
+ - `--session-type`: Type of backend - `jupyter`, `vscode`, `rstudio`, or `spark` (platform dependent)
2144
+
2145
+ **Optional Configuration:**
2146
+ - `--instance`: Instance type (default depends on execution platform: `c5.xlarge` for AWS, `Standard_F1s` for Azure)
2147
+ - `--storage`: Storage in GB (default: 500, range: 100-5000)
2148
+ - `--spot`: Use spot instances (AWS only, cost-saving)
2149
+ - `--shared`: Make session accessible to workspace members
2150
+ - `--cost-limit`: Compute cost limit in USD (default: -1 for unlimited)
2151
+ - `--shutdown-in`: Auto-shutdown duration (e.g., `8h`, `2d`, `30m`)
2152
+
2153
+ **Data & Storage Management:**
2154
+ - `--mount`: Mount a data file into the session. Supports both CloudOS datasets and S3 files (AWS only). Format: `project_name/dataset_path` (e.g., `leila-test/Data/file.csv`) or `s3://bucket/path/to/file` (e.g., `s3://my-bucket/data/file.csv`). Can be used multiple times.
2155
+ - `--link`: Link a folder into the session for read/write access (AWS only). Supports S3 folders and CloudOS folders. Format: `s3://bucket/prefix` (e.g., `s3://my-bucket/data/`) or `project_name/folder_path` (e.g., `leila-test/AnalysesResults/analysis_id/results`). Can be used multiple times. **Note:** Linking is not supported on Azure. Use CloudOS file explorer for data access.
2156
+
2157
+ **Backend-Specific:**
2158
+ - `--r-version`: R version for RStudio (options: `4.4.2`, `4.5.2`) - **optional for rstudio** (default: `4.4.2`)
2159
+ - `--spark-master`: Master instance type for Spark (default: `c5.2xlarge`)
2160
+ - `--spark-core`: Core instance type for Spark (default: `c5.xlarge`)
2161
+ - `--spark-workers`: Initial worker count for Spark (default: 1)
2162
+ - `--verbose`: Show detailed progress messages
2163
+
2164
+
2165
+ **Data Management**
2166
+
2167
+ CloudOS CLI supports multiple ways to access data in interactive sessions, depending on your execution platform:
2168
+ - you can load data directly into the session (i.e. files are copied into the session's mounted-data volume)
2169
+ - you can link folders to your session (i.e the folders are sym-linked to the session). This works only for folders (S3-based) and only in AWS enviornments.
2170
+
2171
+
2172
+ **Data Mounting Examples**
2173
+
2174
+ Mount a file from File Explorer:
2175
+
2176
+ ```bash
2177
+ cloudos interactive-session create \
2178
+ --profile my_profile \
2179
+ --name "Data Analysis" \
2180
+ --session-type jupyter \
2181
+ --mount "my_project/training_data.csv"
2182
+ ```
2183
+
2184
+ Link an S3 bucket:
2185
+
2186
+ ```bash
2187
+ cloudos interactive-session create \
2188
+ --profile my_profile \
2189
+ --name "S3 Access" \
2190
+ --session-type jupyter \
2191
+ --link "s3://my-results-bucket/output/"
2192
+ ```
2193
+
2194
+ Link multiple S3 buckets:
2195
+
2196
+ ```bash
2197
+ cloudos interactive-session create \
2198
+ --profile my_profile \
2199
+ --name "Multi-S3 Session" \
2200
+ --session-type jupyter \
2201
+ --link "s3://input-bucket/data/" \
2202
+ --link "s3://output-bucket/results/"
2203
+ ```
2204
+
2205
+
2206
+
2207
+ This will show progress updates like:
2208
+
2209
+ ```console
2210
+ ✓ Interactive Session Created Successfully
2211
+
2212
+ ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓
2213
+ ┃ Property ┃ Value ┃
2214
+ ┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩
2215
+ │ Session ID │ 69aee0dba197abc123 │
2216
+ │ Name │ Ready Session │
2217
+ │ Backend │ awsJupyterNotebook │
2218
+ │ Status │ initialising │
2219
+ └─────────────┴─────────────────────┘
2220
+ ```
2221
+ ```
2222
+
2223
+ **Output Display**
2224
+
2225
+ The session creation output displays a success message with session details:
2226
+
2227
+ ```bash
2228
+ cloudos interactive-session create \
2229
+ --profile my_profile \
2230
+ --name "My Session" \
2231
+ --session-type jupyter
2232
+ ```
2233
+
2234
+ The output shows the session details including:
2235
+ - Session ID
2236
+ - Session name
2237
+ - Backend type (jupyter, vscode, rstudio, spark)
2238
+ - Current status (scheduled, initialising, setup, running, paused)
2239
+
2240
+
2241
+
2074
2242
  #### Get Interactive Session Status
2075
2243
 
2076
2244
  You can retrieve detailed status information for a specific interactive session using the `cloudos interactive-session status` command. This command provides comprehensive information about the session including its current state, resource allocation, costs, and more.
@@ -2092,7 +2260,7 @@ The command displays session information in a formatted table:
2092
2260
  ║ Session ID ║ 69bc00cb1488084e5a6cae70 ║
2093
2261
  ║ Name ║ analysis-dev (linked) ║
2094
2262
  ║ Status ║ running ║
2095
- ║ Backend ║ awsJupyterNotebook
2263
+ ║ Backend ║ Jupyter
2096
2264
  ║ Owner ║ John Doe ║
2097
2265
  ║ Project ║ research ║
2098
2266
  ║ Instance Type ║ c5.xlarge ║
@@ -2125,7 +2293,7 @@ Status changed: provisioning → running
2125
2293
  **Watch Mode Behavior**
2126
2294
 
2127
2295
  - **Pre-running sessions** (setup, initialising, scheduled): Watch mode will continuously poll and display status changes every 30 seconds (default)
2128
- - **Running/stopped sessions**: Watch mode will show a warning and display the current status instead
2296
+ - **Running/paused sessions**: Watch mode will show a warning and display the current status instead
2129
2297
 
2130
2298
  Example with a running session:
2131
2299
 
@@ -2194,142 +2362,216 @@ cloudos interactive-session status --session-id <SESSION_ID> --profile my_profil
2194
2362
  # Creates: /tmp/session_status.csv
2195
2363
  ```
2196
2364
 
2197
- #### Create Interactive Session
2365
+ #### Pause Interactive Session
2198
2366
 
2199
- You can create and start a new interactive session using the `cloudos interactive-session create` command. This command provisions a new virtual environment with your specified configuration.
2200
-
2201
- The command automatically loads API credentials and workspace information from your profile configuration, so you only need to specify the session-specific details.
2367
+ You can pause and terminate a running interactive session using the `cloudos interactive-session pause` command. This command gracefully shuts down the session and optionally saves session data before termination.
2202
2368
 
2203
2369
  **Basic Usage**
2204
2370
 
2205
- Create a simple Jupyter notebook session:
2371
+ Pause a session with confirmation:
2206
2372
 
2207
2373
  ```bash
2208
- cloudos interactive-session create \
2209
- --profile my_profile \
2210
- --name "My Analysis" \
2211
- --session-type jupyter
2374
+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile
2212
2375
  ```
2213
2376
 
2214
- Create an RStudio session with specific R version:
2377
+ The command displays a confirmation prompt:
2378
+
2379
+ ```console
2380
+ About to pause session: 69bd11ca02326c5b3649f5c1
2381
+ Upload data before pausing: True
2382
+ Force immediate termination: False
2383
+ Continue? [y/N]: y
2384
+
2385
+ ✓ Session pause request sent successfully.
2386
+ You can monitor the session status using: cloudos interactive-session status --session-id 69bd11ca02326c5b3649f5c1
2387
+ ```
2388
+
2389
+ **Skip Confirmation Prompt**
2390
+
2391
+ Use the `-y` or `--yes` flag to skip the confirmation prompt:
2215
2392
 
2216
2393
  ```bash
2217
- cloudos interactive-session create \
2218
- --profile my_profile \
2219
- --name "R Analysis" \
2220
- --session-type rstudio \
2221
- --r-version 4.4.2
2394
+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile -y
2222
2395
  ```
2223
2396
 
2224
- Create a VS Code session (AWS only):
2397
+ **Data Management Options**
2398
+
2399
+ By default, session data is saved to S3 before pausing. Use `--no-upload` to skip data saving (use with caution):
2225
2400
 
2226
2401
  ```bash
2227
- cloudos interactive-session create \
2228
- --profile my_profile \
2229
- --name "Development" \
2230
- --session-type vscode
2402
+ # Save session data before pausing (default)
2403
+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile
2404
+
2405
+ # Skip saving data (use with caution)
2406
+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --no-upload
2231
2407
  ```
2232
2408
 
2233
- Create a Spark cluster session with custom instance types (AWS only):
2409
+ **Termination Modes**
2410
+
2411
+ **Graceful Shutdown (default)**
2412
+
2413
+ Allows the session to clean up resources and save data before terminating:
2234
2414
 
2235
2415
  ```bash
2236
- cloudos interactive-session create \
2237
- --profile my_profile \
2238
- --name "Spark Analysis" \
2239
- --session-type spark \
2240
- --spark-master c5.2xlarge \
2241
- --spark-core c5.xlarge \
2242
- --spark-workers 3
2416
+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile
2243
2417
  ```
2244
2418
 
2245
- **Configuration Options**
2419
+ **Force Immediate Termination**
2246
2420
 
2247
- You can customize your session with various options:
2421
+ Bypass graceful shutdown for immediate termination (useful for stuck sessions):
2248
2422
 
2249
2423
  ```bash
2250
- cloudos interactive-session create \
2251
- --profile my_profile \
2252
- --name "Advanced Session" \
2253
- --session-type jupyter \
2254
- --instance c5.2xlarge \
2255
- --storage 1000 \
2256
- --spot \
2257
- --shared \
2258
- --cost-limit 50.0 \
2259
- --shutdown-in 8h
2424
+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --force
2260
2425
  ```
2261
2426
 
2262
- **Required for Each Session:**
2263
- - `--name`: Session name (1-100 characters)
2264
- - `--session-type`: Type of backend - `jupyter`, `vscode`, `rstudio`, or `spark` (platform dependent)
2427
+ Use `--force` with caution as it may not save session data properly.
2265
2428
 
2266
- **Optional Configuration:**
2267
- - `--instance`: Instance type (default depends on execution platform: `c5.xlarge` for AWS, `Standard_F1s` for Azure)
2268
- - `--storage`: Storage in GB (default: 500, range: 100-5000)
2269
- - `--spot`: Use spot instances (AWS only, cost-saving)
2270
- - `--shared`: Make session accessible to workspace members
2271
- - `--cost-limit`: Compute cost limit in USD (default: -1 for unlimited)
2272
- - `--shutdown-in`: Auto-shutdown duration (e.g., `8h`, `2d`, `30m`)
2429
+ **Wait for Termination**
2273
2430
 
2274
- **Data & Storage Management:**
2275
- - `--mount`: Mount a data file into the session. Supports both CloudOS datasets and S3 files (AWS only). Format: `project_name/dataset_path` (e.g., `leila-test/Data/file.csv`) or `s3://bucket/path/to/file` (e.g., `s3://my-bucket/data/file.csv`). Can be used multiple times.
2276
- - `--link`: Link a folder into the session for read/write access (AWS only). Supports S3 folders and CloudOS folders. Format: `s3://bucket/prefix` (e.g., `s3://my-bucket/data/`) or `project_name/folder_path` (e.g., `leila-test/AnalysesResults/analysis_id/results`). Can be used multiple times. **Note:** Linking is not supported on Azure. Use CloudOS file explorer for data access.
2431
+ Use the `--wait` flag to monitor the session until it reaches a terminal state:
2277
2432
 
2278
- **Backend-Specific:**
2279
- - `--r-version`: R version for RStudio (options: `4.4.2`, `4.5.2`) - **optional for rstudio** (default: `4.4.2`)
2280
- - `--spark-master`: Master instance type for Spark (default: `c5.2xlarge`)
2281
- - `--spark-core`: Core instance type for Spark (default: `c5.xlarge`)
2282
- - `--spark-workers`: Initial worker count for Spark (default: 1)
2433
+ ```bash
2434
+ cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --wait
2435
+ ```
2436
+
2437
+ Output with `--wait`:
2438
+
2439
+ ```console
2440
+ Pausing session...
2441
+ Status: shutting_down
2442
+ Status: uploading_data
2443
+ Status: cleaning_up
2444
+ Status: paused
2445
+ ✓ Session paused successfully
2446
+ ```
2447
+
2448
+ **Error Handling**
2449
+
2450
+ The command provides helpful error messages for common issues:
2451
+
2452
+ ```console
2453
+ # Trying to pause an already paused session
2454
+ Error: Cannot pause session - the session is already paused.
2455
+ Tip: Check the session status with: cloudos interactive-session status --session-id <SESSION_ID>
2456
+
2457
+ # Trying to pause a session that is already being paused
2458
+ Error: Cannot pause session - the session is already being paused.
2459
+ Tip: Wait a moment and check status with: cloudos interactive-session status --session-id <SESSION_ID>
2460
+ ```
2461
+
2462
+ **Examples**
2463
+
2464
+ Basic pause with confirmation:
2465
+
2466
+ ```bash
2467
+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a
2468
+ ```
2469
+
2470
+ Pause without saving data and skip confirmation:
2471
+
2472
+ ```bash
2473
+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a --no-upload -y
2474
+ ```
2475
+
2476
+ Force pause and wait for termination:
2477
+
2478
+ ```bash
2479
+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a --force -y --wait
2480
+ ```
2481
+
2482
+ Pause using profile configuration:
2483
+
2484
+ ```bash
2485
+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --profile my_profile --wait
2486
+ ```
2487
+
2488
+ Pause with verbose output:
2489
+
2490
+ ```bash
2491
+ cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --profile my_profile --verbose
2492
+ ```
2493
+
2494
+ **Options Reference**
2495
+
2496
+ The command automatically loads from profile (via `@with_profile_config` decorator):
2497
+ - **From Profile**: apikey, cloudos-url, workspace-id
2498
+ - **Command Line**: Additional options and behaviors
2499
+
2500
+ **Required:**
2501
+ - `--session-id`: The session ID to pause (24-character hex string)
2502
+
2503
+ **Optional Overrides from Profile:**
2504
+ - `--apikey` (optional): Override API key from profile
2505
+ - `--cloudos-url` (optional): Override CloudOS URL from profile
2506
+ - `--workspace-id` (optional): Override workspace ID from profile
2507
+
2508
+ **Optional Behavior Flags:**
2509
+ - `--no-upload`: Don't save session data before pausing (default: saves data)
2510
+ - `--force`: Force immediate termination, skip graceful shutdown (default: graceful). **Warning:** Shows a warning message that some data may not be saved.
2511
+ - `--wait`: Wait for session to fully pause (default: return immediately after sending pause command)
2512
+ - `-y, --yes`: Skip confirmation prompt (default: show confirmation)
2283
2513
  - `--verbose`: Show detailed progress messages
2284
2514
 
2515
+ **Optional Connection:**
2516
+ - `--disable-ssl-verification`: Disable SSL certificate verification (not recommended)
2517
+ - `--ssl-cert`: Path to SSL certificate file
2518
+ - `--profile`: Profile to use from config file (default: default profile)
2285
2519
 
2286
- **Data Management**
2520
+ #### Resume Interactive Session
2287
2521
 
2288
- CloudOS CLI supports multiple ways to access data in interactive sessions, depending on your execution platform:
2289
- - you can load data directly into the session (i.e. files are copied into the session's mounted-data volume)
2290
- - you can link folders to your session (i.e the folders are sym-linked to the session). This works only for folders (S3-based) and only in AWS enviornments.
2522
+ Resume a paused interactive session with optional configuration updates. You can change instance type, storage, cost limit, auto-shutdown time, and mount additional data files or folders when resuming.
2291
2523
 
2292
2524
 
2293
- **Data Mounting Examples**
2525
+ **Basic Usage**
2294
2526
 
2295
- Mount a file from File Explorer:
2527
+ Resume a paused session:
2296
2528
 
2297
2529
  ```bash
2298
- cloudos interactive-session create \
2299
- --profile my_profile \
2300
- --name "Data Analysis" \
2301
- --session-type jupyter \
2302
- --mount "my_project/training_data.csv"
2530
+ cloudos interactive-session resume --session-id <SESSION_ID> --profile my_profile
2303
2531
  ```
2304
2532
 
2305
- Link an S3 bucket:
2533
+ Resume with updated instance type:
2306
2534
 
2307
2535
  ```bash
2308
- cloudos interactive-session create \
2536
+ cloudos interactive-session resume \
2537
+ --session-id <SESSION_ID> \
2309
2538
  --profile my_profile \
2310
- --name "S3 Access" \
2311
- --session-type jupyter \
2312
- --link "s3://my-results-bucket/output/"
2539
+ --instance c5.2xlarge
2313
2540
  ```
2314
2541
 
2542
+ Resume with multiple updates:
2315
2543
 
2316
- **Output Display**
2544
+ ```bash
2545
+ cloudos interactive-session resume \
2546
+ --session-id <SESSION_ID> \
2547
+ --profile my_profile \
2548
+ --instance m5.xlarge \
2549
+ --storage 1000 \
2550
+ --cost-limit 50.0 \
2551
+ --shutdown-in 12h
2552
+ ```
2317
2553
 
2318
- The session creation output displays a success message with session details:
2554
+ **Mount Additional Data**
2555
+
2556
+ Resume and mount additional files:
2319
2557
 
2320
2558
  ```bash
2321
- cloudos interactive-session create \
2559
+ cloudos interactive-session resume \
2560
+ --session-id <SESSION_ID> \
2322
2561
  --profile my_profile \
2323
- --name "My Session" \
2324
- --session-type jupyter
2562
+ --mount my-project/Data/new-dataset.csv \
2563
+ --mount s3://my-bucket/data/file.txt
2325
2564
  ```
2326
2565
 
2327
- The output shows the session details including:
2328
- - Session ID
2329
- - Session name
2330
- - Backend type (jupyter, vscode, rstudio, spark)
2331
- - Current status (scheduled, initialising, setup, running, stopped)
2332
2566
 
2567
+ **Configuration Updates**
2568
+
2569
+ All configuration parameters are optional. If not specified, the session resumes with its previous configuration.
2570
+
2571
+ - `--instance <TYPE>` - Change instance type (validated by platform)
2572
+ - `--storage <GB>` - Update storage size (100-5000 GB)
2573
+ - `--cost-limit <USD>` - Update compute cost limit (-1 for unlimited)
2574
+ - `--shutdown-in <DURATION>` - Update auto-shutdown time (e.g., 8h, 2d)
2333
2575
 
2334
2576
  ### Datasets
2335
2577