Adam
06/23/2021, 10:13 AMERROR - prefect.CloudFlowRunner | Unexpected error: AttributeError("'Log' object has no attribute 'splitlines'")
I’m running prefect self hosted. Server, agent & flow versions are 0.14.22
Nothing has changed, any idea what could be the reason?ciaran
06/23/2021, 11:26 AMAdam
06/23/2021, 12:33 PM########## tasks ##########
@task()
def add_ten(x):
print(f'starting {x}')
sleep(10)
print(f'ending {x}')
return x * 2
########## run ##########
def kube_cluster():
pod_spec = make_pod_spec(
image="prefect:latest",
)
return KubeCluster(pod_spec)
with Flow("test1",
executor=DaskExecutor(
cluster_class=kube_cluster)
) as flow:
t = add_ten(1)
t1 = add_ten(2)
t2 = add_ten(3)
t3 = add_ten(10)
t4 = add_ten(20)
t5 = add_ten(30)
flow.run_config = KubernetesRun(
image="prefect:latest"
)
ciaran
06/23/2021, 12:35 PMprefect:latest
ciaran
06/23/2021, 12:35 PMciaran
06/23/2021, 12:35 PMAdam
06/23/2021, 12:35 PMciaran
06/23/2021, 12:40 PMAdam
06/23/2021, 1:18 PMciaran
06/23/2021, 1:20 PMZanie
splitlines
in our repo so I'm not sure where this is happening. Can you share a longer traceback for the error or does it not exist?ciaran
06/24/2021, 9:02 AMAdam
06/24/2021, 10:26 AMpip install --no-cache-dir <https://github.com/PrefectHQ/prefect.git@0.14.22#egg=prefect[all_orchestration_extras]>
git clone <https://github.com/PrefectHQ/prefect.git> --branch 0.14.22
Zanie
Zanie
Zanie
Adam
06/25/2021, 7:54 AMPython —version
Python 3.8.6
- custom prefect base image
FROM python-centos:3.8
USER root
ADD <https://github.com/krallin/tini/releases/download/v0.19.0/tini> /opt/app-root/bin/tini
RUN yum update -y && \
pip install --upgrade pip && \
yum install -y gcc git curl && \
mkdir /root/.prefect/ && \
pip install --no-cache-dir git+<https://github.com/PrefectHQ/prefect.git@0.14.22#egg=prefect[all_orchestration_extras]> && \
pip install dask_kubernetes
RUN cd /tmp && \
git clone <https://github.com/PrefectHQ/prefect.git> --branch 0.14.22 && \
cp /tmp/prefect/entrypoint.sh /usr/local/bin/entrypoint.sh && \
rm -rf /tmp/prefect
RUN yum remove -y git && \
yum clean all && yum autoremove -y && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /.cache/pip /dask-worker-space /.local
RUN chgrp -R 0 /.local /.cache /usr /opt /dask-worker-space && \
chmod -R g=u /.local /.cache /usr /opt /dask-worker-space && \
chown -R 1001:0 /.local /.cache /usr /opt /dask-worker-space && \
chmod 775 /.local /.cache /usr /opt /dask-worker-space && \
chmod +x /opt/app-root/bin/tini
USER 1001
ENTRYPOINT ["tini", "-g", "--", "entrypoint.sh"]
- extract from flow
from prefect.executors import DaskExecutor
from dask_kubernetes import KubeCluster, make_pod_spec
########## run ##########
def kube_cluster():
pod_spec = make_pod_spec(
image="<custom prefect image>",
)
return KubeCluster(pod_spec)
with Flow("bb-parallel",
executor=DaskExecutor(
cluster_class=kube_cluster,
adapt_kwargs={"minimum": 5, "maximum": 10})
) as flow:
flow.run_config = KubernetesRun(
image="<custom prefect image>"
)
ciaran
06/25/2021, 9:01 AMdask_kubernetes
- Prefect does install a compatible version if you select all_extras
I believe. It might not be included when you pick all_orchestration_extras
- The setup.py
is a bit confusing.ciaran
06/25/2021, 9:02 AMdask_kubernetes
might be where the funky behaviour is coming fromAdam
06/25/2021, 9:04 AMciaran
06/25/2021, 9:08 AM