Satyasheel
08/11/2022, 9:22 AMKubernetesRun
to run the flow as a k8s jobs. While running the flow we are getting below error:
Pod prefect-job-a75387b8-lc6tn failed.
Container 'data-platform-bq-freshness-prod' state: terminated
Exit Code:: 127
Reason: Error
With Exit code: 127 it seems container is missing some file of DIR but when I checked the container it has all the required files and dir’s.
My current k8s job template looks like as below:
apiVersion: batch/v1
kind: Job
metadata:
namespace: dpa-flows
spec:
ttlSecondsAfterFinished: 604800 # One week
template:
spec:
serviceAccountName: flows-default
containers:
- name: data-platform-flow
env:
- name: PREFECT__LOGGING__LEVEL
value: DEBUG
and Dockerfile as below:
FROM prefecthq/prefect:1.2.1-python3.9
# in order to install pyformance from git, poetry needs git installed om the image.
# Or use poerty 1.2 beta. See: <https://github.com/python-poetry/poetry/pull/2105>
ARG POETRY_VERSION="1.1.14"
RUN apt-get -y update && apt-get -y install git && pip install "poetry==$POETRY_VERSION"
ENV PATH=/root/.poetry/bin:$PATH
# this copy will allow Caching dependencies.
# see <https://stackoverflow.com/questions/53835198/integrating-python-poetry-with-docker>
WORKDIR /code
COPY data_freshness/poetry.lock bq_data_freshness/pyproject.toml /code/
RUN POETRY_VIRTUALENVS_CREATE=false poetry install --no-ansi --no-interaction
ADD data_freshness /data_freshness/
# ml team have a requirement that docker will run as non root
RUN useradd nonrootuser
USER nonrootuser
Any help would be really great 🙂Anna Geller