Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
06408c7
implemented interactive-session list
l-mansouri Mar 16, 2026
86133b0
adds the interactive session creation
l-mansouri Mar 17, 2026
c9830e4
refined in testing
l-mansouri Mar 18, 2026
4fcb373
changelog
l-mansouri Mar 18, 2026
3ebc491
fix lisitng status error
l-mansouri Mar 18, 2026
bb2d61e
changed error message for invalid credentials
l-mansouri Mar 18, 2026
3fe895b
fix error message
l-mansouri Mar 18, 2026
9b0c5a5
removed tmp files
l-mansouri Mar 18, 2026
52f7ea4
updates docs
l-mansouri Mar 18, 2026
c2459f7
added cis
l-mansouri Mar 18, 2026
f7dc8a3
fix typo in ci
l-mansouri Mar 18, 2026
aeaeecf
fix typo in ci
l-mansouri Mar 18, 2026
32606f1
fix typo in ci
l-mansouri Mar 18, 2026
91888e3
cleanup
l-mansouri Mar 18, 2026
a9baa64
address sentry
l-mansouri Mar 18, 2026
2feca3f
removed gitlab token from cis
l-mansouri Mar 18, 2026
61b2801
removed gitlab token from cis
l-mansouri Mar 18, 2026
477f0f6
added azzure interactive-session creation support
l-mansouri Mar 18, 2026
b841b22
cleanup
l-mansouri Mar 18, 2026
9ff31d1
added azure cis
l-mansouri Mar 18, 2026
008dd9d
fix typo
l-mansouri Mar 18, 2026
3fde0f1
fix azure cis
l-mansouri Mar 18, 2026
8d89ee1
fix cis
l-mansouri Mar 18, 2026
91b1304
address sentry
l-mansouri Mar 18, 2026
39695e5
fix typo in ci
l-mansouri Mar 18, 2026
ad6b430
address sentry
l-mansouri Mar 18, 2026
353cd7c
draft implementation
l-mansouri Mar 19, 2026
c068a64
changed table to print full id
l-mansouri Mar 19, 2026
ce7c813
address sentry
l-mansouri Mar 19, 2026
b4d9bc6
Merge branch 'ia_sessions' of https://github.com/lifebit-ai/cloudos-c…
l-mansouri Mar 19, 2026
6e63e54
refined implementation in testing
l-mansouri Mar 19, 2026
f7118d6
updated docs
l-mansouri Mar 19, 2026
fab7087
changelog
l-mansouri Mar 19, 2026
19cb0f8
addded cis
l-mansouri Mar 19, 2026
b1b65e3
fix cis
l-mansouri Mar 19, 2026
1e46741
address sentry
l-mansouri Mar 19, 2026
7366b06
draft implementation
l-mansouri Mar 19, 2026
a0aa5b3
refined implementation and testing
l-mansouri Mar 20, 2026
6898f92
changelog
l-mansouri Mar 20, 2026
11e61c6
updated docs
l-mansouri Mar 20, 2026
6843d29
changed tip in the creation command
l-mansouri Mar 20, 2026
c410ac8
address sentry
l-mansouri Mar 20, 2026
8f8d763
added cis
l-mansouri Mar 20, 2026
190bc74
changed status name to paused
l-mansouri Mar 23, 2026
f5579ec
addressed dani's comments
l-mansouri Mar 23, 2026
6d1fb0b
Merge branch 'main' into ia-status
l-mansouri Mar 23, 2026
7f95e77
fix typo in merge
l-mansouri Mar 23, 2026
80becd9
fix typo in merge
l-mansouri Mar 23, 2026
42026ac
fix typo in merge
l-mansouri Mar 23, 2026
11c6fb2
fix typo in merge
l-mansouri Mar 23, 2026
f24bd8a
addressed sentry
l-mansouri Mar 23, 2026
3bd6e18
address sentry
l-mansouri Mar 24, 2026
a0c097a
Merge branch 'ia-status' of https://github.com/lifebit-ai/cloudos-cli…
l-mansouri Mar 24, 2026
2e2d596
address part of danis comments
l-mansouri Mar 24, 2026
c5f6981
merged main
l-mansouri Mar 24, 2026
9cbb15c
addressed rest of comments
l-mansouri Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,31 @@ jobs:
SESSION_ID: ${{ needs.interactive_session_create.outputs.session_id }}
run: |
cloudos interactive-session status --cloudos-url $CLOUDOS_URL --apikey $CLOUDOS_TOKEN --workspace-id $CLOUDOS_WORKSPACE_ID --session-id $SESSION_ID
interactive_session_pause:
needs: interactive_session_create
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: |
pip install -e .
- name: Pause interactive session
env:
CLOUDOS_TOKEN: ${{ secrets.CLOUDOS_TOKEN_ADAPT }}
CLOUDOS_WORKSPACE_ID: ${{ secrets.CLOUDOS_WORKSPACE_ID_ADAPT }}
CLOUDOS_URL: "https://cloudos.lifebit.ai"
SESSION_ID: ${{ needs.interactive_session_create.outputs.session_id }}
run: |
cloudos interactive-session pause --cloudos-url $CLOUDOS_URL --apikey $CLOUDOS_TOKEN --workspace-id $CLOUDOS_WORKSPACE_ID --session-id $SESSION_ID --yes



Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/ci_az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -765,4 +765,30 @@ jobs:
SESSION_ID: ${{ needs.interactive_session_create.outputs.session_id }}
run: |
cloudos interactive-session status --cloudos-url $CLOUDOS_URL --apikey $CLOUDOS_TOKEN --workspace-id $CLOUDOS_WORKSPACE_ID --session-id $SESSION_ID
interactive_session_pause:
needs: interactive_session_create
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: |
pip install -e .
- name: Pause interactive session
env:
CLOUDOS_TOKEN: ${{ secrets.CLOUDOS_TOKEN_AZURE }}
CLOUDOS_WORKSPACE_ID: ${{ secrets.CLOUDOS_WORKSPACE_ID_AZURE }}
CLOUDOS_URL: "https://dev.sdlc.lifebit.ai"
SESSION_ID: ${{ needs.interactive_session_create.outputs.session_id }}
run: |
cloudos interactive-session pause --cloudos-url $CLOUDOS_URL --apikey $CLOUDOS_TOKEN --workspace-id $CLOUDOS_WORKSPACE_ID --session-id $SESSION_ID --yes


