Skip to content

Commit

Permalink
change: update docker connection id and image registry at dags (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoquintanav authored Nov 6, 2023
1 parent 22b5406 commit d6ac795
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 27 deletions.
6 changes: 2 additions & 4 deletions dags/calcul_potencia_optima_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ def get_random_moll() -> str:

sampled_moll = get_random_moll()


get_conversations_task = DockerOperator(
api_version="auto",
task_id="calcul_potencia_optima",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.erp.calcul_potencia_optima --dbapi "{{ var.value.erp_prod_sp2_uri_ro }}" --dbapi-dades "{{ var.value.dades_prod_db }}"',
Expand All @@ -64,4 +63,3 @@ def get_random_moll() -> str:
retrieve_output=True,
trigger_rule="none_failed",
)

4 changes: 2 additions & 2 deletions dags/erppeek_get_pilotatge_kpis_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def get_random_moll() -> str:
get_conversations_task = DockerOperator(
api_version="auto",
task_id="erppeek_get_pilotatge_kpis_daily",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.erppeek.filtered_models_single_kpis "{{ var.value.dades_prod_db }}" "daily" \
Expand Down
4 changes: 2 additions & 2 deletions dags/hs_get_conversations_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def get_random_moll() -> str:
get_conversations_task = DockerOperator(
api_version="auto",
task_id="hs_get_conversations",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.helpscout.hs_get_conversations "{{ data_interval_start }}" "{{ data_interval_end }}" \
Expand Down
6 changes: 3 additions & 3 deletions dags/hs_get_tags_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_random_moll() -> str:
"retries": 5,
"retry_delay": timedelta(minutes=5),
}

nfs_config = {
"type": "nfs",
"o": f"addr={addr},nfsvers=4",
Expand Down Expand Up @@ -51,9 +51,9 @@ def get_random_moll() -> str:
get_tags_task = DockerOperator(
api_version="auto",
task_id="hs_get_tags",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.helpscout.hs_get_tags "{{ data_interval_start }}" "{{ data_interval_end }}" \
Expand Down
4 changes: 2 additions & 2 deletions dags/hs_mailbox_reports_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def get_random_moll() -> str:
get_conversations_task = DockerOperator(
api_version="auto",
task_id="hs_mailbox_reports",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.helpscout.hs_mailbox_reports update-hs-kpis-pilotatge "{{ data_interval_start }}" "{{ data_interval_end }}" \
Expand Down
4 changes: 2 additions & 2 deletions dags/hs_transform_conversations_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def get_random_moll() -> str:
transform_conversations_task = DockerOperator(
api_version="auto",
task_id="hs_transform_conversations",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m pipelines.hs_transform_conversations "{{ data_interval_start }}" "{{ data_interval_end }}" \
Expand Down
12 changes: 6 additions & 6 deletions dags/meff_update_closing_prices_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def get_random_moll() -> str:
meff_update_closing_prices_task = DockerOperator(
api_version="auto",
task_id="meff_update_closing_prices",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.meff.meff_update_closing_prices "{{ var.value.puppis_prod_db}}"',
Expand Down Expand Up @@ -83,9 +83,9 @@ def get_random_moll() -> str:
meff_slice_day_closing_prices_task = DockerOperator(
api_version="auto",
task_id="meff_slice_day_closing_prices",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m pipelines.meff_closing_prices_day_slice "{{ var.value.puppis_prod_db}}"',
Expand All @@ -100,9 +100,9 @@ def get_random_moll() -> str:
meff_slice_month_closing_prices_task = DockerOperator(
api_version="auto",
task_id="meff_slice_month_closing_prices",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m pipelines.meff_closing_prices_month_slice "{{ var.value.puppis_prod_db}}"',
Expand Down
4 changes: 2 additions & 2 deletions dags/odoo_get_hr_employee_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def get_random_moll() -> str:
get_hr_employee_task = DockerOperator(
api_version="auto",
task_id="odoo_get_hr_employee",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.odoo.hr_employees "{{ var.value.odoo_dbapi}}" "{{ var.value.puppis_prod_db}}" "{{ dag_run.start_date }}"',
Expand Down
4 changes: 2 additions & 2 deletions dags/omie_price_hour_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def get_random_moll() -> str:
get_hr_employee_task = DockerOperator(
api_version="auto",
task_id="omie_get_price_hour",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.omie.omie_update_last_hour_price "{{ var.value.puppis_prod_db}}"',
Expand Down
4 changes: 2 additions & 2 deletions dags/tomatic_calls_stats_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def get_random_moll() -> str:
tomatic_calls_stats_task = DockerOperator(
api_version="auto",
task_id="tomatic_calls_stats",
docker_conn_id="somenergia_registry",
docker_conn_id="somenergia_harbor_dades_registry",
image="{}/{}-requirements:latest".format(
"{{ conn.somenergia_registry.host }}", repo_name
"{{ conn.somenergia_harbor_dades_registry.host }}", repo_name
),
working_dir=f"/repos/{repo_name}",
command='python3 -m datasources.tomatic.tomatic_stats "{{ var.value.dades_prod_db }}" prod "{{ var.value.tomatera_user }}" \
Expand Down

0 comments on commit d6ac795

Please sign in to comment.