Skip to content

Commit cc83a94

Browse files
rishupkclaude
authored andcommitted
feat(mapt-provisioner): use mapt list-versions for RHEL AI version discovery
- Add AWS auto-discovery block in provision_rhelai.sh (same pattern as Azure) - Update SKILL.md: list-versions covers both providers - Bump mapt to 0.14.2 (adds aws rhel-ai list-versions) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Rishabh Kothari <rkothari@redhat.com>
1 parent 91a074d commit cc83a94

6 files changed

Lines changed: 82 additions & 103 deletions

File tree

CLAUDE.md

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This repository contains **Claudio Skills Plugin** - a Claude Code plugin that e
88

99
This plugin enables Claude Code to:
1010

11+
- **Provision and manage cloud infrastructure** using mapt for AWS and Azure (RHEL AI VMs, spot instances, GPU workloads)
1112
- **Analyze GitLab CI/CD job failures** using structured scripts for pipeline debugging
1213
- **Orchestrate Konflux production releases** with self-contained stage-to-production workflows
1314
- **Troubleshoot and analyze AWS CloudWatch Logs** for application debugging and monitoring
@@ -62,9 +63,17 @@ claudio-plugin/
6263
│ ├── run_insights_query.sh # Custom Insights queries
6364
│ ├── trace_request.sh # Cross-service request tracing
6465
│ └── tail_logs.sh # Real-time log monitoring
65-
└── gitlab-branch-manager/
66-
├── SKILL.md # GitLab branch creation and protection skill
67-
└── create_and_protect_branch.sh # Branch creation + protection
66+
├── mapt-provisioner/
67+
│ ├── SKILL.md # Cloud infrastructure provisioning skill
68+
│ └── scripts/
69+
│ ├── _common.sh # Shared helpers (backend validation, creds)
70+
│ ├── provision_rhelai.sh # RHEL AI provisioning (AWS + Azure)
71+
│ ├── provision_snc.sh # OpenShift SNC provisioning (AWS only)
72+
│ ├── destroy.sh # Tear down provisioned resources
73+
│ └── check_status.sh # Query Pulumi state for stack status
74+
├── gitlab-branch-manager/
75+
│ ├── SKILL.md # GitLab branch creation and protection skill
76+
│ └── create_and_protect_branch.sh # Branch creation + protection
6877
└── jira-utilities/
6978
├── SKILL.md # Jira utilities skill (acli-based)
7079
└── scripts/
@@ -144,6 +153,11 @@ source "$SCRIPT_DIR/../common.sh"
144153
- Used by: konflux-release skill
145154
- Supports: Linux x86_64, ARM64
146155

156+
**mapt** (`tools/mapt/install.sh`)
157+
- Installs mapt CLI + Pulumi + all required Pulumi provider plugins
158+
- Used by: mapt-provisioner skill
159+
- Supports: Linux x86_64, ARM64
160+
147161
**skopeo** (`tools/skopeo/install.sh`)
148162
- Installs skopeo via system package manager (dnf/apt/apk)
149163
- Used by: konflux-release skill
@@ -363,6 +377,25 @@ When a new version is released, Renovate automatically creates a PR to update th
363377
- Custom fields (priority, component, team, activity-type) applied via REST PATCH
364378
- CVE deduplication and release-date clustering via embedded jq analysis
365379

380+
### 6. Mapt Provisioner Skill
381+
382+
**Purpose:** Provision and manage cloud VMs and services on AWS and Azure using mapt.
383+
384+
**Use cases:**
385+
- Provision RHEL AI instances with GPU support (CUDA/ROCm)
386+
- Use spot instances for cost-effective testing
387+
- Destroy provisioned resources with state cleanup
388+
- Check stack status and retrieve connection details
389+
- List available RHEL AI versions on AWS and Azure
390+
391+
**Key features:**
392+
- Natural language intent mapping (user says "spin up RHEL AI on Azure with spot", skill handles the rest)
393+
- Automatic RHEL AI version discovery via `mapt <aws|azure> rhel-ai list-versions`
394+
- Stable-over-EA version preference with hard stop on EA-only scenarios
395+
- Spot eviction tolerance defaults tuned for GPU testing workloads
396+
- Pulumi state backend enforcement to prevent orphaned resources
397+
- mapt + Pulumi + provider plugins auto-installed via `tools/mapt/install.sh`
398+
366399
## Prerequisites
367400

