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

Migrate Plexus example DAGs to new design #22457 #24147

Merged
merged 1 commit into from
Jun 3, 2022
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
16 changes: 0 additions & 16 deletions airflow/providers/plexus/example_dags/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/apache-airflow-providers-plexus/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Content
:maxdepth: 1
:caption: Resources

Example DAGs <https://github.com/apache/airflow/tree/main/airflow/providers/plexus/example_dags>
Example DAGs <https://github.com/apache/airflow/tree/main/tests/system/providers/plexus>

.. toctree::
:maxdepth: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,41 @@
# specific language governing permissions and limitations
# under the License.

import os
from datetime import datetime

from airflow import DAG
from airflow.providers.plexus.operators.job import PlexusJobOperator

HOME = '/home/acc'
T3_PRERUN_SCRIPT = 'cp {home}/imdb/run_scripts/mlflow.sh {home}/ && chmod +x mlflow.sh'.format(home=HOME)
ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID")
DAG_ID = "test"


dag = DAG(
'test',
with DAG(
DAG_ID,
default_args={'owner': 'core scientific', 'retries': 1},
description='testing plexus operator',
start_date=datetime(2021, 1, 1),
schedule_interval='@once',
catchup=False,
)
) as dag:
# [START plexus_job_op]
t1 = PlexusJobOperator(
task_id='test',
job_params={
'name': 'test',
'app': 'MLFlow Pipeline 01',
'queue': 'DGX-2 (gpu:Tesla V100-SXM3-32GB)',
'num_nodes': 1,
'num_cores': 1,
'prerun_script': T3_PRERUN_SCRIPT,
},
)
# [END plexus_job_op]


from tests.system.utils import get_test_run # noqa: E402

t1 = PlexusJobOperator(
task_id='test',
job_params={
'name': 'test',
'app': 'MLFlow Pipeline 01',
'queue': 'DGX-2 (gpu:Tesla V100-SXM3-32GB)',
'num_nodes': 1,
'num_cores': 1,
'prerun_script': T3_PRERUN_SCRIPT,
},
dag=dag,
)
# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest)
test_run = get_test_run(dag)