nexus-agent-installer 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/install.js +33 -3
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -59,19 +59,49 @@ async function main() {
|
|
|
59
59
|
if (!resp.ok) fail(`릴리스 조회 실패: HTTP ${resp.status}`);
|
|
60
60
|
const release = await resp.json();
|
|
61
61
|
|
|
62
|
-
const
|
|
62
|
+
const assets = release.assets || [];
|
|
63
|
+
const asset = assets.find(
|
|
64
|
+
(a) => a.name.startsWith("nexus_agent_platform-") && a.name.endsWith(".whl") && a.name.includes(suffix),
|
|
65
|
+
);
|
|
63
66
|
if (!asset) fail(`현재 플랫폼(${process.platform}/${process.arch})에 맞는 wheel을 찾지 못했습니다.`);
|
|
64
67
|
|
|
68
|
+
// 의존성 번들: CI가 미리 빌드한 wheel(litellm 등) + constraints.txt.
|
|
69
|
+
// --no-build와 함께 써서 사용자 PC에서는 소스 빌드(컴파일)가 일어나지 않게 한다.
|
|
70
|
+
const depsName = `deps-${suffix.replace(/\.whl$/, "")}.tar.gz`;
|
|
71
|
+
const depsAsset = assets.find((a) => a.name === depsName);
|
|
72
|
+
|
|
65
73
|
console.log(`다운로드: ${asset.name}`);
|
|
66
74
|
const dl = await fetch(asset.browser_download_url, { headers: { "User-Agent": "nexus-agent-installer" } });
|
|
67
75
|
if (!dl.ok) fail(`다운로드 실패: HTTP ${dl.status}`);
|
|
68
76
|
|
|
69
77
|
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "nexus-agent-install-"));
|
|
70
78
|
const whlPath = path.join(tmpDir, asset.name);
|
|
79
|
+
const depDir = path.join(tmpDir, "deps");
|
|
71
80
|
try {
|
|
72
81
|
fs.writeFileSync(whlPath, Buffer.from(await dl.arrayBuffer()));
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
fs.mkdirSync(depDir);
|
|
83
|
+
|
|
84
|
+
if (depsAsset) {
|
|
85
|
+
const depsDl = await fetch(depsAsset.browser_download_url, { headers: { "User-Agent": "nexus-agent-installer" } });
|
|
86
|
+
if (!depsDl.ok) fail(`의존성 번들 다운로드 실패: HTTP ${depsDl.status}`);
|
|
87
|
+
const depsPath = path.join(tmpDir, depsAsset.name);
|
|
88
|
+
fs.writeFileSync(depsPath, Buffer.from(await depsDl.arrayBuffer()));
|
|
89
|
+
const untar = run("tar", ["-xzf", depsPath, "-C", depDir]);
|
|
90
|
+
if (untar.status !== 0) fail("의존성 번들 압축 해제에 실패했습니다.");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const uvArgs = ["tool", "install", "--force", "--python", "3.13", "--no-build", "--find-links", depDir];
|
|
94
|
+
const constraints = path.join(depDir, "constraints.txt");
|
|
95
|
+
let result;
|
|
96
|
+
if (fs.existsSync(constraints)) {
|
|
97
|
+
result = run("uv", [...uvArgs, "--constraints", constraints, whlPath]);
|
|
98
|
+
if (result.status !== 0) {
|
|
99
|
+
console.log("고정 버전 설치에 실패해 버전 고정 없이 다시 시도합니다...");
|
|
100
|
+
result = run("uv", [...uvArgs, whlPath]);
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
result = run("uv", [...uvArgs, whlPath]);
|
|
104
|
+
}
|
|
75
105
|
if (result.status !== 0) fail("uv tool install이 실패했습니다.");
|
|
76
106
|
} finally {
|
|
77
107
|
fs.rmSync(tmpDir, { recursive: true, force: true });
|
package/package.json
CHANGED