p_mo
p_mo

Reputation: 77

Cloud Run Container Not Building Possibly Due to Package Issue?

I am encountering an error when I am building a Cloud Run container from a particular directory in a GCP project. This particular directory has always built correctly in the past, and no changes were made to it since the last successful build.

Recently, however, I wanted to fire up a pipeline for this directory, so I added a few pound signs to the code (so the Cloud Build trigger could start building the Run container - additionally, the addition of these pound signs should not affect anything in the code). In the process, this error showed up:

E: Unable to locate package python3.7-dev
E: Couldn't find any package by glob 'python3.7-dev'
E: Couldn't find any package by regex 'python3.7-dev'
The command '/bin/sh -c apt-get update   && apt-get upgrade -y   && apt-get install -y wget 
unzip xvfb libxtst6 libxrender1 python3.7-dev build-essential net-tools' returned a non-zero 
code: 100

Given that nothing changed, I'm not sure what caused this error. What could this error message mean, and what actions should I take to fix it? Any help is appreciated, and if more information is needed, I'll gladly update the question. Thanks!

EDIT: These are the dockerfile contents:

FROM python:3.7-slim

# Allow statements and log messages to immediately appear in the Cloud Run logs
ENV PYTHONUNBUFFERED True

# install dependencies
RUN  apt-get update \
  && apt-get upgrade -y \
  && apt-get install -y wget unzip xvfb libxtst6 libxrender1 python3.7-dev build-essential net-tools
#RUN apt-get install -y procps

# set environment variables
ENV TWS_INSTALL_LOG=/root/Jts/tws_install.log \
    ibcIni=/root/ibc/config.ini \
    ibcPath=/opt/ibc \
    javaPath=/opt/i4j_jres \
    twsPath=/root/Jts \
    twsSettingsPath=/root/Jts

# make dirs
RUN mkdir -p /tmp && mkdir -p ${ibcPath} && mkdir -p ${twsPath}

# copy over IB Gateway
COPY Jts /root/Jts
COPY i4j_jres /home/mmr/.i4j_jres

# download IBC
RUN wget -q -O /tmp/IBC.zip https://github.com/IbcAlpha/IBC/releases/download/3.8.2/IBCLinux-3.8.2.zip
RUN unzip /tmp/IBC.zip -d ${ibcPath}
RUN chmod +x ${ibcPath}/*.sh ${ibcPath}/*/*.sh

# copy IBC/Jts configs
COPY ibc/config.ini ${ibcIni}

# copy cmd script
WORKDIR /home
COPY cmd.sh cmd.sh
RUN chmod +x cmd.sh

# set display environment variable (must be set after TWS installation)
ENV DISPLAY=:0


WORKDIR /home
COPY ib_server ./ib_server
COPY __init__.py .
COPY requirements.txt .
RUN pip install -r /home/requirements.txt

# execute cmd script to start Xvfb and gunicorn
CMD ./cmd.sh
# CMD tail -f /dev/null

The container creation is triggered when a change is made to the directory and pushed, which is why I had to add the pound signs and push to fire up the build.

Upvotes: 0

Views: 732

Answers (1)

Alex L
Alex L

Reputation: 157

The error lies in the python3.7-dev package you are trying to install in the container (line 9 of your Dockerfile), as the package no longer exists in the sources of the container. It has nothing to do with your change, or with Cloud Build, as probably the package was just removed from the sources since the last push.

If you need a python-dev package, I would recommend that you consider installing python3-dev especially, or python3.9-dev, as all changes in minor python versions should be backwards compatible with each other.

However if you really need python3.7-dev, you would need to manually recompile and install the packages, or add sources where it can be found and install it then. Bear in mind that the debian version this python image is based in has incompatibilities with this package you will need to manually solve, so it wouldn't be a straight forward solution.

Upvotes: 1

Related Questions