GoogleCloudPlatform / cloud-profiler-python

Stackdriver Profiler Python agent is a tool that continuously gathers CPU usage information from Python applications
Apache License 2.0
27 stars 23 forks source link

Cloud Run Build Error #141

Closed theobouwman closed 7 months ago

theobouwman commented 9 months ago

I am running on FastAPI but get a build error on Cloud Run:

Step #0 - "Build": Failed to build google-cloud-profiler
Step #0 - "Build": ERROR: Could not build wheels for google-cloud-profiler, which is required to install pyproject.toml-based projects

Base Dockerfile:

FROM tiangolo/uvicorn-gunicorn:python3.11-slim
krstef commented 8 months ago

According to instructions in README, it is required to install build-base package as part of Alpine image in order to be able to build cloud-profiler-python properly.

Since you're using python3.11-slim as a base image, you should install equivalent package to build-base, which is in your case build-essential. You can install required package as follows: RUN apt-get update && apt-get install -y --no-install-recommends build-essential

aabmass commented 7 months ago

@krstef's answer is correct. Please re-open if that doesn't solve the issue for you