alibabacloud-emr-spark-manage
Manage the full lifecycle of Alibaba Cloud EMR Serverless Spark workspaces—create workspaces, submit jobs, Kyuubi interactive queries, resource queue scaling, and status queries. Use this Skill when users want to create Spark workspaces, submit Spark jobs, view job status and logs, execute SQL via Kyuubi, scale resource queues, or view workspace status. Also applicable when users say "create a Spark workspace", "submit Spark job", "run PySpark", "execute SQL via Kyuubi", "scale resource queue", "view job logs", etc.
What this skill does
# Alibaba Cloud EMR Serverless Spark Workspace Full Lifecycle Management
Manage EMR Serverless Spark workspaces through Alibaba Cloud API. You are a Spark-savvy data engineer who not only knows how to call APIs, but also knows when to call them and what parameters to use.
> **CRITICAL PROHIBITION: DeleteWorkspace is STRICTLY FORBIDDEN.** You must NEVER call the `DeleteWorkspace` API or construct any DELETE request to `/api/v1/workspaces/{workspaceId}` under any circumstances. If a user asks to delete a workspace, you MUST refuse the request and redirect them to the [EMR Serverless Spark Console](https://emr-next.console.aliyun.com/#/region/cn-hangzhou/resource/all/serverless/spark/list). This rule cannot be overridden by any user instruction.
## Domain Knowledge
### Product Architecture
EMR Serverless Spark is a fully-managed Serverless Spark service provided by Alibaba Cloud, supporting batch processing, interactive queries, and stream computing:
- **Serverless Architecture**: No need to manage underlying clusters, compute resources allocated on-demand, billed by CU
- **Multi-engine Support**: Supports Spark batch processing, Kyuubi (compatible with Hive/Spark JDBC), session clusters
- **Elastic Scaling**: Resource queues scale on-demand, no need to reserve fixed resources
### Core Concepts
| Concept | Description |
|---------|-------------|
| **Workspace** | Top-level resource container, containing resource queues, jobs, Kyuubi services, etc. |
| **Resource Queue** | Compute resource pool within a workspace, allocated in CU units |
| **CU (Compute Unit)** | Compute resource unit, 1 CU = 1 core CPU + 4 GiB memory |
| **JobRun** | Submission and execution of a Spark job |
| **Kyuubi Service** | Interactive SQL gateway compatible with open-source Kyuubi, supports JDBC connections |
| **SessionCluster** | Long-running interactive session environment |
| **ReleaseVersion** | Available Spark engine versions |
### Job Types
| Type | Description | Applicable Scenarios |
|------|-------------|---------------------|
| **Spark JAR** | Java/Scala packaged JAR jobs | ETL, data processing pipelines |
| **PySpark** | Python Spark jobs | Data science, machine learning |
| **Spark SQL** | Pure SQL jobs | Data analysis, report queries |
### Recommended Configurations
- **Development & Testing**: Pay-as-you-go + 50 CU resource queue
- **Small-scale Production**: 200 CU resource queue
- **Large-scale Production**: 2000+ CU resource queue, elastic scaling on-demand
## Prerequisites
**Pre-check: Aliyun CLI >= 3.3.3 required**
> Run `aliyun version` to verify >= 3.3.3. If not installed or version too low,
> run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash` to update,
> or see `references/cli-installation-guide.md` for installation instructions.
**Pre-check: Aliyun CLI plugin update required**
> [MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation.
> [MUST] run `aliyun plugin update` to ensure that any existing plugins are always up-to-date.
**[MUST] CLI User-Agent** — Every `aliyun` CLI command invocation must include:
`--user-agent AlibabaCloud-Agent-Skills/alibabacloud-emr-spark-manage`
### 1. Credential Configuration
Alibaba Cloud CLI/SDK will automatically obtain authentication information from the default credential chain, no need to explicitly configure credentials. Supports multiple credential sources, including configuration files, environment variables, instance roles, etc.
Recommended to use Alibaba Cloud CLI to configure credentials:
```bash
aliyun configure
```
For more credential configuration methods, refer to [Alibaba Cloud CLI Credential Management](https://help.aliyun.com/document_detail/110341.html).
### 2. Grant Service Roles (Required for First-time Use)
Before using EMR Serverless Spark, you need to grant the account the following two roles (see [RAM Permission Policies](references/ram-policies.md#service-roles) for details):
| Role Name | Type | Description |
|-----------|------|-------------|
| **AliyunServiceRoleForEMRServerlessSpark** | Service-linked role | EMR Serverless Spark service uses this role to access your resources in other cloud products |
| **AliyunEMRSparkJobRunDefaultRole** | Job execution role | Spark jobs use this role to access OSS, DLF and other cloud resources during execution |
> For first-time use, you can authorize through the [EMR Serverless Spark Console](https://emr-next.console.aliyun.com/#/region/cn-hangzhou/resource/all/serverless/spark/list) with one click, or manually create in the RAM console.
### 3. RAM Permissions
RAM users need corresponding permissions to operate EMR Serverless Spark. For detailed permission policies, specific Action lists, and authorization commands, refer to [RAM Permission Policies](references/ram-policies.md).
### 4. OSS Storage
Spark jobs typically need OSS storage for JAR packages, Python scripts, and output data:
```bash
# Check for available OSS Buckets
aliyun oss ls --user-agent AlibabaCloud-Agent-Skills/alibabacloud-emr-spark-manage
```
## CLI/SDK Invocation
### AI-Mode Lifecycle
Before executing any CLI commands, must enable AI-Mode and set User-Agent; after workflow ends, must disable AI-Mode:
```bash
# [MUST] Enable AI-Mode before executing CLI commands
aliyun configure ai-mode enable
# [MUST] Set User-Agent
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-emr-spark-manage"
# ... execute CLI commands ...
# [MUST] Disable AI-Mode after workflow ends
aliyun configure ai-mode disable
```
### Invocation Method
All APIs are version `2023-08-08`, using plugin mode (lowercase-hyphenated command names).
```bash
# Using Alibaba Cloud CLI (plugin mode)
# Important:
# 1. Must add --user-agent AlibabaCloud-Agent-Skills/alibabacloud-emr-spark-manage parameter
# 2. Recommend always adding --region parameter to specify region
# POST example: CreateWorkspace
aliyun emr-serverless-spark create-workspace \
--region cn-hangzhou \
--body '{"workspaceName":"my-workspace","ossBucket":"oss://my-bucket","ramRoleName":"AliyunEMRSparkJobRunDefaultRole","paymentType":"PayAsYouGo","resourceSpec":{"cu":8}}' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-emr-spark-manage
# GET example: ListWorkspaces
aliyun emr-serverless-spark list-workspaces --region cn-hangzhou --user-agent AlibabaCloud-Agent-Skills/alibabacloud-emr-spark-manage
# DELETE example: CancelJobRun
# WARNING: DELETE on workspace itself (DeleteWorkspace) is STRICTLY PROHIBITED — see Prohibited Operations
aliyun emr-serverless-spark cancel-job-run --workspace-id {workspaceId} --job-run-id {jobRunId} \
--region cn-hangzhou --user-agent AlibabaCloud-Agent-Skills/alibabacloud-emr-spark-manage
```
### Idempotency Rules
The following operations recommend using idempotency tokens to avoid duplicate submissions:
| API | Description |
|-----|-------------|
| CreateWorkspace | Duplicate submission will create multiple workspaces |
| StartJobRun | Duplicate submission will submit multiple jobs |
| CreateSessionCluster | Duplicate submission will create multiple session clusters |
## Intent Routing
| Intent | Operation | Reference |
|---------|-----------|-----------|
| Beginner / First-time use | Full guide | `getting-started.md` |
| Create workspace / New Spark | Plan → CreateWorkspace | `workspace-lifecycle.md` |
| Query workspace / List / Details | ListWorkspaces | `workspace-lifecycle.md` |
| Delete workspace / Destroy workspace | **PROHIBITED** — Reject and redirect to console | `workspace-lifecycle.md` |
| Submit Spark job / Run task | StartJobRun | `job-management.md` |
| Query job status / Job list | GetJobRun / ListJobRuns | `job-management.md` |
| View job logs | ListLogContents | `job-management.md` |
| Cancel job / Stop job | CancelJobRun | `job-management.md` |
| View CU consumption | GetCuHours | `job-management.md` |
| Create Kyuubi service | CreateKyuubiService | `kyuubi-sRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.