Skip to content

Commit

Permalink
debug container exec path for function
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Oct 24, 2023
1 parent f4f987f commit aec2a42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/engine/src/core/tasks/executors/Function.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions src/engine/src/helpers/GitCacheService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("/")))
Expand Down
10 changes: 5 additions & 5 deletions src/engine/src/owe_python_sdk/TaskExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aec2a42

Please sign in to comment.