25 changes: 25 additions & 0 deletions .github/workflows/ci_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -983,3 +983,28 @@ jobs:
SESSION_ID: ${{ needs.interactive_session_create.outputs.session_id }}
run: |
cloudos interactive-session status --cloudos-url $CLOUDOS_URL --apikey $CLOUDOS_TOKEN --workspace-id $CLOUDOS_WORKSPACE_ID --session-id $SESSION_ID
interactive_session_pause:
needs: interactive_session_create
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: |
pip install -e .
- name: Pause interactive session
env:
CLOUDOS_TOKEN: ${{ secrets.CLOUDOS_TOKEN_DEV }}
CLOUDOS_WORKSPACE_ID: ${{ secrets.CLOUDOS_WORKSPACE_ID_DEV }}
CLOUDOS_URL: "https://dev.sdlc.lifebit.ai"
SESSION_ID: ${{ needs.interactive_session_create.outputs.session_id }}
run: |
cloudos interactive-session pause --cloudos-url $CLOUDOS_URL --apikey $CLOUDOS_TOKEN --workspace-id $CLOUDOS_WORKSPACE_ID --session-id $SESSION_ID --yes
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## lifebit-ai/cloudos-cli: changelog

## v2.85.0 (2026-03-20)

### Feat

- Adds pausing of an interactive session

## v2.84.0 (2026-03-19)

