# nvidia-runai-vscode-extension
**Repository Path**: mirrors_Azure/nvidia-runai-vscode-extension
## Basic Information
- **Project Name**: nvidia-runai-vscode-extension
- **Description**: Nvidia Run:ai VSCode extension
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-10-07
- **Last Updated**: 2026-03-31
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Run:AI VSCode Extension
Manage Run:AI workloads, projects, and clusters directly from VSCode. Built for AI Engineers, Platform Engineers, and ML Researchers.
  
> [!NOTE]
> This extension is currently a work in progress. The Run:AI Azure Marketplace offer will launch soon!
## π Features
- β
**View & Manage Workloads** - Browse, submit, and delete workspaces and training jobs
- π― **Project Browser** - View all projects and departments
- π₯οΈ **Cluster Monitor** - Track connected clusters
- π **Real-time Status** - Color-coded workload indicators (π’ Running, π‘ Pending, π΄ Failed, β
Completed)
- π **Quick Refresh** - One-click updates for all views
- π **Detailed Views** - Comprehensive workload information with resource allocation
- π **GPU Support** - Specify GPU requirements for workloads

## π¦ Installation
**From Source:**
```bash
git clone https://github.com/Azure/nvidia-runai-vscode-extension.git
cd runai-vscode-extension
npm install
npm run compile
code . # Open in VSCode, then press F5 to test
```
**From VSIX:** Extensions view (Ctrl+Shift+X) β "..." menu β "Install from VSIX..."
## βοΈ Configuration
**Quick Setup:**
1. Ctrl+Shift+P β `Run:AI: Configure API Settings`
2. Enter API URL: `https://app.run.ai`
3. Enter API Token
**Or via Settings:**
```json
{
"runai.apiUrl": "https://app.run.ai",
"runai.token": "your-api-token-here"
}
```
## π Usage
**Quick Start:**
1. Click Run:AI icon in Activity Bar
2. See three views: **Workloads**, **Projects**, **Clusters**
3. Click β to submit a workspace or training job
**Submit Workspace:**
- Click β in Workloads view
- Or Ctrl+Shift+P β `Run:AI: Submit Workspace`
- Select project, enter name, image, GPU count
**View Details:** Click any workload to see status, resources, and metadata
**Delete:** Right-click workload β "Delete Workload"
**Refresh:** Click π in any view toolbar
## π― Commands
Access all commands via Command Palette (Ctrl+Shift+P):
| Command | Description |
|---------|-------------|
| `Run:AI: Configure API Settings` | Set up API URL and authentication token |
| `Run:AI: Submit Workspace` | Create a new interactive workspace |
| `Run:AI: Submit Training Job` | Launch a new training workload |
| `Run:AI: Delete Workload` | Remove a workload (requires confirmation) |
| `Run:AI: List All Workloads` | View all workloads in a quick pick menu |
| `Run:AI: Refresh Workloads` | Reload the workloads view |
| `Run:AI: Refresh Projects` | Reload the projects view |
| `Run:AI: Refresh Clusters` | Reload the clusters view |
## ποΈ Architecture
### User Flow
```mermaid
flowchart TD
Start([User Opens VSCode]) --> Check{Configured?}
Check -->|No| Wizard[Getting Started Wizard]
Check -->|Yes| Load[Load Extension]
Wizard --> Configure[Enter API URL & Token]
Configure --> Load
Load --> Show[Show Tree Views]
Show --> Trees[Workloads, Projects, Clusters]
Trees --> Action{User Action}
Action -->|Click +| CheckAPI{API Configured?}
CheckAPI -->|No| Configure
CheckAPI -->|Yes| Submit[Submit Workspace/Training]
Action -->|Click Item| Details[Show Details Panel]
Action -->|Right-click| Menu[Context Menu]
Action -->|Refresh| Fetch[Fetch from API]
Submit --> API[Run:AI REST API]
Details --> Display[Display in Webview]
Menu --> Delete[Delete Workload]
Delete --> API
Fetch --> API
API --> Update[Update Tree Views]
Update --> Trees
style Start fill:#9C27B0,stroke:#333,stroke-width:2px,color:#fff
style API fill:#FF9800,stroke:#333,stroke-width:2px,color:#fff
style Load fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff
style Configure fill:#2196F3,stroke:#333,stroke-width:2px,color:#fff
```
### Component Architecture
```mermaid
graph TB
subgraph "VSCode Extension Host"
subgraph "Extension Core"
EXT[Extension.ts
Entry Point]
CONFIG[Configuration
Management]
COMMANDS[Command
Registry]
end
subgraph "API Layer"
CLIENT[RunAI Client
Axios HTTP]
AUTH[Authentication
Bearer Token]
end
subgraph "UI Providers"
WP[Workloads
TreeProvider]
PP[Projects
TreeProvider]
CP[Clusters
TreeProvider]
end
subgraph "VSCode UI"
ACTBAR[Activity Bar
Run:AI Icon]
TREE[Tree Views]
WEBVIEW[Webview Panels]
CMDPAL[Command Palette]
end
end
subgraph "Run:AI Platform"
API[Run:AI REST API]
WORKLOADS[Workloads Service]
PROJECTS[Projects Service]
CLUSTERS[Clusters Service]
end
USER[User] -->|Clicks/Commands| ACTBAR
USER -->|Opens| CMDPAL
ACTBAR --> TREE
TREE --> WP
TREE --> PP
TREE --> CP
CMDPAL --> COMMANDS
COMMANDS --> EXT
WP -->|Fetch Data| CLIENT
PP -->|Fetch Data| CLIENT
CP -->|Fetch Data| CLIENT
COMMANDS -->|Submit/Delete| CLIENT
EXT --> CONFIG
CONFIG -->|API URL & Token| AUTH
CLIENT --> AUTH
AUTH -->|HTTPS| API
API --> WORKLOADS
API --> PROJECTS
API --> CLUSTERS
WP -->|Display Details| WEBVIEW
style EXT fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff
style CLIENT fill:#2196F3,stroke:#333,stroke-width:2px,color:#fff
style API fill:#FF9800,stroke:#333,stroke-width:2px,color:#fff
style USER fill:#9C27B0,stroke:#333,stroke-width:2px,color:#fff
```
### Workspace Submission Flow
```mermaid
sequenceDiagram
participant User
participant VSCode
participant Extension
participant APIClient
participant RunAI
User->>VSCode: Click "Submit Workspace"
VSCode->>Extension: Trigger command
Extension->>User: Prompt for project
User->>Extension: Select project
Extension->>User: Prompt for name/image/GPU
User->>Extension: Enter details
Extension->>APIClient: submitWorkspace()
APIClient->>RunAI: POST /api/v1/workloads/workspaces
RunAI-->>APIClient: 200 OK
APIClient-->>Extension: Workload created
Extension->>VSCode: Refresh tree view
Extension->>User: Show success message
```
### Security & Authentication
```mermaid
graph LR
USER[User] -->|Configure| CONFIG[VSCode Settings]
CONFIG -->|Store Encrypted| TOKEN[API Token]
TOKEN -->|Load| CLIENT[API Client]
CLIENT -->|Bearer Auth| HTTPS[HTTPS Request]
HTTPS -->|TLS| API[Run:AI API]
style TOKEN fill:#f44336,stroke:#333,stroke-width:2px,color:#fff
style HTTPS fill:#4CAF50,stroke:#333,stroke-width:2px,color:#fff
```
## π§ Development
**Prerequisites:** Node.js 16+, npm 8+, VSCode 1.104+
**Setup:**
```bash
git clone https://github.com/Azure/nvidia-runai-vscode-extension.git
cd runai-vscode-extension
npm install
npm run compile # or `npm run watch` for auto-compile
```
**Test:** Press F5 in VSCode to launch Extension Development Host
**Package:**
```bash
npm install -g @vscode/vsce
vsce package
```
## π API Integration
**Endpoints Used:**
- `GET /api/v1/workloads` - List workloads
- `POST /api/v1/workloads/workspaces` - Submit workspace
- `POST /api/v1/workloads/trainings` - Submit training
- `DELETE /api/v1/workloads/{id}` - Delete workload
- `GET /api/v1/projects` - List projects
- `GET /api/v1/clusters` - List clusters
**Docs:** [Run:AI API Documentation](https://api-docs.run.ai/latest/)
## π€ Contributing
1. Fork the repo
2. Create feature branch: `git checkout -b feature/amazing-feature`
3. Commit changes: `git commit -m 'Add amazing feature'`
4. Push: `git push origin feature/amazing-feature`
5. Open Pull Request
**Code Style:** TypeScript best practices, ESLint (`npm run lint`)
## π Troubleshooting
**Extension not visible:** Reload VSCode (Ctrl+Shift+P β "Developer: Reload Window")
**"Run:AI client not initialized":** Run `Run:AI: Configure API Settings` and enter API URL + token
**Workloads not loading:** Click refresh (π) or check network connectivity to Run:AI API
**API connection issues:** Verify `runai.apiUrl` in settings and check firewall/proxy settings
## π License
MIT License - see [LICENSE](LICENSE)
## π Support
- [GitHub Issues](https://github.com/Azure/nvidia-runai-vscode-extension/issues)
- [Run:AI Documentation](https://docs.run.ai/)
- Run:AI support for API issues
## πΊοΈ Roadmap
- [ ] Real-time status updates & polling
- [ ] Workload logs viewer
- [ ] Port forwarding for workspaces
- [ ] GPU utilization metrics
- [ ] Workload templates
- [ ] Multi-cluster switching
- [ ] SSH & Jupyter integration
- [ ] TensorBoard integration
## πΈ Screenshots
### Extension Views

The Run:AI icon appears in the Activity Bar, providing three main views:
**Workloads View:**
```
Run:AI
ββ Workloads
ββ π’ my-training-job (Running - team-ml)
ββ π‘ data-processing (Pending - team-data)
ββ β
model-evaluation (Completed - team-ml)
```
**Projects View:**
```
ββ Projects
ββ π team-ml (ML Department)
ββ π team-data (Data Science)
ββ π team-research (Research)
```
**Clusters View:**
```
ββ Clusters
ββ π₯οΈ production-cluster (https://prod.run.ai)
ββ π₯οΈ staging-cluster (https://staging.run.ai)
```
### Workload Details Panel
When clicking a workload, a detailed webview displays:
```
ββββββββββββββββββββββββββββββββββββββββ
β my-training-job β
β β
β Status: π’ Running β
β Type: Training β
β Project: team-ml β
β Created: 2025-10-06 10:30:00 β
β β
β Resources β
β GPU: 2 β
β CPU: 4 cores β
β GPU Memory: 16Gi β
β CPU Memory: 32Gi β
ββββββββββββββββββββββββββββββββββββββββ
```
---
**Made with β€οΈ for AI Engineers, Platform Engineers, and ML Researchers**