Loading...
Loading...
Use this skill for MaxFrame SDK development on Alibaba Cloud MaxCompute (ODPS). Helps 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, ODPS, DPE runtime, or need to work with ODPS tables, DataFrame operations, Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.
npx skill4agent add aliyun/alibabacloud-aiops-skills alibabacloud-odps-maxframe-codingdigraph maxframe_workflow {
"User Request Arrives" [shape=box];
"Detect Scenario Type" [shape=diamond];
"Scenario 1: Writing Code" [shape=box];
"Scenario 2: Remote Debug" [shape=box];
"Scenario 3: Local Debug" [shape=box];
"Scenario 4: Custom Runtime" [shape=box];
"Understand Requirements" [shape=box];
"Operator Selection Needed?" [shape=diamond];
"Use lookup_operator.py" [shape=box];
"Confirm with User" [shape=box];
"Implement Code/Config" [shape=box];
"Add Error Handling" [shape=box];
"Validate execute() Called" [shape=box];
"Validate Session Cleanup" [shape=box];
"Provide Guidance" [shape=doublecircle];
"User Request Arrives" -> "Detect Scenario Type";
"Detect Scenario Type" -> "Scenario 1: Writing Code" [label="new pipeline"];
"Detect Scenario Type" -> "Scenario 2: Remote Debug" [label="cluster testing"];
"Detect Scenario Type" -> "Scenario 3: Local Debug" [label="IDE breakpoints"];
"Detect Scenario Type" -> "Scenario 4: Custom Runtime" [label="custom image"];
"Scenario 1: Writing Code" -> "Understand Requirements";
"Scenario 2: Remote Debug" -> "Understand Requirements";
"Scenario 3: Local Debug" -> "Understand Requirements";
"Scenario 4: Custom Runtime" -> "Understand Requirements";
"Understand Requirements" -> "Operator Selection Needed?";
"Operator Selection Needed?" -> "Use lookup_operator.py" [label="yes"];
"Operator Selection Needed?" -> "Implement Code/Config" [label="no"];
"Use lookup_operator.py" -> "Confirm with User";
"Confirm with User" -> "Implement Code/Config";
"Implement Code/Config" -> "Add Error Handling";
"Add Error Handling" -> "Validate execute() Called";
"Validate execute() Called" -> "Validate Session Cleanup";
"Validate Session Cleanup" -> "Provide Guidance";
}maxframe.dataframemaxframe.tensormaxframe.learnmaxframe.sessionmaxframe.udfmaxframe.configdotenv.load_dotenv().env.execute()finallyscripts/lookup_operator.py| Thought | Reality |
|---|---|
| "This is just a simple MaxFrame question" | Questions are tasks. Invoke the skill. |
| "I already know the MaxFrame API" | Skills have latest patterns. Use them. |
| "Let me just write the code directly" | Operator selection is MANDATORY. |
| "I can skip operator confirmation" | User confirmation is REQUIRED. |
python scripts/lookup_operator.py search "<operation>"import maxframe.dataframe as md
from maxframe.session import new_session
import dotenv
dotenv.load_dotenv()
session = new_session()
try:
df = md.read_odps_table("source_table")
result = df.groupby('column').agg({'value': 'sum'})
md.to_odps_table(result, "target_table", overwrite=True).execute()
finally:
session.destroy()references/common-workflow.mdimport maxframe.dataframe as md
from maxframe.session import new_session
session = new_session()
try:
df = md.read_odps_table("table_name")
result = df.groupby('region').agg({'sales': 'sum'})
result.execute()
except Exception as e:
print(f"Error: {e}")
print(f"Logview URL: {session.get_logview_address()}")
finally:
session.destroy()references/remote-debug-guide.mddebug=Truemd.DataFrame(pd.DataFrame(...))import maxframe.dataframe as md
from maxframe.session import new_session
import pandas as pd
session = new_session(debug=True)
sample_data = pd.DataFrame({
'user_id': ['u1', 'u2', 'u3'],
'level': ['gold', 'silver', 'bronze'],
'amount': [1000, 500, 100]
})
df = md.DataFrame(sample_data)
def calculate_discount(row):
# Set breakpoint here in IDE
if row['level'] == 'gold':
return row['amount'] * 0.1
return row['amount'] * 0.02
result = df.apply(calculate_discount, axis=1)
result.execute()
session.destroy()references/local-debug-guide.mdreferences/runtime-image-guides/README.mdWhich Ubuntu version for your custom runtime?
A. Ubuntu 22.04 (Recommended for most cases)
- Stable, production-ready
- Excellent CUDA support (12.4, 12.1, 11.8)
- Widely tested ML libraries (PyTorch, TensorFlow)
- LTS until 2027
B. Ubuntu 24.04 (Modern/latest)
- Newer system packages
- Latest LTS (until 2029)
- Better for non-GPU workloads
- Python 3.12 integration
Recommendation:
- GPU/ML workloads → Ubuntu 22.04
- Modern development → Ubuntu 24.04Which Python versions?
A. Python 3.11 only (Recommended for production)
- Best performance
- Smallest image (~1 GB)
- Excellent package support
B. Python 3.10, 3.11, 3.12 (Development)
- Good compatibility
- Medium size (~2 GB)
- Recent versions
C. All versions 3.7-3.12 (Maximum flexibility)
- Largest image (~3-5 GB)
- Maximum compatibility
- Testing across versions
Recommendation:
- Production → Single version (3.11)
- Development → Recent versions (3.10-3.12)Need GPU support?
A. Yes - GPU-enabled with CUDA 12.4 (Recommended)
- Install PyTorch 2.6.0+cu124
- CUDA toolkit 12.4
- Note: Requires Ubuntu 22.04 for best compatibility
B. No - CPU only
- Standard package installation
- Smaller image size
Recommendation: For ML/AI workloads, GPU support significantly improves performance.# Build
docker build -t <image-tag> <output-dir>
# Test Python
docker run --rm <image-tag> conda run -n py311 python --version
# Test GPU (if applicable)
docker run --rm --gpus all <image-tag> python -c "import torch; print(torch.cuda.is_available())"
# Test packages
docker run --rm <image-tag> conda run -n py311 python -c "import transformers; print(transformers.__version__)"
# Push to registry
docker push <image-tag>from maxframe.session import new_session
session = new_session(
odps=odps_connection,
image="your-registry/your-image:v1"
)
# Your MaxFrame operations here| Component | Recommendation |
|---|---|
| Base Image | Ubuntu 22.04 (production, GPU, ML) |
| Python | 3.11 (production), 3.10-3.12 (development) |
| GPU | Ubuntu 22.04 + CUDA 12.4 + PyTorch 2.6.0+cu124 |
ENV MF_PYTHON_EXECUTABLE=/py-runtime/envs/<env_name>/bin/pythonreferences/runtime-image-guides/python scripts/lookup_operator.py search "<operation>"references/operator-selector.md.execute()finallydebug=TrueMF_PYTHON_EXECUTABLEreferences/operator-selector.mdreferences/local-debug-guide.mdreferences/remote-debug-guide.mdreferences/common-workflow.mdreferences/runtime_image_*.mdassets/examples/*.pyscripts/lookup_operator.py