From a769d5ab4e299a3ec69de8311c17afa8b9b58107 Mon Sep 17 00:00:00 2001 From: Maciej Wielgosz <maciej.wielgosz@nibio.no> Date: Tue, 27 Jun 2023 11:50:02 +0200 Subject: [PATCH] updated oracle wrapper local --- check_list.info | 2 +- run_oracle_wrapper_local.py | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/check_list.info b/check_list.info index c4d464f..a2df05e 100644 --- a/check_list.info +++ b/check_list.info @@ -1,4 +1,4 @@ Dockerfile - set correct oracle wrapper build.sh -run_oracle_wrapper.py or run_oracle_wrapper_local.py -> set paths +run_oracle_wrapper.py or run_oracle_wrapper_local.py -> pick a right mode (DEBUG or not) config.yaml -> pick segmentation or instance segmentation \ No newline at end of file diff --git a/run_oracle_wrapper_local.py b/run_oracle_wrapper_local.py index 180160c..68180e7 100644 --- a/run_oracle_wrapper_local.py +++ b/run_oracle_wrapper_local.py @@ -1,14 +1,16 @@ -# This is the the file to be run on the oracle cloud +# Author: Maciej Wielgosz +# THis the oracle wrapper for the Oracle Cloud Infrastructure (OCI) environment and Docker container -import oci import argparse import os -import io import shutil + import yaml from run import main +DEBUG_MODE = False + def run_oracle_wrapper(path_to_config_file): # read the config file from config folder @@ -16,15 +18,19 @@ def run_oracle_wrapper(path_to_config_file): config_flow_params = yaml.load(f, Loader=yaml.FullLoader) # read system environment variables - # input_location = os.environ['OBJ_INPUT_LOCATION'] - # output_location = os.environ['OBJ_OUTPUT_LOCATION'] - # remap the input and output locations - # input_location = input_location.replace("@axqlz2potslu", "").replace("oci://", "/mnt/") - # output_location = output_location.replace("@axqlz2potslu", "").replace("oci://", "/mnt/") + if DEBUG_MODE: + input_location = "local_folder_in/las_files/" + output_location = "local_folder_out/las_files/" + else: + # get the input and output locations from the environment variables + input_location = os.environ['OBJ_INPUT_LOCATION'] + output_location = os.environ['OBJ_OUTPUT_LOCATION'] + + # remap the input and output locations + input_location = input_location.replace("@axqlz2potslu", "").replace("oci://", "/mnt/") + output_location = output_location.replace("@axqlz2potslu", "").replace("oci://", "/mnt/") - input_location = "local_folder_in/las_files/" - output_location = "local_folder_out/las_files/" # copy files from input_location to the input folder shutil.copytree(input_location, config_flow_params['general']['input_folder']) -- GitLab