-
Notifications
You must be signed in to change notification settings - Fork 12
Refactor Dagster configuration and environment setup #176
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||||||||||||||||||||||||||||||||
| import os | ||||||||||||||||||||||||||||||||||||
| import sys | ||||||||||||||||||||||||||||||||||||
| from pathlib import Path | ||||||||||||||||||||||||||||||||||||
| from datetime import datetime, timedelta, timezone | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
|
|
@@ -17,8 +18,14 @@ | |||||||||||||||||||||||||||||||||||
| os.environ["ANOMSTACK_DAGSTER_LOCAL_COMPUTE_LOG_MANAGER_DIRECTORY"] = "tmp" | ||||||||||||||||||||||||||||||||||||
| os.environ["ANOMSTACK_DAGSTER_LOCAL_ARTIFACT_STORAGE_DIR"] = "tmp" | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # Cutoff for long-running (1 hour ago) | ||||||||||||||||||||||||||||||||||||
| cutoff_time = datetime.now(timezone.utc) - timedelta(hours=1) | ||||||||||||||||||||||||||||||||||||
| # Add the parent directory to sys.path to import the sensor module | ||||||||||||||||||||||||||||||||||||
| sys.path.append(str(script_dir.parent)) | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
| from anomstack.sensors.timeout import get_kill_after_minutes | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # Use the same configurable timeout as the sensor | ||||||||||||||||||||||||||||||||||||
| kill_after_minutes = get_kill_after_minutes() | ||||||||||||||||||||||||||||||||||||
| cutoff_time = datetime.now(timezone.utc) - timedelta(minutes=kill_after_minutes) | ||||||||||||||||||||||||||||||||||||
| print(f"Using {kill_after_minutes} minute timeout") | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+28
|
||||||||||||||||||||||||||||||||||||
| from anomstack.sensors.timeout import get_kill_after_minutes | |
| # Use the same configurable timeout as the sensor | |
| kill_after_minutes = get_kill_after_minutes() | |
| cutoff_time = datetime.now(timezone.utc) - timedelta(minutes=kill_after_minutes) | |
| print(f"Using {kill_after_minutes} minute timeout") | |
| try: | |
| from anomstack.sensors.timeout import get_kill_after_minutes | |
| # Use the same configurable timeout as the sensor | |
| kill_after_minutes = get_kill_after_minutes() | |
| print(f"Using {kill_after_minutes} minute timeout") | |
| except (ImportError, AttributeError) as e: | |
| print(f"⚠️ Warning: Could not import 'get_kill_after_minutes' or call it: {e}") | |
| kill_after_minutes = 60 # Default timeout value | |
| print(f"Using default timeout of {kill_after_minutes} minutes") | |
| cutoff_time = datetime.now(timezone.utc) - timedelta(minutes=kill_after_minutes) |
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.
[nitpick] Mounting dagster_docker.yaml directly over dagster.yaml could overwrite any existing dagster.yaml file in the container. This tight coupling makes it difficult to have different configurations per service. Consider using a more explicit configuration approach or documenting this behavior clearly.