Skip to main content

Launch H2O-3

A composite action that creates an H2O-3 cluster through AI Engine Manager, blocks until it is ready, and returns the cluster's API URL as an output — later steps in the calling job can connect to it directly. Authentication is handled via the auto-injected H2O_CLOUD_CLIENT_PLATFORM_TOKEN so there is no need to pass credentials (the runner already has them).

Because the action runs inline, it also leaves the h2o-engine-manager client installed in the job, so later steps can import it to talk to the cluster.

Every input except engine_id is optional: leave them empty and the engine inherits the default values from the selected profile.

Action​

id: launch-h2o3
name: Launch H2O-3 Instance

inputs:
engine_id:
type: string
required: true
description: "Engine ID — used to connect to the engine from subsequent steps"

display_name:
type: string
required: false
default: ""
description: "Human-readable engine name"

node_count:
type: string
required: false
default: ""
description: "Cluster node count (default from profile)"

cpu:
type: string
required: false
default: ""
description: "CPU units per node (default from profile)"

memory:
type: string
required: false
default: ""
description: "Memory per node, e.g. 8Gi (default from profile)"

max_idle_duration:
type: string
required: false
default: ""
description: "Auto-terminate after idle, e.g. 30m, 2h (default from profile)"

max_running_duration:
type: string
required: false
default: ""
description: "Max running time, e.g. 12h (default from profile)"

version:
type: string
required: false
default: ""
description: "H2O-3 version resource name (default: latest)"

profile:
type: string
required: false
default: ""
description: "H2O-3 profile resource name (default: first available)"

outputs:
engine_url:
description: "API URL of the ready cluster"
value: ${{ .steps.launch.outputs.engine_url }}

steps:
- name: Install AIEM client
run: sudo uv pip install --system h2o-engine-manager

- id: launch
name: Launch H2O-3 engine
timeout: "30m"
env:
ENGINE_ID: ${{ .inputs.engine_id }}
DISPLAY_NAME: ${{ .inputs.display_name }}
NODE_COUNT: ${{ .inputs.node_count }}
CPU: ${{ .inputs.cpu }}
MEMORY: ${{ .inputs.memory }}
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('NODE_COUNT'):
kwargs['node_count'] = int(os.environ['NODE_COUNT'])
if os.environ.get('CPU'):
kwargs['cpu'] = int(os.environ['CPU'])
if os.environ.get('MEMORY'):
kwargs['memory_bytes'] = os.environ['MEMORY']
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['h2o_engine_version'] = os.environ['VERSION']
if os.environ.get('PROFILE'):
kwargs['profile'] = os.environ['PROFILE']

engine = clients.h2o_engine_client.create_engine(**kwargs)
print(f'Engine created: {engine.name}')

print('Waiting for engine to become ready...')
engine.wait()

print('Engine is ready')
print(f'Engine URL: {engine.api_url}')

with open(os.environ['H2O_WORKFLOWS_OUTPUT'], 'a') as f:
f.write(f'engine_url={engine.api_url}\n')
"

Publish the action to make it callable from workflows.

Use it from your workflow​

Give the uses step an id to read the cluster URL in later steps of the same job:

id: train-with-h2o3
name: Train with H2O-3

jobs:
train:
timeout: "1h" # must cover the cluster launch wait (up to 30m)
steps:
- uses: <workspace-id>:launch-h2o3@latest
id: h2o3
with:
engine_id: "my-h2o3-cluster"

- name: Use the cluster
env:
H2O3_URL: ${{ .steps.h2o3.outputs.engine_url }}
run: echo "H2O-3 is ready at $H2O3_URL"

Add display_name, node_count, cpu, memory, and other optional inputs listed above as needed to override profile defaults.


Feedback