Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove end2end.yml #5034

Merged
merged 16 commits into from
Jun 16, 2024
83 changes: 8 additions & 75 deletions .github/workflows/end2end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ on:
description: "Priorities of tests to register (comma-separated)"
required: true
type: string
cache_key:
description: "Cache key for docker image"
required: true
type: string
jobs:
endtoend:
name: End to End tests
runs-on: ubuntu-latest
env:
FLYTESNACKS_VERSION: ""
steps:
- uses: insightsengineering/disk-space-reclaimer@v1
- name: Set latest Flytesnacks release
if: ${{ env.FLYTESNACKS_VERSION == '' }}
run: |
Expand All @@ -30,40 +27,10 @@ jobs:
- uses: actions/setup-python@v3
with:
python-version: 3.11
- id: load-docker-cache-datacatalog
uses: actions/cache@v3
with:
path: /tmp/tmp/docker-images-datacatalog
key: ${{ inputs.cache_key }}-datacatalog
- id: load-docker-cache-flyteadmin
uses: actions/cache@v3
with:
path: /tmp/tmp/docker-images-flyteadmin
key: ${{ inputs.cache_key }}-flyteadmin
- id: load-docker-cache-flytecopilot
uses: actions/cache@v3
with:
path: /tmp/tmp/docker-images-flytecopilot
key: ${{ inputs.cache_key }}-flytecopilot
- id: load-docker-cache-flytepropeller
uses: actions/cache@v3
with:
path: /tmp/tmp/docker-images-flytepropeller
key: ${{ inputs.cache_key }}-flytepropeller
- name: Create Sandbox Cluster
run: |
cp /tmp/tmp/docker-images-datacatalog/snapshot-datacatalog.tar snapshot-datacatalog.tar
cp /tmp/tmp/docker-images-flyteadmin/snapshot-flyteadmin.tar snapshot-flyteadmin.tar
cp /tmp/tmp/docker-images-flytecopilot/snapshot-flytecopilot.tar snapshot-flytecopilot.tar
cp /tmp/tmp/docker-images-flytepropeller/snapshot-flytepropeller.tar snapshot-flytepropeller.tar
flytectl config init
flytectl sandbox start --source=$(pwd)
- name: Prime docker cache
run: |
flytectl sandbox exec -- docker load -i /root/snapshot-datacatalog.tar
flytectl sandbox exec -- docker load -i /root/snapshot-flyteadmin.tar
flytectl sandbox exec -- docker load -i /root/snapshot-flytecopilot.tar
flytectl sandbox exec -- docker load -i /root/snapshot-flytepropeller.tar
flytectl demo start --source=$(pwd) --image ghcr.io/${{ github.repository_owner }}/flyte-sandbox-bundled:latest --disable-agent
pingsutw marked this conversation as resolved.
Show resolved Hide resolved
- name: Setup Flytekit
run: |
python -m pip install --upgrade pip
Expand All @@ -76,48 +43,14 @@ jobs:
repository: flyteorg/flytesnacks
path: flytesnacks
ref: ${{ env.FLYTESNACKS_VERSION }}
- name: Register P0 tests
- name: Register flytesnacks examples
if: ${{ inputs.priorities == 'P0' }}
run: |
while read -r line;
do
pyflyte --config ./boilerplate/flyte/end2end/functional-test-config.yaml \
register \
--project flytesnacks \
--domain development \
--image cr.flyte.org/flyteorg/flytekit:py3.11-latest \
--version ${{ env.FLYTESNACKS_VERSION }} \
flytesnacks/$line;
done < flytesnacks/flyte_tests.txt
- name: Register all flytesnacks examples
if: ${{ inputs.priorities != 'P0' }}
uses: unionai/[email protected]
with:
flytesnacks: true
project: flytesnacks
version: ${{ env.FLYTESNACKS_VERSION }}
domain: development
# - name: Pre Upgrade Tests
# if: ${{ github.event.repository.name == 'flyteadmin' }}
# env:
# PRIORITIES: "${{ inputs.priorities }}"
# run: |
# make end2end_execute
- name: Upgrade Helm charts
run: |
flytectl sandbox exec -- helm repo add flyteorg https://flyteorg.github.io/flyte
flytectl sandbox exec -- helm repo update
flytectl sandbox exec -- helm upgrade flyte -n flyte-core --kubeconfig=/etc/rancher/k3s/k3s.yaml flyteorg/flyte-core -f /flyteorg/share/flyte/values-sandbox.yaml --wait --set datacatalog.image.repository=${{ github.repository_owner }}/datacalog,datacatalog.image.tag=latest
# TODO(monorepo): the following commands are not correct.
# we have to separate the calls to replace the images into different commands.
# flytectl sandbox exec -- helm upgrade flyte -n flyte-core --kubeconfig=/etc/rancher/k3s/k3s.yaml flyteorg/flyte-core -f /flyteorg/share/flyte/values-sandbox.yaml --wait \
# --set datacatalog.image.repository=${{ github.repository_owner }}/datacalog,datacatalog.image.tag=latest
# --set flyteadmin.image.repository=${{ github.repository_owner }}/datacalog,flyteadmin.image.tag=latest
# --set flytecopilot.image.repository=${{ github.repository_owner }}/datacalog,flytecopilot.image.tag=latest
# --set flytepropeller.image.repository=${{ github.repository_owner }}/datacalog,flytepropeller.image.tag=latest

