-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yuvraj <[email protected]>
- Loading branch information
Showing
5 changed files
with
73 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,17 @@ jobs: | |
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
- uses: unionai/[email protected] | ||
with: | ||
version: '0.1.10' | ||
- run: docker pull ghcr.io/flyteorg/flyte-sandbox:dind | ||
- name: setup sandbox | ||
run: flytectl sandbox start | ||
run: make setup | ||
- name: wait for sandbox | ||
run: | | ||
n=0 | ||
until [ "$n" -ge 5 ]; do | ||
echo "try $n" | ||
make wait && break | ||
n=$((n+1)) | ||
sleep 1 | ||
done | ||
- name: fast register | ||
run: REGISTRY=ghcr.io/flyteorg VERSION=latest make fast_register | ||
run: REGISTRY=ghcr.io/flyteorg VERSION=latest make fast_register |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Test snacks | ||
name: Serialize snacks | ||
|
||
on: | ||
pull_request: | ||
|
@@ -15,57 +15,34 @@ jobs: | |
with: | ||
path: /tmp/release-snacks-core/ | ||
key: release-snacks-core | ||
- uses: unionai/[email protected] | ||
with: | ||
version: '0.1.10' | ||
- name: setup sandbox | ||
run: flytectl sandbox start | ||
- name: Generate Serialize proto | ||
run: | | ||
make -C cookbook/core serialize | ||
- name: Register core example workflow | ||
run : make -C cookbook/core register | ||
- name: run pytest #TODO | ||
run: echo "Hello" | ||
integrations-build: | ||
name: Build Integrations example | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
- uses: unionai/[email protected] | ||
with: | ||
version: '0.1.10' | ||
- uses: actions/cache@v1 | ||
with: | ||
path: /tmp/release-snacks-integrations/ | ||
key: release-snacks-plugins | ||
- name: Generate Serialize proto | ||
run: | | ||
make -C cookbook/integrations serialize | ||
- name: Register integrations example workflow | ||
run : make -C cookbook/integrations register | ||
- name: run pytest #TODO | ||
run: echo "Hello" | ||
case_studies-build: | ||
name: Build Case studies example | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
- uses: unionai/[email protected] | ||
with: | ||
version: '0.1.10' | ||
- uses: actions/cache@v1 | ||
with: | ||
path: /tmp/release-snacks-case-studies/ | ||
key: release-snacks-case-studies | ||
- name: Generate Serialize proto | ||
run: | | ||
make -C cookbook/case_studies serialize | ||
- name: Register case_studies example workflow | ||
run : make -C cookbook/case_studies register | ||
- name: run pytest #TODO | ||
run: echo "Hello" | ||
make -C cookbook/case_studies serialize |
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
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,44 @@ | ||
import os | ||
import pathlib | ||
import subprocess | ||
|
||
import pytest | ||
from flytekit.common import launch_plan | ||
from flytekit.models import literals | ||
from flytekit.models.core.identifier import Identifier, ResourceType | ||
|
||
PROJECT = "flytesnacks" | ||
DOMAIN = "development" | ||
VERSION = os.getpid() | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def flyte_workflows_source_dir(): | ||
return pathlib.Path("../" / os.path.dirname(__file__)) / "containerization" | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def flyte_workflows_register(request): | ||
proto_path = request.config.getoption("--proto-path") | ||
subprocess.check_call( | ||
f"flytectl register files {proto_path} -p {PROJECT} -d {DOMAIN} -v v{VERSION}", | ||
shell=True, | ||
) | ||
|
||
def test_stub(flyteclient, flyte_workflows_register): | ||
projects = flyteclient.list_projects_paginated(limit=5, token=None) | ||
assert len(projects) <= 5 | ||
|
||
|
||
def test_launch_workflow(flyteclient, flyte_workflows_register): | ||
lp = launch_plan.SdkLaunchPlan.fetch( | ||
"flytesnacks", | ||
"development", | ||
"workflows.raw_container.raw_container_wf", | ||
f"v{VERSION}", | ||
) | ||
execution = lp.launch_with_literals( | ||
"flytesnacks", "development", literals.LiteralMap({}) | ||
) | ||
print(execution.id.name) | ||
|