Skip to content

Commit f77fb13

Browse files
authored
feat: Long waited annotated pattern
* docs: updating examples * refactor: nodes as modules * refactor: symbol changes * refactor: symbol changes * fix: remove interference with logging within the application * chore: minor changes to the logging structure * fix: log messages being part of the catalog * test: removing assertion to have parallel step root to be part of logs * test: removing assertion to have parallel step root to be part of logs * chore: formatting * refactor: getting annotated pattern * refactor: pipeline in good shape except for notebook * feat: refactored to a much simpler code base * fix: notebooks work now * fix: adding better tests * test: writting more unit tests * test: writting more unit tests * refactor: working pipeline execution * refactor: working pipeline execution * fix: removing unwanted examples * feat: Jobs working * feat: Jobs working * feat: Revamped codebase with emulator test pattern * feat: Revamped codebase with emulator test pattern * feat: Revamped codebase with emulator test pattern * feat: Revamped codebase with emulator test pattern
1 parent f760198 commit f77fb13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4814
-3766
lines changed

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: uv python install
4040

4141
- name: Install the project
42-
run: uv sync --all-extras --dev --frozen
42+
run: uv sync --dev --frozen --extra examples --extra notebook
4343

4444
- name: Run lint
4545
# For example, using `flake8`

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ repos:
1717
hooks:
1818
- id: ruff
1919
args: [--fix, --exit-non-zero-on-fix]
20-
exclude: ^tests
20+
exclude: ^(tests/|examples)
2121
- id: ruff-format
22-
exclude: ^tests
22+
exclude: ^(tests/|examples)
2323
- repo: https://github.com/jorisroovers/gitlint
2424
rev: v0.19.1
2525
hooks:

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ WORKDIR /app
2222
ENV http_proxy=
2323
ENV https_proxy=
2424

25-
RUN uv sync --index https://artifactory.astrazeneca.net/api/pypi/pypi-virtual/simple/ --frozen
25+
RUN uv sync --verbose --frozen --extra examples --extra notebook --extra k8s
26+
2627

2728
ENV PATH="/app/.venv/bin:$PATH"

examples/01-tasks/notebook.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
44
python examples/01-tasks/notebook.py
55
6-
The notebook is executed in the same environment so any installed packages are available for the
6+
The notebook is executed in the same environment
7+
so any installed packages are available for the
78
notebook.
89
9-
Upon successful execution, the output notebook with cell outputs is stored in the catalog.
10+
Upon successful execution, the output notebook with
11+
cell outputs is stored in the catalog.
1012
1113
"""
1214

@@ -20,7 +22,6 @@ def main():
2022
hello_task = NotebookTask(
2123
name="hello",
2224
notebook="examples/common/simple_notebook.ipynb",
23-
terminate_with_success=True,
2425
)
2526

2627
# The pipeline has only one step.

examples/01-tasks/python_task_as_pipeline.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212

1313

1414
def main():
15-
# Create a tasks which calls the function "hello"
16-
# If this step executes successfully,
17-
# the pipeline will terminate with success
15+
# A single step pipeline can also be created using the
16+
# task.as_pipeline() method.
1817
pipeline = PythonTask(
1918
name="hello",
2019
function=hello,
21-
terminate_with_success=True,
2220
).as_pipeline()
2321

2422
pipeline.execute()

examples/01-tasks/python_tasks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def main():
1818
hello_task = PythonTask(
1919
name="hello",
2020
function=hello,
21-
terminate_with_success=True,
2221
)
2322

2423
# The pipeline has only one step.

examples/01-tasks/scripts.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
44
python examples/01-tasks/scripts.py
55
6-
The command can be anything that can be executed in a shell.
7-
The stdout/stderr of the execution is captured as execution log and stored in the catalog.
6+
The command can be anything that can be
7+
executed in a shell.
8+
The stdout/stderr of the execution is
9+
captured as execution log and stored in the catalog.
810
911
"""
1012

@@ -16,7 +18,6 @@ def main():
1618
hello_task = ShellTask(
1719
name="hello",
1820
command="echo 'Hello World!'",
19-
terminate_with_success=True,
2021
)
2122

2223
# The pipeline has only one step.
@@ -29,3 +30,4 @@ def main():
2930

3031
if __name__ == "__main__":
3132
main()
33+
main()

examples/01-tasks/scripts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ dag:
1111
shell:
1212
type: task
1313
command_type: shell
14-
command: echo "hello world!!" # The path is relative to the root of the project.
14+
command: echo "hello world!!"
1515
next: success

examples/01-tasks/stub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
step 1 >> step 2 >> step 3 >> success
55
6-
All the steps are mocked and they will just pass through.
6+
All the steps are stubbed and they will just pass through.
77
Use this pattern to define the skeleton of your pipeline
88
and flesh out the steps later.
99
@@ -27,7 +27,7 @@ def main():
2727
# mature pipelines
2828
step2 = Stub(name="step2", what="is this thing")
2929

30-
step3 = Stub(name="step3", terminate_with_success=True)
30+
step3 = Stub(name="step3")
3131

3232
pipeline = Pipeline(steps=[step1, step2, step3])
3333

examples/01-tasks/stub.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dag:
44
55
step 1 >> step 2 >> step 3 >> success
66
7-
All the steps are mocked and they will just pass through.
7+
All the steps are stubbed and they will just pass through.
88
Use this pattern to define the skeleton of your pipeline
99
and flesh out the steps later.
1010

0 commit comments

Comments
 (0)