forked from dagster-io/dagster
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[externals] Remove IO modes entirely (dagster-io#16008)
## Summary & Motivation Removes IO modes entirely from `dagster-external`, standardizing on the use of temporary files for IPC. ## How I Tested These Changes Existing test suite (though many tests have been deleted).
- Loading branch information
Showing
6 changed files
with
58 additions
and
409 deletions.
There are no files selected for viewing
This file contains 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
35 changes: 8 additions & 27 deletions
35
python_modules/dagster-external/dagster_external/params.py
This file contains 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 |
---|---|---|
@@ -1,42 +1,23 @@ | ||
import os | ||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
from dagster_external.protocol import ( | ||
DAGSTER_EXTERNAL_DEFAULT_HOST, | ||
DAGSTER_EXTERNAL_DEFAULT_INPUT_MODE, | ||
DAGSTER_EXTERNAL_DEFAULT_OUTPUT_MODE, | ||
DAGSTER_EXTERNAL_DEFAULT_PORT, | ||
DAGSTER_EXTERNAL_ENV_KEYS, | ||
ExternalExecutionIOMode, | ||
) | ||
|
||
|
||
def get_external_execution_params() -> "ExternalExecutionParams": | ||
is_orchestration_active = bool(os.getenv("DAGSTER_EXTERNAL_IS_ORCHESTRATION_ACTIVE")) | ||
raw_input_mode = os.getenv( | ||
DAGSTER_EXTERNAL_ENV_KEYS["input_mode"], DAGSTER_EXTERNAL_DEFAULT_INPUT_MODE | ||
) | ||
raw_output_mode = os.getenv( | ||
DAGSTER_EXTERNAL_ENV_KEYS["output_mode"], DAGSTER_EXTERNAL_DEFAULT_OUTPUT_MODE | ||
) | ||
input_path = os.getenv(DAGSTER_EXTERNAL_ENV_KEYS["input"]) | ||
output_path = os.getenv(DAGSTER_EXTERNAL_ENV_KEYS["output"]) | ||
assert input_path, "input_path must be set" | ||
assert output_path, "output_path must be set" | ||
return ExternalExecutionParams( | ||
is_orchestration_active=is_orchestration_active, | ||
input_mode=ExternalExecutionIOMode[raw_input_mode], | ||
output_mode=ExternalExecutionIOMode[raw_output_mode], | ||
input_path=os.getenv(DAGSTER_EXTERNAL_ENV_KEYS["input"]), | ||
output_path=os.getenv(DAGSTER_EXTERNAL_ENV_KEYS["output"]), | ||
host=os.getenv(DAGSTER_EXTERNAL_ENV_KEYS["host"], DAGSTER_EXTERNAL_DEFAULT_HOST), | ||
port=int(os.getenv(DAGSTER_EXTERNAL_ENV_KEYS["port"], DAGSTER_EXTERNAL_DEFAULT_PORT)), | ||
input_path=input_path, | ||
output_path=output_path, | ||
) | ||
|
||
|
||
@dataclass | ||
class ExternalExecutionParams: | ||
is_orchestration_active: bool | ||
input_mode: str | ||
output_mode: str | ||
input_path: Optional[str] | ||
output_path: Optional[str] | ||
host: str | ||
port: int | ||
input_path: str | ||
output_path: str |
This file contains 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
This file contains 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
This file contains 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.