Skip to content

fix: Switch to pyproject.toml based builds #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 14, 2025

Conversation

di
Copy link
Member

@di di commented May 12, 2025

Fixes the buildpack integration test failure in #363.

@di di changed the title Switch to pyproject.toml-based builds fix: Switch to pyproject.toml based builds May 12, 2025
@di di force-pushed the switch-to-pyproject.toml branch from 889ed39 to 3cdac23 Compare May 12, 2025 23:25
@di di force-pushed the switch-to-pyproject.toml branch from 1c24807 to d1f3726 Compare May 13, 2025 00:22
@di
Copy link
Member Author

di commented May 13, 2025

I've disabled the Python 3.12 conformance test job, it was failing.

Specifically, the buildpack is incorrectly selecting Ubuntu 18.04 as the base image for the Python 3.12 runtime, but Python 3.12 and above is only available in Ubuntu 20.04, and it doesn't appear possible to configure/override this via the conformance test suite. This may be a bug with the buildpack.

$ curl -sA GCPBuildpacks https://dl.google.com/runtimes/ubuntu1804/python/version.json | jq -c 'map(split(".") | map(tonumber)) | sort | max | join(".")'
"3.11.12"

$ curl -sA GCPBuildpacks https://dl.google.com/runtimes/ubuntu2204/python/version.json | jq -c 'map(split(".") | map(tonumber)) | sort | max | join(".")'
"3.13.3"

Copy of the log output for posterity:

