-
Notifications
You must be signed in to change notification settings - Fork 1
Storage in AiiDA's db #13
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
Draft
GeigerJ2
wants to merge
12
commits into
aiidateam:main
Choose a base branch
from
GeigerJ2:aiida-db
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4c268fa
copy files over from prev branch
GeigerJ2 4a82878
backup for prev listener files
GeigerJ2 1889b02
integrate into aiida_dag_run_listener.py
GeigerJ2 7926285
add run script for arithmetic add
GeigerJ2 0dafabc
wip; run script
GeigerJ2 0a9507a
script runs through now
GeigerJ2 7b2071e
wip
GeigerJ2 b144a11
Merge remote-tracking branch 'upstream/main' into aiida-db
GeigerJ2 ad39d9d
wip
GeigerJ2 31966dc
wip; before using only one hookimpl
GeigerJ2 4aad408
wip; logic in `on_dag_run_success` hookimpl
GeigerJ2 7e325d6
wip
GeigerJ2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from pathlib import Path | ||
import os | ||
from airflow.api.client.local_client import Client | ||
|
||
# Set AIRFLOW__CORE__DAGS_FOLDER to include example_dags | ||
dag_folder = str( | ||
Path(__file__).parent / "src" / "airflow_provider_aiida" / "example_dags" | ||
) | ||
os.environ["AIRFLOW__CORE__DAGS_FOLDER"] = dag_folder | ||
|
||
# Import AFTER setting the environment variable | ||
from airflow.models import DagBag | ||
|
||
# Create directories | ||
Path("/tmp/airflow/local_workdir").mkdir(parents=True, exist_ok=True) | ||
Path("/tmp/airflow/remote_workdir").mkdir(parents=True, exist_ok=True) | ||
|
||
# Configuration | ||
conf = { | ||
"machine": "localhost", | ||
"local_workdir": "/tmp/airflow/local_workdir", | ||
"remote_workdir": "/tmp/airflow/remote_workdir", | ||
"add_x": 10, | ||
"add_y": 5, | ||
"multiply_x": 7, | ||
"multiply_y": 3, | ||
} | ||
|
||
# Run DAG using test mode (bypasses serialization requirement) | ||
dagbag = DagBag(dag_folder=dag_folder, include_examples=False) | ||
dag = dagbag.get_dag("arithmetic_add_multiply") | ||
|
||
# Use test mode with execution_date to avoid serialization issues | ||
|
||
# dag.test( | ||
# run_conf=conf, | ||
# # execution_date=datetime.now(), | ||
# use_executor=False, # Run tasks sequentially in the same process | ||
# ) | ||
|
||
# Trigger DAG using API client (requires scheduler to be running) | ||
client: Client = Client() | ||
client.trigger_dag(dag_id="arithmetic_add_multiply", conf=conf) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed i think