Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
Signed-off-by: chahatsagarmain <[email protected]>
  • Loading branch information
chahatsagarmain committed Jan 19, 2025
1 parent a79c922 commit ed4fc57
Show file tree
Hide file tree
Showing 22 changed files with 78 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend-visualization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python-version: '3.9'

- name: Run tests
run: ./test/presubmit-backend-visualization.sh
run: make backend-visualization-test
19 changes: 6 additions & 13 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,24 @@ jobs:
python-version: '3.9'
- name: Install sdk
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install -e sdk/python
make setup-backend-test
- name: Create KFP cluster
uses: ./.github/actions/kfp-tekton-cluster
- name: "flip coin test"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-flip-coin.sh" ./.github/resources/scripts/e2e-test.sh
make backend-test-flip-coin
- name: "static loop test"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-static-loop.sh" ./.github/resources/scripts/e2e-test.sh
make backend-test-static-loop
- name: "dynamic loop test"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-dynamic-loop.sh" ./.github/resources/scripts/e2e-test.sh
make backend-test-dynamic-loop
- name: "use env"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-env.sh" ./.github/resources/scripts/e2e-test.sh
make backend-test-env
- name: "use volume"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-volume.sh" ./.github/resources/scripts/e2e-test.sh
make backend-test-volume
- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
Expand Down
27 changes: 5 additions & 22 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: Initialization tests v1
working-directory: ./backend/test/initialization
run: go test -v ./... -namespace kubeflow -args -runIntegrationTests=true
- name: Forward Port and initialize tests v1
run: make e2e-initialization-tests-v1

- name: Collect test results
if: always()
Expand Down Expand Up @@ -71,13 +67,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}


- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: Initialization tests v2
working-directory: ./backend/test/v2/initialization
run: go test -v ./... -namespace kubeflow -args -runIntegrationTests=true
run: make e2e-initialization-tests-v2

- name: Collect test results
if: always()
Expand Down Expand Up @@ -106,12 +97,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: API integration tests v1
working-directory: ./backend/test/integration
run: go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true
run: make e2e-api-integration-tests-v1

- name: Collect test results
if: always()
Expand Down Expand Up @@ -140,12 +127,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: API integration tests v2
working-directory: ./backend/test/v2/integration
run: go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true
run: make e2e-api-integration-tests-v2

- name: Collect test results
if: always()
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ jobs:
with:
node-version: '14'

- name: Clean npm cache
run: npm cache clean --force

- name: Install dependencies
run: cd ./frontend && npm ci
- name: Setup frontend test
run: make setup-frontend-test

- name: Run Frontend Tests
run: cd ./frontend && npm run test:ci
run: make frontend-test

2 changes: 1 addition & 1 deletion .github/workflows/gcpc-modules-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
run: pip install $(grep 'pytest==' sdk/python/requirements-dev.txt)

- name: Run test
run: pytest ./test/gcpc-tests/run_all_gcpc_modules.py
run: make grpc-modules-test
9 changes: 2 additions & 7 deletions .github/workflows/kfp-kubernetes-execution-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: apt-get update
run: sudo apt-get update

Expand Down Expand Up @@ -72,8 +69,6 @@ jobs:
- name: Install requirements
run: pip install -r ./test/kfp-kubernetes-execution-tests/requirements.txt

- name: Run tests
- name: Forward port and run tests
run: |
export KFP_ENDPOINT="http://localhost:8888"
export TIMEOUT_SECONDS=2700
pytest ./test/kfp-kubernetes-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS
make kfp-kubernetes-execution-tests
2 changes: 1 addition & 1 deletion .github/workflows/kfp-kubernetes-library-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
python-version: ${{matrix.python.version}}

