aletrn commited on
Commit
da125ed
·
1 Parent(s): 0176362

[feat] prepare vis_output folder within /tmp

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -1
  2. wrappers/fastapi_wrapper.py +1 -1
Dockerfile CHANGED
@@ -14,7 +14,8 @@ COPY samgis ${WORKDIR_ROOT}/samgis
14
  COPY wrappers ${WORKDIR_ROOT}/wrappers
15
  COPY pyproject.toml poetry.lock README.md ${WORKDIR_ROOT}
16
  RUN . ${WORKDIR_ROOT}/.venv && which python && echo "# install samgis #" && pip install .
17
- RUN mkdir ${WORKDIR_ROOT}/vis_output
 
18
 
19
  RUN ls -l /usr/bin/which
20
  RUN /usr/bin/which python
 
14
  COPY wrappers ${WORKDIR_ROOT}/wrappers
15
  COPY pyproject.toml poetry.lock README.md ${WORKDIR_ROOT}
16
  RUN . ${WORKDIR_ROOT}/.venv && which python && echo "# install samgis #" && pip install .
17
+ RUN mkdir /tmp/vis_output
18
+ RUN ls -l /tmp/vis_output
19
 
20
  RUN ls -l /usr/bin/which
21
  RUN /usr/bin/which python
wrappers/fastapi_wrapper.py CHANGED
@@ -88,7 +88,7 @@ def infer_samgis(request_input: ApiRequestBody) -> JSONResponse:
88
  except Exception as inference_exception:
89
  import subprocess
90
  home_content = subprocess.run(
91
- "ls -l /var/task {PROJECT_ROOT_FOLDER} {PROJECT_ROOT_FOLDER}/* {WORKDIR} {WORKDIR}/*", shell=True, universal_newlines=True, stdout=subprocess.PIPE
92
  )
93
  app_logger.error(f"/home/user ls -l: {home_content.stdout}.")
94
  app_logger.error(f"inference error:{inference_exception}.")
 
88
  except Exception as inference_exception:
89
  import subprocess
90
  home_content = subprocess.run(
91
+ "ls -l /var/task /var/task/* {WRITE_TMP_ON_DISK} {WRITE_TMP_ON_DISK}/* {PROJECT_ROOT_FOLDER} {PROJECT_ROOT_FOLDER}/* {WORKDIR} {WORKDIR}/*", shell=True, universal_newlines=True, stdout=subprocess.PIPE
92
  )
93
  app_logger.error(f"/home/user ls -l: {home_content.stdout}.")
94
  app_logger.error(f"inference error:{inference_exception}.")