From aec2a42bb2f44050a60d7956913d9ffc3edbf05a Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Tue, 24 Oct 2023 11:05:50 -0500 Subject: [PATCH] debug container exec path for function --- src/engine/src/core/tasks/executors/Function.py | 5 +---- src/engine/src/helpers/GitCacheService.py | 2 -- src/engine/src/owe_python_sdk/TaskExecutor.py | 10 +++++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/engine/src/core/tasks/executors/Function.py b/src/engine/src/core/tasks/executors/Function.py index c4fa10df..eee7251b 100644 --- a/src/engine/src/core/tasks/executors/Function.py +++ b/src/engine/src/core/tasks/executors/Function.py @@ -55,19 +55,16 @@ def execute(self): job_name = gen_resource_name(prefix="fn") # Prepares the file system for the Function task by clone # git repsoitories specified in the request - print("Initialize git cache") git_cache_service = GitCacheService(cache_dir=self.task.exec_dir) try: for repo in self.task.git_repositories: - print("repo", repo) git_cache_service.add(repo.url, repo.directory, branch=repo.branch) - print("cloned successfully") except Exception as e: return self._task_result(1, errors=[str(e)]) # Set up the container details for the task's specified runtime container_details = self._setup_container() - print("V1JOB body") + # Job body body = client.V1Job( metadata=client.V1ObjectMeta( diff --git a/src/engine/src/helpers/GitCacheService.py b/src/engine/src/helpers/GitCacheService.py index c9e08a25..960ff59a 100644 --- a/src/engine/src/helpers/GitCacheService.py +++ b/src/engine/src/helpers/GitCacheService.py @@ -11,9 +11,7 @@ def add(self, url: str, directory: str, branch=None): kwargs = {} if branch != None: kwargs["branch"] = branch - print("BEFORE CLONE") git.Repo.clone_from(url, os.path.join(self._cache_dir, directory.lstrip("/")), **kwargs) - print("AFTER CLONE") def repo_exists(self, path): return os.path.exists(os.path.join(self._cache_dir, path.lstrip("/"))) diff --git a/src/engine/src/owe_python_sdk/TaskExecutor.py b/src/engine/src/owe_python_sdk/TaskExecutor.py index 05140013..e2cddfd8 100644 --- a/src/engine/src/owe_python_sdk/TaskExecutor.py +++ b/src/engine/src/owe_python_sdk/TaskExecutor.py @@ -103,11 +103,11 @@ def cleanup(self, terminating=False): for resource in self._resources: # Jobs and Job Pods if resource.type == ResourceType.job: - self.batch_v1_api.delete_namespaced_job( - name=resource.job.metadata.name, - namespace=KUBERNETES_NAMESPACE, - body=client.V1DeleteOptions(propagation_policy="Background"), - ) + # self.batch_v1_api.delete_namespaced_job( + # name=resource.job.metadata.name, + # namespace=KUBERNETES_NAMESPACE, + # body=client.V1DeleteOptions(propagation_policy="Background"), + # ) continue # ConfigMaps