Garret Cook
01/22/2021, 4:57 PMnicholas
Garret Cook
01/22/2021, 5:00 PMnicholas
Garret Cook
01/22/2021, 5:01 PMnicholas
prefect backend serverGarret Cook
01/22/2021, 5:02 PMGarret Cook
01/22/2021, 5:02 PMnicholas
curl <http://localhost:4200/graphql>Garret Cook
01/22/2021, 5:04 PMGET /graphql HTTP/1.1
User-Agent: curl/7.29.0
Host: localhost:4200
Accept: /< HTTP/1.1 400 Bad Request < X-Powered-By: Express < Access-Control-Allow-Origin: * < Content-Type: text/html; charset=utf-8 < Content-Length: 18 < ETag: W/“12-7JEJwpG8g89ii7CR/6hhfN27Q+k” < Date: Fri, 22 Jan 2021 170345 GMT < Connection: keep-alive < Keep-Alive: timeout=5 < * Connection #0 to host localhost left intact GET query missing.
nicholas
Garret Cook
01/22/2021, 5:07 PMGarret Cook
01/22/2021, 5:08 PMnicholas
echo "from prefect.utilities.docker_util import get_docker_ip\nprint(get_docker_ip())" > docker_ip.py && python docker_ip.pynicholas
nicholas
Garret Cook
01/22/2021, 5:14 PM[root@prefect ~]# cat docker_ip.pyfrom prefect.utilities.docker_util import get_docker_ipprint(get_docker_ip())[root@prefect ~]# python3.6 docker_ip.py172.17.0.1[root@prefect ~]#Garret Cook
01/22/2021, 5:14 PMnicholas
nicholas
firewalldfirewall-cmd --zone=public --add-masquerade --permanent && firewall-cmd --reloadnicholas
Garret Cook
01/22/2021, 5:22 PMGarret Cook
01/22/2021, 5:22 PMnicholas
Garret Cook
01/22/2021, 5:29 PMGarret Cook
01/22/2021, 5:29 PM[root@prefect ~]# prefect agent docker start____            __           _        _                    _|  _ \ _ __ ___ / _| ___  ___| |_     / \   __ _  ___ _ __ | |_| |_) | '__/ _ \ |_ / _ \/ __| __|   / _ \ / _|  __/| | |  __/  _|  __/ (__| |_   / ___ \ (_| |  __/ | | | |_|_|   |_|  \___|_|  \___|\___|\__| /_/   \_\__, |\___|_| |_|\__||___/[2021-01-22 17:27:21,044] INFO - agent | Starting DockerAgent with labels [][2021-01-22 17:27:21,045] INFO - agent | Agent documentation can be found at <https://docs.prefect.io/orchestration/>[2021-01-22 17:27:21,045] INFO - agent | Agent connecting to the Prefect API at <http://localhost:4200>[2021-01-22 17:27:21,079] INFO - agent | Waiting for flow runs...[2021-01-22 17:27:21,316] INFO - agent | Found 1 flow run(s) to submit for execution.[2021-01-22 17:27:21,513] INFO - agent | Deploying flow run 2d740d95-feb3-4ae9-b002-c4581595abf8[2021-01-22 17:27:21,518] INFO - agent | Pulling image prefecthq/prefect:0.14.3...[2021-01-22 17:27:24,245] INFO - agent | Successfully pulled image prefecthq/prefect:0.14.3...[2021-01-22 17:28:08,008] INFO - agent | Found 1 flow run(s) to submit for execution.[2021-01-22 17:28:08,175] INFO - agent | Deploying flow run 980ddf94-76c8-4e90-8219-59c80a3b30e5[2021-01-22 17:28:08,181] INFO - agent | Pulling image prefecthq/prefect:0.14.3...[2021-01-22 17:28:08,933] INFO - agent | Successfully pulled image prefecthq/prefect:0.14.3...nicholas
Garret Cook
01/22/2021, 5:30 PMnicholas
nicholas
Garret Cook
01/22/2021, 5:32 PM[root@prefect production-flows]# cat task.pyimport prefectfrom prefect.run_configs.docker import DockerRunfrom prefect import task, Flow@taskdef say_hello():logger = prefect.context.get("logger")<http://logger.info|logger.info>("Hello, Cloud!")with Flow("hello-flow") as flow:say_hello()flow.run_config = DockerRun(#env={"SOME_VAR": "VALUE"},#image="example/image-name:with-tag")# builds the Docker image and pushes Flow metadata to the Prefect Cloud database#flow.deploy(project_name="Backups")flow.register(project_name="Backups")nicholas
RunningGarret Cook
01/22/2021, 6:30 PMnicholas
DockerRunfrom prefect.storage import Docker
flow.storage = Docker()nicholas
Garret Cook
01/22/2021, 6:34 PMnicholas
Garret Cook
01/22/2021, 6:34 PMGarret Cook
01/22/2021, 6:34 PMGarret Cook
01/22/2021, 6:35 PM[2021-01-22 17:43:53,340] INFO - agent | Pulling image prefecthq/prefect:0.14.3...Garret Cook
01/22/2021, 6:35 PMnicholas
nicholas
Garret Cook
01/22/2021, 7:42 PMprefect agent docker start --show-flow-logsGarret Cook
01/22/2021, 7:42 PMGarret Cook
01/22/2021, 7:43 PMnicholas
nicholas
Garret Cook
01/22/2021, 8:24 PMurllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=4200): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0166b2a908>: Failed to establish a new connection: [Errno 113] No route to host',))Garret Cook
01/22/2021, 8:26 PMGarret Cook
01/22/2021, 8:26 PMGarret Cook
01/22/2021, 8:26 PMGarret Cook
01/22/2021, 8:34 PMGarret Cook
01/22/2021, 8:35 PMGarret Cook
01/22/2021, 8:35 PMnicholas
nicholas
Garret Cook
01/22/2021, 8:36 PMnicholas
Garret Cook
01/22/2021, 8:37 PMGarret Cook
01/22/2021, 8:37 PMnicholas
nicholas
Garret Cook
01/22/2021, 8:38 PM