Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Sep 24, 2024
1 parent 4574408 commit 5676957
Show file tree
Hide file tree
Showing 80 changed files with 98 additions and 98 deletions.
4 changes: 2 additions & 2 deletions src/engine/src/core/Server.py → src/engine/src/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
)
from owe_python_sdk.schema import WorkflowSubmissionRequest, EmptyObject

from core.workers import WorkerPool
from core.workflows import WorkflowExecutor
from workers import WorkerPool
from workflows import WorkflowExecutor
from utils import serialize_request, load_plugins, lbuffer_str as lbuf
from errors import NoAvailableWorkers, WorkflowTerminated

Expand Down
2 changes: 0 additions & 2 deletions src/engine/src/core/daos/__init__.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/engine/src/core/expressions/__init__.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/engine/src/core/ioc/__init__.py

This file was deleted.

6 changes: 0 additions & 6 deletions src/engine/src/core/mappers/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions src/engine/src/core/middleware/archivers/__init__.py

This file was deleted.

8 changes: 0 additions & 8 deletions src/engine/src/core/repositories/__init__.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/engine/src/core/state/__init__.py

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/engine/src/core/templating/__init__.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/engine/src/core/workers/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions src/engine/src/core/workflows/__init__.py

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.state import ReactiveState
from state import ReactiveState


class WorkflowExecutorStateDAO:
Expand Down
2 changes: 2 additions & 0 deletions src/engine/src/daos/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from daos.FileSystemDAO import FileSystemDAO
from daos.WorkflowExecutorStateDAO import WorkflowExecutorStateDAO
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ConditionalExpression,
ConditionalExpressions
)
from core.expressions import OperandResolver
from expressions import OperandResolver
from errors.tasks import ConditionalExpressionEvalError, OperandResolutionError


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from owe_python_sdk.schema import Operand

from core.workflows import ValueFromService
from workflows import ValueFromService
from errors.tasks import OperandResolutionError


Expand Down
2 changes: 2 additions & 0 deletions src/engine/src/expressions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from expressions.ConditionalExpressionEvaluator import ConditionalExpressionEvaluator
from expressions.OperandResolver import OperandResolver
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from typing import List

