Python and node.js major version update#191
Conversation
Python 3.10 reaches EOL October 2026. Upgrade to 3.12 (EOL October 2028) for openpai-runtime, postgresql-sdk, cluster-utilization, and cert-expiration-checker. Co-Authored-By: Claude <noreply@anthropic.com>
Node.js 20 reached EOL March 2026. Upgrade to Node 24 (current LTS) for rest-server, database-controller, alert-handler, job-status-change-notification, and grafana. - Replace native `diskusage` package with built-in `fs.statfs()` in database-controller to eliminate unmaintained native addon dependency - Restore `npm install -g npm@latest` (Node 24 supports npm 12+) - Update engines field to ^24 in package.json files - Regenerate yarn.lock files under Node 24 - Add `corepack enable` for grafana plugin build Co-Authored-By: Claude <noreply@anthropic.com>
Ubuntu 20.04 reached EOL April 2025. Replace with 24.04 while keeping 22.04 for existing user jobs. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR modernizes the platform runtime/tooling by moving container builds and Node service constraints to newer major versions (Python 3.12 and Node.js 24), and adjusts a few dependent build/runtime details to stay compatible.
Changes:
- Update Node.js base images and package
engines.nodeconstraints to^24across multiple services. - Update Python base images to
python:3.12-*for Python-based components. - Replace the
diskusagenative dependency withfs/promises.statfsin the database-controller, and update related lockfiles/caches.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/rest-server/yarn.lock | Updates lockfile resolution/checksum after Node/tooling changes. |
| src/rest-server/package.json | Bumps engines.node to ^24. |
| src/rest-server/build/rest-server.common.dockerfile | Updates Node base image to 24 and adjusts npm install behavior. |
| src/postgresql-sdk/build/postgresql-sdk.k8s.dockerfile | Updates Python base image to 3.12-slim. |
| src/openpai-runtime/src/src/package_cache/package_cache_info | Updates cached package OS targets (removes 20.04, adds 24.04). |
| src/openpai-runtime/build/openpai-runtime.common.dockerfile | Updates Ubuntu cache stages and Python base image to 3.12. |
| src/grafana/build/grafana.common.dockerfile | Updates Node base image to 24; ensures Yarn availability via corepack. |
| src/database-controller/src/yarn.lock | Removes diskusage and now-unused transitive deps from the lockfile. |
| src/database-controller/src/watcher/cluster-event/index.js | Replaces diskusage with fs/promises.statfs for disk health checks. |
| src/database-controller/src/package.json | Removes diskusage dependency. |
| src/database-controller/build/database-controller.common.dockerfile | Updates Node base image to 24 and adjusts npm install behavior. |
| src/alert-manager/src/job-status-change-notification/package.json | Bumps engines.node to ^24. |
| src/alert-manager/src/alert-handler/package.json | Bumps engines.node to ^24. |
| src/alert-manager/build/job-status-change-notification.common.dockerfile | Updates Node base image to 24 and adjusts npm install behavior. |
| src/alert-manager/build/cluster-utilization.common.dockerfile | Updates Python base image to 3.12-slim. |
| src/alert-manager/build/cert-expiration-checker.common.dockerfile | Updates Python base image to 3.12-slim. |
| src/alert-manager/build/alert-handler.common.dockerfile | Updates Node base image to 24 and adjusts npm install behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
POSIX defines blocks/bavail in units of frsize (fundamental block size), not bsize (optimal transfer size). They differ on some filesystems. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 17 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (6)
src/rest-server/build/rest-server.common.dockerfile:21
- Using
npm@latestmakes Docker builds non-reproducible and can introduce breaking changes when npm releases a new major/minor. Pin to a known-compatible major (or remove this line and rely on the npm bundled with the Node base image) to keep builds stable.
RUN npm install -g npm@latest
src/database-controller/build/database-controller.common.dockerfile:7
- Using
npm@latestmakes Docker builds non-reproducible and can introduce breaking changes when npm releases a new major/minor. Pin to a known-compatible major (or remove this line and rely on the npm bundled with the Node base image) to keep builds stable.
RUN npm install -g npm@latest
src/alert-manager/build/job-status-change-notification.common.dockerfile:7
- Using
npm@latestmakes Docker builds non-reproducible and can introduce breaking changes when npm releases a new major/minor. Pin to a known-compatible major (or remove this line and rely on the npm bundled with the Node base image) to keep builds stable.
RUN npm install -g npm@latest
src/alert-manager/build/alert-handler.common.dockerfile:7
- Using
npm@latestmakes Docker builds non-reproducible and can introduce breaking changes when npm releases a new major/minor. Pin to a known-compatible major (or remove this line and rely on the npm bundled with the Node base image) to keep builds stable.
RUN npm install -g npm@latest
src/database-controller/src/watcher/cluster-event/index.js:92
statfs()can return unexpected/invalid values (e.g., missing block size orblocksbeing 0), which would makecurrentUsageNaN/Infinity and bypass the safety exit check. Add a small validation step and computeuseddefensively so the health check fails closed.
const stats = await statfs(config.diskPath);
const blockSize = stats.frsize ?? stats.bsize;
const available = stats.bavail * blockSize;
const total = stats.blocks * blockSize;
const currentUsage = ((total - available) / total) * 100;
src/openpai-runtime/build/openpai-runtime.common.dockerfile:20
- The PR description says this change is a Python/Node major version bump, but this Dockerfile also changes the package-cache OS matrix (removes Ubuntu 20.04 and adds Ubuntu 24.04). Please either update the PR description to include the Ubuntu base/cache changes, or split/revert these OS changes if they’re out of scope.
FROM ubuntu:22.04 AS ubuntu_22_04_cache
This PR updates the Python version from 3.10 to 3.12, and updates the Node.js version from 20 to 24