airflow-unicore-integration 0.2.3__tar.gz → 0.2.5__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.2.3/src/airflow_unicore_integration.egg-info → airflow_unicore_integration-0.2.5}/PKG-INFO +1 -1
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/pyproject.toml +1 -1
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/executors/unicore_executor.py +20 -1
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/util/job.py +6 -1
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5/src/airflow_unicore_integration.egg-info}/PKG-INFO +1 -1
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/LICENSE +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/README.rst +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/setup.cfg +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/__init__.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/executors/__init__.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/executors/run_task_via_supervisor.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/hooks/__init__.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/hooks/unicore_hooks.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/operators/__init__.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/operators/container.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/operators/unicore_operators.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/policies/__init__.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration/util/launch_script_content.py +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration.egg-info/SOURCES.txt +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration.egg-info/dependency_links.txt +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration.egg-info/entry_points.txt +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration.egg-info/requires.txt +0 -0
- {airflow_unicore_integration-0.2.3 → airflow_unicore_integration-0.2.5}/src/airflow_unicore_integration.egg-info/top_level.txt +0 -0
|
@@ -20,8 +20,10 @@ from airflow.models.taskinstance import TaskInstance
|
|
|
20
20
|
from airflow.models.taskinstancekey import TaskInstanceKey
|
|
21
21
|
from airflow.utils.state import TaskInstanceState
|
|
22
22
|
from pyunicore import client
|
|
23
|
+
from pyunicore.credentials import AuthenticationFailedException
|
|
23
24
|
from pyunicore.credentials import Credential
|
|
24
25
|
from pyunicore.credentials import create_credential
|
|
26
|
+
from requests.exceptions import RequestException
|
|
25
27
|
|
|
26
28
|
from ..util.job import JobDescriptionGenerator
|
|
27
29
|
from ..util.job import NaiveJobDescriptionGenerator
|
|
@@ -152,7 +154,24 @@ class UnicoreExecutor(BaseExecutor):
|
|
|
152
154
|
raise TypeError(f"Don't know how to queue workload of type {type(workload).__name__}")
|
|
153
155
|
|
|
154
156
|
# submit job to unicore and add to active_jobs dict for task state management
|
|
155
|
-
|
|
157
|
+
try:
|
|
158
|
+
job = self._submit_job(workload)
|
|
159
|
+
except AuthenticationFailedException as auth_exception:
|
|
160
|
+
self.fail(workload.ti.key)
|
|
161
|
+
self.log.error(
|
|
162
|
+
"Invalid default credentials for UNICORE. Failing all UNICORE tasks until this has been resolved."
|
|
163
|
+
)
|
|
164
|
+
self.log.error(auth_exception)
|
|
165
|
+
return
|
|
166
|
+
except RequestException as re:
|
|
167
|
+
# Any kind of requests error, from DNS issues, to timeout Issues, to invalid UNICORE URL issues
|
|
168
|
+
self.fail(workload.ti.key)
|
|
169
|
+
self.log.error(
|
|
170
|
+
"Some Error appeared during the connection attempt to UNICORE. Failing this task Instance."
|
|
171
|
+
)
|
|
172
|
+
self.log.error(re)
|
|
173
|
+
return
|
|
174
|
+
|
|
156
175
|
self.active_jobs[workload.ti.key] = job
|
|
157
176
|
|
|
158
177
|
def end(self, heartbeat_interval=10) -> None:
|
|
@@ -27,6 +27,7 @@ class JobDescriptionGenerator:
|
|
|
27
27
|
EXECUTOR_CONFIG_POST_COMMANDS = "postcommands" # gets added to the unicore job descirption
|
|
28
28
|
EXECUTOR_CONFIG_JOB_TYPE = "job_type"
|
|
29
29
|
EXECUTOR_CONFIG_LOGIN_NODE = "login_node"
|
|
30
|
+
EXECUTOR_CONFIG_JOB_DESCRIPTION_PARAMS = "custom_job_description_additions"
|
|
30
31
|
EXECUTOR_CONFIG_UNICORE_CONN_KEY = (
|
|
31
32
|
"unicore_connection_id" # alternative connection id for the Unicore connection to use
|
|
32
33
|
)
|
|
@@ -63,6 +64,7 @@ class NaiveJobDescriptionGenerator(JobDescriptionGenerator):
|
|
|
63
64
|
user_added_post_commands: list[str] = executor_config.get(JobDescriptionGenerator.EXECUTOR_CONFIG_POST_COMMANDS, []) # type: ignore
|
|
64
65
|
user_defined_job_type: str = executor_config.get(JobDescriptionGenerator.EXECUTOR_CONFIG_JOB_TYPE, None) # type: ignore
|
|
65
66
|
user_defined_login_node: str = executor_config.get(JobDescriptionGenerator.EXECUTOR_CONFIG_LOGIN_NODE, None) # type: ignore
|
|
67
|
+
user_added_job_description: Dict[str, Any] = executor_config.get(JobDescriptionGenerator.EXECUTOR_CONFIG_JOB_DESCRIPTION_PARAMS, {}) # type: ignore
|
|
66
68
|
# get local dag path from cmd and fix dag path in arguments
|
|
67
69
|
dag_rel_path = str(workload.dag_rel_path)
|
|
68
70
|
if dag_rel_path.startswith("DAG_FOLDER"):
|
|
@@ -79,7 +81,7 @@ class NaiveJobDescriptionGenerator(JobDescriptionGenerator):
|
|
|
79
81
|
if user_defined_job_type:
|
|
80
82
|
job_descr_dict["Job type"] = user_defined_job_type
|
|
81
83
|
if user_defined_login_node:
|
|
82
|
-
job_descr_dict["Login
|
|
84
|
+
job_descr_dict["Login node"] = user_defined_login_node
|
|
83
85
|
|
|
84
86
|
# check which python virtualenv to use
|
|
85
87
|
if user_defined_python_env:
|
|
@@ -194,4 +196,7 @@ class NaiveJobDescriptionGenerator(JobDescriptionGenerator):
|
|
|
194
196
|
if user_added_resources:
|
|
195
197
|
job_descr_dict["Resources"] = user_added_resources
|
|
196
198
|
|
|
199
|
+
# overwrite with values from user added field
|
|
200
|
+
job_descr_dict.update(user_added_job_description)
|
|
201
|
+
|
|
197
202
|
return job_descr_dict
|
|
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
|