- name: Run tests
run: ./test/presubmit-test-kfp-kubernetes-library.sh
run: make kfp-kubernetes-library-test
7 changes: 2 additions & 5 deletions .github/workflows/kfp-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: Run Samples Tests
- name: Forward port and run samples tests
run: |
./backend/src/v2/test/sample-test.sh
make kfp-samples
2 changes: 1 addition & 1 deletion .github/workflows/kfp-sdk-runtime-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
- name: Run KFP Runtime Code Tests
run: |
export PULL_NUMBER="${{ github.event.inputs.pull_number || github.event.pull_request.number }}"
./test/presubmit-test-kfp-runtime-code.sh
make kfp-sdk-runtime-tests
4 changes: 2 additions & 2 deletions .github/workflows/kfp-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
python-version: ${{ matrix.python-version }}

- name: Run SDK Tests
run: |
./test/presubmit-tests-sdk.sh
make kfp-sdk-tests
2 changes: 1 addition & 1 deletion .github/workflows/kubeflow-pipelines-manifests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: actions/checkout@v4

- name: Run tests
run: ./manifests/kustomize/hack/presubmit.sh
run: make kubeflow-pipelines-manifests
11 changes: 4 additions & 7 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ jobs:
uses: ./.github/actions/kfp-cluster
with:
k8s_version: ${{ matrix.k8s_version }}
- name: Port forward kfp apiserver
run: |
nohup kubectl port-forward --namespace kubeflow svc/ml-pipeline 8888:8888 &
- name: Run Functional Tests
run: |
log_dir=$(mktemp -d)
./test/kfp-functional-test/kfp-functional-test.sh > $log_dir/periodic_tests.txt

- name: Port forward and run Functional Tests
run: make periodic-test

- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/presubmit-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
go-version-file: go.mod

- name: Run Backend Tests
run: ./test/presubmit-backend-test.sh
run: make presubmit-backend
2 changes: 1 addition & 1 deletion .github/workflows/sdk-component-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
run: pip install -r ./test/sdk-execution-tests/requirements.txt

- name: Run component YAML tests
run: ./test/presubmit-component-yaml.sh
run: make sdk-component-yaml
2 changes: 1 addition & 1 deletion .github/workflows/sdk-docformatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python-version: 3.9

- name: Run docformatter tests
run: ./test/presubmit-docformatter-sdk.sh
run: make sdk-docformatter
9 changes: 2 additions & 7 deletions .github/workflows/sdk-execution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: apt-get update
run: sudo apt-get update

Expand Down Expand Up @@ -63,8 +60,6 @@ jobs:
- name: Install requirements
run: pip install -r ./test/sdk-execution-tests/requirements.txt

- name: Run tests
- name: Forward API port and run tests
run: |
export KFP_ENDPOINT="http://localhost:8888"
export TIMEOUT_SECONDS=2700
pytest ./test/sdk-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS
make sdk-execution
2 changes: 1 addition & 1 deletion .github/workflows/sdk-isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python-version: 3.9

- name: Run isort tests
run: ./test/presubmit-isort-sdk.sh
run: make ./test/presubmit-isort-sdk.sh
2 changes: 1 addition & 1 deletion .github/workflows/sdk-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python-version: 3.9

- name: Run SDK upgrade tests
run: ./test/presubmit-test-sdk-upgrade.sh
run: make ./test/presubmit-test-sdk-upgrade.sh
2 changes: 1 addition & 1 deletion .github/workflows/sdk-yapf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
run: pip install yapf

- name: Run YAPF SDK Tests
run: ./test/presubmit-yapf-sdk.sh
run: make sdk-yapf
29 changes: 26 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,31 @@ backend-test:
TEST_SCRIPT="test-env.sh" ./.github/resources/scripts/e2e-test.sh
TEST_SCRIPT="test-volume.sh" ./.github/resources/scripts/e2e-test.sh

.PHONY: backend-test-flip-coin
backend-test-flip-coin:
. .venv/bin/activate
TEST_SCRIPT="test-flip-coin.sh" ./.github/resources/scripts/e2e-test.sh

.PHONY: backend-test-static-loop
backend-test-static-loop:
. .venv/bin/activate
TEST_SCRIPT="test-static-loop.sh" ./.github/resources/scripts/e2e-test.sh

