@rainbow-robotics/muscat-plugin-kit 0.1.2-dev.31 → 0.1.2-dev.34

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.
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
9
9
  python3 \
10
10
  python3-pip \
11
11
  && rm -rf /var/lib/apt/lists/* \
12
- && pip3 install uv --break-system-packages
12
+ && pip3 install uv==0.8.18 --break-system-packages
13
13
 
14
14
  # TODO(cpp-sdk): the Python SDK is a pybind wrapper over the cpp SDK, so the
15
15
  # cpp SDK shared lib must be present for the python module to load. Install the
package/cli/src/build.mjs CHANGED
@@ -382,7 +382,6 @@ function packZip(pluginRoot) {
382
382
  const size = statSync(full).isDirectory() ? dirSize(full) : statSync(full).size;
383
383
  log.info(` ├─ ${e} ${humanSize(size)}`);
384
384
  }
385
- log.warn("robot install checks free space via GET /plugin/capacity (507 if low).");
386
385
  }
387
386
 
388
387
  /**
@@ -20,21 +20,23 @@ export function assertDockerReady() {
20
20
  }
21
21
 
22
22
  /** Build the dev image from the kit's bundled Dockerfile (Docker layer-caches). */
23
- export function ensureImage(image = PYTHON_DEV_IMAGE) {
24
- log.step(`docker build -t ${image} (first run is slow, then cached)…`);
23
+ export function ensureImage(image = PYTHON_DEV_IMAGE, { platform = null } = {}) {
24
+ log.step(`docker build -t ${image}${platform ? ` (${platform})` : ""} (first run is slow, then cached)…`);
25
+ const platformFlags = platform ? ["--platform", platform] : [];
25
26
  const r = spawnSync(
26
27
  "docker",
27
- ["build", "-t", image, "-f", DOCKERFILE, dirname(DOCKERFILE)],
28
+ ["build", ...platformFlags, "-t", image, "-f", DOCKERFILE, dirname(DOCKERFILE)],
28
29
  { stdio: "inherit" },
29
30
  );
30
31
  if (r.status !== 0) throw new Error("docker build failed.");
31
32
  pruneMuskatImages();
32
33
  }
33
34
 
34
- // manylinux tag that matches each target arch for pip --platform
35
- const ARCH_PLATFORM = {
36
- x86_64: "manylinux2014_x86_64",
37
- aarch64: "manylinux2014_aarch64",
35
+ // Docker --platform 플래그: 컨테이너를 target arch로 띄우면
36
+ // pip이 glibc + arch를 자동 감지해 올바른 휠을 받는다.
37
+ const ARCH_DOCKER_PLATFORM = {
38
+ x86_64: "linux/amd64",
39
+ aarch64: "linux/arm64",
38
40
  };
39
41
 
40
42
  /**
@@ -73,23 +75,36 @@ export function lockAndVendor(pluginRoot, archs = ["x86_64", "aarch64"]) {
73
75
  // 한 arch가 실패해도 나머지 arch는 계속 시도한다.
74
76
  const failed = [];
75
77
  for (const arch of archs) {
76
- const platform = ARCH_PLATFORM[arch];
77
- if (!platform) {
78
+ const dockerPlatform = ARCH_DOCKER_PLATFORM[arch];
79
+ if (!dockerPlatform) {
78
80
  log.warn(`unknown arch '${arch}' — skipped`);
79
81
  continue;
80
82
  }
81
- log.step(`vendoring wheels for ${arch} (${platform})…`);
83
+ // arch별 이미지 빌드 (--platform 지정) → pip이 glibc+arch 자동 감지 → 올바른 휠 선택.
84
+ const archImage = `${PYTHON_DEV_IMAGE}-${arch}`;
85
+ ensureImage(archImage, { platform: dockerPlatform });
86
+
87
+ log.step(`vendoring wheels for ${arch} (${dockerPlatform})…`);
88
+ // 패키지별 개별 download로 private/미공개 패키지 실패 시에도 나머지 계속 진행.
89
+ const script = [
90
+ `set -e`,
91
+ `cd /plugin`,
92
+ `mkdir -p dist/wheels`,
93
+ `pkgs=$(grep -v '^#' dist/requirements.lock | grep -v '^[[:space:]]' | grep -v '^$')`,
94
+ `SKIP=""`,
95
+ `for pkg in $pkgs; do`,
96
+ ` pip3 download "$pkg" --no-deps --only-binary=:all: -d dist/wheels -q 2>&1 || SKIP="$SKIP $pkg"`,
97
+ `done`,
98
+ `[ -z "$SKIP" ] || echo "WARN: no wheel found (package not on PyPI or missing binary wheel):$SKIP"`,
99
+ ].join("\n");
82
100
  const r = spawnSync(
83
101
  "docker",
84
102
  [
85
103
  "run", "--rm",
104
+ "--platform", dockerPlatform,
86
105
  "-v", `${pluginRoot}:/plugin`,
87
- PYTHON_DEV_IMAGE,
88
- "bash", "-c",
89
- `set -e && cd /plugin && mkdir -p dist/wheels && ` +
90
- `uv pip download -r dist/requirements.lock ` +
91
- `--only-binary :all: --platform ${platform} --python-version 3.12 ` +
92
- `-d dist/wheels`,
106
+ archImage,
107
+ "bash", "-c", script,
93
108
  ],
94
109
  { stdio: "inherit" },
95
110
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainbow-robotics/muscat-plugin-kit",
3
- "version": "0.1.2-dev.31",
3
+ "version": "0.1.2-dev.34",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -31,7 +31,7 @@
31
31
  "@types/react-dom": "^19.0.4"
32
32
  },
33
33
  "dependencies": {
34
- "@rainbow-robotics/preview-host": "0.1.2-dev.31",
34
+ "@rainbow-robotics/preview-host": "0.1.2-dev.34",
35
35
  "socket.io": "^4.8.1"
36
36
  },
37
37
  "optionalDependencies": {