|
@@ -58,11 +58,16 @@ class PythonTaskCompiler(TaskCompiler):
|
|
self.default_image = config.get('TASK_IMAGES', 'python') # 'SXKJ:32775/pod_python:1.1'
|
|
self.default_image = config.get('TASK_IMAGES', 'python') # 'SXKJ:32775/pod_python:1.1'
|
|
self.default_cmd = "python main.py"
|
|
self.default_cmd = "python main.py"
|
|
self.task.cmd = "echo \"$SCRIPT\" > main.py && " + (self.task.cmd or self.default_cmd)
|
|
self.task.cmd = "echo \"$SCRIPT\" > main.py && " + (self.task.cmd or self.default_cmd)
|
|
|
|
+
|
|
if config.get('HOST_ALIAS', 'enable', fallback=None) in ['true', "True", True]:
|
|
if config.get('HOST_ALIAS', 'enable', fallback=None) in ['true', "True", True]:
|
|
host_alias: Dict = json.loads(config.get('HOST_ALIAS', 'host_alias'))
|
|
host_alias: Dict = json.loads(config.get('HOST_ALIAS', 'host_alias'))
|
|
for k, v in host_alias.items():
|
|
for k, v in host_alias.items():
|
|
self.task.cmd = f"echo '{k} {v}' >> /etc/hosts && {self.task.cmd}"
|
|
self.task.cmd = f"echo '{k} {v}' >> /etc/hosts && {self.task.cmd}"
|
|
|
|
|
|
|
|
+ if config.get('K8S', 'enable_kerberos', fallback=None) in ['true', "True", True]:
|
|
|
|
+ principal = config.get('HIVE', 'principal', fallback=None)
|
|
|
|
+ self.task.cmd = f"kinit -kt /workspace/conf/user.keytab {principal} && {self.task.cmd}"
|
|
|
|
+
|
|
|
|
|
|
class DataXTaskCompiler(TaskCompiler):
|
|
class DataXTaskCompiler(TaskCompiler):
|
|
def __init__(self, item: AirflowTask):
|
|
def __init__(self, item: AirflowTask):
|