Launch Driverless AI
A callable workflow that creates a Driverless AI engine through AI Engine Manager, then blocks until it reaches STATE_RUNNING. Authenticates with the auto-injected H2O_CLOUD_CLIENT_PLATFORM_TOKEN — you don't pass credentials, the runner already has them.
Every input except engine_id is optional: leave them empty and the engine inherits the values from the selected profile.
Workflow
id: launch-dai
name: Launch Driverless AI Instance
trigger:
callable: true
inputs:
engine_id:
type: string
required: true
description: "Engine ID — used to connect to the engine from subsequent jobs"
display_name:
type: string
required: false
default: ""
description: "Human-readable engine name"
cpu:
type: string
required: false
default: ""
description: "CPU units (default from profile)"
gpu:
type: string
required: false
default: ""
description: "GPU units (default from profile)"
memory:
type: string
required: false
default: ""
description: "Memory allocation, e.g. 32Gi (default from profile)"
storage:
type: string
required: false
default: ""
description: "Storage allocation, e.g. 64Gi (default from profile)"
max_idle_duration:
type: string
required: false
default: ""
description: "Auto-pause after idle, e.g. 30m, 2h (default from profile)"
max_running_duration:
type: string
required: false
default: ""
description: "Max running time, e.g. 12h, 2d (default from profile)"
version:
type: string
required: false
default: ""
description: "DAI version resource name, e.g. workspaces/global/daiEngineVersions/1.11.23 (default: latest)"
profile:
type: string
required: false
default: ""
description: "DAI profile resource name, e.g. workspaces/global/daiEngineProfiles/default (default: first available)"
jobs:
launch-dai:
name: Launch DAI instance
timeout: "30m"
steps:
- name: Install AIEM client
run: sudo uv pip install --system h2o-engine-manager
- name: Launch DAI engine
env:
ENGINE_ID: ${{ .inputs.engine_id }}
DISPLAY_NAME: ${{ .inputs.display_name }}
CPU: ${{ .inputs.cpu }}
GPU: ${{ .inputs.gpu }}
MEMORY: ${{ .inputs.memory }}
STORAGE: ${{ .inputs.storage }}
MAX_IDLE: ${{ .inputs.max_idle_duration }}
MAX_RUNNING: ${{ .inputs.max_running_duration }}
VERSION: ${{ .inputs.version }}
PROFILE: ${{ .inputs.profile }}
run: |
python3 -c "
import os
import h2o_engine_manager
clients = h2o_engine_manager.login(
platform_token=os.environ['H2O_CLOUD_CLIENT_PLATFORM_TOKEN'],
)
kwargs = {'engine_id': os.environ['ENGINE_ID']}
if os.environ.get('DISPLAY_NAME'):
kwargs['display_name'] = os.environ['DISPLAY_NAME']
if os.environ.get('CPU'):
kwargs['cpu'] = int(os.environ['CPU'])
if os.environ.get('GPU'):
kwargs['gpu'] = int(os.environ['GPU'])
if os.environ.get('MEMORY'):
kwargs['memory_bytes'] = os.environ['MEMORY']
if os.environ.get('STORAGE'):
kwargs['storage_bytes'] = os.environ['STORAGE']
if os.environ.get('MAX_IDLE'):
kwargs['max_idle_duration'] = os.environ['MAX_IDLE']
if os.environ.get('MAX_RUNNING'):
kwargs['max_running_duration'] = os.environ['MAX_RUNNING']
if os.environ.get('VERSION'):
kwargs['dai_engine_version'] = os.environ['VERSION']
if os.environ.get('PROFILE'):
kwargs['profile'] = os.environ['PROFILE']
engine = clients.dai_engine_client.create_engine(**kwargs)
print(f'Engine created: {engine.engine_id}')
print(f'State: {engine.state.value}')
print('Waiting for engine to become ready...')
engine.wait()
print(f'Engine is ready: {engine.state.value}')
print(f'Engine URL: {engine.api_url}')
"
Calling it from your workflow
jobs:
start-dai:
workflow:
name: launch-dai
inputs:
engine_id: "my-dai-engine"
Add display_name, cpu, gpu, memory, etc. as needed to override profile defaults.
Feedback
- Submit and view feedback for this page
- Send feedback about H2O Workflows to cloud-feedback@h2o.ai