Agentic discovery of compiled HPC applications: characterize an artifact's arch, linkage, capability, and provenance so a scheduler knows where it can run.
Project description
artifact-secretary
This library serves as a discovery tool to look into opaque objects (like containers) to figure out what is needed to run, build, etc. Our use case is for scheduling. We want to find the best spot for said opaque container.
Details
Container Discovery
For each image in a catalog:
- Start the container running.
- Copy our inspection code (Python) into it.
- An agent drives the inspection (find binary, read ELF and linkage, how compiled).
- Writes results into an artifact.
Install
Use the devcontainer (.devcontainer/).
python3 -m pip install -e .
python3 -m pip install -e .[aws]
# Claude
export ANTHROPIC_API_KEY=sk-ant-...
# AWS
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_DEFAULT_REGION=us-east-1
Test connection:
aws sts get-caller-identity
aws bedrock list-inference-profiles --region "$AWS_DEFAULT_REGION" \
--query 'inferenceProfileSummaries[].inferenceProfileId' --output text
python3 -c "import boto3; print(boto3.client('sts').get_caller_identity()['Arn'])"
python3 -c "import boto3,os; c=boto3.client('bedrock', region_name=os.environ.get('AWS_DEFAULT_REGION','us-east-1')); print([p['inferenceProfileId'] for p in c.list_inference_profiles()['inferenceProfileSummaries']])"
And test:
python3 - <<'PY'
from strands import Agent
from strands.models import BedrockModel
m = BedrockModel(model_id="us.anthropic.claude-sonnet-5", # paste a real one from step 3
region_name="us-east-1")
print(Agent(model=m)("say ok"))
PY
Usage
artifact-secretary profile --backend aws \
--model us.anthropic.claude-sonnet-5 \
--catalog ghcr.io/converged-computing/metric-lammps-cpu:zen4-reax \
--out lookup.json
By default it deletes any image it had to pull so your disk doesn't fill up.
Images you already had are left alone. Use --keep-images to keep everything.
The inspection library works on its own if you just want the facts and don't want an agent or a key:
from secretary import Target, Inspector, derive_capability
insp = Inspector(Target("/opt/lammps"))
elf = insp.inspect_elf("/build/lmp")
cap = derive_capability(elf["needed"], elf["rpath"])
Output
A lookup keyed by digest. Facts only — no cluster, no jobspec. Multiple
artifacts means multiple builds in one image (a LAMMPS image with both a CPU
and a CUDA build, say).
{
"version": "artifact-lookup/v1",
"entries": {
"reg/lammps@sha256:...": {
"reproduce": {"reference": "reg/lammps:efa", "pulled_by_us": true},
"artifacts": [
{"application": "lammps", "binary": "/opt/lammps/build/lmp", "arch": "arm64",
"needed": ["libcudart.so.12","libfabric.so.1","libefa.so.1","libmpi.so.40"],
"capability": {"accelerator": "cuda", "fabric_efa": true, "mpi": "openmpi"},
"provenance": {"build_system": "cmake", "compiler": "nvcc_wrapper",
"flags": ["Kokkos_ENABLE_CUDA=ON"]}}
]
}
}
}
Turning this into a fleetq jobspec is a separate job for a separate tool that reads the lookup. It's not this tool's business.
How the framework part works
A task says three things: what to ask the user, which tools the agent gets, and what a valid result looks like. The framework handles the rest — running the setup conversation, saving the manifest so runs are repeatable, and running the agent with those tools.
Tools are either read (agent uses them freely) or action (agent has to get
the user to confirm before it runs). Profiling is all read tools. A future
submit-a-job task would use an action tool for the actual submit, and the
manifest lookup from this tool would be its input.
License
HPCIC DevTools is distributed under the terms of the MIT license. All new contributions must be made under this license.
See LICENSE, COPYRIGHT, and NOTICE for details.
SPDX-License-Identifier: (MIT)
LLNL-CODE- 842614
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file artifact_secretary-0.0.0.tar.gz.
File metadata
- Download URL: artifact_secretary-0.0.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fa5feaa44134c04b1d3917a21390993e6f20a7be92d4679d06f4401d84a74ef
|
|
| MD5 |
5d1943ad6439b707e87e9b0c0ab0dc16
|
|
| BLAKE2b-256 |
228eb7f1f68ffb31dd24a7be5bc95d9e27d5e4cb1203a822fa2e33c9c9fc6785
|
File details
Details for the file artifact_secretary-0.0.0-py3-none-any.whl.
File metadata
- Download URL: artifact_secretary-0.0.0-py3-none-any.whl
- Upload date:
- Size: 34.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38e4191e6a4db4c12ce5b8e9071c2b4364a3173ba7080cf088f2e4f485352483
|
|
| MD5 |
a3cc8baa7287ab1dba51802fe6a7b964
|
|
| BLAKE2b-256 |
56a67a9a1114d9eb1cb8833bb345446bd332dae4fe9a424c752e58dafa1ffe54
|