Skip to content

Commit

Permalink
make commands
Browse files Browse the repository at this point in the history
Signed-off-by: chahatsagarmain <[email protected]>
  • Loading branch information
chahatsagarmain committed Feb 6, 2025
1 parent 37a7b4e commit 509054c
Show file tree
Hide file tree
Showing 103 changed files with 1,232 additions and 618 deletions.
4 changes: 2 additions & 2 deletions .github/actions/kfp-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ runs:

- name: Build images
shell: bash
run: ./.github/resources/scripts/build-images.sh
run: make build-images

- name: Deploy KFP
shell: bash
run: ./.github/resources/scripts/deploy-kfp.sh
run: make deploy-kfp
4 changes: 2 additions & 2 deletions .github/actions/kfp-tekton-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ runs:

- name: Build images
shell: bash
run: ./.github/resources/scripts/build-images.sh
run: make build-images

- name: Deploy KFP
shell: bash
run: ./.github/resources/scripts/deploy-kfp-tekton.sh
run: make deploy-kfp-tekton
6 changes: 3 additions & 3 deletions .github/resources/manifests/argo/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ resources:
- ../../../../manifests/kustomize/env/platform-agnostic

images:
- name: gcr.io/ml-pipeline/api-server
- name: ghcr.io/kubeflow/kfp-api-server
newName: kind-registry:5000/apiserver
newTag: latest
- name: gcr.io/ml-pipeline/persistenceagent
- name: ghcr.io/kubeflow/kfp-persistence-agent
newName: kind-registry:5000/persistenceagent
newTag: latest
- name: gcr.io/ml-pipeline/scheduledworkflow
- name: ghcr.io/kubeflow/kfp-scheduled-workflow-controller
newName: kind-registry:5000/scheduledworkflow
newTag: latest

Expand Down
6 changes: 3 additions & 3 deletions .github/resources/manifests/tekton/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ resources:
# when application is deleted.

images:
- name: gcr.io/ml-pipeline/api-server
- name: ghcr.io/kubeflow/kfp-api-server
newName: kind-registry:5000/apiserver
newTag: latest
- name: gcr.io/ml-pipeline/persistenceagent
- name: ghcr.io/kubeflow/kfp-persistence-agent
newName: kind-registry:5000/persistenceagent
newTag: latest
- name: gcr.io/ml-pipeline/scheduledworkflow
- name: ghcr.io/kubeflow/kfp-scheduled-workflow-controller
newName: kind-registry:5000/scheduledworkflow
newTag: latest
- name: '*/aipipeline/tekton-exithandler-controller'
Expand Down
10 changes: 5 additions & 5 deletions .github/resources/scripts/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,35 @@ EXIT_CODE=0

docker system prune -a -f

docker build -q -t "${REGISTRY}/apiserver:${TAG}" -f backend/Dockerfile . && docker push "${REGISTRY}/apiserver:${TAG}" || EXIT_CODE=$?
docker build --progress=plain -t "${REGISTRY}/apiserver:${TAG}" -f backend/Dockerfile . && docker push "${REGISTRY}/apiserver:${TAG}" || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]
then
echo "Failed to build apiserver image."
exit $EXIT_CODE
fi

docker build -q -t "${REGISTRY}/persistenceagent:${TAG}" -f backend/Dockerfile.persistenceagent . && docker push "${REGISTRY}/persistenceagent:${TAG}" || EXIT_CODE=$?
docker build --progress=plain -t "${REGISTRY}/persistenceagent:${TAG}" -f backend/Dockerfile.persistenceagent . && docker push "${REGISTRY}/persistenceagent:${TAG}" || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]
then
echo "Failed to build persistenceagent image."
exit $EXIT_CODE
fi

docker build -q -t "${REGISTRY}/scheduledworkflow:${TAG}" -f backend/Dockerfile.scheduledworkflow . && docker push "${REGISTRY}/scheduledworkflow:${TAG}" || EXIT_CODE=$?
docker build --progress=plain -t "${REGISTRY}/scheduledworkflow:${TAG}" -f backend/Dockerfile.scheduledworkflow . && docker push "${REGISTRY}/scheduledworkflow:${TAG}" || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]
then
echo "Failed to build scheduledworkflow image."
exit $EXIT_CODE
fi

docker build -q -t "${REGISTRY}/driver:${TAG}" -f backend/Dockerfile.driver . && docker push "${REGISTRY}/driver:${TAG}" || EXIT_CODE=$?
docker build --progress=plain -t "${REGISTRY}/driver:${TAG}" -f backend/Dockerfile.driver . && docker push "${REGISTRY}/driver:${TAG}" || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]
then
echo "Failed to build driver image."
exit $EXIT_CODE
fi

docker build -q -t "${REGISTRY}/launcher:${TAG}" -f backend/Dockerfile.launcher . && docker push "${REGISTRY}/launcher:${TAG}" || EXIT_CODE=$?
docker build --progress=plain -t "${REGISTRY}/launcher:${TAG}" -f backend/Dockerfile.launcher . && docker push "${REGISTRY}/launcher:${TAG}" || EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]
then
echo "Failed to build launcher image."
Expand Down
13 changes: 13 additions & 0 deletions .github/resources/scripts/kfp-readiness/wait_for_pods.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
config.load_kube_config()
v1 = client.CoreV1Api()