flytectl sandbox exec -- k3s kubectl get pods -n flyte -oyaml
- name: Post Upgrade Tests
flytectl --config ./boilerplate/flyte/end2end/functional-test-config.yaml \
register examples \
--project flytesnacks \
--domain development
- name: Run flytesnacks examples
env:
PRIORITIES: "${{ inputs.priorities }}"
run: |
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/single-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,11 @@ jobs:
tags: ${{ steps.image-names.outputs.tags }}
build-args: "FLYTE_SANDBOX_VERSION=${{ env.FLYTE_SANDBOX_VERSION }}"
push: true

endtoend:
name: End2End Test
needs: [ build-and-push-sandbox-bundled-image ]
pingsutw marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/end2end.yml
with:
priorities: "P0"
17 changes: 15 additions & 2 deletions boilerplate/flyte/end2end/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ def execute_workflow(
workflow_name,
inputs,
cluster_pool_name: Optional[str] = None,
wait: bool = False,
):
print(f"Fetching workflow={workflow_name} and version={version}")
wf = remote.fetch_workflow(name=workflow_name, version=version)
return remote.execute(wf, inputs=inputs, wait=False, cluster_pool=cluster_pool_name)
print(f"Executing workflow={workflow_name} and version={version}")
return remote.execute(wf, inputs=inputs, wait=wait, cluster_pool=cluster_pool_name)


def executions_finished(
Expand Down Expand Up @@ -64,6 +66,7 @@ def schedule_workflow_groups(
terminate_workflow_on_failure: bool,
parsed_manifest: List[dict],
cluster_pool_name: Optional[str] = None,
parallel: bool = True,
) -> Dict[str, bool]:
"""
Schedule workflows executions for all workflow groups and return True if all executions succeed, otherwise
Expand All @@ -81,7 +84,7 @@ def schedule_workflow_groups(
if not workflows:
continue
executions_by_wfgroup[wf_group] = [
execute_workflow(remote, tag, workflow[0], workflow[1], cluster_pool_name)
execute_workflow(remote, tag, workflow[0], workflow[1], cluster_pool_name, not parallel)
for workflow in workflows
]

Expand Down Expand Up @@ -137,6 +140,7 @@ def run(
test_project_name: str,
test_project_domain: str,
cluster_pool_name: Optional[str] = None,
parallel: bool = True,
) -> List[Dict[str, str]]:
remote = FlyteRemote(
Config.auto(config_file=config_file_path),
Expand Down Expand Up @@ -184,6 +188,7 @@ def run(
terminate_workflow_on_failure,
parsed_manifest,
cluster_pool_name,
parallel
)

for workflow_group, succeeded in results_by_wfgroup.items():
Expand Down Expand Up @@ -243,6 +248,12 @@ def run(
is_flag=False,
help="Name of domain in project to run functional tests on",
)
@click.option(
"--parallel",
is_flag=True,
default=False,
Copy link
Member Author

@pingsutw pingsutw May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run flytesnacks workflow serially by default in the CI due to disk pressure in the sandbox.

help="Run tests in parallel if set to True",
)
@click.argument(
"cluster_pool_name",
required=False,
Expand All @@ -257,6 +268,7 @@ def cli(
terminate_workflow_on_failure,
test_project_name,
test_project_domain,
parallel,
cluster_pool_name,
):
print(f"return_non_zero_on_failure={return_non_zero_on_failure}")
Expand All @@ -268,6 +280,7 @@ def cli(
test_project_name,
test_project_domain,
cluster_pool_name,
parallel
)

# Write a json object in its own line describing the result of this run to stdout
Expand Down
Loading