From 03f46eff7bc16708468422389b8b902c89837f7a Mon Sep 17 00:00:00 2001 From: anikaweinmann Date: Tue, 14 Mar 2023 14:55:35 +0100 Subject: [PATCH] first idea where to start the VM inside of actinia --- src/actinia_core/rest/base/resource_base.py | 8 ++++++++ src/actinia_core/rest/ephemeral_processing.py | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/actinia_core/rest/base/resource_base.py b/src/actinia_core/rest/base/resource_base.py index 983d76a24..abd402e3b 100644 --- a/src/actinia_core/rest/base/resource_base.py +++ b/src/actinia_core/rest/base/resource_base.py @@ -352,6 +352,14 @@ def preprocess( ] self.job_timeout = int(process_time_limit * process_num_limit * 20) + # IDEA: maybe here we can also ask for the user the ( + # self.user_credentials["vm_definition"]): + # * VM size + # * number of worker per VM + # * mounts + # * ... + # return directly an error message (create_response_from_model) + # Create the resource URL base and use a placeholder for the file name # The placeholder __None__ must be replaced by the resource URL # generator diff --git a/src/actinia_core/rest/ephemeral_processing.py b/src/actinia_core/rest/ephemeral_processing.py index d29870a64..3ff969e52 100644 --- a/src/actinia_core/rest/ephemeral_processing.py +++ b/src/actinia_core/rest/ephemeral_processing.py @@ -172,6 +172,16 @@ def post(self, location_name): rdc = self.preprocess(location_name=location_name) if rdc: + # IDEA: here VM start (asyncron - subprocess?) + # QUESTION: + # * set status to accepted or to startingVM? + # * consider from "queue_type": only if "per_job", "per_user" the VM should be started? + # prepare_actinia(vm_size, queue_name (created in enqueue_job)) + # * check if VM already run (if only one VM should be started per user) + # * start VM + # * install actinia + # * start worker for queue_name (execute_actinia) + # vm_size, ... in preprocess (attributes of rdc?) enqueue_job(self.job_timeout, start_job, rdc) html_code, response_model = pickle.loads(self.response_data)