Skip to content

Commit 04f7fbc

Browse files
Merge branch 'master' into streaming-deck-v2
2 parents 137579f + 27c9edd commit 04f7fbc

File tree

224 files changed

+8673
-5612
lines changed

Some content is hidden

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

224 files changed

+8673
-5612
lines changed

.github/workflows/single-binary.yml

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches:
1111
- master
1212
- rc/*
13-
- 'release-v**'
13+
- "release-v**"
1414
workflow_dispatch:
1515

1616
jobs:
@@ -197,6 +197,99 @@ jobs:
197197
--version ${{ env.FLYTESNACKS_VERSION }} \
198198
flytesnacks/$line;
199199
done < flytesnacks/flyte_tests.txt
200+
- name: Install Pytest
201+
run: |
202+
pip install pytest
203+
- name: End2End
204+
run: |
205+
make end2end_execute
206+
207+
sandbox-bundled-offloaded-functional-tests:
208+
runs-on: ubuntu-latest
209+
env:
210+
FLYTESNACKS_PRIORITIES: "P0"
211+
FLYTESNACKS_VERSION: ""
212+
timeout-minutes: 60
213+
needs: [build-and-push-single-binary-image]
214+
steps:
215+
- name: Set latest Flytesnacks release
216+
if: ${{ env.FLYTESNACKS_VERSION == '' }}
217+
run: |
218+
FLYTESNACKS_VERSION="$(curl --silent https://api.github.com/repos/flyteorg/flytesnacks/releases/latest | jq -r .tag_name)"
219+
echo "FLYTESNACKS_VERSION=${FLYTESNACKS_VERSION}" >> ${GITHUB_ENV}
220+
- name: Checkout
221+
uses: actions/checkout@v4
222+
- uses: actions/download-artifact@v4
223+
with:
224+
name: single-binary-image
225+
path: docker/sandbox-bundled/images/tar
226+
- name: Set up Docker Buildx
227+
uses: docker/setup-buildx-action@v2
228+
with:
229+
driver-opts: image=moby/buildkit:master
230+
buildkitd-flags: "--allow-insecure-entitlement security.insecure"
231+
- name: Build sandbox image for functional tests
232+
uses: docker/build-push-action@v6
233+
with:
234+
context: docker/sandbox-bundled
235+
load: true
236+
allow: "security.insecure"
237+
tags: flyte-sandbox-bundled:local
238+
# Without this, the GHA runner is under disk pressure and evicts all the pods.
239+
# Buildx cache uses roughly 50% (7gb) of the GHA runner's disk (14gb).
240+
- name: Prune Docker Buildx cache to reclaim storage
241+
run: docker buildx prune --all --force
242+
- name: Set up Python
243+
uses: actions/setup-python@v4
244+
with:
245+
python-version: "3.12"
246+
- uses: unionai/flytectl-setup-action@v0.0.3
247+
- name: Setup sandbox
248+
run: |
249+
mkdir -p ~/.flyte/sandbox
250+
cat << EOF > ~/.flyte/sandbox/config.yaml
251+
propeller:
252+
literal-offloading-config:
253+
enabled: true
254+
min-size-in-mb-for-offloading: 0.000001
255+
task_resources:
256+
defaults:
257+
cpu: "0"
258+
memory: "0"
259+
limits:
260+
cpu: "0"
261+
memory: "0"
262+
EOF
263+
flytectl demo start --image flyte-sandbox-bundled:local --imagePullPolicy Never
264+
# By setting min-size-in-mb-for-offloading to 0.000001, we ensure that all tasks are offloaded.
265+
- name: Install Python dependencies
266+
run: |
267+
python -m pip install --upgrade pip
268+
pip install uv
269+
uv pip install --system flytekit flytekitplugins-deck-standard "numpy<2.0.0" pyarrow pandas
270+
uv pip freeze
271+
- name: Checkout flytesnacks
272+
uses: actions/checkout@v4
273+
with:
274+
repository: flyteorg/flytesnacks
275+
path: flytesnacks
276+
ref: ${{ env.FLYTESNACKS_VERSION }}
277+
- name: Register specific tests
278+
run: |
279+
flytekit_version=$(pip show flytekit | grep -i version | awk '{ print $2 }')
280+
while read -r line;
281+
do
282+
pyflyte -vv --config ./boilerplate/flyte/end2end/functional-test-config.yaml \
283+
register \
284+
--project flytesnacks \
285+
--domain development \
286+
--image cr.flyte.org/flyteorg/flytekit:py3.12-${flytekit_version} \
287+
--version ${{ env.FLYTESNACKS_VERSION }} \
288+
flytesnacks/$line;
289+
done < flytesnacks/flyte_tests.txt
290+
- name: Install Pytest
291+
run: |
292+
pip install pytest
200293
- name: End2End
201294
run: |
202295
make end2end_execute

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ docs/examples
3838
docs/_src
3939
docs/_projects
4040
docs/tests
41+
empty-config.yaml

CHANGELOG/CHANGELOG-v1.14.0.md

Lines changed: 207 additions & 0 deletions
Large diffs are not rendered by default.

CHANGELOG/CHANGELOG-v1.14.1.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Flyte 1.14.1 Release Notes
2+
3+
* Update flytestdlib and affected tools (copilot) for missing config.
4+
5+
## What's Changed
6+
* docs: Refactor merge sort code example to use literalinclude by @davidlin20dev in https://github.com/flyteorg/flyte/pull/6091
7+
* [DOCS] Using ImageSpec in ContainerTask by @machichima in https://github.com/flyteorg/flyte/pull/6095
8+
* Eager doc updates by @wild-endeavor in https://github.com/flyteorg/flyte/pull/6099
9+
* Revert "fix: return the config file not found error" by @eapolinario in https://github.com/flyteorg/flyte/pull/6100
10+
* Remove notes on deprecated Batch size by @wild-endeavor in https://github.com/flyteorg/flyte/pull/6102
11+
* Upstream: Add labels to published execution events by @katrogan in https://github.com/flyteorg/flyte/pull/6104
12+
* Fix: Make distributed error aggregation opt-in by @fg91 in https://github.com/flyteorg/flyte/pull/6103
13+
* Add default labels and annotations to Ray worker pods too. by @katrogan in https://github.com/flyteorg/flyte/pull/6107
14+
* Fix: Remove the default search dialog if it exists (on CMD + K) by @chmod77 in https://github.com/flyteorg/flyte/pull/6106
15+
16+
## New Contributors
17+
* @chmod77 made their first contribution in https://github.com/flyteorg/flyte/pull/6106
18+
19+
**Full Changelog**: https://github.com/flyteorg/flyte/compare/v1.14.0...v1.14.1

README.md

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

boilerplate/flyte/end2end/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
end2end_execute: export FLYTESNACKS_PRIORITIES ?= P0
88
end2end_execute: export FLYTESNACKS_VERSION ?= $(shell curl --silent "https://api.github.com/repos/flyteorg/flytesnacks/releases/latest" | jq -r .tag_name)
99
end2end_execute:
10-
./boilerplate/flyte/end2end/end2end.sh ./boilerplate/flyte/end2end/functional-test-config.yaml --return_non_zero_on_failure
11-
10+
pytest ./boilerplate/flyte/end2end/test_run.py \
11+
--flytesnacks_release_tag=$(FLYTESNACKS_VERSION) \
12+
--priorities=$(FLYTESNACKS_PRIORITIES) \
13+
--config_file=./boilerplate/flyte/end2end/functional-test-config.yaml \
14+
--return_non_zero_on_failure
15+
1216
.PHONY: k8s_integration_execute
1317
k8s_integration_execute:
1418
echo "pass"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import pytest
2+
3+
def pytest_addoption(parser):
4+
parser.addoption("--flytesnacks_release_tag", required=True)
5+
parser.addoption("--priorities", required=True)
6+
parser.addoption("--config_file", required=True)
7+
parser.addoption(
8+
"--return_non_zero_on_failure",
9+
action="store_true",
10+
default=False,
11+
help="Return a non-zero exit status if any workflow fails",
12+
)
13+
parser.addoption(
14+
"--terminate_workflow_on_failure",
15+
action="store_true",
16+
default=False,
17+
help="Abort failing workflows upon exit",
18+
)
19+
parser.addoption(
20+
"--test_project_name",
21+
default="flytesnacks",
22+
help="Name of project to run functional tests on"
23+
)
24+
parser.addoption(
25+
"--test_project_domain",
26+
default="development",
27+
help="Name of domain in project to run functional tests on"
28+
)
29+
parser.addoption(
30+
"--cluster_pool_name",
31+
required=False,
32+
type=str,
33+
default=None,
34+
)
35+
36+
@pytest.fixture
37+
def setup_flytesnacks_env(pytestconfig):
38+
return {
39+
"flytesnacks_release_tag": pytestconfig.getoption("--flytesnacks_release_tag"),
40+
"priorities": pytestconfig.getoption("--priorities"),
41+
"config_file": pytestconfig.getoption("--config_file"),
42+
"return_non_zero_on_failure": pytestconfig.getoption("--return_non_zero_on_failure"),
43+
"terminate_workflow_on_failure": pytestconfig.getoption("--terminate_workflow_on_failure"),
44+
"test_project_name": pytestconfig.getoption("--test_project_name"),
45+
"test_project_domain": pytestconfig.getoption("--test_project_domain"),
46+
"cluster_pool_name": pytestconfig.getoption("--cluster_pool_name"),
47+
}

boilerplate/flyte/end2end/end2end.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 22 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import traceback
66
from typing import Dict, List, Optional
77

8-
import click
8+
import pytest
99
import requests
1010
from flytekit.configuration import Config
1111
from flytekit.models.core.execution import WorkflowExecutionPhase
@@ -15,7 +15,6 @@
1515
WAIT_TIME = 10
1616
MAX_ATTEMPTS = 200
1717

18-
1918
def execute_workflow(
2019
remote: FlyteRemote,
2120
version,
@@ -27,7 +26,6 @@ def execute_workflow(
2726
wf = remote.fetch_workflow(name=workflow_name, version=version)
2827
return remote.execute(wf, inputs=inputs, wait=False, cluster_pool=cluster_pool_name)
2928

30-
3129
def executions_finished(
3230
executions_by_wfgroup: Dict[str, List[FlyteWorkflowExecution]]
3331
) -> bool:
@@ -36,7 +34,6 @@ def executions_finished(
3634
return False
3735
return True
3836

39-
4037
def sync_executions(
4138
remote: FlyteRemote, executions_by_wfgroup: Dict[str, List[FlyteWorkflowExecution]]
4239
):
@@ -50,13 +47,11 @@ def sync_executions(
5047
print("GOT TO THE EXCEPT")
5148
print("COUNT THIS!")
5249

53-
5450
def report_executions(executions_by_wfgroup: Dict[str, List[FlyteWorkflowExecution]]):
5551
for executions in executions_by_wfgroup.values():
5652
for execution in executions:
5753
print(execution)
5854

59-
6055
def schedule_workflow_groups(
6156
tag: str,
6257
workflow_groups: List[str],
@@ -65,10 +60,6 @@ def schedule_workflow_groups(
6560
parsed_manifest: List[dict],
6661
cluster_pool_name: Optional[str] = None,
6762
) -> Dict[str, bool]:
68-
"""
69-
Schedule workflows executions for all workflow groups and return True if all executions succeed, otherwise
70-
return False.
71-
"""
7263
executions_by_wfgroup = {}
7364
# Schedule executions for each workflow group,
7465
for wf_group in workflow_groups:
@@ -120,30 +111,32 @@ def schedule_workflow_groups(
120111
results[wf_group] = len(non_succeeded_executions) == 0
121112
return results
122113

123-
124114
def valid(workflow_group, parsed_manifest):
125115
"""
126116
Return True if a workflow group is contained in parsed_manifest,
127117
False otherwise.
128118
"""
129119
return workflow_group in set(wf_group["name"] for wf_group in parsed_manifest)
130120

121+
def test_run(setup_flytesnacks_env):
122+
123+
env = setup_flytesnacks_env
124+
125+
flytesnacks_release_tag = env["flytesnacks_release_tag"]
126+
priorities = env["priorities"]
127+
config_file_path = env["config_file"]
128+
terminate_workflow_on_failure = env["terminate_workflow_on_failure"]
129+
test_project_name = env["test_project_name"]
130+
test_project_domain = env["test_project_domain"]
131+
cluster_pool_name = env["cluster_pool_name"]
132+
return_non_zero_on_failure = env["return_non_zero_on_failure"]
131133

132-
def run(
133-
flytesnacks_release_tag: str,
134-
priorities: List[str],
135-
config_file_path,
136-
terminate_workflow_on_failure: bool,
137-
test_project_name: str,
138-
test_project_domain: str,
139-
cluster_pool_name: Optional[str] = None,
140-
) -> List[Dict[str, str]]:
141134
remote = FlyteRemote(
142135
Config.auto(config_file=config_file_path),
143136
test_project_name,
144137
test_project_domain,
145138
)
146-
139+
147140
# For a given release tag and priority, this function filters the workflow groups from the flytesnacks
148141
# manifest file. For example, for the release tag "v0.2.224" and the priority "P0" it returns [ "core" ].
149142
manifest_url = (
@@ -210,75 +203,15 @@ def run(
210203
"color": background_color,
211204
}
212205
results.append(result)
213-
return results
214-
215-
216-
@click.command()
217-
@click.argument("flytesnacks_release_tag")
218-
@click.argument("priorities")
219-
@click.argument("config_file")
220-
@click.option(
221-
"--return_non_zero_on_failure",
222-
default=False,
223-
is_flag=True,
224-
help="Return a non-zero exit status if any workflow fails",
225-
)
226-
@click.option(
227-
"--terminate_workflow_on_failure",
228-
default=False,
229-
is_flag=True,
230-
help="Abort failing workflows upon exit",
231-
)
232-
@click.option(
233-
"--test_project_name",
234-
default="flytesnacks",
235-
type=str,
236-
is_flag=False,
237-
help="Name of project to run functional tests on",
238-
)
239-
@click.option(
240-
"--test_project_domain",
241-
default="development",
242-
type=str,
243-
is_flag=False,
244-
help="Name of domain in project to run functional tests on",
245-
)
246-
@click.argument(
247-
"cluster_pool_name",
248-
required=False,
249-
type=str,
250-
default=None,
251-
)
252-
def cli(
253-
flytesnacks_release_tag,
254-
priorities,
255-
config_file,
256-
return_non_zero_on_failure,
257-
terminate_workflow_on_failure,
258-
test_project_name,
259-
test_project_domain,
260-
cluster_pool_name,
261-
):
262-
print(f"return_non_zero_on_failure={return_non_zero_on_failure}")
263-
results = run(
264-
flytesnacks_release_tag,
265-
priorities,
266-
config_file,
267-
terminate_workflow_on_failure,
268-
test_project_name,
269-
test_project_domain,
270-
cluster_pool_name,
271-
)
272206

273-
# Write a json object in its own line describing the result of this run to stdout
274207
print(f"Result of run:\n{json.dumps(results)}")
275208

276-
# Return a non-zero exit code if core fails
277209
if return_non_zero_on_failure:
278-
for result in results:
279-
if result["status"] not in ("passing", "coming soon"):
280-
sys.exit(1)
281-
282-
283-
if __name__ == "__main__":
284-
cli()
210+
fail_results = [result for result in results if result["status"] not in ("passing", "coming soon")]
211+
if fail_results:
212+
fail_msgs = [
213+
f"Workflow '{r['label']}' failed with status '{r['status']}'" for r in fail_results
214+
]
215+
pytest.fail("\n".join(fail_msgs))
216+
217+
assert results == [{"label": "core", "status": "passing", "color": "green"}]

0 commit comments

Comments
 (0)