airflow-unicore-integration 0.1.9__tar.gz → 0.1.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airflow_unicore_integration-0.1.9/src/airflow_unicore_integration.egg-info → airflow_unicore_integration-0.1.10}/PKG-INFO +1 -1
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/pyproject.toml +1 -1
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/util/job.py +16 -5
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10/src/airflow_unicore_integration.egg-info}/PKG-INFO +1 -1
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/LICENSE +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/README.rst +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/setup.cfg +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/__init__.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/executors/__init__.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/executors/run_task_via_supervisor.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/executors/unicore_executor.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/hooks/__init__.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/hooks/unicore_hooks.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/operators/__init__.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/operators/unicore_operators.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/policies/__init__.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration/util/launch_script_content.py +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration.egg-info/SOURCES.txt +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration.egg-info/dependency_links.txt +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration.egg-info/entry_points.txt +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration.egg-info/requires.txt +0 -0
- {airflow_unicore_integration-0.1.9 → airflow_unicore_integration-0.1.10}/src/airflow_unicore_integration.egg-info/top_level.txt +0 -0
|
@@ -34,10 +34,13 @@ class JobDescriptionGenerator:
|
|
|
34
34
|
def create_job_description(self, workload: ExecuteTask) -> Dict[str, Any]:
|
|
35
35
|
raise NotImplementedError()
|
|
36
36
|
|
|
37
|
+
def get_job_name(self, key: TaskInstanceKey) -> str:
|
|
38
|
+
return f"{key.dag_id} - {key.task_id} - {key.run_id} - {key.try_number}"
|
|
39
|
+
|
|
37
40
|
|
|
38
41
|
class NaiveJobDescriptionGenerator(JobDescriptionGenerator):
|
|
39
42
|
"""
|
|
40
|
-
This class generates a naive unicore job, that expects there to be a working python env
|
|
43
|
+
This class generates a naive unicore job, that expects there to be a working python env containing airflow and any other required dependencies on the executing system.
|
|
41
44
|
"""
|
|
42
45
|
|
|
43
46
|
GIT_DAG_BUNDLE_CLASSPATH = "airflow.providers.git.bundles.git.GitDagBundle"
|
|
@@ -84,7 +87,7 @@ class NaiveJobDescriptionGenerator(JobDescriptionGenerator):
|
|
|
84
87
|
"Data": LAUNCH_SCRIPT_CONTENT_STR,
|
|
85
88
|
}
|
|
86
89
|
# start filling the actual job description
|
|
87
|
-
job_descr_dict["Name"] =
|
|
90
|
+
job_descr_dict["Name"] = self.get_job_name(key)
|
|
88
91
|
job_descr_dict["Executable"] = (
|
|
89
92
|
f". airflow_config.env && . {python_env} && python run_task_via_supervisor.py --json-string '{workload.model_dump_json()}'" # TODO may require module load to be setup for some systems
|
|
90
93
|
)
|
|
@@ -153,12 +156,20 @@ class NaiveJobDescriptionGenerator(JobDescriptionGenerator):
|
|
|
153
156
|
|
|
154
157
|
airflow_env_import = {"To": "airflow_config.env", "Data": env_file_content}
|
|
155
158
|
|
|
156
|
-
job_descr_dict["
|
|
157
|
-
|
|
159
|
+
job_descr_dict["Imports"] = [worker_script_import, airflow_env_import]
|
|
160
|
+
|
|
161
|
+
if len(user_added_pre_commands) > 0:
|
|
162
|
+
precommand_import = {"To": "precommand.sh", "Data": user_added_pre_commands}
|
|
163
|
+
job_descr_dict["Imports"].append(precommand_import)
|
|
164
|
+
job_descr_dict["User precommand"] = "bash precommand.sh"
|
|
165
|
+
if len(user_added_post_commands) > 0:
|
|
166
|
+
postcommand_import = {"To": "postcommand.sh", "Data": user_added_post_commands}
|
|
167
|
+
job_descr_dict["Imports"].append(postcommand_import)
|
|
168
|
+
job_descr_dict["User postcommand"] = "bash postcommand.sh"
|
|
169
|
+
|
|
158
170
|
job_descr_dict["RunUserPrecommandOnLoginNode"] = (
|
|
159
171
|
"true" # precommand needs public internet access to clone dag repos
|
|
160
172
|
)
|
|
161
|
-
job_descr_dict["Imports"] = [worker_script_import, airflow_env_import]
|
|
162
173
|
# add user defined options to description
|
|
163
174
|
if user_added_env:
|
|
164
175
|
job_descr_dict["Environment"].update(user_added_env)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|