2025/05/12 23:31:48 Validating for http...
Pulling image gcr.io/gae-runtimes/buildpacks/python/builder:latest
latest: Pulling from gae-runtimes/buildpacks/python/builder
Digest: sha256:1252122ad4d807116ef607110c21e95bb07808ce0300ce3b565904d00d945ae2
Status: Image is up to date for gcr.io/gae-runtimes/buildpacks/python/builder:latest
Selected run image gcr.io/gae-runtimes/buildpacks/stacks/google-gae-18/run
Pulling image gcr.io/gae-runtimes/buildpacks/stacks/google-gae-18/run
latest: Pulling from gae-runtimes/buildpacks/stacks/google-gae-18/run
53e5e[15](https://github.com/GoogleCloudPlatform/functions-framework-python/actions/runs/14984718538/job/42096342450?pr=365#step:6:16)8da5a: Already exists
7577c9c60d3f: Pulling fs layer
3c2cba919283: Pulling fs layer
5b64e9594bb4: Pulling fs layer
aa95460e0f62: Pulling fs layer
e61fcd9a4a9c: Pulling fs layer
c52b02cc2bef: Pulling fs layer
ba186d3670e5: Pulling fs layer
04ae2d9457d7: Pulling fs layer
66ee498b206d: Pulling fs layer
6d73356edc3e: Pulling fs layer
be78d9e38218: Pulling fs layer
b2c5182e7a51: Pulling fs layer
2953c0449d23: Pulling fs layer
70c7f394fd0f: Pulling fs layer
024cb7f3f964: Pulling fs layer
db794309d427: Pulling fs layer
024b5fdfb60a: Pulling fs layer
cdd40cc7a528: Pulling fs layer
72be2cd5b003: Pulling fs layer
6271f1d64338: Pulling fs layer
aa95460e0f62: Waiting
e61fcd9a4a9c: Waiting
c52b02cc2bef: Waiting
ba186d3670e5: Waiting
04ae2d9457d7: Waiting
66ee498b206d: Waiting
6d73356edc3e: Waiting
be78d9e38218: Waiting
b2c5182e7a51: Waiting
2953c0449d23: Waiting
70c7f394fd0f: Waiting
024cb7f3f964: Waiting
db794309d427: Waiting
024b5fdfb60a: Waiting
cdd40cc7a528: Waiting
72be2cd5b003: Waiting
6271f1d64338: Waiting
3c2cba919283: Verifying Checksum
3c2cba919283: Download complete
5b64e9594bb4: Verifying Checksum
5b64e9594bb4: Download complete
7577c9c60d3f: Download complete
aa95460e0f62: Verifying Checksum
aa95460e0f62: Download complete
e61fcd9a4a9c: Verifying Checksum
e61fcd9a4a9c: Download complete
c52b02cc2bef: Verifying Checksum
c52b02cc2bef: Download complete
7577c9c60d3f: Pull complete
3c2cba919283: Pull complete
ba186d3670e5: Verifying Checksum
ba186d3670e5: Download complete
5b64e9594bb4: Pull complete
aa95460e0f62: Pull complete
e61fcd9a4a9c: Pull complete
04ae2d9457d7: Download complete
c52b02cc2bef: Pull complete
ba186d3670e5: Pull complete
04ae2d9457d7: Pull complete
66ee498b206d: Download complete
66ee498b206d: Pull complete
6d73356edc3e: Download complete
6d73356edc3e: Pull complete
be78d9e38218: Verifying Checksum
be78d9e38218: Download complete
be78d9e38218: Pull complete
b2c5182e7a51: Verifying Checksum
b2c5182e7a51: Download complete
b2c5182e7a51: Pull complete
2953c0449d23: Verifying Checksum
2953c0449d23: Pull complete
70c7f394fd0f: Download complete
70c7f394fd0f: Pull complete
db794309d427: Verifying Checksum
db794309d427: Download complete
024b5fdfb60a: Verifying Checksum
024b5fdfb60a: Download complete
cdd40cc7a528: Verifying Checksum
cdd40cc7a528: Download complete
72be2cd5b003: Verifying Checksum
72be2cd5b003: Download complete
6271f1d64338: Verifying Checksum
6271f1d64338: Download complete
024cb7f3f964: Verifying Checksum
024cb7f3f964: Download complete
024cb7f3f964: Pull complete
db794309d427: Pull complete
024b5fdfb60a: Pull complete
cdd40cc7a528: Pull complete
72be2cd5b003: Pull complete
6271f1d64338: Pull complete
Digest: sha256:70e4881c619f2c0fa4c9eb87ff55df14a93d3d8189b0b1fb50d74c25cbac23ef
Status: Downloaded newer image for gcr.io/gae-runtimes/buildpacks/stacks/google-gae-18/run:latest
Pulling image buildpacksio/lifecycle:0.[16](https://github.com/GoogleCloudPlatform/functions-framework-python/actions/runs/14984718538/job/42096342450?pr=365#step:6:17).0
0.16.0: Pulling from buildpacksio/lifecycle
fc251a6e7981: Pulling fs layer
e79f28f8f2a6: Pulling fs layer
fc251a6e7981: Verifying Checksum
fc251a6e7981: Download complete
e79f28f8f2a6: Verifying Checksum
e79f28f8f2a6: Download complete
fc251a6e7981: Pull complete
e79f28f8f2a6: Pull complete
Digest: sha256:f75a04887fced3ae0504a37edb2c0d29d366511cd9ede34dbb90c5282b106e79
Status: Downloaded newer image for buildpacksio/lifecycle:0.16.0
Creating builder with the following buildpacks:
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
-> [email protected]
Provided Environment Variables
  GOOGLE_FUNCTION_SIGNATURE_TYPE=http
  GOOGLE_FUNCTION_TARGET=write_http_declarative
  GOOGLE_RUNTIME=python312
  GOOGLE_RUNTIME_VERSION=3.12
  X_GOOGLE_TARGET_PLATFORM=gcf
Using build cache volume pack-cache-library_c_o_nformance-test-func_latest-7ef430739d00.build
===> ANALYZING
Running the analyzer on OS linux with:
Container Settings:
  Args: /cnb/lifecycle/analyzer -gid 0 -log-level debug -daemon -stack /layers/stack.toml -run-image gcr.io/gae-runtimes/buildpacks/stacks/google-gae-18/run -launch-cache /launch-cache conformance-test-func
  System Envs: CNB_USER_ID=33 CNB_GROUP_ID=33 CNB_PLATFORM_API=0.11
  Image: buildpacksio/lifecycle:0.16.0
  User: root
  Labels: map[author:pack]
Host Settings:
  Binds: /var/run/docker.sock:/var/run/docker.sock pack-cache-library_c_o_nformance-test-func_latest-7ef430739d00.launch:/launch-cache pack-layers-gzmlhnheak:/layers pack-app-hbmhcmcvgd:/workspace
  Network Mode: 
[analyzer] Previous image with name "conformance-test-func" not found
[analyzer] Analyzing image "2e039a676ef1b47d846d3bcc1824727d2cb78f3feef6eadad6b9545b464812d8"
===> DETECTING
Running the detector on OS linux with:
Container Settings:
  Args: /cnb/lifecycle/detector -app /workspace -log-level debug
  System Envs: CNB_PLATFORM_API=0.11
  Image: pack.local/builder/6d677a687564736[17](https://github.com/GoogleCloudPlatform/functions-framework-python/actions/runs/14984718538/job/42096342450?pr=365#step:6:18)878:latest
  User: 
  Labels: map[author:pack]
Host Settings:
  Binds: pack-layers-gzmlhnheak:/layers pack-app-hbmhcmcvgd:/workspace
  Network Mode: 
[detector] ======== Output: [email protected] ========
[detector] Opting out: Env var GAE_APPLICATION_YAML_PATH is not set, not a GAE Flex app.
[detector] ======== Output: [email protected] ========
[detector] Opting in: GOOGLE_RUNTIME  matches "python"
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Output: [email protected] ========
[detector] Opting in: gunicorn missing from requirements.txt
[detector] ======== Output: [email protected] ========
[detector] Opting in: X_GOOGLE_TARGET_PLATFORM set to "gcf"
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Results ========
[detector] fail: [email protected]
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Output: [email protected] ========
[detector] Opting in: GOOGLE_RUNTIME  matches "python"
[detector] ======== Output: [email protected] ========
[detector] Opting in: GOOGLE_FUNCTION_TARGET set to "write_http_declarative"
[detector] ======== Output: [email protected] ========
[detector] Opting out: env var GOOGLE_RUNTIME is not set to python37
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Output: [email protected] ========
[detector] Opting in: always enabled
[detector] ======== Output: [email protected] ========
[detector] Opting out: X_GOOGLE_SKIP_RUNTIME_LAUNCH is not 'true'
[detector] ======== Results ========
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] skip: [email protected]
[detector] pass: [email protected]
[detector] pass: [email protected]
[detector] skip: [email protected]
[detector] Resolving plan... (try #1)
[detector] 5 of 7 buildpacks participating
[detector] google.utils.archive-source       0.0.1
[detector] google.python.runtime             0.9.1
[detector] google.python.functions-framework 0.9.6
[detector] google.python.pip                 0.9.2
[detector] google.utils.label                0.0.2
===> RESTORING
Running the restorer on OS linux with:
Container Settings:
  Args: /cnb/lifecycle/restorer -cache-dir /cache -gid 0 -log-level debug
  System Envs: CNB_USER_ID=33 CNB_GROUP_ID=33 CNB_PLATFORM_API=0.11
  Image: buildpacksio/lifecycle:0.16.0
  User: root
  Labels: map[author:pack]
Host Settings:
  Binds: pack-cache-library_c_o_nformance-test-func_latest-7ef430739d00.build:/cache pack-layers-gzmlhnheak:/layers pack-app-hbmhcmcvgd:/workspace
  Network Mode: 
[restorer] Reading buildpack directory: /layers/google.utils.archive-source
[restorer] Reading buildpack directory: /layers/google.python.runtime
[restorer] Reading buildpack directory: /layers/google.python.functions-framework
[restorer] Reading buildpack directory: /layers/google.python.pip
[restorer] Reading buildpack directory: /layers/google.utils.label
[restorer] Reading buildpack directory: /layers/google.utils.archive-source
[restorer] Reading buildpack directory: /layers/google.python.runtime
[restorer] Reading buildpack directory: /layers/google.python.functions-framework
[restorer] Reading buildpack directory: /layers/google.python.pip
[restorer] Reading buildpack directory: /layers/google.utils.label
===> BUILDING
Running the builder on OS linux with:
Container Settings:
  Args: /cnb/lifecycle/builder -app /workspace -log-level debug
  System Envs: CNB_PLATFORM_API=0.11
  Image: pack.local/builder/6d677a68756473617878:latest
  User: 
  Labels: map[author:pack]
Host Settings:
  Binds: pack-layers-gzmlhnheak:/layers pack-app-hbmhcmcvgd:/workspace
  Network Mode: 
[builder] Starting build
[builder] Running build for buildpack [email protected]
[builder] Looking up buildpack
[builder] Finding plan
[builder] Creating plan directory
[builder] Preparing paths
[builder] Running build command
[builder] === Utils - Archive Source ([email protected]) ===
[builder] Adding image label google.source-archive: /workspace/.googlebuild/source-code.tar.gz
[builder] Processing layers
[builder] Updating environment
[builder] Reading output files
[builder] Updating buildpack processes
[builder] Updating process list
[builder] Finished running build for buildpack [email protected]
[builder] Running build for buildpack [email protected]
[builder] Looking up buildpack
[builder] Finding plan
[builder] Creating plan directory
[builder] Preparing paths
[builder] Running build command
[builder] === Python - Runtime ([email protected]) ===
[builder] layers path: /layers/google.python.runtime/python
[builder] Using Python version from GOOGLE_RUNTIME_VERSION: 3.12
[builder] 2025/05/12 23:32:46 [DEBUG] GET https://dl.google.com/runtimes/ubuntu1804/python/version.json
[builder] Failure: (ID: afc8608d) invalid Python version specified: failed to resolve version matching: 3.12
[builder] ERROR: failed to build: exit status 1
[20](https://github.com/GoogleCloudPlatform/functions-framework-python/actions/runs/14984718538/job/42096342450?pr=365#step:6:21)25/05/12 23:32:46 unable to start server: building function container: building function image: executing lifecycle: failed with status code: 51
Server logs: could not read stdout file "/tmp/ff_serverlog_stdout.txt": open /tmp/ff_serverlog_stdout.txt: no such file or directory

@akerekes akerekes merged commit 4c44d08 into GoogleCloudPlatform:main May 14, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants