Skip to content

Commit

Permalink
api target breeder dag config file
Browse files Browse the repository at this point in the history
Associate dag config file with uuid of breeder.  That prepares ground
for several separately running breeder instances.
  • Loading branch information
cherusk committed Dec 26, 2023
1 parent 7ebb005 commit 61a8bb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def breeders_id_delete(breeder_id): # noqa: E501
"""

# cleanup dag definition config file
filename = f"{DAG_DIR}/root_dag.py"
filename = f"{DAG_DIR}/{breeder_id}.py"

if os.path.exists(filename):
os.remove(filename)
Expand Down Expand Up @@ -201,7 +201,7 @@ def create_breeder(api_client, content):
# templating related
environment = Environment(loader=FileSystemLoader(DAG_TEMPLATES_DIR))
template = environment.get_template("root_dag.py")
filename = f"{DAG_DIR}/root_dag.py"
filename = f"{DAG_DIR}/{breeder_id}.py"
rendered_dag = template.render(breeder_config_full)

with open(filename, mode="w", encoding="utf-8") as dag_file:
Expand Down

0 comments on commit 61a8bb3

Please sign in to comment.