.PHONY: backend-test-dynamic-loop
backend-test-dynamic-loop:
. .venv/bin/activate
TEST_SCRIPT="test-dynamic-loop.sh" ./.github/resources/scripts/e2e-test.sh

.PHONY: backend-test-env
backend-test-env:
. .venv/bin/activate
TEST_SCRIPT="test-env.sh" ./.github/resources/scripts/e2e-test.sh

.PHONY: backend-test-volume
backend-test-volume:
. .venv/bin/activate
TEST_SCRIPT="test-volume.sh" ./.github/resources/scripts/e2e-test.sh

.PHONY: backend-visualization-test
backend-visualization-test:
./test/presubmit-backend-visualization.sh
Expand Down Expand Up @@ -66,7 +91,7 @@ frontend-test:
grpc-modules-test:
pytest ./test/gcpc-tests/run_all_gcpc_modules.py

PHONY: kfp-kubernetes-execution-tests
.PHONY: kfp-kubernetes-execution-tests
kfp-kubernetes-execution-tests:
./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
export KFP_ENDPOINT="http://localhost:8888"
Expand All @@ -84,7 +109,6 @@ kfp-samples:

.PHONY: kfp-sdk-runtime-tests
kfp-sdk-runtime-tests:
export PULL_NUMBER="${{ github.event.inputs.pull_number || github.event.pull_request.number }}"
./test/presubmit-test-kfp-runtime-code.sh

.PHONY: kfp-sdk-tests
Expand All @@ -95,7 +119,6 @@ kfp-sdk-tests:
kubeflow-pipelines-manifests:
./manifests/kustomize/hack/presubmit.sh


.PHONY: periodic-test
periodic-test:
nohup kubectl port-forward --namespace kubeflow svc/ml-pipeline 8888:8888 &
Expand Down
10 changes: 10 additions & 0 deletions Makefile.setup.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ setup-backend-visualization-test: setup-python
setup-frontend-test:
nvm install 14
nvm use 14
npm cache clean --force
cd ./frontend && npm ci

.PHONY: setup-grpc-modules-test
setup-grpc-modules-test: setup-python
Expand Down Expand Up @@ -72,6 +74,12 @@ setup-kfp-kubernetes-execution-tests: setup-kfp

.PHONY: setup-kfp-samples
setup-kfp-samples: setup-python setup-kfp

.PHONY: setup-kfp-sdk-runtime-tests
setup-kfp-sdk-runtime-tests: setup-python

.PHONY: setup-kfp-sdk-tests
setup-kfp-sdk-tests: setup-python

.PHONY: setup-periodic-test
setup-periodic-test: setup-kfp
Expand All @@ -86,6 +94,7 @@ setup-sdk-component-yaml: setup-python
pip3 install protobuf==4.25.3
cd ./api
make clean python
cd ./..
python3 -m pip install api/v2alpha1/python
pip install -r ./test/sdk-execution-tests/requirements.txt

Expand All @@ -102,6 +111,7 @@ setup-sdk-execution: setup-python setup-kfp
pip3 install protobuf==4.25.3
cd ./api
make clean python
cd ./..
python3 -m pip install api/v2alpha1/python
pip install -r ./test/sdk-execution-tests/requirements.txt

Expand Down
6 changes: 5 additions & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Tests are automatically triggered on GitHub when:

GitHub Actions workflows are defined in the `.github/workflows/` directory.

### Reproducing CI Steps Locally
### Reproducing CI Steps Locally with Make Commands

To replicate the steps locally:

Expand All @@ -84,6 +84,10 @@ To replicate the steps locally:

3. To mimic the GitHub Actions environment, export any required environment variables found in the workflow files.

4. Install the dependencies for the test using command `make setup-{test_name}` . The commands with the steps are in `Makefile.setup.mk`

5. Run the test using command `make {test_name}` all the test that can be run using make command are in `Makefile`.

* * * * *

Troubleshooting
Expand Down

0 comments on commit ed4fc57

Please sign in to comment.