Hey all! I'm trying to use `DocekrStorage`, and my...
# prefect-community
w
Hey all! I'm trying to use
DocekrStorage
, and my
Dockerfile
looks like the below. It gets through all the steps except the final step with an error. Does anyone know how to resolve this?
k
What is your Prefect version locally when you do this?
w
0.15.9 @Kevin Kho
@Kevin Kho we actually have images already built (from somewhere else) in ECR. Can we just use those instead of trying to have us build them with
DockerStorage
?
k
Yeah totally just point to them with
KubernetesRun(image="…")
and then your Storage becomes
LocalStorage(path_to_file="some/path/in/container/flow.py")
or something like that.
Ah that may be a bit off. Let me just give you an example here from Anna. Note the
build=False
in the register call
Can you move the error to the thread to keep the main channel a bit cleaner when you get the chance?
w
Copy code
Step 16/16 : RUN python /opt/prefect/healthcheck.py '["/opt/prefect/flows/dbt.prefect"]' '(3, 8)'
 ---> Running in 24a30f5c6416
Beginning health checks...
System Version check: OK
/opt/prefect/healthcheck.py:152: UserWarning: Flow uses module which is not importable. Refer to documentation on how to import custom mo
dules <https://docs.prefect.io/api/latest/storage.html#docker>
  flows = cloudpickle_deserialization_check(flow_file_paths)
Traceback (most recent call last):
  File "/opt/prefect/healthcheck.py", line 152, in <module>
    flows = cloudpickle_deserialization_check(flow_file_paths)
  File "/opt/prefect/healthcheck.py", line 44, in cloudpickle_deserialization_check
    flows.append(cloudpickle.loads(flow_bytes))
ModuleNotFoundError: No module named 'prefect.backend'

The command '/bin/sh -c python /opt/prefect/healthcheck.py '["/opt/prefect/flows/dbt.prefect"]' '(3, 8)'' returned a non-zero code: 1
    Error building storage:
      Traceback (most recent call last):
        File "/usr/local/lib/python3.8/site-packages/prefect/cli/build_register.py", line 463, in build_and_register
    storage.build()
        File "/usr/local/lib/python3.8/site-packages/prefect/storage/docker.py", line 308, in build
    self._build_image(push=push)
        File "/usr/local/lib/python3.8/site-packages/prefect/storage/docker.py", line 373, in _build_image
    raise ValueError(
      ValueError: Your docker image failed to build!  Your flow might have failed one of its deployment health checks - please ensure tha
t all necessary files and dependencies have been included.

  Registering 'dbt'... Error
Dockerfile
contents:
Copy code
FROM prefecthq/prefect:latest-python3.8

ENV PIP_NO_CACHE_DIR=1

# Copying some stuff from our repo into the image.
COPY workflows /workflows
COPY app /app

RUN pip install -r workflows/requirements.txt
RUN pip install -e /workflows
RUN pip install -e /app

ENV PYTHONPATH=/
Sure thing @Kevin Kho. Sorry; good call.
k
Thank you!
w
@Christian Nuss
s
k
Yeah so local is the default and it saves things on the local machine, but you can also use it to specify a file relative to your container
🙌 1