Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dataflow decompress prototype #501

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions src/airflow/dags/eqtl_preprocess.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"""Airflow DAG for the Preprocess part of the pipeline."""
from __future__ import annotations

from pathlib import Path

import common_airflow as common
from airflow.models.dag import DAG
from airflow.providers.google.cloud.operators.dataflow import (
DataflowTemplatedJobStartOperator,
)

# CLUSTER_NAME = "otg-preprocess-finngen"
# AUTOSCALING = "finngen-preprocess"

EQTL_CATALOG_SUSIE_LOCATION = "gs://eqtl_catalog_data/ebi_ftp/susie"
TEMP_DECOMPRESS_LOCATION = "gs://eqtl_catalog_data/tmp_susie_decompressed"
DECOMPRESS_FAILED_LOG = "gs://eqtl_catalog_data/tmp_susie_decompressed.log"

with DAG(
dag_id=Path(__file__).stem,
description="Open Targets Genetics — eQTL preprocess",
default_args=common.shared_dag_args,
**common.shared_dag_kwargs,
):
start_template_job = DataflowTemplatedJobStartOperator(
task_id="decompress_sussie_outputs",
template="gs://dataflow-templates/latest/Bulk_Decompress_GCS_Files",
location="europe-west1",
project_id="open-targets-genetics-dev",
parameters={
"inputFilePattern": f"{EQTL_CATALOG_SUSIE_LOCATION}/**/*.gz",
"outputDirectory": TEMP_DECOMPRESS_LOCATION,
"outputFailureFile": DECOMPRESS_FAILED_LOG,
},
)

# (
# common.create_cluster(
# CLUSTER_NAME,
# autoscaling_policy=AUTOSCALING,
# master_disk_size=2000,
# num_workers=6,
# )
# >> common.install_dependencies(CLUSTER_NAME)
# >> [finngen_summary_stats_preprocess, finngen_finemapping_ingestion]
# >> common.delete_cluster(CLUSTER_NAME)
# )

start_template_job
1 change: 1 addition & 0 deletions src/airflow/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
apache-airflow-providers-google==10.10.1
apache-airflow-providers-apache-beam==5.6.1
psycopg2-binary==2.9.9