From 19d2e6788b05d08289623152b35a126dca48bd38 Mon Sep 17 00:00:00 2001 From: Mecoli1219 Date: Mon, 16 Dec 2024 22:22:07 -0800 Subject: [PATCH 1/6] Enable offloading e2e test Signed-off-by: Mecoli1219 --- .github/workflows/single-binary.yml | 99 ++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/.github/workflows/single-binary.yml b/.github/workflows/single-binary.yml index 2849c1eac4..1328993064 100644 --- a/.github/workflows/single-binary.yml +++ b/.github/workflows/single-binary.yml @@ -10,7 +10,7 @@ on: branches: - master - rc/* - - 'release-v**' + - "release-v**" workflow_dispatch: jobs: @@ -160,7 +160,7 @@ jobs: python-version: "3.12" - uses: unionai/flytectl-setup-action@v0.0.3 with: - version: '0.9.2' + version: "0.9.2" - name: Setup sandbox run: | mkdir -p ~/.flyte/sandbox @@ -206,6 +206,101 @@ jobs: run: | make end2end_execute + sandbox-bundled-offloaded-functional-tests: + runs-on: ubuntu-latest + env: + FLYTESNACKS_PRIORITIES: "P0" + FLYTESNACKS_VERSION: "" + timeout-minutes: 60 + needs: [build-and-push-single-binary-image] + steps: + - name: Set latest Flytesnacks release + if: ${{ env.FLYTESNACKS_VERSION == '' }} + run: | + FLYTESNACKS_VERSION="$(curl --silent https://api.github.com/repos/flyteorg/flytesnacks/releases/latest | jq -r .tag_name)" + echo "FLYTESNACKS_VERSION=${FLYTESNACKS_VERSION}" >> ${GITHUB_ENV} + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: single-binary-image + path: docker/sandbox-bundled/images/tar + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: image=moby/buildkit:master + buildkitd-flags: "--allow-insecure-entitlement security.insecure" + - name: Build sandbox image for functional tests + uses: docker/build-push-action@v6 + with: + context: docker/sandbox-bundled + load: true + allow: "security.insecure" + tags: flyte-sandbox-bundled:local + # Without this, the GHA runner is under disk pressure and evicts all the pods. + # Buildx cache uses roughly 50% (7gb) of the GHA runner's disk (14gb). + - name: Prune Docker Buildx cache to reclaim storage + run: docker buildx prune --all --force + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + - uses: unionai/flytectl-setup-action@v0.0.3 + with: + version: "0.9.2" + - name: Setup sandbox + run: | + mkdir -p ~/.flyte/sandbox + cat << EOF > ~/.flyte/sandbox/config.yaml + propeller: + create-flyteworkflow-crd: true + kube-config: $HOME/.flyte/sandbox/kubeconfig + rawoutput-prefix: s3://my-s3-bucket/data + literal-offloading-config: + enabled: true + min-size-in-mb-for-offloading: 0.000001 + task_resources: + defaults: + cpu: "0" + memory: "0" + limits: + cpu: "0" + memory: "0" + EOF + flytectl demo start --image flyte-sandbox-bundled:local --imagePullPolicy Never + # By setting min-size-in-mb-for-offloading to 0.000001, we ensure that all tasks are offloaded. + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install uv + uv pip install --system flytekit flytekitplugins-deck-standard "numpy<2.0.0" pyarrow pandas + uv pip freeze + - name: Checkout flytesnacks + uses: actions/checkout@v4 + with: + repository: flyteorg/flytesnacks + path: flytesnacks + ref: ${{ env.FLYTESNACKS_VERSION }} + - name: Register specific tests + run: | + flytekit_version=$(pip show flytekit | grep -i version | awk '{ print $2 }') + while read -r line; + do + pyflyte -vv --config ./boilerplate/flyte/end2end/functional-test-config.yaml \ + register \ + --project flytesnacks \ + --domain development \ + --image cr.flyte.org/flyteorg/flytekit:py3.12-${flytekit_version} \ + --version ${{ env.FLYTESNACKS_VERSION }} \ + flytesnacks/$line; + done < flytesnacks/flyte_tests.txt + - name: Install Pytest + run: | + pip install pytest + - name: End2End + run: | + make end2end_execute + build-and-push-sandbox-bundled-image: if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest From 223a399f3ef4bc9de61b8b4c65054d4d1df9a6fe Mon Sep 17 00:00:00 2001 From: Mecoli1219 Date: Mon, 16 Dec 2024 23:15:41 -0800 Subject: [PATCH 2/6] Fix kube-config path Signed-off-by: Mecoli1219 --- .github/workflows/single-binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/single-binary.yml b/.github/workflows/single-binary.yml index 1328993064..0b004622f1 100644 --- a/.github/workflows/single-binary.yml +++ b/.github/workflows/single-binary.yml @@ -254,7 +254,7 @@ jobs: cat << EOF > ~/.flyte/sandbox/config.yaml propeller: create-flyteworkflow-crd: true - kube-config: $HOME/.flyte/sandbox/kubeconfig + kube-config: ~/.flyte/sandbox/kubeconfig rawoutput-prefix: s3://my-s3-bucket/data literal-offloading-config: enabled: true From 0c3dd7987ffd8db8f4e841e27afa7cd53316fa53 Mon Sep 17 00:00:00 2001 From: Mecoli1219 Date: Mon, 16 Dec 2024 23:36:05 -0800 Subject: [PATCH 3/6] stop sandbox Signed-off-by: Mecoli1219 --- .github/workflows/single-binary.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/single-binary.yml b/.github/workflows/single-binary.yml index 0b004622f1..3282c4d420 100644 --- a/.github/workflows/single-binary.yml +++ b/.github/workflows/single-binary.yml @@ -205,6 +205,8 @@ jobs: - name: End2End run: | make end2end_execute + - name: Stop sandbox + run: flytectl demo teardown sandbox-bundled-offloaded-functional-tests: runs-on: ubuntu-latest @@ -300,6 +302,8 @@ jobs: - name: End2End run: | make end2end_execute + - name: Stop sandbox + run: flytectl demo teardown build-and-push-sandbox-bundled-image: if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} From e798becbdb8ad07daded0179855ecf85637f8de4 Mon Sep 17 00:00:00 2001 From: Mecoli1219 Date: Tue, 17 Dec 2024 00:17:44 -0800 Subject: [PATCH 4/6] change order Signed-off-by: Mecoli1219 --- .github/workflows/single-binary.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/single-binary.yml b/.github/workflows/single-binary.yml index 3282c4d420..ccba0a1538 100644 --- a/.github/workflows/single-binary.yml +++ b/.github/workflows/single-binary.yml @@ -119,7 +119,7 @@ jobs: file: Dockerfile push: true - sandbox-bundled-functional-tests: + sandbox-bundled-offloaded-functional-tests: runs-on: ubuntu-latest env: FLYTESNACKS_PRIORITIES: "P0" @@ -165,6 +165,13 @@ jobs: run: | mkdir -p ~/.flyte/sandbox cat << EOF > ~/.flyte/sandbox/config.yaml + propeller: + create-flyteworkflow-crd: true + kube-config: ~/.flyte/sandbox/kubeconfig + rawoutput-prefix: s3://my-s3-bucket/data + literal-offloading-config: + enabled: true + min-size-in-mb-for-offloading: 0.000001 task_resources: defaults: cpu: "0" @@ -174,6 +181,7 @@ jobs: memory: "0" EOF flytectl demo start --image flyte-sandbox-bundled:local --imagePullPolicy Never + # By setting min-size-in-mb-for-offloading to 0.000001, we ensure that all tasks are offloaded. - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -208,7 +216,7 @@ jobs: - name: Stop sandbox run: flytectl demo teardown - sandbox-bundled-offloaded-functional-tests: + sandbox-bundled-functional-tests: runs-on: ubuntu-latest env: FLYTESNACKS_PRIORITIES: "P0" @@ -254,13 +262,6 @@ jobs: run: | mkdir -p ~/.flyte/sandbox cat << EOF > ~/.flyte/sandbox/config.yaml - propeller: - create-flyteworkflow-crd: true - kube-config: ~/.flyte/sandbox/kubeconfig - rawoutput-prefix: s3://my-s3-bucket/data - literal-offloading-config: - enabled: true - min-size-in-mb-for-offloading: 0.000001 task_resources: defaults: cpu: "0" @@ -270,7 +271,6 @@ jobs: memory: "0" EOF flytectl demo start --image flyte-sandbox-bundled:local --imagePullPolicy Never - # By setting min-size-in-mb-for-offloading to 0.000001, we ensure that all tasks are offloaded. - name: Install Python dependencies run: | python -m pip install --upgrade pip From 09eb0474c117e4d899512a792a97dd09ebc2e7d9 Mon Sep 17 00:00:00 2001 From: Mecoli1219 Date: Tue, 17 Dec 2024 00:31:49 -0800 Subject: [PATCH 5/6] test Signed-off-by: Mecoli1219 --- .github/workflows/single-binary.yml | 176 ++++++++++++++-------------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/.github/workflows/single-binary.yml b/.github/workflows/single-binary.yml index ccba0a1538..44b1008eee 100644 --- a/.github/workflows/single-binary.yml +++ b/.github/workflows/single-binary.yml @@ -216,94 +216,94 @@ jobs: - name: Stop sandbox run: flytectl demo teardown - sandbox-bundled-functional-tests: - runs-on: ubuntu-latest - env: - FLYTESNACKS_PRIORITIES: "P0" - FLYTESNACKS_VERSION: "" - timeout-minutes: 60 - needs: [build-and-push-single-binary-image] - steps: - - name: Set latest Flytesnacks release - if: ${{ env.FLYTESNACKS_VERSION == '' }} - run: | - FLYTESNACKS_VERSION="$(curl --silent https://api.github.com/repos/flyteorg/flytesnacks/releases/latest | jq -r .tag_name)" - echo "FLYTESNACKS_VERSION=${FLYTESNACKS_VERSION}" >> ${GITHUB_ENV} - - name: Checkout - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 - with: - name: single-binary-image - path: docker/sandbox-bundled/images/tar - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - driver-opts: image=moby/buildkit:master - buildkitd-flags: "--allow-insecure-entitlement security.insecure" - - name: Build sandbox image for functional tests - uses: docker/build-push-action@v6 - with: - context: docker/sandbox-bundled - load: true - allow: "security.insecure" - tags: flyte-sandbox-bundled:local - # Without this, the GHA runner is under disk pressure and evicts all the pods. - # Buildx cache uses roughly 50% (7gb) of the GHA runner's disk (14gb). - - name: Prune Docker Buildx cache to reclaim storage - run: docker buildx prune --all --force - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.12" - - uses: unionai/flytectl-setup-action@v0.0.3 - with: - version: "0.9.2" - - name: Setup sandbox - run: | - mkdir -p ~/.flyte/sandbox - cat << EOF > ~/.flyte/sandbox/config.yaml - task_resources: - defaults: - cpu: "0" - memory: "0" - limits: - cpu: "0" - memory: "0" - EOF - flytectl demo start --image flyte-sandbox-bundled:local --imagePullPolicy Never - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install uv - uv pip install --system flytekit flytekitplugins-deck-standard "numpy<2.0.0" pyarrow pandas - uv pip freeze - - name: Checkout flytesnacks - uses: actions/checkout@v4 - with: - repository: flyteorg/flytesnacks - path: flytesnacks - ref: ${{ env.FLYTESNACKS_VERSION }} - - name: Register specific tests - run: | - flytekit_version=$(pip show flytekit | grep -i version | awk '{ print $2 }') - while read -r line; - do - pyflyte -vv --config ./boilerplate/flyte/end2end/functional-test-config.yaml \ - register \ - --project flytesnacks \ - --domain development \ - --image cr.flyte.org/flyteorg/flytekit:py3.12-${flytekit_version} \ - --version ${{ env.FLYTESNACKS_VERSION }} \ - flytesnacks/$line; - done < flytesnacks/flyte_tests.txt - - name: Install Pytest - run: | - pip install pytest - - name: End2End - run: | - make end2end_execute - - name: Stop sandbox - run: flytectl demo teardown + # sandbox-bundled-functional-tests: + # runs-on: ubuntu-latest + # env: + # FLYTESNACKS_PRIORITIES: "P0" + # FLYTESNACKS_VERSION: "" + # timeout-minutes: 60 + # needs: [build-and-push-single-binary-image] + # steps: + # - name: Set latest Flytesnacks release + # if: ${{ env.FLYTESNACKS_VERSION == '' }} + # run: | + # FLYTESNACKS_VERSION="$(curl --silent https://api.github.com/repos/flyteorg/flytesnacks/releases/latest | jq -r .tag_name)" + # echo "FLYTESNACKS_VERSION=${FLYTESNACKS_VERSION}" >> ${GITHUB_ENV} + # - name: Checkout + # uses: actions/checkout@v4 + # - uses: actions/download-artifact@v4 + # with: + # name: single-binary-image + # path: docker/sandbox-bundled/images/tar + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + # with: + # driver-opts: image=moby/buildkit:master + # buildkitd-flags: "--allow-insecure-entitlement security.insecure" + # - name: Build sandbox image for functional tests + # uses: docker/build-push-action@v6 + # with: + # context: docker/sandbox-bundled + # load: true + # allow: "security.insecure" + # tags: flyte-sandbox-bundled:local + # # Without this, the GHA runner is under disk pressure and evicts all the pods. + # # Buildx cache uses roughly 50% (7gb) of the GHA runner's disk (14gb). + # - name: Prune Docker Buildx cache to reclaim storage + # run: docker buildx prune --all --force + # - name: Set up Python + # uses: actions/setup-python@v4 + # with: + # python-version: "3.12" + # - uses: unionai/flytectl-setup-action@v0.0.3 + # with: + # version: "0.9.2" + # - name: Setup sandbox + # run: | + # mkdir -p ~/.flyte/sandbox + # cat << EOF > ~/.flyte/sandbox/config.yaml + # task_resources: + # defaults: + # cpu: "0" + # memory: "0" + # limits: + # cpu: "0" + # memory: "0" + # EOF + # flytectl demo start --image flyte-sandbox-bundled:local --imagePullPolicy Never + # - name: Install Python dependencies + # run: | + # python -m pip install --upgrade pip + # pip install uv + # uv pip install --system flytekit flytekitplugins-deck-standard "numpy<2.0.0" pyarrow pandas + # uv pip freeze + # - name: Checkout flytesnacks + # uses: actions/checkout@v4 + # with: + # repository: flyteorg/flytesnacks + # path: flytesnacks + # ref: ${{ env.FLYTESNACKS_VERSION }} + # - name: Register specific tests + # run: | + # flytekit_version=$(pip show flytekit | grep -i version | awk '{ print $2 }') + # while read -r line; + # do + # pyflyte -vv --config ./boilerplate/flyte/end2end/functional-test-config.yaml \ + # register \ + # --project flytesnacks \ + # --domain development \ + # --image cr.flyte.org/flyteorg/flytekit:py3.12-${flytekit_version} \ + # --version ${{ env.FLYTESNACKS_VERSION }} \ + # flytesnacks/$line; + # done < flytesnacks/flyte_tests.txt + # - name: Install Pytest + # run: | + # pip install pytest + # - name: End2End + # run: | + # make end2end_execute + # - name: Stop sandbox + # run: flytectl demo teardown build-and-push-sandbox-bundled-image: if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} From c2d265b5c9e67a5c5c72f9a0865e9a936375a2f3 Mon Sep 17 00:00:00 2001 From: Mecoli1219 Date: Tue, 17 Dec 2024 10:36:06 -0800 Subject: [PATCH 6/6] Update config.yaml Signed-off-by: Mecoli1219 --- .github/workflows/single-binary.yml | 181 +++++++++++++--------------- 1 file changed, 87 insertions(+), 94 deletions(-) diff --git a/.github/workflows/single-binary.yml b/.github/workflows/single-binary.yml index 44b1008eee..b8e21fa6a5 100644 --- a/.github/workflows/single-binary.yml +++ b/.github/workflows/single-binary.yml @@ -119,6 +119,93 @@ jobs: file: Dockerfile push: true + sandbox-bundled-functional-tests: + runs-on: ubuntu-latest + env: + FLYTESNACKS_PRIORITIES: "P0" + FLYTESNACKS_VERSION: "" + timeout-minutes: 60 + needs: [build-and-push-single-binary-image] + steps: + - name: Set latest Flytesnacks release + if: ${{ env.FLYTESNACKS_VERSION == '' }} + run: | + FLYTESNACKS_VERSION="$(curl --silent https://api.github.com/repos/flyteorg/flytesnacks/releases/latest | jq -r .tag_name)" + echo "FLYTESNACKS_VERSION=${FLYTESNACKS_VERSION}" >> ${GITHUB_ENV} + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: single-binary-image + path: docker/sandbox-bundled/images/tar + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: image=moby/buildkit:master + buildkitd-flags: "--allow-insecure-entitlement security.insecure" + - name: Build sandbox image for functional tests + uses: docker/build-push-action@v6 + with: + context: docker/sandbox-bundled + load: true + allow: "security.insecure" + tags: flyte-sandbox-bundled:local + # Without this, the GHA runner is under disk pressure and evicts all the pods. + # Buildx cache uses roughly 50% (7gb) of the GHA runner's disk (14gb). + - name: Prune Docker Buildx cache to reclaim storage + run: docker buildx prune --all --force + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + - uses: unionai/flytectl-setup-action@v0.0.3 + with: + version: "0.9.2" + - name: Setup sandbox + run: | + mkdir -p ~/.flyte/sandbox + cat << EOF > ~/.flyte/sandbox/config.yaml + task_resources: + defaults: + cpu: "0" + memory: "0" + limits: + cpu: "0" + memory: "0" + EOF + flytectl demo start --image flyte-sandbox-bundled:local --imagePullPolicy Never + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install uv + uv pip install --system flytekit flytekitplugins-deck-standard "numpy<2.0.0" pyarrow pandas + uv pip freeze + - name: Checkout flytesnacks + uses: actions/checkout@v4 + with: + repository: flyteorg/flytesnacks + path: flytesnacks + ref: ${{ env.FLYTESNACKS_VERSION }} + - name: Register specific tests + run: | + flytekit_version=$(pip show flytekit | grep -i version | awk '{ print $2 }') + while read -r line; + do + pyflyte -vv --config ./boilerplate/flyte/end2end/functional-test-config.yaml \ + register \ + --project flytesnacks \ + --domain development \ + --image cr.flyte.org/flyteorg/flytekit:py3.12-${flytekit_version} \ + --version ${{ env.FLYTESNACKS_VERSION }} \ + flytesnacks/$line; + done < flytesnacks/flyte_tests.txt + - name: Install Pytest + run: | + pip install pytest + - name: End2End + run: | + make end2end_execute + sandbox-bundled-offloaded-functional-tests: runs-on: ubuntu-latest env: @@ -166,9 +253,6 @@ jobs: mkdir -p ~/.flyte/sandbox cat << EOF > ~/.flyte/sandbox/config.yaml propeller: - create-flyteworkflow-crd: true - kube-config: ~/.flyte/sandbox/kubeconfig - rawoutput-prefix: s3://my-s3-bucket/data literal-offloading-config: enabled: true min-size-in-mb-for-offloading: 0.000001 @@ -213,97 +297,6 @@ jobs: - name: End2End run: | make end2end_execute - - name: Stop sandbox - run: flytectl demo teardown - - # sandbox-bundled-functional-tests: - # runs-on: ubuntu-latest - # env: - # FLYTESNACKS_PRIORITIES: "P0" - # FLYTESNACKS_VERSION: "" - # timeout-minutes: 60 - # needs: [build-and-push-single-binary-image] - # steps: - # - name: Set latest Flytesnacks release - # if: ${{ env.FLYTESNACKS_VERSION == '' }} - # run: | - # FLYTESNACKS_VERSION="$(curl --silent https://api.github.com/repos/flyteorg/flytesnacks/releases/latest | jq -r .tag_name)" - # echo "FLYTESNACKS_VERSION=${FLYTESNACKS_VERSION}" >> ${GITHUB_ENV} - # - name: Checkout - # uses: actions/checkout@v4 - # - uses: actions/download-artifact@v4 - # with: - # name: single-binary-image - # path: docker/sandbox-bundled/images/tar - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - # with: - # driver-opts: image=moby/buildkit:master - # buildkitd-flags: "--allow-insecure-entitlement security.insecure" - # - name: Build sandbox image for functional tests - # uses: docker/build-push-action@v6 - # with: - # context: docker/sandbox-bundled - # load: true - # allow: "security.insecure" - # tags: flyte-sandbox-bundled:local - # # Without this, the GHA runner is under disk pressure and evicts all the pods. - # # Buildx cache uses roughly 50% (7gb) of the GHA runner's disk (14gb). - # - name: Prune Docker Buildx cache to reclaim storage - # run: docker buildx prune --all --force - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: "3.12" - # - uses: unionai/flytectl-setup-action@v0.0.3 - # with: - # version: "0.9.2" - # - name: Setup sandbox - # run: | - # mkdir -p ~/.flyte/sandbox - # cat << EOF > ~/.flyte/sandbox/config.yaml - # task_resources: - # defaults: - # cpu: "0" - # memory: "0" - # limits: - # cpu: "0" - # memory: "0" - # EOF - # flytectl demo start --image flyte-sandbox-bundled:local --imagePullPolicy Never - # - name: Install Python dependencies - # run: | - # python -m pip install --upgrade pip - # pip install uv - # uv pip install --system flytekit flytekitplugins-deck-standard "numpy<2.0.0" pyarrow pandas - # uv pip freeze - # - name: Checkout flytesnacks - # uses: actions/checkout@v4 - # with: - # repository: flyteorg/flytesnacks - # path: flytesnacks - # ref: ${{ env.FLYTESNACKS_VERSION }} - # - name: Register specific tests - # run: | - # flytekit_version=$(pip show flytekit | grep -i version | awk '{ print $2 }') - # while read -r line; - # do - # pyflyte -vv --config ./boilerplate/flyte/end2end/functional-test-config.yaml \ - # register \ - # --project flytesnacks \ - # --domain development \ - # --image cr.flyte.org/flyteorg/flytekit:py3.12-${flytekit_version} \ - # --version ${{ env.FLYTESNACKS_VERSION }} \ - # flytesnacks/$line; - # done < flytesnacks/flyte_tests.txt - # - name: Install Pytest - # run: | - # pip install pytest - # - name: End2End - # run: | - # make end2end_execute - # - name: Stop sandbox - # run: flytectl demo teardown build-and-push-sandbox-bundled-image: if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}