https://prefect.io logo
Title
s

Satyasheel

08/11/2022, 9:22 AM
Hi All, I am pretty new to Prefect (Please bear with me) and currently migrating a jenkins/Airflow job to Prefect. I am running everything in prefect cloud, we are using
KubernetesRun
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 🙂
1
a

Anna Geller

08/12/2022, 1:43 PM
Welcome! Are you running this on Cloud 1? And if you are new to Prefect I would highly highly encourage you to use Prefect 2.0 instead which is the default version now docs.prefect.io
the error might be related to poetry - you can try removing poetry dependencies and package everything purely with pip