368401
Each skill has its own dependencies:
@@ -395,6 +428,13 @@ Each skill has its own dependencies:
395428
- `JIRA_TOKEN` - API token from Atlassian account settings → Security → API tokens
396429
- `JIRA_EMAIL` - Your Atlassian account email
397430

431+
**Mapt Provisioner Skill:**
432+
- `mapt` - Installed automatically via `tools/mapt/install.sh`
433+
- `MAPT_BACKEND_URL` - Pulumi state backend (s3:// or azblob://)
434+
- AWS targets: `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY` (or `AWS_PROFILE`), `AWS_DEFAULT_REGION`
435+
- Azure targets: `ARM_TENANT_ID`, `ARM_SUBSCRIPTION_ID`, `ARM_CLIENT_ID`, `ARM_CLIENT_SECRET`
436+
- Azure blob backend: `AZURE_STORAGE_ACCOUNT`, `AZURE_STORAGE_KEY`
437+
398438
## Installation
399439

400440
This plugin is configured in the marketplace at `.claude-plugin/marketplace.json` and can be loaded by Claude Code from the local `claudio-plugin` directory.
@@ -742,3 +782,5 @@ Apache License 2.0 - See LICENSE file for details.
742782
## Author
743783

744784
Claudio (v0.1.0)
785+
786+
**Knowledge Graph:** A graphify graph exists at `graphify-out/`. Use `/graphify query "<question>"` for codebase questions — the graph is faster than reading files.

claudio-plugin/skills/mapt-provisioner/SKILL.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Users will ask in natural language — extract the intent and map it to script f
2323
| "tag it X=Y" / "tags X=Y,A=B" | `--tags X=Y,A=B` |
2424
| "store state in s3://..." / "backend s3://..." | set `MAPT_BACKEND_URL=s3://...` |
2525
| "destroy it" / "tear it down" / "clean up" | `destroy.sh` |
26-
| "what versions are available?" / "list images" | `get_azure_rhelai_version.sh --list` |
26+
| "what versions are available?" / "list images" | `mapt <aws\|azure> rhel-ai list-versions --accelerator <acc>` |
2727
| "check status" / "is it up?" | `check_status.sh` |
2828
| "connect to it" / "SSH in" / "run X on it" | SSH directly using conn-details |
2929

@@ -60,7 +60,6 @@ Before running any provisioning script, verify the required environment variable
6060
| AWS | `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY`, or `AWS_PROFILE` |
6161
| Azure | `ARM_TENANT_ID`, `ARM_SUBSCRIPTION_ID`, `ARM_CLIENT_ID`, `ARM_CLIENT_SECRET` (mapt maps these to `AZURE_*` internally via `setAZIdentityEnvs()`) |
6262
| Azure (azblob backend) | `AZURE_STORAGE_ACCOUNT`, `AZURE_STORAGE_KEY` |
63-
| Azure RHELAI (version auto-discovery) | `AZURE_GALLERY_RESOURCE_GROUP` — resource group mapt uses for image lookups; required when `--version` is not passed |
6463
| SNC (additionally) | `PULL_SECRET_FILE` (path to file from https://console.redhat.com/openshift/create/local) |
6564

6665
If `MAPT_BACKEND_URL` is not set, **stop and explain the orphaned-resource risk**. Do NOT proceed.
@@ -78,7 +77,7 @@ OpenShift SNC is AWS only — mapt does not support Azure for SNC.
7877

7978
| Option | Purpose |
8079
|--------|---------|
81-
| `--version` | RHELAI version (default: 3.0.0) |
80+
| `--version` | RHELAI version (auto-discovered if omitted; specify manually if discovery fails) |
8281
| `--cpus`, `--memory` | Instance size |
8382
| `--gpus` | Number of GPUs |
8483
| `--accelerator` | GPU type: `cuda` or `rocm` (mapt default: cuda) |

claudio-plugin/skills/mapt-provisioner/scripts/_common.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# ARM_CLIENT_SECRET - Azure credential (for Azure targets)
1515
# AZURE_STORAGE_ACCOUNT - Azure storage account name (for azblob state backend)
1616
# AZURE_STORAGE_KEY - Azure storage account key (for azblob state backend)
17-
# AZURE_GALLERY_RESOURCE_GROUP - Resource group mapt uses for image lookups (for Azure version auto-discovery)
1817
# PULL_SECRET_FILE - Path to OpenShift pull secret (for SNC targets)
1918

2019
SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

claudio-plugin/skills/mapt-provisioner/scripts/get_azure_rhelai_version.sh

Lines changed: 0 additions & 93 deletions
This file was deleted.

claudio-plugin/skills/mapt-provisioner/scripts/provision_rhelai.sh

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ usage() {
3636
echo "Options:"
3737
echo " --provider Cloud provider: aws or azure (required)"
3838
echo " --project-name Stack identifier (default: auto-generated)"
39-
echo " --version RHELAI version (azure: auto-discovered; aws: mapt default)"
39+
echo " --version RHELAI version (auto-discovered for both aws and azure)"
4040
echo " --cpus Number of CPUs"
4141
echo " --memory Memory in GiB"
4242
echo " --gpus Number of GPUs"
@@ -87,7 +87,14 @@ fi
8787
if [[ "$PROVIDER" == "azure" && -z "$VERSION" ]]; then
8888
echo "Discovering latest RHEL AI version in Azure gallery..."
8989
ACCEL_ARG="${ACCELERATOR:-cuda}"
90-
VERSION=$("$SCRIPT_DIR/get_azure_rhelai_version.sh" --accelerator "$ACCEL_ARG")
90+
VERSIONS=$(mapt azure rhel-ai list-versions --accelerator "$ACCEL_ARG")
91+
if [[ -z "${VERSIONS//[[:space:]]/}" ]]; then
92+
echo "ERROR: no Azure RHEL AI versions returned for accelerator '${ACCEL_ARG}'." >&2
93+
exit 1
94+
fi
95+
# Prefer stable (non-EA); fall back to EA only if no stable exists.
96+
STABLE=$(echo "$VERSIONS" | { grep -v "\-ea" || true; } | tail -1)
97+
VERSION="${STABLE:-$(echo "$VERSIONS" | tail -1)}"
9198
echo " Found version: $VERSION"
9299
if [[ "$VERSION" == *"-ea"* ]]; then
93100
echo "" >&2
@@ -101,6 +108,31 @@ if [[ "$PROVIDER" == "azure" && -z "$VERSION" ]]; then
101108
fi
102109
fi
103110

111+
# For AWS, discover the latest available AMI version when not specified
112+
if [[ "$PROVIDER" == "aws" && -z "$VERSION" ]]; then
113+
echo "Discovering latest RHEL AI version in AWS..."
114+
ACCEL_ARG="${ACCELERATOR:-cuda}"
115+
VERSIONS=$(mapt aws rhel-ai list-versions --accelerator "$ACCEL_ARG")
116+
if [[ -z "${VERSIONS//[[:space:]]/}" ]]; then
117+
echo "ERROR: no AWS RHEL AI versions returned for accelerator '${ACCEL_ARG}'." >&2
118+
exit 1
119+
fi
120+
# Prefer stable (non-EA); fall back to EA only if no stable exists.
121+
STABLE=$(echo "$VERSIONS" | { grep -v "\-ea" || true; } | tail -1)
122+
VERSION="${STABLE:-$(echo "$VERSIONS" | tail -1)}"
123+
echo " Found version: $VERSION"
124+
if [[ "$VERSION" == *"-ea"* ]]; then
125+
echo "" >&2
126+
echo "ERROR: Only Early Access (EA) versions are available for accelerator '${ACCEL_ARG}' in AWS." >&2
127+
echo " Discovered version: $VERSION" >&2
128+
echo "" >&2
129+
echo " EA versions are pre-release and may cause failures. Options:" >&2
130+
echo " 1. Use a different accelerator: --accelerator rocm" >&2
131+
echo " 2. Proceed explicitly: --version $VERSION --accelerator $ACCEL_ARG" >&2
132+
exit 1
133+
fi
134+
fi
135+
104136
if [[ -z "$PROJECT_NAME" ]]; then
105137
PROJECT_NAME=$(generate_project_name "rhelai")
106138
fi

claudio-plugin/tools/mapt/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ source "$SCRIPT_DIR/../common.sh"
2525
# ============================================================================
2626

2727
# renovate: datasource=github-releases depName=redhat-developer/mapt
28-
MAPT_VERSION="0.14.1"
28+
MAPT_VERSION="0.14.2"
2929

3030
# renovate: datasource=github-releases depName=pulumi/pulumi
3131
PULUMI_VERSION="3.234.0"

0 commit comments

Comments
 (0)