diff --git a/breeder/linux_network_stack/objective.py b/breeder/linux_network_stack/objective.py index c4b46448..37c6625a 100644 --- a/breeder/linux_network_stack/objective.py +++ b/breeder/linux_network_stack/objective.py @@ -1,6 +1,7 @@ def objective(trial, + run=None, identifier=None, archive_db_url=None, locking_db_url=None, @@ -43,7 +44,7 @@ def objective(trial, logger.debug('fetching setting data') - breeder_table_name = f"{breeder_name}" + breeder_table_name = f"{breeder_name}_{run}_{identifier}" query = f"SELECT * FROM {breeder_table_name} WHERE {breeder_table_name}.setting_id = '{setting_id}';" archive_db_data = archive_db_engine.execute(query).fetchall() diff --git a/breeder/linux_network_stack/optimization.py b/breeder/linux_network_stack/optimization.py index ef553ab2..27e19cd0 100644 --- a/breeder/linux_network_stack/optimization.py +++ b/breeder/linux_network_stack/optimization.py @@ -1,6 +1,6 @@ -def create_optimization_dag(dag_id, config, identifier): +def create_optimization_dag(dag_id, config, run, identifier): dag = DAG(dag_id, default_args=DEFAULTS, @@ -22,6 +22,7 @@ def run_optimization(): objective_kwargs = dict(archive_db_url=f'postgresql://{ARCHIVE_DB_USER}:{ARCHIVE_DB_PASSWORD}@{ARCHIVE_DB_HOSTNAME}:{ARCHIVE_DB_PORT}/{ARCHIVE_DB_DATABASE}', locking_db_url=DLM_DB_CONNECTION, + run=run, identifier=identifier, breeder_name=config.get('name'), ) diff --git a/breeder/linux_network_stack/root_dag.py b/breeder/linux_network_stack/root_dag.py index 4bc4677d..e9314343 100644 --- a/breeder/linux_network_stack/root_dag.py +++ b/breeder/linux_network_stack/root_dag.py @@ -143,7 +143,7 @@ def determine_config_shard(run_id=None, dag_id = f'{dag_name}_{run_id}' if not is_cooperative: config = determine_config_shard() - globals()[f'{dag_id}_optimization_{identifier}'] = create_optimization_dag(f'{dag_id}_optimization_{identifier}', config, identifier) + globals()[f'{dag_id}_optimization_{identifier}'] = create_optimization_dag(f'{dag_id}_optimization_{identifier}', config, run_id, identifier) globals()[f'{dag_id}_target_{identifier}'] = create_target_interaction_dag(f'{dag_id}_target_interaction_{identifier}', config, target, identifier) target_id += 1