### Feat
Expand Down
168 changes: 162 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Python package for interacting with CloudOS
- [Interactive Sessions](#interactive-sessions)
- [List Interactive Sessions](#list-interactive-sessions)
- [Get Interactive Session Status](#get-interactive-session-status)
- [Pause Interactive Session](#pause-interactive-session)
- [Create Interactive Session](#create-interactive-session)
- [Datasets](#datasets)
- [List Files](#list-files)
Expand Down Expand Up @@ -1972,9 +1973,9 @@ The table displays sessions with pagination controls (press `n` for next page, `
┏━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Status ┃ Name ┃ Type ┃ ID ┃ Owner ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━┩
stopped │ cloudosR │ awsRstudio │ 69aee0dba197… │ Leila │
│ running │ analysis-dev │ awsJupyterNotebook │ 69ae972a18f0… │ John │
stopped │ test_session │ awsVSCode │ 69a996c098ab… │ James │
paused │ cloudosR │ RStudio │ 69aee0dba197… │ Leila │
│ running │ analysis-dev │ Jupyter │ 69ae972a18f0… │ John │
paused │ test_session │ VS Code │ 69a996c098ab… │ James │
└─────────┴──────────────┴────────────────────┴───────────────┴────────┘

Total sessions: 15
Expand Down Expand Up @@ -2012,7 +2013,7 @@ Interactive session list saved to interactive_sessions_list.json
You can filter sessions by status and other criteria:

```bash
# Filter by status (setup, initialising, running, scheduled, stopped)
# Filter by status (setup, initialising, running, scheduled, paused)
cloudos interactive-session list --profile my_profile --filter-status running

# Show only your own sessions
Expand Down Expand Up @@ -2090,7 +2091,7 @@ Status changed: provisioning → running
**Watch Mode Behavior**

- **Pre-running sessions** (setup, initialising, scheduled): Watch mode will continuously poll and display status changes every 30 seconds (default)
- **Running/stopped sessions**: Watch mode will show a warning and display the current status instead
- **Running/paused sessions**: Watch mode will show a warning and display the current status instead

Example with a running session:

Expand Down Expand Up @@ -2159,6 +2160,161 @@ cloudos interactive-session status --session-id <SESSION_ID> --profile my_profil
# Creates: /tmp/session_status.csv
```

#### Pause Interactive Session

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.

**Basic Usage**

Pause a session with confirmation:

```bash
cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile
```

The command displays a confirmation prompt:

```console
About to pause session: 69bd11ca02326c5b3649f5c1
Upload data before pausing: True
Force immediate termination: False
Continue? [y/N]: y

✓ Session pause request sent successfully.
You can monitor the session status using: cloudos interactive-session status --session-id 69bd11ca02326c5b3649f5c1
```

**Skip Confirmation Prompt**

Use the `-y` or `--yes` flag to skip the confirmation prompt:

```bash
cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile -y
```

**Data Management Options**

By default, session data is saved to S3 before pausing. Use `--no-upload` to skip data saving (use with caution):

```bash
# Save session data before pausing (default)
cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile

# Skip saving data (use with caution)
cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --no-upload
```

**Termination Modes**

**Graceful Shutdown (default)**

Allows the session to clean up resources and save data before terminating:

```bash
cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile
```

**Force Immediate Termination**

Bypass graceful shutdown for immediate termination (useful for stuck sessions):

```bash
cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --force
```

Use `--force` with caution as it may not save session data properly.

**Wait for Termination**

Use the `--wait` flag to monitor the session until it reaches a terminal state:

```bash
cloudos interactive-session pause --session-id <SESSION_ID> --profile my_profile --wait
```

Output with `--wait`:

```console
Pausing session...
Status: shutting_down
Status: uploading_data
Status: cleaning_up
Status: stopped
✓ Session paused successfully
```

**Error Handling**

The command provides helpful error messages for common issues:

```console
# Trying to pause an already paused session
Error: Cannot pause session - the session is already paused.
Tip: Check the session status with: cloudos interactive-session status --session-id <SESSION_ID>

# Trying to pause a session that is already being paused
Error: Cannot pause session - the session is already being paused.
Tip: Wait a moment and check status with: cloudos interactive-session status --session-id <SESSION_ID>
```

**Examples**

Basic pause with confirmation:

```bash
cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a
```

Pause without saving data and skip confirmation:

```bash
cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a --no-upload -y
```

Force pause and wait for termination:

```bash
cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --workspace-id 687fb9905c45270e09db1e9a --force -y --wait
```

Pause using profile configuration:

```bash
cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --profile my_profile --wait
```

Pause with verbose output:

```bash
cloudos interactive-session pause --session-id 688351ab6be610972db54a8e --profile my_profile --verbose
```

**Options Reference**

The command automatically loads from profile (via `@with_profile_config` decorator):
- **From Profile**: apikey, cloudos-url, workspace-id
- **Command Line**: Additional options and behaviors

**Required:**
- `--session-id`: The session ID to pause (24-character hex string)

**Optional Overrides from Profile:**
- `--apikey` (optional): Override API key from profile
- `--cloudos-url` (optional): Override CloudOS URL from profile
- `--workspace-id` (optional): Override workspace ID from profile

**Optional Behavior Flags:**
- `--no-upload`: Don't save session data before pausing (default: saves data)
- `--force`: Force immediate termination, skip graceful shutdown (default: graceful). **Warning:** Shows a warning message that some data may not be saved.
- `--wait`: Wait for session to fully pause (default: return immediately after sending pause command)
- `-y, --yes`: Skip confirmation prompt (default: show confirmation)
- `--verbose`: Show detailed progress messages

**Optional Connection:**
- `--disable-ssl-verification`: Disable SSL certificate verification (not recommended)
- `--ssl-cert`: Path to SSL certificate file
- `--profile`: Profile to use from config file (default: default profile)

#### Create Interactive Session

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.
Expand Down Expand Up @@ -2293,7 +2449,7 @@ The output shows the session details including:
- Session ID
- Session name
- Backend type (jupyter, vscode, rstudio, spark)
- Current status (scheduled, initialising, setup, running, stopped)
- Current status (scheduled, initialising, setup, running, paused)


### Datasets
Expand Down
2 changes: 1 addition & 1 deletion cloudos_cli/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.84.0'
__version__ = '2.85.0'
Loading
Loading