carla-pack
CARLA 用 Content Pack を GitHub のリポジトリ権限で配布する ためのクライアントです。サーバはありません。
carla-pack ──(1) GitHub API: carla-packs.toml を読む ───────────► GitHub(Private リポジトリ)
──(2) GitHub API: 読み取り専用の S3 鍵を読む ─────────► └ Release "carla-pack-credentials"
──(3) SigV4 で直接ダウンロード ───────────────────────► S3 互換ストレージ(R2 / S3 / MinIO …)
──(4) SHA-256 と carla-pack.json で検証 → 配置 → mount ─► CARLA サーバ
- アクセス権の確認は GitHub が行います。 Pack リポジトリ(Private)を読めるユーザーだけが、
マニフェスト
carla-packs.tomlと、Release に置かれた読み取り専用のストレージ鍵を取得できます。読めない人には GitHub が 404 を返すだけです。 誰に配るかは、そのリポジトリの Read 権限(ユーザー / Team / Organization)でそのまま決まります。 - ファイルは S3 互換ストレージから直接 ダウンロードします(Cloudflare R2、AWS S3、MinIO、SeaweedFS など)。 誰に配ってもよい Pack は Hugging Face Hub の公開リポジトリ にも置けます(鍵不要、匿名で取得)。
- 鍵は Pack リポジトリの GitHub Actions が 6 時間ごとに作り直す有効期限 12 時間の一時鍵 で、バケットの Pack 用プレフィックスを読むことしかできません。 R2 は一時認証情報 API、AWS は GitHub OIDC で発行するので、長期の鍵はどこにも保存しません。
- ダウンロードしたファイルはマニフェストの SHA-256 とサイズ、さらに Pack 自身の
carla-pack.jsonの全ファイルのハッシュで検証してから配置します。 - コア(GitHub API、SigV4、ダウンロード、検証、展開)は Rust、CLI と CARLA へのマウントは Python です(PyO3 / maturin、abi3 wheel)。
旧版(Cloudflare Workers / AWS Lambda の Registry サーバ)は廃止しました。その設計との違いは docs/architecture.md にあります。
使う(Pack をダウンロードする側)
pip install carla-pack-registry # 開発中は「開発」を参照
gh auth login # GitHub CLI のトークンをそのまま使います(GH_TOKEN / GITHUB_TOKEN / carla-pack login でも可)
carla-pack whoami
carla-pack repo add tier4/carla-packs # マップ名で探すときの検索対象(CARLA_PACK_REPOS でも指定可)
carla-pack ls # 読めるリポジトリの Pack 一覧
carla-pack find NishishinjukuMap # そのマップを含む Pack
carla-pack install NishishinjukuMap --map \
--packs-dir /opt/carla/Linux/CarlaUnreal/Packs --mount localhost:2000
carla-pack install tier4/carla-packs/NishishinjukuPack@1.2.0 --packs-dir ./Packs # 参照で指定
carla-pack pull tier4/carla-packs/NishishinjukuPack -o ./downloads # tarball だけ取得
PyPI の配布名は carla-pack-registry、Python のモジュール名は carla_pack_registry、コマンド名は carla-pack です
(CARLA 本体の Util/ContentPacks/carla_pack.py と同じ環境に入れても衝突しません)。
Pack の指定は OWNER/REPO/PACK[@VERSION] です。バージョンを省略すると最新(--base-release / --platform で絞り込み)、
--sha256 を付けるとその成果物に固定します(lock ファイル用)。
Python から(シナリオライブラリへの組み込み)
import typesafe_carla.carla as carla # 公式の carla モジュールでも可
from carla_pack_registry import Client, deploy_pack, ensure_map
client = carla.Client("localhost", 2000)
# サーバに無いマップだけ、読めるリポジトリから探して取得・検証・配置・mount する。あれば何もしない(None)。
pack = ensure_map(client, "NishishinjukuMap", "/opt/carla/Linux/CarlaUnreal/Packs",
repos=["tier4/carla-packs"])
client.load_world("NishishinjukuMap")
# lock ファイルの内容(参照 + SHA-256)で再現性のある取得
deploy_pack("tier4/carla-packs/NishishinjukuPack", packs_dir, carla_client=client,
sha256=pack["sha256"])
# 低レベル API
c = Client() # トークン・検索対象は環境 / 保存済み設定から
release = c.find_map("NishishinjukuMap") # {"ref", "repo", "name", "version", "sha256", "maps", ...}
path = c.fetch(release) # キャッシュ(SHA-256 名)に取得して検証、パスを返す
c.install(release, packs_dir) # 検証して <packs_dir>/<name> に配置(同一なら何もしない)
packs_dirは CARLA サーバから同じパスで読める場所にしてください(パッケージのLinux/CarlaUnreal/Packs、-carla-packs=<dir>、または mount するなら任意のフォルダ)。- 同じ Pack(名前・バージョン・base release・platform)がインストール済みならダウンロードしません。別バージョンの置き換えは
force=True(mount 中なら先に unmount)。 - ダウンロードは
~/.cache/carla-pack/blobs/<sha256>.tar.gzにキャッシュします(CARLA_PACK_CACHE_DIR)。 数 GB の Pack は、キャッシュの tarball と展開後の Pack で サイズの約 2 倍 のディスクを使います。 - 接続が途中で切れても、受け取った位置から Range で再開します(最大 5 回)。再開しても全体の SHA-256 で検証します。
地図データを形式で引く
Pack が持つ地図データを、マップ名と形式名でローカルのパスとして取り出せます。CARLA サーバは要りません(Pack はキャッシュに取得・検証・展開されます)。
- どの Pack でも、
carla-pack.jsonにある標準の形式(opendrive/navmesh/traffic_manager/map_logic)。 - Pack が
Content/Config/roadgen_asset.json(任意)を持っていれば、その形式も(roadgen のcarla_pack_assetsが書く:lanelet2/autoware(Lanelet2・点群地図・projector)/pointcloud/sumo/commonroad/clipgt/rdshq/gpudrive/womdなど)。
carla-pack formats hakuturu583/carla-packs-test/RoadgenHighwayPack # マップ × 形式の一覧
carla-pack data hakuturu583/carla-packs-test/RoadgenHighwayPack --format lanelet2
carla-pack data RoadgenHighway --map --format autoware --file pointcloud_map # フォルダの中の 1 ファイル
carla-pack find RoadgenHighway --format lanelet2 # その形式を持つ Pack(公開時の索引で探す)
carla-pack find SomeDataOnlyMap --assets # asset ファイルにだけあるマップも探す
carla-pack ls --formats # 一覧に形式の列を出す
carla-pack formats ./Packs/RoadgenHighwayPack # インストール済みの Pack フォルダや tarball も可
from carla_pack_registry import Client, map_data, map_formats
client = Client()
release = client.find_map("RoadgenHighway", format="autoware")
autoware_dir = client.map_data(release, "RoadgenHighway", "autoware") # Autoware の map_path にそのまま
pcd = client.map_data(release, "RoadgenHighway", "autoware", file="pointcloud_map")
client.formats(release) # {map: {format: {type, path, files, origin}}}
map_formats("/opt/carla/CarlaUnreal/Packs/RoadgenHighwayPack") # インストール済みの Pack
map_data("/opt/carla/CarlaUnreal/Packs/RoadgenHighwayPack", "RoadgenHighway", "opendrive")
carla-pack publish は、マップごとの形式を carla-packs.toml のエントリ(formats)に書きます。find --format はこの索引で探すので、ダウンロードしません。
設定
| 項目 | 方法 |
|---|---|
| GitHub トークン | CARLA_PACK_TOKEN → GH_TOKEN → GITHUB_TOKEN → carla-pack login で保存したもの → gh auth token の順 |
| 検索対象のリポジトリ | --repo(繰り返し可)、CARLA_PACK_REPOS(カンマ区切り)、carla-pack repo add |
| 保存場所 | CARLA_PACK_CONFIG_DIR(既定 ~/.config/carla-pack/config.json、パーミッション 600) |
| GitHub Enterprise Server | CARLA_PACK_GITHUB_API(例 https://ghe.example.com/api/v3) |
carla-pack login は GitHub App(推奨: Contents 読み取り専用、Pack リポジトリにインストール)の client ID によるデバイスフローです
(--client-id / CARLA_PACK_GITHUB_CLIENT_ID、OAuth App なら --scope repo)。gh auth login 済みなら不要です。
CI では Pack リポジトリを読める fine-grained PAT か GitHub App のトークンを CARLA_PACK_TOKEN に渡してください
(ワークフローの GITHUB_TOKEN は他のリポジトリを読めません)。
配る(Pack リポジトリを作る側)
docs/pack-repository.md を参照してください。概要:
- Private リポジトリを作り、templates/pack-repo/carla-packs.toml を置く。配りたい相手に Read 権限を付ける。
- バケット(R2 / S3)と読み取り専用の鍵の発行元を用意し、鍵のローテーション workflow をコピーする。
carla-pack publish <Pack>.tar.gzでアップロードとマニフェストへの追記を行い、commit / push する。 アップロード先は R2 / S3(carla-pack が直接マルチパートで送る)か Hugging Face(pip install 'carla-pack-registry[huggingface]'、huggingface_hub経由)。
開発
uv venv && . .venv/bin/activate
uv pip install "maturin>=1.9,<2" pytest "moto[server]==5.2.5" boto3 "huggingface_hub>=0.32"
maturin develop # Rust コアをビルドして carla_pack_registry をインストール
cargo fmt --check && cargo clippy --all-targets --features python -- -D warnings
cargo test # Rust: SigV4 の公式テストベクタ、GitHub / S3 のモックサーバでの全フロー、展開の安全性
pytest # Python: CARLA 側(mount / unmount の順序)と、moto(IAM 認証付き S3)+ 偽 GitHub での E2E
maturin build --release # wheel(abi3: Python 3.10 以上で共通)
PyPI へのリリースは PR のラベルで行います。release:major|minor|patch を 1 つ付けてマージすると、バージョンの更新・タグ・GitHub Release・PyPI 公開まで
.github/workflows/release.yml が行います(docs/release.md)。
ドキュメント
| ドキュメント | 内容 |
|---|---|
| docs/architecture.md | 仕組み、マニフェストと鍵ファイルの形式、旧 Registry サーバとの違い |
| docs/security.md | 信頼の境界、失効、残留リスク |
| docs/pack-repository.md | Pack リポジトリの作り方(R2 / AWS / その他の S3 互換) |
| docs/release.md | carla-pack-registry の PyPI リリース手順(ラベル駆動、Trusted Publishing) |
ライセンス
Metadata
Release files for carla-pack-registry 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| carla_pack_registry-0.3.0.tar.gz | 116.5 kB | With provenance | Details for carla_pack_registry-0.3.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| carla_pack_registry-0.3.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for carla_pack_registry-0.3.0-cp310-abi3-win_amd64.whl |
| carla_pack_registry-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for carla_pack_registry-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl |
| carla_pack_registry-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for carla_pack_registry-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl |
| carla_pack_registry-0.3.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for carla_pack_registry-0.3.0-cp310-abi3-macosx_11_0_arm64.whl |
| carla_pack_registry-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for carla_pack_registry-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 15.9 MB
Release files / carla_pack_registry-0.3.0.tar.gz
| Download URL | carla_pack_registry-0.3.0.tar.gz |
|---|---|
| Size | 116.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d56f98054aba0240a9f1f6ef04142da6ba109205974d2394448709153e10f98
|
|
BLAKE2b-256 checksum How to use checksums |
40907865c03157842436ba9da5f31d51e1839641b5bf1891f86626cdfc992e0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / carla_pack_registry-0.3.0-cp310-abi3-win_amd64.whl
| Download URL | carla_pack_registry-0.3.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5c116d79df41c2179156a7cf873ae717d76ceac649f65ffae62c798aa4bf4301
|
|
BLAKE2b-256 checksum How to use checksums |
b1df8e8623d04fc072c1824ce54b706e3fb3ddb9734cd946fe41a19809cff914
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / carla_pack_registry-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | carla_pack_registry-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9fd9676701492bd87fcb2df8953c06d81950cead7c24bedb8a3c3f81968a7eae
|
|
BLAKE2b-256 checksum How to use checksums |
3baeb532b885e81547e1a1a7496aadb09942eabaf37544325aeb10d1bf773d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / carla_pack_registry-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | carla_pack_registry-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
1d75b84be8a653f3a4f5ffa72cf3a0658f2f1f79cc253a011c76bdc8e3a350b5
|
|
BLAKE2b-256 checksum How to use checksums |
5327bad4be0c8a682990e726757c5c9669cd0f49f9724c6afd5f217413754cf8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / carla_pack_registry-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | carla_pack_registry-0.3.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2ec7ad1a82899781372ca9947ea6a0e6ed24811a79515bdbab9848b9e15cfeed
|
|
BLAKE2b-256 checksum How to use checksums |
4856640775f6340b3b0a999ea8fe9d876238dcad46c9d0124855e1712b82eeaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / carla_pack_registry-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | carla_pack_registry-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
39f4bb72cfae23cc7bc8e6d958a84d33d00274385b833069784c3e50c3466150
|
|
BLAKE2b-256 checksum How to use checksums |
b113b5bbeea2bcc6dc52a33e9f22adb10816d43a4bcccaf7d9cfb8dfb3cf7f5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for carla-pack-registry 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for carla_pack_registry-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.