cloudos-cli 2.82.1__tar.gz → 2.83.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.
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/PKG-INFO +243 -2
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/README.md +242 -1
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/__init__.py +1 -1
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/__main__.py +2 -0
- cloudos_cli-2.83.0/cloudos_cli/_version.py +1 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/clos.py +205 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/configure/configure.py +4 -6
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/datasets/cli.py +0 -2
- cloudos_cli-2.83.0/cloudos_cli/interactive_session/__init__.py +1 -0
- cloudos_cli-2.83.0/cloudos_cli/interactive_session/cli.py +625 -0
- cloudos_cli-2.83.0/cloudos_cli/interactive_session/interactive_session.py +1263 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli.egg-info/PKG-INFO +243 -2
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli.egg-info/SOURCES.txt +6 -0
- cloudos_cli-2.83.0/tests/test_interactive_session/__init__.py +1 -0
- cloudos_cli-2.83.0/tests/test_interactive_session/test_create_session.py +482 -0
- cloudos_cli-2.83.0/tests/test_interactive_session/test_list_sessions.py +250 -0
- cloudos_cli-2.82.1/cloudos_cli/_version.py +0 -1
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/LICENSE +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/bash/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/bash/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/configure/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/configure/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/constants.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/cost/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/cost/cost.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/cromwell/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/cromwell/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/datasets/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/datasets/datasets.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/import_wf/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/import_wf/import_wf.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/jobs/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/jobs/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/jobs/job.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/link/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/link/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/link/link.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/logging/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/logging/logger.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/procurement/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/procurement/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/procurement/images.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/projects/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/projects/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/queue/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/queue/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/queue/queue.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/related_analyses/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/related_analyses/related_analyses.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/array_job.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/cli_helpers.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/cloud.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/details.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/errors.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/last_wf.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/requests.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/utils/resources.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/workflows/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli/workflows/cli.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli.egg-info/dependency_links.txt +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli.egg-info/entry_points.txt +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli.egg-info/requires.txt +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/cloudos_cli.egg-info/top_level.txt +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/setup.cfg +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/setup.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/functions_for_pytest.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/test_cli_project_create.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/test_cost/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/test_cost/test_job_cost.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/test_error_messages.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/test_logging/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/test_logging/test_logger.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.0}/tests/test_related_analyses/__init__.py +0 -0
- {cloudos_cli-2.82.1 → cloudos_cli-2.83.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.
|
|
3
|
+
Version: 2.83.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
|
|
@@ -98,6 +98,9 @@ Python package for interacting with CloudOS
|
|
|
98
98
|
- [Custom Script Path](#custom-script-path)
|
|
99
99
|
- [Custom Script Project](#custom-script-project)
|
|
100
100
|
- [Use multiple projects for files in `--parameter` option](#use-multiple-projects-for-files-in---parameter-option)
|
|
101
|
+
- [Interactive Sessions](#interactive-sessions)
|
|
102
|
+
- [List Interactive Sessions](#list-interactive-sessions)
|
|
103
|
+
- [Create Interactive Session](#create-interactive-session)
|
|
101
104
|
- [Datasets](#datasets)
|
|
102
105
|
- [List Files](#list-files)
|
|
103
106
|
- [Move Files](#move-files)
|
|
@@ -311,7 +314,14 @@ To generate a named profile, use the following command:
|
|
|
311
314
|
cloudos configure --profile {profile-name}
|
|
312
315
|
```
|
|
313
316
|
|
|
314
|
-
The same prompts will appear. If a profile with the same name already exists, the current parameters will appear in square brackets and can be overwritten or left unchanged by pressing Enter/Return.
|
|
317
|
+
The same prompts will appear, including the execution platform (aws or azure). If a profile with the same name already exists, the current parameters will appear in square brackets and can be overwritten or left unchanged by pressing Enter/Return.
|
|
318
|
+
|
|
319
|
+
When configuring a profile, you can specify:
|
|
320
|
+
- **API Key**: Your CloudOS API credentials
|
|
321
|
+
- **CloudOS URL**: The CloudOS instance URL
|
|
322
|
+
- **Project Name**: Default project for commands
|
|
323
|
+
- **Execution Platform**: `aws` (default) or `azure` - determines default instance types and available features
|
|
324
|
+
- **Repository Platform**: Version control system (github, gitlab, etc.)
|
|
315
325
|
|
|
316
326
|
> [!NOTE]
|
|
317
327
|
> When there is already at least 1 previous profile defined, a new question will appear asking to make the current profile as default
|
|
@@ -1967,6 +1977,237 @@ will take all `csv` file extensions in the specified folder.
|
|
|
1967
1977
|
|
|
1968
1978
|
---
|
|
1969
1979
|
|
|
1980
|
+
|
|
1981
|
+
|
|
1982
|
+
### Interactive Sessions
|
|
1983
|
+
|
|
1984
|
+
Interactive sessions allow you to work within the platform using different virtual environments (Jupyter Notebooks, RStudio, VS Code, etc.). You can list, monitor, and manage your interactive sessions using the CLI.
|
|
1985
|
+
|
|
1986
|
+
#### List Interactive Sessions
|
|
1987
|
+
|
|
1988
|
+
You can get a list of all interactive sessions in your workspace by running `cloudos interactive-session list`. The command can produce three different output formats that can be selected using the `--output-format` option:
|
|
1989
|
+
|
|
1990
|
+
- **stdout** (default): Displaysa table directly in the terminal with interactive pagination
|
|
1991
|
+
- **csv**: Saves session data to a CSV file with a minimum predefined set of columns by default, or all available columns using the `--all-fields` parameter
|
|
1992
|
+
- **json**: Saves complete session information to a JSON file with all available fields
|
|
1993
|
+
|
|
1994
|
+
To display the list of interactive sessions as a formatted table in the terminal:
|
|
1995
|
+
|
|
1996
|
+
```bash
|
|
1997
|
+
cloudos interactive-session list --profile my_profile
|
|
1998
|
+
# or explicitly:
|
|
1999
|
+
cloudos interactive-session list --profile my_profile --output-format stdout
|
|
2000
|
+
```
|
|
2001
|
+
|
|
2002
|
+
The table displays sessions with pagination controls (press `n` for next page, `p` for previous page, or `q` to quit):
|
|
2003
|
+
|
|
2004
|
+
```console
|
|
2005
|
+
Interactive Sessions
|
|
2006
|
+
┏━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┓
|
|
2007
|
+
┃ Status ┃ Name ┃ Type ┃ ID ┃ Owner ┃
|
|
2008
|
+
┡━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━┩
|
|
2009
|
+
│ stopped │ cloudosR │ awsRstudio │ 69aee0dba197… │ Leila │
|
|
2010
|
+
│ running │ analysis-dev │ awsJupyterNotebook │ 69ae972a18f0… │ John │
|
|
2011
|
+
│ stopped │ test_session │ awsVSCode │ 69a996c098ab… │ James │
|
|
2012
|
+
└─────────┴──────────────┴────────────────────┴───────────────┴────────┘
|
|
2013
|
+
|
|
2014
|
+
Total sessions: 15
|
|
2015
|
+
Page: 1 of 3
|
|
2016
|
+
Sessions on this page: 5
|
|
2017
|
+
|
|
2018
|
+
n = next, p = prev, q = quit
|
|
2019
|
+
```
|
|
2020
|
+
|
|
2021
|
+
To save sessions to a CSV file with all available fields:
|
|
2022
|
+
|
|
2023
|
+
```bash
|
|
2024
|
+
cloudos interactive-session list --profile my_profile --output-format csv --all-fields
|
|
2025
|
+
```
|
|
2026
|
+
|
|
2027
|
+
The expected output is something similar to:
|
|
2028
|
+
|
|
2029
|
+
```console
|
|
2030
|
+
Interactive session list saved to interactive_sessions_list.csv
|
|
2031
|
+
```
|
|
2032
|
+
|
|
2033
|
+
To save the same information in JSON format:
|
|
2034
|
+
|
|
2035
|
+
```bash
|
|
2036
|
+
cloudos interactive-session list --profile my_profile --output-format json
|
|
2037
|
+
```
|
|
2038
|
+
|
|
2039
|
+
```console
|
|
2040
|
+
Interactive session list collected with a total of 15 sessions.
|
|
2041
|
+
Interactive session list saved to interactive_sessions_list.json
|
|
2042
|
+
```
|
|
2043
|
+
|
|
2044
|
+
**Filtering Options**
|
|
2045
|
+
|
|
2046
|
+
You can filter sessions by status and other criteria:
|
|
2047
|
+
|
|
2048
|
+
```bash
|
|
2049
|
+
# Filter by status (setup, initialising, running, scheduled, stopped)
|
|
2050
|
+
cloudos interactive-session list --profile my_profile --filter-status running
|
|
2051
|
+
|
|
2052
|
+
# Show only your own sessions
|
|
2053
|
+
cloudos interactive-session list --profile my_profile --filter-only-mine
|
|
2054
|
+
|
|
2055
|
+
# Include archived sessions
|
|
2056
|
+
cloudos interactive-session list --profile my_profile --archived
|
|
2057
|
+
|
|
2058
|
+
# Custom pagination
|
|
2059
|
+
cloudos interactive-session list --profile my_profile --limit 20 --page 2
|
|
2060
|
+
```
|
|
2061
|
+
|
|
2062
|
+
**Table Columns**
|
|
2063
|
+
|
|
2064
|
+
You can customize which columns to display:
|
|
2065
|
+
|
|
2066
|
+
```bash
|
|
2067
|
+
# Display specific columns
|
|
2068
|
+
cloudos interactive-session list --profile my_profile --table-columns "status,name,owner,project,created_at,cost"
|
|
2069
|
+
```
|
|
2070
|
+
|
|
2071
|
+
Available columns: `backend`, `cost`, `cost_limit`, `created_at`, `id`, `instance`, `name`, `owner`, `project`, `resources`, `runtime`, `saved_at`, `spot`, `status`, `time_left`, `type`, `version`
|
|
2072
|
+
|
|
2073
|
+
|
|
2074
|
+
#### Create Interactive Session
|
|
2075
|
+
|
|
2076
|
+
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.
|
|
2077
|
+
|
|
2078
|
+
The command automatically loads API credentials and workspace information from your profile configuration, so you only need to specify the session-specific details.
|
|
2079
|
+
|
|
2080
|
+
**Basic Usage**
|
|
2081
|
+
|
|
2082
|
+
Create a simple Jupyter notebook session:
|
|
2083
|
+
|
|
2084
|
+
```bash
|
|
2085
|
+
cloudos interactive-session create \
|
|
2086
|
+
--profile my_profile \
|
|
2087
|
+
--name "My Analysis" \
|
|
2088
|
+
--session-type jupyter
|
|
2089
|
+
```
|
|
2090
|
+
|
|
2091
|
+
Create an RStudio session with specific R version:
|
|
2092
|
+
|
|
2093
|
+
```bash
|
|
2094
|
+
cloudos interactive-session create \
|
|
2095
|
+
--profile my_profile \
|
|
2096
|
+
--name "R Analysis" \
|
|
2097
|
+
--session-type rstudio \
|
|
2098
|
+
--r-version 4.4.2
|
|
2099
|
+
```
|
|
2100
|
+
|
|
2101
|
+
Create a VS Code session (AWS only):
|
|
2102
|
+
|
|
2103
|
+
```bash
|
|
2104
|
+
cloudos interactive-session create \
|
|
2105
|
+
--profile my_profile \
|
|
2106
|
+
--name "Development" \
|
|
2107
|
+
--session-type vscode
|
|
2108
|
+
```
|
|
2109
|
+
|
|
2110
|
+
Create a Spark cluster session with custom instance types (AWS only):
|
|
2111
|
+
|
|
2112
|
+
```bash
|
|
2113
|
+
cloudos interactive-session create \
|
|
2114
|
+
--profile my_profile \
|
|
2115
|
+
--name "Spark Analysis" \
|
|
2116
|
+
--session-type spark \
|
|
2117
|
+
--spark-master c5.2xlarge \
|
|
2118
|
+
--spark-core c5.xlarge \
|
|
2119
|
+
--spark-workers 3
|
|
2120
|
+
```
|
|
2121
|
+
|
|
2122
|
+
**Configuration Options**
|
|
2123
|
+
|
|
2124
|
+
You can customize your session with various options:
|
|
2125
|
+
|
|
2126
|
+
```bash
|
|
2127
|
+
cloudos interactive-session create \
|
|
2128
|
+
--profile my_profile \
|
|
2129
|
+
--name "Advanced Session" \
|
|
2130
|
+
--session-type jupyter \
|
|
2131
|
+
--instance c5.2xlarge \
|
|
2132
|
+
--storage 1000 \
|
|
2133
|
+
--spot \
|
|
2134
|
+
--shared \
|
|
2135
|
+
--cost-limit 50.0 \
|
|
2136
|
+
--shutdown-in 8h
|
|
2137
|
+
```
|
|
2138
|
+
|
|
2139
|
+
**Required for Each Session:**
|
|
2140
|
+
- `--name`: Session name (1-100 characters)
|
|
2141
|
+
- `--session-type`: Type of backend - `jupyter`, `vscode`, `rstudio`, or `spark` (platform dependent)
|
|
2142
|
+
|
|
2143
|
+
**Optional Configuration:**
|
|
2144
|
+
- `--instance`: Instance type (default depends on execution platform: `c5.xlarge` for AWS, `Standard_F1s` for Azure)
|
|
2145
|
+
- `--storage`: Storage in GB (default: 500, range: 100-5000)
|
|
2146
|
+
- `--spot`: Use spot instances (AWS only, cost-saving)
|
|
2147
|
+
- `--shared`: Make session accessible to workspace members
|
|
2148
|
+
- `--cost-limit`: Compute cost limit in USD (default: -1 for unlimited)
|
|
2149
|
+
- `--shutdown-in`: Auto-shutdown duration (e.g., `8h`, `2d`, `30m`)
|
|
2150
|
+
|
|
2151
|
+
**Data & Storage Management:**
|
|
2152
|
+
- `--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.
|
|
2153
|
+
- `--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.
|
|
2154
|
+
|
|
2155
|
+
**Backend-Specific:**
|
|
2156
|
+
- `--r-version`: R version for RStudio (options: `4.4.2`, `4.5.2`) - **optional for rstudio** (default: `4.4.2`)
|
|
2157
|
+
- `--spark-master`: Master instance type for Spark (default: `c5.2xlarge`)
|
|
2158
|
+
- `--spark-core`: Core instance type for Spark (default: `c5.xlarge`)
|
|
2159
|
+
- `--spark-workers`: Initial worker count for Spark (default: 1)
|
|
2160
|
+
- `--verbose`: Show detailed progress messages
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
**Data Management**
|
|
2164
|
+
|
|
2165
|
+
CloudOS CLI supports multiple ways to access data in interactive sessions, depending on your execution platform:
|
|
2166
|
+
- you can load data directly into the session (i.e. files are copied into the session's mounted-data volume)
|
|
2167
|
+
- 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.
|
|
2168
|
+
|
|
2169
|
+
|
|
2170
|
+
**Data Mounting Examples**
|
|
2171
|
+
|
|
2172
|
+
Mount a file from File Explorer:
|
|
2173
|
+
|
|
2174
|
+
```bash
|
|
2175
|
+
cloudos interactive-session create \
|
|
2176
|
+
--profile my_profile \
|
|
2177
|
+
--name "Data Analysis" \
|
|
2178
|
+
--session-type jupyter \
|
|
2179
|
+
--mount "my_project/training_data.csv"
|
|
2180
|
+
```
|
|
2181
|
+
|
|
2182
|
+
Link an S3 bucket:
|
|
2183
|
+
|
|
2184
|
+
```bash
|
|
2185
|
+
cloudos interactive-session create \
|
|
2186
|
+
--profile my_profile \
|
|
2187
|
+
--name "S3 Access" \
|
|
2188
|
+
--session-type jupyter \
|
|
2189
|
+
--link "s3://my-results-bucket/output/"
|
|
2190
|
+
```
|
|
2191
|
+
|
|
2192
|
+
|
|
2193
|
+
**Output Display**
|
|
2194
|
+
|
|
2195
|
+
The session creation output displays a success message with session details:
|
|
2196
|
+
|
|
2197
|
+
```bash
|
|
2198
|
+
cloudos interactive-session create \
|
|
2199
|
+
--profile my_profile \
|
|
2200
|
+
--name "My Session" \
|
|
2201
|
+
--session-type jupyter
|
|
2202
|
+
```
|
|
2203
|
+
|
|
2204
|
+
The output shows the session details including:
|
|
2205
|
+
- Session ID
|
|
2206
|
+
- Session name
|
|
2207
|
+
- Backend type (jupyter, vscode, rstudio, spark)
|
|
2208
|
+
- Current status (scheduled, initialising, setup, running, stopped)
|
|
2209
|
+
|
|
2210
|
+
|
|
1970
2211
|
### Datasets
|
|
1971
2212
|
|
|
1972
2213
|
Manage files and folders within your CloudOS File Explorer programmatically. These commands provide comprehensive file management capabilities for organizing research data and results.
|
|
@@ -63,6 +63,9 @@ Python package for interacting with CloudOS
|
|
|
63
63
|
- [Custom Script Path](#custom-script-path)
|
|
64
64
|
- [Custom Script Project](#custom-script-project)
|
|
65
65
|
- [Use multiple projects for files in `--parameter` option](#use-multiple-projects-for-files-in---parameter-option)
|
|
66
|
+
- [Interactive Sessions](#interactive-sessions)
|
|
67
|
+
- [List Interactive Sessions](#list-interactive-sessions)
|
|
68
|
+
- [Create Interactive Session](#create-interactive-session)
|
|
66
69
|
- [Datasets](#datasets)
|
|
67
70
|
- [List Files](#list-files)
|
|
68
71
|
- [Move Files](#move-files)
|
|
@@ -276,7 +279,14 @@ To generate a named profile, use the following command:
|
|
|
276
279
|
cloudos configure --profile {profile-name}
|
|
277
280
|
```
|
|
278
281
|
|
|
279
|
-
The same prompts will appear. If a profile with the same name already exists, the current parameters will appear in square brackets and can be overwritten or left unchanged by pressing Enter/Return.
|
|
282
|
+
The same prompts will appear, including the execution platform (aws or azure). If a profile with the same name already exists, the current parameters will appear in square brackets and can be overwritten or left unchanged by pressing Enter/Return.
|
|
283
|
+
|
|
284
|
+
When configuring a profile, you can specify:
|
|
285
|
+
- **API Key**: Your CloudOS API credentials
|
|
286
|
+
- **CloudOS URL**: The CloudOS instance URL
|
|
287
|
+
- **Project Name**: Default project for commands
|
|
288
|
+
- **Execution Platform**: `aws` (default) or `azure` - determines default instance types and available features
|
|
289
|
+
- **Repository Platform**: Version control system (github, gitlab, etc.)
|
|
280
290
|
|
|
281
291
|
> [!NOTE]
|
|
282
292
|
> When there is already at least 1 previous profile defined, a new question will appear asking to make the current profile as default
|
|
@@ -1932,6 +1942,237 @@ will take all `csv` file extensions in the specified folder.
|
|
|
1932
1942
|
|
|
1933
1943
|
---
|
|
1934
1944
|
|
|
1945
|
+
|
|
1946
|
+
|
|
1947
|
+
### Interactive Sessions
|
|
1948
|
+
|
|
1949
|
+
Interactive sessions allow you to work within the platform using different virtual environments (Jupyter Notebooks, RStudio, VS Code, etc.). You can list, monitor, and manage your interactive sessions using the CLI.
|
|
1950
|
+
|
|
1951
|
+
#### List Interactive Sessions
|
|
1952
|
+
|
|
1953
|
+
You can get a list of all interactive sessions in your workspace by running `cloudos interactive-session list`. The command can produce three different output formats that can be selected using the `--output-format` option:
|
|
1954
|
+
|
|
1955
|
+
- **stdout** (default): Displaysa table directly in the terminal with interactive pagination
|
|
1956
|
+
- **csv**: Saves session data to a CSV file with a minimum predefined set of columns by default, or all available columns using the `--all-fields` parameter
|
|
1957
|
+
- **json**: Saves complete session information to a JSON file with all available fields
|
|
1958
|
+
|
|
1959
|
+
To display the list of interactive sessions as a formatted table in the terminal:
|
|
1960
|
+
|
|
1961
|
+
```bash
|
|
1962
|
+
cloudos interactive-session list --profile my_profile
|
|
1963
|
+
# or explicitly:
|
|
1964
|
+
cloudos interactive-session list --profile my_profile --output-format stdout
|
|
1965
|
+
```
|
|
1966
|
+
|
|
1967
|
+
The table displays sessions with pagination controls (press `n` for next page, `p` for previous page, or `q` to quit):
|
|
1968
|
+
|
|
1969
|
+
```console
|
|
1970
|
+
Interactive Sessions
|
|
1971
|
+
┏━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┓
|
|
1972
|
+
┃ Status ┃ Name ┃ Type ┃ ID ┃ Owner ┃
|
|
1973
|
+
┡━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━┩
|
|
1974
|
+
│ stopped │ cloudosR │ awsRstudio │ 69aee0dba197… │ Leila │
|
|
1975
|
+
│ running │ analysis-dev │ awsJupyterNotebook │ 69ae972a18f0… │ John │
|
|
1976
|
+
│ stopped │ test_session │ awsVSCode │ 69a996c098ab… │ James │
|
|
1977
|
+
└─────────┴──────────────┴────────────────────┴───────────────┴────────┘
|
|
1978
|
+
|
|
1979
|
+
Total sessions: 15
|
|
1980
|
+
Page: 1 of 3
|
|
1981
|
+
Sessions on this page: 5
|
|
1982
|
+
|
|
1983
|
+
n = next, p = prev, q = quit
|
|
1984
|
+
```
|
|
1985
|
+
|
|
1986
|
+
To save sessions to a CSV file with all available fields:
|
|
1987
|
+
|
|
1988
|
+
```bash
|
|
1989
|
+
cloudos interactive-session list --profile my_profile --output-format csv --all-fields
|
|
1990
|
+
```
|
|
1991
|
+
|
|
1992
|
+
The expected output is something similar to:
|
|
1993
|
+
|
|
1994
|
+
```console
|
|
1995
|
+
Interactive session list saved to interactive_sessions_list.csv
|
|
1996
|
+
```
|
|
1997
|
+
|
|
1998
|
+
To save the same information in JSON format:
|
|
1999
|
+
|
|
2000
|
+
```bash
|
|
2001
|
+
cloudos interactive-session list --profile my_profile --output-format json
|
|
2002
|
+
```
|
|
2003
|
+
|
|
2004
|
+
```console
|
|
2005
|
+
Interactive session list collected with a total of 15 sessions.
|
|
2006
|
+
Interactive session list saved to interactive_sessions_list.json
|
|
2007
|
+
```
|
|
2008
|
+
|
|
2009
|
+
**Filtering Options**
|
|
2010
|
+
|
|
2011
|
+
You can filter sessions by status and other criteria:
|
|
2012
|
+
|
|
2013
|
+
```bash
|
|
2014
|
+
# Filter by status (setup, initialising, running, scheduled, stopped)
|
|
2015
|
+
cloudos interactive-session list --profile my_profile --filter-status running
|
|
2016
|
+
|
|
2017
|
+
# Show only your own sessions
|
|
2018
|
+
cloudos interactive-session list --profile my_profile --filter-only-mine
|
|
2019
|
+
|
|
2020
|
+
# Include archived sessions
|
|
2021
|
+
cloudos interactive-session list --profile my_profile --archived
|
|
2022
|
+
|
|
2023
|
+
# Custom pagination
|
|
2024
|
+
cloudos interactive-session list --profile my_profile --limit 20 --page 2
|
|
2025
|
+
```
|
|
2026
|
+
|
|
2027
|
+
**Table Columns**
|
|
2028
|
+
|
|
2029
|
+
You can customize which columns to display:
|
|
2030
|
+
|
|
2031
|
+
```bash
|
|
2032
|
+
# Display specific columns
|
|
2033
|
+
cloudos interactive-session list --profile my_profile --table-columns "status,name,owner,project,created_at,cost"
|
|
2034
|
+
```
|
|
2035
|
+
|
|
2036
|
+
Available columns: `backend`, `cost`, `cost_limit`, `created_at`, `id`, `instance`, `name`, `owner`, `project`, `resources`, `runtime`, `saved_at`, `spot`, `status`, `time_left`, `type`, `version`
|
|
2037
|
+
|
|
2038
|
+
|
|
2039
|
+
#### Create Interactive Session
|
|
2040
|
+
|
|
2041
|
+
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.
|
|
2042
|
+
|
|
2043
|
+
The command automatically loads API credentials and workspace information from your profile configuration, so you only need to specify the session-specific details.
|
|
2044
|
+
|
|
2045
|
+
**Basic Usage**
|
|
2046
|
+
|
|
2047
|
+
Create a simple Jupyter notebook session:
|
|
2048
|
+
|
|
2049
|
+
```bash
|
|
2050
|
+
cloudos interactive-session create \
|
|
2051
|
+
--profile my_profile \
|
|
2052
|
+
--name "My Analysis" \
|
|
2053
|
+
--session-type jupyter
|
|
2054
|
+
```
|
|
2055
|
+
|
|
2056
|
+
Create an RStudio session with specific R version:
|
|
2057
|
+
|
|
2058
|
+
```bash
|
|
2059
|
+
cloudos interactive-session create \
|
|
2060
|
+
--profile my_profile \
|
|
2061
|
+
--name "R Analysis" \
|
|
2062
|
+
--session-type rstudio \
|
|
2063
|
+
--r-version 4.4.2
|
|
2064
|
+
```
|
|
2065
|
+
|
|
2066
|
+
Create a VS Code session (AWS only):
|
|
2067
|
+
|
|
2068
|
+
```bash
|
|
2069
|
+
cloudos interactive-session create \
|
|
2070
|
+
--profile my_profile \
|
|
2071
|
+
--name "Development" \
|
|
2072
|
+
--session-type vscode
|
|
2073
|
+
```
|
|
2074
|
+
|
|
2075
|
+
Create a Spark cluster session with custom instance types (AWS only):
|
|
2076
|
+
|
|
2077
|
+
```bash
|
|
2078
|
+
cloudos interactive-session create \
|
|
2079
|
+
--profile my_profile \
|
|
2080
|
+
--name "Spark Analysis" \
|
|
2081
|
+
--session-type spark \
|
|
2082
|
+
--spark-master c5.2xlarge \
|
|
2083
|
+
--spark-core c5.xlarge \
|
|
2084
|
+
--spark-workers 3
|
|
2085
|
+
```
|
|
2086
|
+
|
|
2087
|
+
**Configuration Options**
|
|
2088
|
+
|
|
2089
|
+
You can customize your session with various options:
|
|
2090
|
+
|
|
2091
|
+
```bash
|
|
2092
|
+
cloudos interactive-session create \
|
|
2093
|
+
--profile my_profile \
|
|
2094
|
+
--name "Advanced Session" \
|
|
2095
|
+
--session-type jupyter \
|
|
2096
|
+
--instance c5.2xlarge \
|
|
2097
|
+
--storage 1000 \
|
|
2098
|
+
--spot \
|
|
2099
|
+
--shared \
|
|
2100
|
+
--cost-limit 50.0 \
|
|
2101
|
+
--shutdown-in 8h
|
|
2102
|
+
```
|
|
2103
|
+
|
|
2104
|
+
**Required for Each Session:**
|
|
2105
|
+
- `--name`: Session name (1-100 characters)
|
|
2106
|
+
- `--session-type`: Type of backend - `jupyter`, `vscode`, `rstudio`, or `spark` (platform dependent)
|
|
2107
|
+
|
|
2108
|
+
**Optional Configuration:**
|
|
2109
|
+
- `--instance`: Instance type (default depends on execution platform: `c5.xlarge` for AWS, `Standard_F1s` for Azure)
|
|
2110
|
+
- `--storage`: Storage in GB (default: 500, range: 100-5000)
|
|
2111
|
+
- `--spot`: Use spot instances (AWS only, cost-saving)
|
|
2112
|
+
- `--shared`: Make session accessible to workspace members
|
|
2113
|
+
- `--cost-limit`: Compute cost limit in USD (default: -1 for unlimited)
|
|
2114
|
+
- `--shutdown-in`: Auto-shutdown duration (e.g., `8h`, `2d`, `30m`)
|
|
2115
|
+
|
|
2116
|
+
**Data & Storage Management:**
|
|
2117
|
+
- `--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.
|
|
2118
|
+
- `--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.
|
|
2119
|
+
|
|
2120
|
+
**Backend-Specific:**
|
|
2121
|
+
- `--r-version`: R version for RStudio (options: `4.4.2`, `4.5.2`) - **optional for rstudio** (default: `4.4.2`)
|
|
2122
|
+
- `--spark-master`: Master instance type for Spark (default: `c5.2xlarge`)
|
|
2123
|
+
- `--spark-core`: Core instance type for Spark (default: `c5.xlarge`)
|
|
2124
|
+
- `--spark-workers`: Initial worker count for Spark (default: 1)
|
|
2125
|
+
- `--verbose`: Show detailed progress messages
|
|
2126
|
+
|
|
2127
|
+
|
|
2128
|
+
**Data Management**
|
|
2129
|
+
|
|
2130
|
+
CloudOS CLI supports multiple ways to access data in interactive sessions, depending on your execution platform:
|
|
2131
|
+
- you can load data directly into the session (i.e. files are copied into the session's mounted-data volume)
|
|
2132
|
+
- 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.
|
|
2133
|
+
|
|
2134
|
+
|
|
2135
|
+
**Data Mounting Examples**
|
|
2136
|
+
|
|
2137
|
+
Mount a file from File Explorer:
|
|
2138
|
+
|
|
2139
|
+
```bash
|
|
2140
|
+
cloudos interactive-session create \
|
|
2141
|
+
--profile my_profile \
|
|
2142
|
+
--name "Data Analysis" \
|
|
2143
|
+
--session-type jupyter \
|
|
2144
|
+
--mount "my_project/training_data.csv"
|
|
2145
|
+
```
|
|
2146
|
+
|
|
2147
|
+
Link an S3 bucket:
|
|
2148
|
+
|
|
2149
|
+
```bash
|
|
2150
|
+
cloudos interactive-session create \
|
|
2151
|
+
--profile my_profile \
|
|
2152
|
+
--name "S3 Access" \
|
|
2153
|
+
--session-type jupyter \
|
|
2154
|
+
--link "s3://my-results-bucket/output/"
|
|
2155
|
+
```
|
|
2156
|
+
|
|
2157
|
+
|
|
2158
|
+
**Output Display**
|
|
2159
|
+
|
|
2160
|
+
The session creation output displays a success message with session details:
|
|
2161
|
+
|
|
2162
|
+
```bash
|
|
2163
|
+
cloudos interactive-session create \
|
|
2164
|
+
--profile my_profile \
|
|
2165
|
+
--name "My Session" \
|
|
2166
|
+
--session-type jupyter
|
|
2167
|
+
```
|
|
2168
|
+
|
|
2169
|
+
The output shows the session details including:
|
|
2170
|
+
- Session ID
|
|
2171
|
+
- Session name
|
|
2172
|
+
- Backend type (jupyter, vscode, rstudio, spark)
|
|
2173
|
+
- Current status (scheduled, initialising, setup, running, stopped)
|
|
2174
|
+
|
|
2175
|
+
|
|
1935
2176
|
### Datasets
|
|
1936
2177
|
|
|
1937
2178
|
Manage files and folders within your CloudOS File Explorer programmatically. These commands provide comprehensive file management capabilities for organizing research data and results.
|
|
@@ -8,4 +8,4 @@ Python package for interacting with Cloud OS (https://cloudos.lifebit.ai/)
|
|
|
8
8
|
from .clos import Cloudos
|
|
9
9
|
from ._version import __version__
|
|
10
10
|
|
|
11
|
-
__all__ = ['jobs', 'utils', 'clos', 'queue', 'configure', 'datasets', 'import_wf']
|
|
11
|
+
__all__ = ['jobs', 'utils', 'clos', 'queue', 'configure', 'datasets', 'import_wf', 'interactive_session']
|
|
@@ -25,6 +25,7 @@ from cloudos_cli.procurement.cli import procurement
|
|
|
25
25
|
from cloudos_cli.datasets.cli import datasets
|
|
26
26
|
from cloudos_cli.configure.cli import configure
|
|
27
27
|
from cloudos_cli.link.cli import link
|
|
28
|
+
from cloudos_cli.interactive_session.cli import interactive_session
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
# Install the custom exception handler
|
|
@@ -63,6 +64,7 @@ run_cloudos_cli.add_command(procurement)
|
|
|
63
64
|
run_cloudos_cli.add_command(datasets)
|
|
64
65
|
run_cloudos_cli.add_command(configure)
|
|
65
66
|
run_cloudos_cli.add_command(link)
|
|
67
|
+
run_cloudos_cli.add_command(interactive_session)
|
|
66
68
|
|
|
67
69
|
if __name__ == '__main__':
|
|
68
70
|
run_cloudos_cli()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.83.0'
|