Skip to content

Commit d550a30

Browse files
committed
refactor(relay): minimize plugin bundle
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
1 parent 24fadd7 commit d550a30

2 files changed

Lines changed: 5 additions & 15 deletions

File tree

crates/switchyard-nemo-relay-plugin/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ python3 crates/switchyard-nemo-relay-plugin/scripts/package_bundle.py \
223223
```
224224

225225
On macOS the library suffix is `.dylib`; Windows builds use `.dll`. The bundle
226-
builder copies the shared library, materialized manifest, JSON schema, README,
227-
LICENSE, and NOTICE, then writes `SHA256SUMS`.
226+
builder creates the minimal Relay package: the shared library, a materialized
227+
manifest with Relay's inline SHA-256 integrity digest, and the JSON schema.
228228

229229
Install the materialized bundle with Relay's normal lifecycle commands:
230230

crates/switchyard-nemo-relay-plugin/scripts/package_bundle.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
"""Build an operator-facing NeMo Relay plugin bundle from a compiled cdylib."""
4+
"""Materialize the minimal Relay plugin bundle from a compiled cdylib."""
55

66
from __future__ import annotations
77

@@ -11,7 +11,6 @@
1111
from pathlib import Path
1212

1313
CRATE_ROOT = Path(__file__).resolve().parents[1]
14-
REPOSITORY_ROOT = CRATE_ROOT.parents[1]
1514

1615

1716
def digest(path: Path) -> str:
@@ -24,7 +23,7 @@ def digest(path: Path) -> str:
2423

2524

2625
def main() -> None:
27-
"""Materialize a self-contained plugin bundle in an empty directory."""
26+
"""Materialize a Relay-loadable plugin bundle in an empty directory."""
2827
parser = argparse.ArgumentParser()
2928
parser.add_argument("--library", required=True, type=Path)
3029
parser.add_argument("--output", required=True, type=Path)
@@ -49,22 +48,13 @@ def main() -> None:
4948

5049
artifact = output / library.name
5150
shutil.copy2(library, artifact)
52-
for name in ("config.schema.json", "README.md"):
53-
shutil.copy2(CRATE_ROOT / name, output / name)
54-
for name in ("LICENSE", "NOTICE"):
55-
shutil.copy2(REPOSITORY_ROOT / name, output / name)
51+
shutil.copy2(CRATE_ROOT / "config.schema.json", output / "config.schema.json")
5652

5753
artifact_digest = digest(artifact)
5854
manifest = manifest.replace("<platform-library-file>", artifact.name)
5955
manifest = manifest.replace("<artifact-sha256>", artifact_digest)
6056
(output / "relay-plugin.toml").write_text(manifest, encoding="utf-8")
6157

62-
checksums = []
63-
for path in sorted(output.iterdir(), key=lambda item: item.name):
64-
if path.name != "SHA256SUMS" and path.is_file():
65-
checksums.append(f"{digest(path)} {path.name}")
66-
(output / "SHA256SUMS").write_text("\n".join(checksums) + "\n", encoding="utf-8")
67-
6858
print(output)
6959

7060

0 commit comments

Comments
 (0)