def log_pods():
pods = v1.list_namespaced_pod(namespace=namespace)

for pod in pods.items:
try:
logging.info(
f"---- Pod {namespace}/{pod.metadata.name} logs ----\n"
+ v1.read_namespaced_pod_log(pod.metadata.name, namespace)
)
except client.exceptions.ApiException:
continue

def get_pod_statuses():
pods = v1.list_namespaced_pod(namespace=namespace)
Expand Down Expand Up @@ -74,6 +85,8 @@ def check_pods(calm_time=10, timeout=600, retries_after_ready=5):
logging.info(f"Pods are still stabilizing. Retrying in {calm_time} seconds...")
time.sleep(calm_time)
else:
log_pods()

raise Exception("Pods did not stabilize within the timeout period.")

logging.info("Final pod statuses:")
Expand Down
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 test-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 test-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 test-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 test-backend-test-dynamic-loop
- name: "use env"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-env.sh" ./.github/resources/scripts/e2e-test.sh
make test-backend-test-env
- name: "use volume"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-volume.sh" ./.github/resources/scripts/e2e-test.sh
make test-backend-test-volume
- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
Expand Down
63 changes: 12 additions & 51 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 test-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 test-e2e-initialization-tests-v2

- name: Collect test results
if: always()
Expand Down Expand Up @@ -106,15 +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: Forward MySQL port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "mysql" 3306 3306

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

- name: Collect test results
if: always()
Expand Down Expand Up @@ -143,13 +127,9 @@ 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 kubeflow -args -runIntegrationTests=true

run: make test-e2e-api-integration-tests-v2

- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -177,19 +157,9 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

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

- name: Forward Frontend port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline-ui" 3000 3000

- name: Build frontend integration tests image
working-directory: ./test/frontend-integration-test
run: docker build . -t kfp-frontend-integration-test:local

- name: Frontend integration tests
run: docker run --net=host kfp-frontend-integration-test:local --remote-run true

- name: Forward API port and run integration test
run: make test-e2e-frontend-integration-test

- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -217,18 +187,9 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

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

- name: Install prerequisites
run: pip3 install -r ./test/sample-test/requirements.txt

- name: Basic sample tests - sequential
run: python3 ./test/sample-test/sample_test_launcher.py sample_test run_test --namespace kubeflow --test-name sequential --results-gcs-dir output

- name: Basic sample tests - exit_handler
run: python3 ./test/sample-test/sample_test_launcher.py sample_test run_test --namespace kubeflow --test-name exit_handler --expected-result failed --results-gcs-dir output

- name: Forward API port and run integration tests
run: make test-e2e-basic-sample-tests

- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
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: '22'

- 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 test-frontend

34 changes: 3 additions & 31 deletions .github/workflows/gcpc-modules-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,8 @@ jobs:
with:
python-version: 3.9

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

- name: Install protobuf-compiler
run: sudo apt-get install protobuf-compiler -y

- name: Install setuptools
run: |
pip3 install setuptools
pip3 freeze
- name: Install Wheel
run: pip3 install wheel==0.42.0

- name: Install python sdk
run: pip install sdk/python

- name: Generate API proto files
working-directory: ./api
run: make clean python

- name: Install kfp-pipeline-spec from source
run: |
python3 -m pip install api/v2alpha1/python
- name: Install google-cloud component
run: pip install components/google-cloud

- name: Install Pytest
run: pip install $(grep 'pytest==' sdk/python/requirements-dev.txt)
- name: Install requirements
run: make setup-grpc-modules-test

- name: Run test
run: pytest ./test/gcpc-tests/run_all_gcpc_modules.py
run: make test-grpc-modules
47 changes: 4 additions & 43 deletions .github/workflows/kfp-kubernetes-execution-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,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: Install requirements
run: make setup-kfp-kubernetes-execution-tests-without-kfp

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

- name: Install protobuf-compiler
run: sudo apt-get install protobuf-compiler -y

- name: Install setuptools
run: |
pip3 install setuptools
pip3 freeze
- name: Install Wheel
run: pip3 install wheel==0.42.0

- name: Install protobuf
run: pip3 install protobuf==4.25.3

- name: Generate API proto files
working-directory: ./api
run: make clean python

- name: Install kfp-pipeline-spec from source
run: |
python3 -m pip install api/v2alpha1/python
- name: Generate kfp-kubernetes proto files from source
working-directory: ./kubernetes_platform
run: make clean python

- name: Install kfp-kubernetes from source
run: |
pip install -e ./kubernetes_platform/python[dev]
- name: Install requirements
run: pip install -r ./test/kfp-kubernetes-execution-tests/requirements.txt

- name: 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
- name: Forward port and run tests
run: make test-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 test-kfp-kubernetes-library-test
Loading

0 comments on commit 509054c

Please sign in to comment.