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
66from __future__ import annotations
77
1111from pathlib import Path
1212
1313CRATE_ROOT = Path (__file__ ).resolve ().parents [1 ]
14- REPOSITORY_ROOT = CRATE_ROOT .parents [1 ]
1514
1615
1716def digest (path : Path ) -> str :
@@ -24,7 +23,7 @@ def digest(path: Path) -> str:
2423
2524
2625def 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