qingxu98 commited on
Commit
e523543
1 Parent(s): c7d9c76
docker_as_a_service/docker_as_a_service.py CHANGED
@@ -44,6 +44,7 @@ def read_output(stream, output_queue):
44
  async def stream_generator(request_obj):
45
  import tempfile
46
  # Create a temporary directory
 
47
  with tempfile.TemporaryDirectory(ignore_cleanup_errors=True) as temp_dir:
48
 
49
  # Construct the docker command
@@ -110,10 +111,12 @@ async def stream_generator(request_obj):
110
  break
111
 
112
  await asyncio.sleep(0.5)
 
113
 
114
  # Get the return code
115
  return_code = process.returncode
116
  yield yield_message("(daas return code:) " + str(return_code))
 
117
 
118
  # print(f"Successfully downloaded video {video_id}")
119
  existing_file_after_download = glob.glob(os.path.join(download_folder, '**', '*'))
@@ -132,11 +135,13 @@ async def stream_generator(request_obj):
132
  with open(fp, "rb") as f:
133
  file_bytes = f.read()
134
  server_file_attach[fn] = file_bytes
135
-
 
136
  dsacm = DockerServiceApiComModel(
137
  server_message="complete",
138
  server_file_attach=server_file_attach,
139
  )
 
140
  yield python_obj_to_pickle_file_bytes(dsacm)
141
 
142
 
 
44
  async def stream_generator(request_obj):
45
  import tempfile
46
  # Create a temporary directory
47
+ print('create temp dir')
48
  with tempfile.TemporaryDirectory(ignore_cleanup_errors=True) as temp_dir:
49
 
50
  # Construct the docker command
 
111
  break
112
 
113
  await asyncio.sleep(0.5)
114
+ print("(daas return) ")
115
 
116
  # Get the return code
117
  return_code = process.returncode
118
  yield yield_message("(daas return code:) " + str(return_code))
119
+ print("(daas return code:) " + str(return_code))
120
 
121
  # print(f"Successfully downloaded video {video_id}")
122
  existing_file_after_download = glob.glob(os.path.join(download_folder, '**', '*'))
 
135
  with open(fp, "rb") as f:
136
  file_bytes = f.read()
137
  server_file_attach[fn] = file_bytes
138
+ print("downloaded_files")
139
+ print(downloaded_files)
140
  dsacm = DockerServiceApiComModel(
141
  server_message="complete",
142
  server_file_attach=server_file_attach,
143
  )
144
+ print("sending files")
145
  yield python_obj_to_pickle_file_bytes(dsacm)
146
 
147