https://prefect.io logo
#prefect-community
Title
# prefect-community
a

Atsushi Saito

04/11/2022, 5:26 PM
I have questions on the
late 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?
k

Kevin Kho

04/11/2022, 5:32 PM
Hey @Atsushi Saito, cold you move some of the details into the thread to keep the main channel cleaner? This is a labelling issue. Let me find some reading for you
See this
a

Atsushi Saito

04/11/2022, 5:54 PM
flow.py
has a flow.
Copy code
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.
Copy code
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:
Copy code
$ prefect agent docker start
with
~/.prefect/config.toml
has api-key for cloud UI Terminal 2:
Copy code
$ 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 ========================
Copy code
$ 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>
k

Kevin Kho

04/11/2022, 7:50 PM
thanks for moving it!
2 Views