How to submit a python batch job? #5309
Unanswered
HaoYang670
asked this question in
Q&A
Replies: 1 comment
-
Hi @HaoYang670, I was able to run a python code with the POST /batches (with uploading resource) (to upload the python script) running the following code: from requests_toolbelt.multipart.encoder import MultipartEncoder
import json
encoder = MultipartEncoder(
fields={
'batchRequest': ('', json.dumps(
{
'batchType': 'pyspark',
'name': 'my_python_script_app',
'conf': {
'spark.submit.deployMode': 'cluster'
}
}
), 'application/json'),
'resourceFile': ('script_file.py', open('/tmp/script_file.py', 'rb')),
})
requests.post(f'{KYUUBI_URL}/api/v1/batches',
data=encoder,
headers={'Content-Type': encoder.content_type}) Unfortunately, I didn't try with a file located on the server. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
cc @pan3793 Thank you for telling me that Kyuubi batch API supports python, which helps a lot for our project!
I also got this error in log when submit a Python job using the
post batch
api. The python file is located at the Kyuubi server.I've tried to set the batch type to be
spark
andpyspark
but neither of them works.Also, how to set the
className
?Beta Was this translation helpful? Give feedback.
All reactions