Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)5.4k · #14853

compute-env-setup

Skill này làm gì

Skill này dạy agent cách chuẩn bị một file kích hoạt cho máy tính từ xa, để các công việc tải đúng gói. Skill viết các bước thiết lập và kiểm tra môi trường, còn việc tạo hay xóa tài nguyên thì để người dùng làm.

Khi nào nên dùng

  • ✓Khi một công việc từ xa cần gói, module hoặc cài đặt bộ nhớ đệm mà máy chủ chưa cung cấp.
  • ✓Khi người dùng cần một bước kích hoạt môi trường lặp lại được cho máy tính Open Science.
  • ✓Khi một công việc từ xa lỗi vì thiếu gói hoặc module trên máy chủ.

Liên kết skill

https://github.com/aipoch/open-science/blob/main/resources/skills/compute-env-setup/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/aipoch/open-science/blob/main/resources/skills/compute-env-setup/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Công việc từ xa của tôi trên máy tính cần một bộ gói Python cụ thể. Hãy chuẩn bị các bước thiết lập và một file kích hoạt cho nó.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra các định nghĩa môi trường có sẵn, viết file kích hoạt với các thiết lập cần thiết, và đưa ra các lệnh thiết lập chính xác. Agent không tự chạy lệnh nào tạo hoặc xóa tài nguyên của người dùng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Compute environment setup

Prepare one reproducible environment definition and instructions for one small user-managed host activation file. Open-Science resolves submitJob(..., { environment: '<name>' }) by sourcing ~/.open-science/environments/<name>.sh before the workload. Existing ~/.openscience/environments/<name>.sh definitions remain readable in place. Before creating an activation, check both names: update the existing definition at its exact location; if both exist, ask the user which to retain. Never create a second activation just to rename the brand. The file contains activation only; it does not install packages when a job starts.

Software environment setup and Slurm accounting service configuration are separate concerns. An unavailable sacct service is not evidence that Python, Conda, modules, or the named activation file are missing. Use the Remote Compute Skill's Slurm troubleshooting reference for scheduler status and cancellation problems; do not make enabling accounting the only recovery path or assume the user has administrator privileges.

The environment, package caches, images, and activation file are user-managed durable resources, not Open-Science-owned components. This Skill may inspect them and prepare exact setup/removal commands, but must not execute commands that create, replace, or remove those resources. The user or host administrator runs those commands outside Open-Science and owns their lifecycle. Do not interpret the ~/.openscience path as app ownership.

Use host.compute only in repl_execute JavaScript. Python and R data kernels do not expose it. Start from the Session catalog and do not guess a provider id:

const hosts = await host.compute.listHosts()
const selected = hosts.filter((candidate) => candidate.role === 'selected')
const candidates = selected.length > 0 ? selected : hosts

Choose the requested host, or a suitable candidate when the user left the target open. Read its knowledge and probe snapshot before changing it:

const providerId = candidates[0].provider_id
const executionMode = candidates[0].execution_mode
const details = await host.compute.details(providerId, { mode: 'read' })
const compute = host.compute.create(providerId)

If no eligible host exists, or the selected host is unsuitable, explain the concrete blocker. Do not install locally as a substitute for a requested remote environment.

Define the environment

Keep the reproducible source in the user's project: an environment.yml, requirements or lock file, container definition, or a short setup script appropriate to the stack. When installation must run on a compute node, include exact user- or administrator-run staging and scheduler commands in the plan; do not submit that installation through Open-Science. Do not store project package lists or secrets in the host knowledge document.

Use a logical name containing 1–64 letters, numbers, periods, underscores, or hyphens, starting with a letter or number. Its host activation file is:

~/.open-science/environments/<name>.sh

The activation file itself and every path it references must be visible at the same path on the execution node. A shared home directory satisfies this. If login and compute nodes have separate homes, copy the activation file to the compute-node home at the same path and use shared software and data paths inside it; if the host offers no durable way to do that, explain the limitation.

Prefer the host's existing environment system:

  • Conda or micromamba: create the environment from the project definition, then source the shell hook and activate it in the activation file.
  • Modules: load the exact module versions in the activation file. Combine modules with a venv or conda environment when Python packages are also needed.
  • Apptainer or Singularity: installation and image creation are cluster-specific. Use an existing shared image when possible. Do not claim that environment wraps an arbitrary command in a container; the activation contract only sources shell setup.

Set cache paths and bounded thread variables in the activation file when the workload needs them. Keep credentials out of it. Avoid sudo, system package changes, shell-profile edits, and unrequested changes to other named environments.

Before installing, use one batched, read-only probe to identify the scheduler, available environment tools, relevant modules, quotas, and shared scratch. A typica

Câu hỏi thường gặp

File kích hoạt có cài gói không?

Không. Skill nói nó chỉ chứa kích hoạt và không cài gói khi công việc bắt đầu.

Nếu dịch vụ kế toán bị lỗi thì sao?

Skill nói điều đó không có nghĩa là môi trường bị thiếu, và chỉ đến tài liệu xử lý sự cố bộ lập lịch.

Ai quản lý môi trường?

Người dùng hoặc quản trị viên máy chủ quản lý, còn skill chỉ chuẩn bị các lệnh.

Chi tiết

Mô tả gốc của tác giả

Prepare reproducible setup instructions and validate a user-managed named software environment on an Open-Science SSH Compute Host, including direct SSH and Slurm hosts. Use when a remote job needs packages, modules, cache variables, or a repeatable activation that the host does not already provide.

repo: aipoch/open-science

Độ phổ biến

Sao GitHub
5.4k
Vị trí xếp hạng
#14853
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự