PulumiがBunランタイムの完全サポートを追加
本文の状態
日本語全文を表示中
詳細モードで約4分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
InfoQ
Pulumiは、Bunを単なるパッケージマネージャーから完全なランタイムとしてサポートすることを発表した。Pulumi 3.227.0では、開発者はPulumi.yamlでruntime: bunを設定でき、Node.jsのインストールなしでBunがインフラストラクチャプログラム全体を実行できる。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るSource Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Pulumiは、BunがPulumiの正式サポート対象ランタイム(runtime)となったことを発表した。これは以前のパッケージマネージャー(package manager)オプションとしての役割を超えたものとなる。Pulumi 3.227.0のリリースに伴い、開発者はPulumi.yaml内でruntime: bunを設定するだけで、Node.jsのインストールなしでBunにインフラストラクチャプログラム(infrastructure program)全体を実行させることができる。
Bunが2022年に最初にリリースされた際、そのコンセプトはシンプルだった。V8ではなくJavaScriptCoreを基盤とした、より高速なJavaScriptランタイム(JavaScript runtime)であること。それ以来、このプロジェクトは規模と野心を大幅に拡大してきた。BunはJarred Sumnerによって発明され、2021年5月に初めてプレビューされ、2023年9月にバージョン1.0としてリリースされた。このランタイムは、パッケージマネージャー(package manager)、バンドラー(bundler)、テストランナー(test runner)を単一のバイナリ(binary)に統合している点で他と一線を画しており、すべてZigプログラミング言語(Zig programming language)で構築され、AppleのWebKitエンジン(WebKit engine)であるJavaScriptCoreによって駆動されている。これはNode.jsやDenoが使用するV8エンジンとは異なるアプローチである。
このプロジェクトはAnthropicによる買収により、大きな組織的な支援を得た。AnthropicはすでにClaude Codeのデプロイに本製品を使用している。Anthropicは、Bunが「オープンソース(open source)でありMITライセンス(MIT-licensed)のまま維持される」と表明し、JavaScriptおよびTypeScript開発者による一般利用のための開発は継続すると述べている。パフォーマンスの数値は一貫したセールスポイントとなっている:BunはNode.jsと比較して、起動時間(startup times)が4倍高速(5〜15ms対60〜120ms)、パッケージインストールが6〜35倍高速である。
この統合は、Bunの1.0リリース以降、PulumiのGitHubイシュートラッカー(GitHub issue tracker)で最も要望の多かった機能の一つだった。BunがPulumiユーザーにとって特に魅力的である理由は3つの機能にある。第一に、ネイティブTypeScript実行(native TypeScript execution):Bunはts-nodeや別個のコンパイルステップ(compile step)を必要とせず、TypeScriptファイルを直接実行する。これは従来、PulumiのTypeScriptワークフローに煩雑さを生み出してきた要素である。第二に、高速な依存関係のインストール(dependency installation):これによりCI/CDパイプライン(CI/CD pipelines)におけるインフラストラクチャプログラムの初期構築が加速する。第三に、Bunは100%のNode.js互換性(Node.js compatibility)を目標としており、Pulumiで既に使用されているnpmパッケージ(npm packages)はそのままの状態で動作する。
runtime: bunが設定されると、Pulumiはプログラムの実行とパッケージの管理の両方にBunを使用し、別個のパッケージマネージャー(package manager)オプションを設定する必要がなくなる。pulumi new bunコマンドにより、新しいプロジェクトテンプレートが利用可能である。
注目すべき操作性の向上は、非同期コード(async code)に関するものである。CommonJS形式のPulumiプログラムでは、リソースを宣言する前にデータソース(data source)を待機する場合、プログラム全体を非同期のエントリポイント関数(entrypoint function)でラップする必要があった。Bunの完全なESM(ECMAScript Modules)サポートにより、トップレベルのawait(top-level await)がラッパーなしでモジュールレベルで動作し、プログラムの構造を大幅に簡素化している。
既存のNode.jsベースのPulumiプロジェクトを持つチームは、Pulumi.yaml内のランタイムフィールド(runtime field)を更新し、Bunの推奨コンパイラオプション(compiler options)(module: "Preserve"およびmoduleResolution: "bundler"を含む)を使用するようにtsconfig.jsonを調整し、ESMを採用するためにpackage.jsonに"type": "module"を追加することで移行できる。
今回のリリースには、2つの重要な制限事項が含まれています。
Pulumiのコールバック関数(callback functions)、通称マジックラムダ(magic lambdas)は、Bunランタイムではサポートされていません。これは、Node.js v8およびBunで完全に利用可能ではないinspectorモジュール(inspector modules)に依存する関数シリアライゼーション(function serialization)を必要とするためです。
動的プロバイダー(Dynamic Providers)も同様の理由でサポートされていません。
これらの機能のいずれかに依存しているチームは、ランタイムをnodejsのまま維持する必要がありますが、Node.jsランタイム設定でpackagemanager: bunを設定することで、Bunの高速なパッケージ管理の恩恵を受けることができます。
Bunランタイムのサポートには、Bun 1.3以降およびPulumi 3.227.0以降が必要です。
著者について(About the Author)
クラウディオ・マソロ(Claudio Masolo)
クラウディオはNearformのシニアDevOpsエンジニアです。趣味はランニング、読書、そして古いビデオゲームをプレイすることです。
原文を表示
Pulumi has announced that Bun is now a fully supported runtime for Pulumi, going beyond its previous role as merely a package manager option. With the new release of Pulumi 3.227.0, developers can set runtime: bun in their Pulumi.yaml and have Bun execute their entire infrastructure program, with no Node.js installation required.
When Bun first launched in 2022, the pitch was simple: a faster JavaScript runtime built on JavaScriptCore instead of V8. Since then, the project has grown substantially in scope and ambition. Bun was invented by Jarred Sumner, first previewed in May 2021, and released as version 1.0 in September 2023. The runtime distinguishes itself by bundling a package manager, bundler, and test runner into a single binary, all built with the Zig programming language and powered by JavaScriptCore, Apple's WebKit engine. This is rather than the V8 engine used by Node.js and Deno.
The project gained significant institutional backing when it was acquired by Anthropic, which already uses the product for deploying Claude Code. Anthropic stated that Bun "will remain open source and MIT-licensed" and that its development for general use by JavaScript and TypeScript developers will continue. Performance figures have been a consistent selling point: Bun delivers 4x faster startup times (5–15ms vs 60–120ms) and 6–35x faster package installs compared to Node.js.
The integration was among the most requested features in Pulumi's GitHub issue tracker since Bun's 1.0 release. Three capabilities make Bun particularly attractive for Pulumi users. First, native TypeScript execution: Bun runs TypeScript files directly without requiring ts-node or a separate compile step, which has historically added friction to Pulumi TypeScript workflows. Second, faster dependency installation, which speeds up the bootstrapping of infrastructure programs in CI/CD pipelines. Third, Bun aims for 100% Node.js compatibility, so the npm packages already used with Pulumi should work out of the box.
When runtime: bun is configured, Pulumi uses Bun for both running programs and managing packages, removing the need to configure a separate package manager option. A new project template is available via pulumi new bun.
One notable ergonomic improvement concerns async code. In CommonJS Pulumi programs, awaiting a data source before declaring resources required wrapping the program in an async entrypoint function. With Bun's full ESM support, top-level await works at the module level without any wrapper, simplifying program structure considerably.
Teams with existing Node.js-based Pulumi projects can migrate by updating the runtime field in Pulumi.yaml, adjusting tsconfig.json to use Bun's recommended compiler options, including module: "Preserve" and moduleResolution: "bundler", and adding "type": "module" to package.json to opt into ESM.
The release does carry two notable limitations. Pulumi's callback functions, sometimes called magic lambdas, are not supported under the Bun runtime because they rely on function serialization that depends on Node.js v8 and inspector modules not fully available in Bun. Dynamic providers are similarly unsupported for the same reason. Teams that rely on either of these features should remain on runtime: nodejs, though they can still benefit from Bun's faster package management by setting packagemanager: bun in their Node.js runtime configuration.
Bun runtime support requires Bun 1.3 or later and Pulumi 3.227.0 or later.
About the Author
Claudio Masolo
Claudio is a Senior DevOps Engineer at Nearform.
In his spare time, he likes running, reading, and playing old video games.
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み