Kyle McChesney
10/13/2021, 8:23 PMfrom settings import JOB_QUEUE, JOB_DEF
@task
def trigger_batch_job(input):
...
return BatchSubmit(
job_name=job_name,
job_definition=JOB_DEF,
job_queue=JOB_QUEUE,
batch_kwargs=...,
).run()
with Flow(...):
inputs = some_task()
wait_res = AWSClientWait(
client='batch',
waiter_name='JobComplete',
)(
waiter_kwargs={
'jobs': [
trigger_batch_job(inputs),
],
'WaiterConfig': {
'Delay': 10,
'MaxAttempts': 10000,
},
},
)
And a settings.py file that looks like:
# settings.py
import os
JOB_DEF = os.environ.get(
'PREFECT_FLOWS_JOB_DEF',
'job-latest',
)
JOB_QUEUE = os.environ.get(
'PREFECT_FLOWS_JOB_QUEUE',
'job-gpu-dev',
)
The idea here is to have dynamic values for these settings based on what environment this is running in (we have dev/test/prod AWS accounts)Kyle McChesney
10/13/2021, 8:24 PMKyle McChesney
10/13/2021, 8:25 PMHugo Slepicka
10/13/2021, 9:28 PMOwen McMahon
10/13/2021, 9:30 PMhost_config
arg of DockerRun
, however looking at the Docker Python SDK docs, it appears the ports for forwarding have to additionally be passed into the create_container()
function (https://docker-py.readthedocs.io/en/stable/api.html#docker.api.container.ContainerApiMixin.create_container), which looking at the prefect source code, is not an additional arg I can pass into the run configs of DockerRun
to thus be sent into create_container()
. So, doesn't seem possible.
This feels like something pretty common and doable, and I'm guessing I'm just looking at it the wrong direction. Has anyone accomplish this before and have any suggestions? Thanks!Billy McMonagle
10/13/2021, 10:48 PMMarwan Sarieddine
10/13/2021, 11:29 PMDerek Heyman
10/14/2021, 4:02 AMJohn Shearer
10/14/2021, 11:07 AMHawkar Mahmod
10/14/2021, 11:31 AMprefect run
for a local flow?Andreas Tsangarides
10/14/2021, 2:18 PMECSAgent
we can use agent_address=<address:port>
. Should that be the load balancer's DNS ?
2. What is the health-check command to set in the application balancer?Amine Dirhoussi
10/14/2021, 2:28 PMbrian
10/14/2021, 3:07 PMClaire Herdeman
10/14/2021, 5:32 PMLouis Auneau
10/14/2021, 5:35 PMprefect version
.
virutalenv env
source env/bin/activate
pip install prefect==2.0a2
prefect version
This outputs:
0+unknown
William Grim
10/14/2021, 6:06 PMprefect.context.get("logger")
, but is there a better place where I can hook up my own log handlers?
For example, we are going to write a log handler that can send agent/flow logs to a central location like kafka or s3 or datadog or whatever. We haven't exactly decided the target location yet, but we do know we want a central space, and I'm just trying to find the best place to configure and hook up our custom log handler.Tony Yun
10/14/2021, 6:17 PMTony Yun
10/14/2021, 6:36 PMAndrew Black
10/14/2021, 7:27 PMJeff Baatz
10/14/2021, 7:37 PM0.14.22
, but a quick dig through github issues didn't reveal any known problem with this (or any changes to that task definition for quite a while), so I may just being doing something wrong.Eddie
10/14/2021, 9:35 PMcreate_flow_run
or do we need to use StartFlowRun
in that scenario?Hugo Kitano
10/14/2021, 11:53 PMShaoyi Zhang
10/15/2021, 12:47 AMEldho Suresh
10/15/2021, 2:39 AMsecret
using GraphQL mutation https://docs.prefect.io/orchestration/concepts/secrets.html#graphql
It’s erroring out for me -
"message": "Expected type JSON!, found \"MY SECRET VALUE\"; Expecting value: line 1 column 1 (char 0)",
Tim Chan
10/15/2021, 5:06 PMitay livni
10/15/2021, 10:45 PM2.0.a3
. Is there a way to import prefect secrets? Previously I used from prefect.tasks.secrets import PrefectSecret
. Thanks in advance...Berty
10/16/2021, 12:17 AM'connection reset by peer'
errors from tasks in various flow. Do you have any pointers to troubleshoot this?Chu Lục Ninh
10/16/2021, 2:05 PMRowan Gaffney
10/17/2021, 7:26 PMgitlab.exceptions.GitlabGetError: 404: 404 Not Found.
This is a self-hosted gitlab, but a public repo. Does this error suggest authentication issues or am I missing something else? Thanks!
agent is launched with: prefect agent docker start --api <http://localhost:4200> --show-flow-logs --label docker_local
storage configs: GitLab(host = selfhost_gitlab_url, repo='rgaffney/simple_orchestration', path='HelloWorld_flow.py',ref='prefect_v1')
run_configs: DockerRun(image="prefecthq/prefect:core-0.15.5", env={"EXTRA_PIP_PACKAGES": 'asyncio aiohttp aiofiles prefect[gitlab]'}, labels=['docker_local'])
Jinho Chung
10/17/2021, 11:17 PMpd.read_sql()
and so the text is then stored in a column in the pandas dataframe. I then decode the strings and use striprtf
to convert to plain text. I have never had a problem performing this step in Jupyter notebooks or on multiple machines, but when I run this in Prefect, for a portion of the text I get a UnicodeDecodeError
despite using text.decode(encoding='latin-1', errors='replace')
. I've tried using chardet
but have had no luck. Thanks in advance for the help.Jinho Chung
10/17/2021, 11:17 PMpd.read_sql()
and so the text is then stored in a column in the pandas dataframe. I then decode the strings and use striprtf
to convert to plain text. I have never had a problem performing this step in Jupyter notebooks or on multiple machines, but when I run this in Prefect, for a portion of the text I get a UnicodeDecodeError
despite using text.decode(encoding='latin-1', errors='replace')
. I've tried using chardet
but have had no luck. Thanks in advance for the help.striprtf
) and not with Prefect!