Skip to content
Cloud & Infrastructure
Skill

/alibabacloud-emr-spark-manage

Spark job execution role, used to access OSS, DLF and other cloud resources during job execution

From plugin
alibabacloud-aiops-skills
213200 skills
Install
$ npx -y skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-emr-spark-manage --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/alibabacloud-emr-spark-manage

Context preview

The summary Claude sees to decide when to auto-load this skill.

Spark job execution role, used to access OSS, DLF and other cloud resources during job execution

SKILL.md

alibabacloud-emr-spark-manage.SKILL.md
name: alibabacloud-emr-spark-manage
description: >
  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.
license: MIT
compatibility: >
  Requires Alibaba Cloud CLI (aliyun >= 3.3.3) or Python SDK,
  API version 2023-08-08, ROA style.
  Supports Alibaba Cloud default credential chain, including environment variables, configuration files, instance roles, etc.
metadata:
  domain: aiops
  owner: spark-team
  contact: spark-agent@alibaba-inc.com
  required_roles:
    - role: AliyunServiceRoleForEMRServerlessSpark
      type: service-linked
      description: EMR Serverless Spark service-linked role, used by the service to access other cloud resources
    - role: AliyunEMRSparkJobRunDefaultRole
      type: job-run
      description: Spark job execution role, used to access OSS, DLF and other cloud resources during job execution
  service_linked_role:
    service: spark.emr-serverless.aliyuncs.com
    action: ram:CreateServiceLinkedRole

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:

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 manuall

Read more
Ships withalibabacloud-aiops-skills

Official Alibaba Cloud Agent Skills collection, providing AI agents with rich Alibaba Cloud product capabilities and general-purpose tooling.

Get the whole plugin

Other skills on alibabacloud-aiops-skills.