Patrick Alves
12/02/2022, 4:19 PMKubernetesJobs
.
I’ve experiencing an issue when I run workflows from UI.
1. I select a Flow -> RUN
2. It schedules a Flow for the next seconds.
3. But the flow keep on pending forever.
4. It actually creates another flow that runs (with no tags, see the images)
On the image every squared are actually the same RUN created twice. The original never run, and it creates a new one that runs.Khuyen Tran
12/02/2022, 4:50 PMcls-check-computers
?Patrick Alves
12/02/2022, 4:51 PMKhuyen Tran
12/02/2022, 4:52 PMPatrick Alves
12/02/2022, 4:52 PMKhuyen Tran
12/02/2022, 4:57 PMPatrick Alves
12/02/2022, 5:42 PM@task
def get_secrets_task():
return xxxx
@task
def get_computers(ad_server, ad_user, ad_pass, days_no_logon=100):
logger = get_run_logger()
<http://logger.info|logger.info>("Recuperando informações de usuários do Active Directory")
<http://logger.info|logger.info>(f"filtrando computadores presentes no AD que não logan há {days_no_logon} dias")
return xxxx
# ====== Create the workflow ====== #
VERSION = 'v1.2.2'
@flow(
name="cis-check-computers",
description="Verifica computadores no Active Directory sem eventos de login por mais de 100 dias.",
version=VERSION)
def check_computers(days_no_logon: int = 100):
logger = get_run_logger()
set_global_logger(logger)
xxxxx
# ========== Create Deployment for Kubernetes ========== #
check_computers_deployment = Deployment.build_from_flow(
flow = check_computers,
name = 'check-computers',
tags = ['cis', 'bot','kubernetes'],
infrastructure = settings.KUBERNETES_JOB_BLOCK,
infra_overrides=dict(
namespace='prefect',
image=settings.DOCKER_IMAGE,
command=['python', 'workflows/check_computers/flow.py'],
),
# Every weekday at 7:00 am
schedule=(CronSchedule(cron="0 7 * * 1-5", timezone="America/Belem"))
)
if __name__ == "__main__":
check_computers()
Anna Geller
12/04/2022, 10:46 PMPatrick Alves
12/21/2022, 7:08 PMAnna Geller
12/21/2022, 7:31 PM