nevcohen commented on PR #46817: URL: https://github.com/apache/airflow/pull/46817#issuecomment-2674541729
> I did some tests here(spark on kubernetes). > cluster mode:we get that the returncode is 0 but the spark k8s driver exit code is 1. > ``` > import subprocess > > if __name__ == '__main__': > spark_submit_cmd = ["/usr/hdp/3.1.5.0-152/spark3/bin/spark-submit", > "--master", "k8s://https://kubernetes.default.svc.cluster.local" , > "--deploy-mode", "cluster" , > "--conf" ,"spark.executor.memoryOverhead=1g" , > "--conf" ,"spark.kubernetes.container.image=patsnap-us.tencentcloudcr.com/data/spark:v3.2.4.16" , > "--conf" ,"spark.kubernetes.authenticate.driver.serviceAccountName=spark" , > "--conf" ,"spark.kubernetes.file.upload.path=s3a://testpatsnapus-1251949819/patent2/spark/upload" , > "--conf" ,"spark.hadoop.fs.s3a.endpoint=http://na-ashburn.lan.s3-proxy.info", > "--conf" ,"spark.hadoop.fs.s3a.impl=org.apache.hadoop.fs.s3a.S3AFileSystem" , > "--conf" ,"spark.hadoop.fs.s3.impl=org.apache.hadoop.fs.s3a.S3AFileSystem" , > "--conf" ,"spark.hadoop.fs.s3a.fast.upload=true", > "--conf" ,"spark.hadoop.fs.s3a.access.key=***" , > "--conf" ,"spark.hadoop.fs.s3a.secret.key='***'" , > "--conf", "spark.hadoop.fs.ofs.user.appid=1250000000", > "--conf", "spark.hadoop.fs.ofs.tmp.cache.dir=/tmp/hadoop_cos", > "--conf" ,"spark.hadoop.fs.cosn.credentials.provider=org.apache.hadoop.fs.auth.SimpleCredentialProvider", > "--conf", "spark.hadoop.fs.cosn.impl=org.apache.hadoop.fs.CosFileSystem", > "--conf", "spark.hadoop.fs.cosn.bucket.region=na-ashburn", > "--conf", "spark.hadoop.fs.cosn.bucket.endpoint_suffix=cos.na-ashburn.myqcloud.com" , > "--conf", "spark.hadoop.fs.cosn.userinfo.secretId=***", > "--conf", "spark.hadoop.fs.cosn.userinfo.secretKey=***", > "--conf", "spark.hadoop.fs.AbstractFileSystem.cosn.impl=org.apache.hadoop.fs.CosN", > "--conf", "spark.kubernetes.driver.podTemplateFile=/usr/hdp/3.1.5.0-152/spark3/kubernetes/template/driver-template.yml", > "--conf", "spark.kubernetes.executor.podTemplateFile=/usr/hdp/3.1.5.0-152/spark3/kubernetes/template/executor-template.yml", > "--conf", "spark.history.fs.logDirectory=cosn://testpatsnapus-1251949819/patent2/spark3/share_log/spark_history_server/", > "--conf", "spark.eventLog.dir=cosn://testpatsnapus-1251949819/patent2/spark3/share_log/spark_history_server/", > "--conf", "spark.memory.fraction=0.1", > "--conf" ,"spark.eventLog.enabled=True" , > "--conf" ,"spark.kubernetes.namespace=dm-poc" , > "--num-executors" ,"2" , > "--executor-cores" ,"10" , > "--executor-memory" ,"512m" , > "--driver-memory" ,"512m" , > "--name" ,"test_code", > "--class","org.apache.spark.examples.SparkPi" , > "/usr/hdp/3.1.5.0-152/spark3/examples/jars/spark-examples_2.12-3.2.4.jar" , > "100000000"] > _submit_sp = subprocess.Popen( > spark_submit_cmd, > stdout=subprocess.PIPE, > stderr=subprocess.STDOUT, > bufsize=-1, > universal_newlines=True, > ) > > for line in iter(_submit_sp.stdout): > print(line) > > returncode = _submit_sp.wait() > print(returncode) > > > ``` >  > > > client mode: When the driver program runs on a worker, an exit code will appear in the log, but it cannot be used as a basis for judging the program status. You can directly use the return code to judge. > The same sparkpi program has an exit code, and the final calculation is successful. >  >  > > I made corresponding adjustments to the program > > Excellent! Now that makes sense! Looks great! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
