Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Firebase Functions Python build cannot reliably install private Artifact Registry packages

Đang mở
#271 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
google-cloud, python
Lĩnh vực
build-system, cloud

Hướng nghiên cứu

Bắt đầu bằng cách xem xét buildpack google.python.pip được liệt kê và lệnh python3 -m pip install --requirement requirements.txt trong builder image được chỉ định. Tái hiện lỗi với requirements.txt mẫu và xác minh các quyền của tài khoản dịch vụ Cloud Build. Được xem là hoàn tất khi một lần triển khai Firebase Functions có thể cài đặt gói riêng tư của Artifact Registry mà không cần vendoring, pipeline tùy chỉnh hoặc containerization.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature-request

Summary

Deploying Firebase Functions written in Python cannot reliably install private Python packages hosted in Google Artifact Registry using the documented authentication mechanism.

Although Artifact Registry supports authentication via the keyrings.google-artifactregistry-auth backend, the Firebase Functions build process installs dependencies in a single pip invocation. This creates a bootstrapping problem where the authentication backend must already be installed before pip attempts to resolve private dependencies.

As a result, private packages cannot be consumed out-of-the-box during function deployment causing deployment issues and ultimately meaning private packages cannot be consumed in firebase functions. Private Python packages are a common pattern for shared internal libraries, and the current limitation makes this workflow difficult.

Expected Behaviour

A Firebase Functions deployment should be able to install private Python packages hosted in Artifact Registry without requiring custom build pipelines, vendored wheels, or containerization.

For example, the following requirements.txt should work:

--extra-index-url https://<LOCATION>-python.pkg.dev/<PROJECT>/<REPO>/simple/

private-package==0.0.1

provided that:

  • the Cloud Build service account has artifactregistry.reader
  • the repository contains the package

Actual Behaviour

The Artifact Registry authentication mechanism requires the keyring backend to be present before pip attempts to fetch packages.

However pip resolves and downloads packages before installing their dependencies, meaning that adding the backend as a dependency does not help.

Example attempt:

--extra-index-url https://<LOCATION>-python.pkg.dev/<PROJECT>/<REPO>/simple/

keyring
keyrings.google-artifactregistry-auth
private-package==0.0.1

This still fails because pip attempts to resolve private-package before installing the keyring backend. This creates a bootstrap race condition

Why this is a Problem

The current behavior makes it effectively impossible to use private Artifact Registry Python packages with Firebase Functions without workarounds such as:

  • vendoring wheels into the repository
  • migrating to cloud run where the build process can be controlled

Environment Details

Builder image:

europe-west2-docker.pkg.dev/serverless-runtimes/google-22-full/builder/python:python_20260224_RC00_lightweight

Buildpacks used:

google.utils.archive-source
google.python.runtime
google.python.functions-framework
google.python.pip
google.utils.label-image
google.python.link-runtime

The pip step is executed as:

python3 -m pip install --requirement requirements.txt

Python runtime:

Python 3.13.12

Suggested Solutions

Option 1: Preinstall Artifact Registry authentication backend

Ensure the build environment includes:

keyring
keyrings.google-artifactregistry-auth

before the pip install step.

Option 2: Two-phase dependency install

Modify the Python buildpack to run:

pip install keyring keyrings.google-artifactregistry-auth
pip install -r requirements.txt
Ngôn ngữ chính
Python
Star
167
Fork
36
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/firebase-functions-python

Tất cả issue của firebase/firebase-functions-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.