from owe_python_sdk.Plugin import Plugin
from core.ioc import IOCContainer
from core.state import ReactiveState
from core.daos import (
from ioc import IOCContainer
from state import ReactiveState
from daos import (
WorkflowExecutorStateDAO,
FileSystemDAO
)
from core.mappers import (
from mappers import (
ArgMapper,
ArgValueFileMapper,
EnvMapper,
EnvVarValueFileMapper,
TaskMapper,
TaskOutputMapper
)
from core.repositories import (
from repositories import (
ArgRepository,
ArgValueFileRepository,
EnvRepository,
Expand All @@ -25,12 +25,12 @@
TaskRepository,
TemplateRepository
)
from core.tasks.TaskInputFileStagingService import TaskInputFileStagingService
from core.workflows import (
from tasks.TaskInputFileStagingService import TaskInputFileStagingService
from workflows import (
GraphValidator,
ValueFromService
)
from core.expressions import (
from expressions import (
ConditionalExpressionEvaluator,
OperandResolver
)
Expand Down
2 changes: 2 additions & 0 deletions src/engine/src/ioc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from ioc.IOCContainer import IOCContainer
from ioc.IOCContainerFactory import IOCContainerFactory
2 changes: 1 addition & 1 deletion src/engine/src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys, logging

from core.Server import Server
from Server import Server


# Set all third-party library loggers to critical
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.daos import WorkflowExecutorStateDAO
from daos import WorkflowExecutorStateDAO


class ArgMapper:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.daos import FileSystemDAO
from daos import FileSystemDAO


class ArgValueFileMapper:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.daos import WorkflowExecutorStateDAO
from daos import WorkflowExecutorStateDAO


class EnvMapper:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.daos import FileSystemDAO
from daos import FileSystemDAO


class EnvVarValueFileMapper:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.daos import WorkflowExecutorStateDAO
from daos import WorkflowExecutorStateDAO


class TaskMapper:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from core.daos import FileSystemDAO
from daos import FileSystemDAO


class TaskOutputMapper:
Expand Down
6 changes: 6 additions & 0 deletions src/engine/src/mappers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from mappers.ArgMapper import ArgMapper
from mappers.ArgValueFileMapper import ArgValueFileMapper
from mappers.EnvVarValueFileMapper import EnvVarValueFileMapper
from mappers.EnvMapper import EnvMapper
from mappers.TaskMapper import TaskMapper
from mappers.TaskOutputMapper import TaskOutputMapper
4 changes: 4 additions & 0 deletions src/engine/src/middleware/archivers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from middleware.archivers.S3Archiver import S3Archiver
from middleware.archivers.IRODSArchiver import IRODSArchiver


2 changes: 1 addition & 1 deletion src/engine/src/owe_python_sdk/TaskExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from owe_python_sdk.TaskOutputFile import TaskOutputFile
from owe_python_sdk.constants import STDERR, STDOUT
from utils import lbuffer_str as lbuf
from core.resources import Resource, ResourceType
from resources import Resource, ResourceType
from conf.constants import (
DEFAULT_POLLING_INTERVAL,
KUBERNETES_NAMESPACE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.mappers import ArgMapper
from mappers import ArgMapper


class ArgRepository:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.mappers import ArgValueFileMapper
from mappers import ArgValueFileMapper


class ArgValueFileRepository:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.mappers import EnvMapper
from mappers import EnvMapper


class EnvRepository:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.mappers import EnvVarValueFileMapper
from mappers import EnvVarValueFileMapper


class EnvVarValueFileRepository:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.mappers import TaskOutputMapper
from mappers import TaskOutputMapper

from owe_python_sdk.schema import Task

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.mappers import TaskMapper
from mappers import TaskMapper


class TaskRepository:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from urllib.parse import urlparse

from core.repositories import GitCacheRepository
from repositories import GitCacheRepository
from owe_python_sdk.schema import Uses


Expand Down
8 changes: 8 additions & 0 deletions src/engine/src/repositories/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from repositories.EnvRepository import EnvRepository
from repositories.GitCacheRepository import GitCacheRepository
from repositories.ArgRepository import ArgRepository
from repositories.ArgValueFileRepository import ArgValueFileRepository
from repositories.EnvVarValueFileRepository import EnvVarValueFileRepository
from repositories.TaskOutputRepository import TaskOutputRepository
from repositories.TaskRepository import TaskRepository
from repositories.TemplateRepository import TemplateRepository
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any
from threading import Lock

from core.state import Hook
from state import Hook


class ReactiveState(object):
Expand Down
2 changes: 2 additions & 0 deletions src/engine/src/state/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from state.Hook import Hook, method_hook
from state.ReactiveState import ReactiveState
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json, base64, os

from core.tasks.executors.builders.helpers.ContextResolver import context_resolver
from tasks.executors.builders.helpers.ContextResolver import context_resolver
from errors.credentials import CredentialsError
from owe_python_sdk.TaskExecutor import TaskExecutor

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging

from owe_python_sdk.events import EventExchange
from core.tasks.BuildTaskExecutorResolver import build_task_executor_resolver
from core.tasks.executors.requesters.HTTP import HTTP
from core.tasks.executors.Function import Function
from core.tasks.executors.Application import Application
from tasks.BuildTaskExecutorResolver import build_task_executor_resolver
from tasks.executors.requesters.HTTP import HTTP
from tasks.executors.Function import Function
from tasks.executors.Application import Application
from errors.tasks import InvalidTaskTypeError


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from core.workflows import ValueFromService
from workflows import ValueFromService
from owe_python_sdk.schema import Task
from errors.tasks import TaskInputStagingError
from owe_python_sdk.utils import select_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from owe_python_sdk.TaskExecutor import TaskExecutor
from conf.constants import KUBERNETES_NAMESPACE
from core.resources import PodResource
from resources import PodResource
from utils import get_flavor
from utils.k8s import flavor_to_k8s_resource_reqs, gen_resource_name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
KUBERNETES_NAMESPACE,
OWE_PYTHON_SDK_DIR,
)
from core.resources import JobResource
from resources import JobResource
from utils import get_flavor
from utils.k8s import flavor_to_k8s_resource_reqs, gen_resource_name
from core.tasks import function_bootstrap
from core.repositories import GitCacheRepository
from tasks import function_bootstrap
from repositories import GitCacheRepository


class ContainerDetails:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
KANIKO_IMAGE_URL,
KANIKO_IMAGE_TAG
)
from core.tasks.BaseBuildExecutor import BaseBuildExecutor
from core.resources import ConfigMapResource, JobResource
from tasks.BaseBuildExecutor import BaseBuildExecutor
from resources import ConfigMapResource, JobResource
from utils import get_flavor, lbuffer_str as lbuf
from utils.k8s import flavor_to_k8s_resource_reqs, gen_resource_name
from errors import WorkflowTerminated
Expand Down
1 change: 1 addition & 0 deletions src/engine/src/tasks/executors/builders/kaniko/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from tasks.executors.builders.kaniko.Kaniko import Kaniko
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
)

from conf.constants import KUBERNETES_NAMESPACE, WORKFLOW_NFS_SERVER
from core.resources import JobResource
from core.tasks.BaseBuildExecutor import BaseBuildExecutor
from core.tasks.executors.builders.singularity.helpers.ContainerBuilder import container_builder
from resources import JobResource
from tasks.BaseBuildExecutor import BaseBuildExecutor
from tasks.executors.builders.singularity.helpers.ContainerBuilder import container_builder
from errors import WorkflowTerminated
from utils.k8s import gen_resource_name

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from tasks.executors.builders.singularity.Singularity import Singularity
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Union

from core.repositories import TemplateRepository
from repositories import TemplateRepository
from owe_python_sdk.schema import (
Uses,
Pipeline,
Expand Down
1 change: 1 addition & 0 deletions src/engine/src/templating/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from templating.TemplateMapper import TemplateMapper
2 changes: 1 addition & 1 deletion src/engine/src/tests/TestConditionalExpressionEvaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from unittest.mock import Mock

from core.expressions import (
from expressions import (
ConditionalExpressionEvaluator,

)
Expand Down
4 changes: 2 additions & 2 deletions src/engine/src/tests/TestIOCContainerFactory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

from core.ioc import IOCContainerFactory
from core.daos import WorkflowExecutorStateDAO
from ioc import IOCContainerFactory
from daos import WorkflowExecutorStateDAO


class TestIOCContainerFactory(unittest.TestCase):
Expand Down
Loading

0 comments on commit 5676957

Please sign in to comment.