|
@@ -58,11 +58,16 @@ class PythonTaskCompiler(TaskCompiler):
|
|
|
self.default_image = config.get('TASK_IMAGES', 'python') # 'SXKJ:32775/pod_python:1.1'
|
|
|
self.default_cmd = "python main.py"
|
|
|
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]:
|
|
|
host_alias: Dict = json.loads(config.get('HOST_ALIAS', 'host_alias'))
|
|
|
for k, v in host_alias.items():
|
|
|
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):
|
|
|
def __init__(self, item: AirflowTask):
|