-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,822 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from typing import TypedDict, List | ||
from enum import Enum | ||
from modules.task import task, TaskType, TaskSpec | ||
from modules.workflow import Workflow, WorkflowSpec | ||
|
||
@task(TaskSpec( | ||
name="hello_world", | ||
type=TaskType.PYTHON, | ||
description="This is a test task", | ||
dependencies="This is a test task", | ||
metadata={ | ||
"author": "Yuvraj Singh", | ||
"version": "1.0.0", | ||
}, | ||
base_image="python:3.12", | ||
entrypoint="python", | ||
args=[], | ||
env={} | ||
)) | ||
def hello_world(a : int, b : int) -> bool: | ||
print("Hello, World!") | ||
return True | ||
|
||
|
||
@task(TaskSpec( | ||
name="hello_world", | ||
type=TaskType.PYTHON, | ||
description="This is a test task", | ||
dependencies="This is a test task", | ||
metadata={ | ||
"author": "Yuvraj Singh", | ||
"version": "1.0.0", | ||
}, | ||
base_image="python:3.12", | ||
entrypoint="python", | ||
args=[], | ||
env={} | ||
)) | ||
def hello_world_2(a : int, b : int) -> bool: | ||
print("Hello, World!") | ||
return True | ||
|
||
|
||
@Workflow(WorkflowSpec( | ||
name="hello_world", | ||
description="This is a test workflow", | ||
metadata={ | ||
"author": "Yuvraj Singh", | ||
"version": "1.0.0", | ||
}, | ||
)) | ||
def hello_world_workflow(a : int, b : int)-> bool: | ||
return hello_world(a=a, b=b) or hello_world(a=a, b=b) | ||
|
||
|
||
if __name__ == "__main__": | ||
hello_world() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
from typing import TypedDict, List | ||
from enum import Enum | ||
from functools import wraps | ||
from modules.cloud.v1.cloud_pb2 import Task | ||
|
||
class TaskType(Enum): | ||
PYTHON = "python" | ||
|
||
class TaskMetadata(TypedDict): | ||
author: str | ||
version: str | ||
|
||
class TaskSpec(TypedDict): | ||
name: str | ||
type: TaskType | ||
description: str | ||
dependencies: List[str] | ||
metadata: TaskMetadata | ||
base_image: str | ||
entrypoint: str |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
from typing import TypedDict, List, Dict | ||
from enum import Enum | ||
from functools import wraps | ||
from modules.cloud.v1.cloud_pb2 import Workflow | ||
|
||
class WorkflowType(Enum): | ||
PYTHON = "python" | ||
|
||
class WorkflowMetadata(TypedDict): | ||
author: str | ||
version: str | ||
|
||
class WorkflowSpec(TypedDict): | ||
name: str | ||
type: WorkflowType | ||
description: str | ||
dependencies: List[str] | ||
metadata: WorkflowMetadata | ||
base_image: str | ||
entrypoint: str | ||
args: List[str] | ||
env: Dict[str, str] |
Oops, something went wrong.