Atsushi Saito
04/11/2022, 5:26 PMlate runs
icon on cloud UI.
However, cloud-UI shows neither success (green status) nor failure (red status)
Is this a issue about docker-login ? or are there other possible causes?Kevin Kho
04/11/2022, 5:32 PMAtsushi Saito
04/11/2022, 5:54 PMflow.py
has a flow.
import prefect
from prefect import task, Flow
from prefect.storage import Local
from prefect.run_configs import DockerRun, LocalRun
@task
def say_hello():
logger = prefect.context.get("logger")
<http://logger.info|logger.info>("Hello, Cloud!")
_run_config = DockerRun(
env={},
image="MyDockerHubAccount/prefect-hello:latest"
)
_storage=Local()
with Flow("flow-tutorial-002", run_config=_run_config, storage=_storage) as flow:
say_hello()
# Register the flow under the "tutorial" project
flow.register(project_name="tutorial-002")
DockerRun
argument is build with the following Dockerfile and pushed into docker-hub.
FROM prefecthq/prefect:latest-python3.8
RUN pip install pandas numpy scikit-learn prefect dvc prefect[github]
RUN apt update && apt install -y curl unzip && rm -rf /var/lib/apt/lists/*
RUN curl "<https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>" -o "awscliv2.zip"
RUN unzip awscliv2.zip && ./aws/install
Terminal 1:
$ prefect agent docker start
with ~/.prefect/config.toml
has api-key for cloud UI
Terminal 2:
$ prefect create project tutorial-002
tutorial-002 created
$ prefect register -p flow.py --project tutorial-002 --name flow-tutorial-002
Collecting flows...
/home/a-saito/mlops/sand_dvc/prf/flow.py:23: UserWarning: Attempting to call `flow.register` during execution of flow file will lead to unexpected results.
flow.register(project_name="tutorial-002")
Processing 'flow.py':
Building `Local` storage...
Registering 'flow-tutorial-002'... Done
└── ID: e92946fc-4416-450a-8fed-99318c223e07
└── Version: 2
======================== 1 registered ========================
$ prefect run --id e92946fc-4416-450a-8fed-99318c223e07
Looking up flow metadata... Done
Creating run for flow 'flow-tutorial-002'... Done
└── Name: rough-swine
└── UUID: d4defc15-8784-4760-b63f-0e275caddf87
└── Labels: ['DL-BoxII']
└── Parameters: {}
└── Context: {}
└── URL: <https://cloud.prefect.io/asc0/flow-run/d4defc15-8784-4760-b63f-0e275caddf87>
Kevin Kho
04/11/2022, 7:50 PM