Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Oct 17, 2023
1 parent fe4968d commit 3c92d12
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- master
paths-ignore:
- "docs/**"
pull_request:
paths-ignore:
- "docs/**"
# pull_request:
# paths-ignore:
# - "docs/**"
jobs:
lint:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
push:
branches:
- master
pull_request:
branches:
- master
# pull_request:
# branches:
# - master
jobs:
docs_warnings:
name: Docs Warnings
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/end2end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: End to End tests

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
endtoend:
name: End to End tests
runs-on: ubuntu-latest
env:
FLYTESNACKS_VERSION: ""
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: unionai/[email protected]
name: Setup flytectl
- uses: actions/setup-python@v3
with:
python-version: 3.10
- name: Create Sandbox Cluster
run: |
flytectl config init
flytectl demo start
kubectl create -k "github.com/ray-project/kuberay/ray-operator/config/default?ref=v0.5.2"
kubectl rollout restart deployment flyte-sandbox -n flyte
- name: Setup Flytekit
run: |
python -m pip install --upgrade pip
pip install flytekit flytekitplugins-deck-standard flytekitplugins-ray
pip freeze
- name: execute flyte workflows
working-directory: examples
run: |
pyflyte run --remote integration_test.py integration_test
37 changes: 37 additions & 0 deletions examples/integration_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from basics.basics.documenting_workflows import google_docstring_wf, numpy_docstring_wf, sphinx_docstring_wf
from basics.basics.hello_world import hello_world_wf
from basics.basics.imperative_workflow import imperative_wf
from basics.basics.launch_plan import simple_wf_lp_fixed_inputs
from basics.basics.named_outputs import simple_wf_with_named_outputs
from basics.basics.shell_task import shell_task_wf
from basics.basics.task import slope
from basics.basics.workflow import simple_wf_with_partial
from ray_plugin.ray_plugin.ray_example import ray_workflow
from flytekit import workflow, task


@workflow
def integration_test():
# Test Basic Workflows
google_docstring_wf()
numpy_docstring_wf()
sphinx_docstring_wf()

hello_world_wf()
imperative_wf(x=[-3, 0, 3], y=[7, 4, -2])

simple_wf_lp_fixed_inputs(y=[-3, 2, -2])
simple_wf_with_named_outputs()

shell_task_wf()
slope(x=[-3, 0, 3], y=[7, 4, -2])
simple_wf_with_partial(x=[-3, 0, 3], y=[7, 4, -2])

# Test Plugins
ray_workflow(n=5)

# TODO: Add more plugins here, like spark, tensorflow, torch, Dask.


if __name__ == '__main__':
integration_test()
2 changes: 1 addition & 1 deletion examples/ray_plugin/ray_plugin/ray_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def f(x):
# %%
@task(
task_config=ray_config,
requests=Resources(mem="2Gi", cpu="2"),
requests=Resources(mem="800Mi", cpu="1"),
container_image=custom_image,
)
def ray_task(n: int) -> typing.List[int]:
Expand Down

0 comments on commit 3c92d12

Please sign in to comment.