跳到正文
Skillpedia
部署与云(DevOps)5.4k · #14853

compute-env-setup

它能做什么

这项技能教智能体为远程计算主机准备激活文件,使任务能加载正确的软件包。它编写设置步骤并检查环境,但创建或删除资源的操作由用户自己决定。

适用场景

  • ✓当远程任务需要主机未提供的软件包、模块或缓存设置时。
  • ✓当用户需要为 Open Science 计算主机设置可重复使用的环境激活时。
  • ✓当远程任务因主机缺少某个软件包或模块而失败时。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/aipoch/open-science/blob/main/resources/skills/compute-env-setup/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我在计算主机上的远程任务需要特定的 Python 软件包组合。请帮我准备设置步骤和激活文件。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查现有的环境定义,编写包含所需设置的激活文件,并给出准确的设置命令。它不会自行运行创建或删除用户资源的命令。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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

常见问题

激活文件会安装软件包吗?

不会。技能说明,该文件只包含激活设置,不会在任务启动时安装软件包。

如果作业记账服务不可用怎么办?

技能说明,这并不代表环境缺失,并会指向调度器故障排除参考文档。

谁负责管理环境?

由用户或主机管理员负责管理,技能只负责准备命令。

详情

作者的原始描述

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

热度

GitHub 星标
5.4k
排名
#14853
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能