Create an IDE Engine
This guide explains what an IDE Engine is and how to create one with the Python client.
What is an IDE Engine?
An IDE Engine is a browser-based VS Code editor (code-server) that runs as your own engine in H2O AI Cloud. It provides:
- The VS Code editor, terminal, and pinned extensions in the browser
- Python with the H2O client libraries, Wave, and the
h2oCLI. The Python clients call H2O AI Cloud as you without a separate login: the engine gets your platform token when you create it and a fresh one each time you resume it. Theh2oCLI still needs a one-timeh2o config update-platform-token. - A persistent home directory (
/home/h2o) that keeps your files, settings, and Git configuration across pause and resume - Configurable CPU, GPU, memory, storage, and timeout settings, within the limits of an IDE Engine profile
Prerequisites
Before you create an IDE Engine, make sure that:
- You have the Python client installed. See Python client installation.
- You need at least the IDE Engine User role (
enginemanager-ide-engine-user) assigned in the target workspace. See RBAC roles and permissions for the full role breakdown. - An administrator has created at least one IDE Engine profile assigned to you and one enabled IDE Engine image. See IDE Engine profiles.
- AI Engine Manager is deployed with the Gateway API (
gateway.enabled: truein the Helm chart). The engine's URL is served through an HTTPRoute that AI Engine Manager creates for each engine, so IDE Engines can't be opened on a deployment that uses Ambassador.
Create an IDE Engine
import h2o_engine_manager
from h2o_engine_manager.clients.ide_engine.engine import IDEEngine
aiem = h2o_engine_manager.login()
ide_engine_client = aiem.ide_engine_client
engine = ide_engine_client.create_ide_engine(
parent="workspaces/<workspace-id>",
ide_engine=IDEEngine(
profile="workspaces/global/ideEngineProfiles/development",
ide_engine_image="workspaces/global/ideEngineImages/vscode-0-1-0",
display_name="My IDE",
),
ide_engine_id="my-ide",
)
# Wait until the engine stops starting; it's then RUNNING, or FAILED if it couldn't start.
engine = ide_engine_client.wait(name=engine.name, timeout_seconds=600)
print(engine.state)
profile and ide_engine_image are required. Every other setting is optional and takes the profile's default when you leave it unset:
| Field | Description |
|---|---|
display_name | Human-readable name, up to 63 characters |
cpu | Number of CPU units |
gpu | Number of GPU units |
memory_bytes | Memory, for example "8Gi" |
storage_bytes | Size of the persistent home directory, for example "20Gi". You can grow it later; it can't shrink |
max_idle_duration | How long the editor can be idle before the engine pauses, for example "2h" |
max_running_duration | How long the engine can run before it pauses, for example "8h" |
The values must be within the profile's constraints; otherwise, the request fails with a validation error that names the field and the limit.
Engine ID guidelines
- Must start with a lowercase letter
- Must end with a lowercase letter or digit
- Can contain only lowercase letters, digits, or dashes (-)
- Min length: 1 char, Max length: 63 chars
Idle and running limits
An IDE Engine pauses itself in two cases:
- Idle: when nobody has used the editor for longer than
max_idle_duration, the editor shuts down and AI Engine Manager pauses the engine. - Running: when the engine has run longer than
max_running_durationsince it last started, AI Engine Manager pauses it.
Pausing keeps your home directory. Resume the engine to continue where you left off. See Manage an IDE Engine.
Feedback
- Submit and view feedback for this page
- Send feedback about AI Engine Manager to cloud-feedback@h2o.ai