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

Change integration test sysytem from KinD Cluster to Minikube Cluster #1899

Merged
merged 1 commit into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/darts-cifar10-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: E2E Test with darts-cnn-cifar10
on:
- pull_request

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need GITHUB_TOKEN? I don't think, it is exposed to pull_request type for forked repos anways.

Copy link
Member Author

Choose a reason for hiding this comment

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

@johnugeorge Thanks for your review.
According to this document, it seems that actions-setup-minikube calls GitHub REST API.
So, I added GITHUB_TOKEN.

Would you like to remove GITHUB_TOKEN?

Copy link
Member

Choose a reason for hiding this comment

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

https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token Token has only read permission and hence it would be ok. I am thinking if there will be any security concern

Copy link
Member

Choose a reason for hiding this comment

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

For unauthenticated requests, it is limited to 60 per hour https://docs.github.com/en/rest/overview/resources-in-the-rest-api#requests-from-personal-accounts Hence, we will need GitHub token if we use this action.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it makes sense.
I don't have any concerns about the security issues of GITHUB_TOKEN. Do you have any concerns?


jobs:
e2e:
runs-on: ubuntu-20.04
Expand All @@ -25,9 +28,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# Detail: https://hub.docker.com/r/kindest/node
# TODO (tenzen-y): We need to consider running tests on more kubernetes versions.
# kubernetes-version: ["v1.20.15", "v1.21.12", "v1.22.9", "v1.23.6", "v1.24.1"]
kubernetes-version: ["v1.21.12", "v1.22.9", "v1.23.6"]
# kubernetes-version: ["v1.20.15", "v1.21.13", "v1.22.10", "v1.23.7", "v1.24.1"]
kubernetes-version: ["v1.21.13", "v1.22.10", "v1.23.7"]
# Comma Delimited
experiments: ["darts-cpu"]
8 changes: 5 additions & 3 deletions .github/workflows/enas-cifar10-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: E2E Test with enas-cnn-cifar10
on:
- pull_request

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
e2e:
runs-on: ubuntu-20.04
Expand All @@ -25,9 +28,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# Detail: https://hub.docker.com/r/kindest/node
# TODO (tenzen-y): We need to consider running tests on more kubernetes versions.
# kubernetes-version: ["v1.20.15", "v1.21.12", "v1.22.9", "v1.23.6", "v1.24.1"]
kubernetes-version: ["v1.21.12", "v1.22.9", "v1.23.6"]
# kubernetes-version: ["v1.20.15", "v1.21.13", "v1.22.10", "v1.23.7", "v1.24.1"]
kubernetes-version: ["v1.21.13", "v1.22.10", "v1.23.7"]
# Comma Delimited
experiments: ["enas-cpu"]
12 changes: 7 additions & 5 deletions .github/workflows/katib-ui-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: E2E Test for katib-ui
on:
- pull_request

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
e2e:
runs-on: ubuntu-20.04
Expand All @@ -15,16 +18,15 @@ jobs:
with:
kubernetes-version: ${{ matrix.kubernetes-version }}

- name: Set Up KinD Cluster
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-kind.sh true
- name: Set Up Minikube Cluster
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-minikube.sh true

- name: Start Katib
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-katib.sh true false

strategy:
fail-fast: false
matrix:
# Detail: https://hub.docker.com/r/kindest/node
# TODO (tenzen-y): We need to consider running tests on more kubernetes versions.
# kubernetes-version: ["v1.20.15", "v1.21.12", "v1.22.9", "v1.23.6", "v1.24.1"]
kubernetes-version: ["v1.21.12", "v1.22.9", "v1.23.6"]
# kubernetes-version: ["v1.20.15", "v1.21.13", "v1.22.10", "v1.23.7", "v1.24.1"]
kubernetes-version: ["v1.21.13", "v1.22.10", "v1.23.7"]
8 changes: 5 additions & 3 deletions .github/workflows/mxnet-mnist-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: E2E Test with mxnet-mnist
on:
- pull_request

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
e2e:
runs-on: ubuntu-20.04
Expand All @@ -25,10 +28,9 @@ jobs:
strategy:
fail-fast: false
matrix:
# Detail: https://hub.docker.com/r/kindest/node
# TODO (tenzen-y): We need to consider running tests on more kubernetes versions.
# kubernetes-version: ["v1.20.15", "v1.21.12", "v1.22.9", "v1.23.6", "v1.24.1"]
kubernetes-version: ["v1.21.12", "v1.22.9", "v1.23.6"]
# kubernetes-version: ["v1.20.15", "v1.21.13", "v1.22.10", "v1.23.7", "v1.24.1"]
kubernetes-version: ["v1.21.13", "v1.22.10", "v1.23.7"]
# Comma Delimited
experiments:
# suggestion-hyperopt
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pytorch-mnist-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: E2E Test with pytorch-mnist
on:
- pull_request

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
e2e:
runs-on: ubuntu-20.04
Expand All @@ -26,10 +29,9 @@ jobs:
strategy:
fail-fast: false
matrix:
# Detail: https://hub.docker.com/r/kindest/node
# TODO (tenzen-y): We need to consider running tests on more kubernetes versions.
# kubernetes-version: ["v1.20.15", "v1.21.12", "v1.22.9", "v1.23.6", "v1.24.1"]
kubernetes-version: ["v1.21.12", "v1.22.9", "v1.23.6"]
# kubernetes-version: ["v1.20.15", "v1.21.13", "v1.22.10", "v1.23.7", "v1.24.1"]
kubernetes-version: ["v1.21.13", "v1.22.10", "v1.23.7"]
# Comma Delimited
experiments:
- "file-metrics-collector,pytorchjob-mnist"
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/template-e2e-test/action.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Template for e2e tests.

inputs:
cluster_name:
required: false
type: string
default: katib-e2e-cluster
experiments:
required: true
type: string
Expand All @@ -22,9 +18,9 @@ inputs:
runs:
using: composite
steps:
- name: Set Up KinD Cluster
- name: Set Up Minikube Cluster
shell: bash
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-kind.sh ${{ inputs.katib-ui }} ${{ inputs.trial-images }} ${{ inputs.cluster_name }} ${{ inputs.experiments }}
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-minikube.sh ${{ inputs.katib-ui }} ${{ inputs.trial-images }} ${{ inputs.experiments }}

- name: Set Up Katib
shell: bash
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/template-setup-e2e-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@ inputs:
kubernetes-version:
required: true
type: string
cluster_name:
required: false
type: string
default: katib-e2e-cluster

runs:
using: composite
steps:
- name: Set Up KinD Cluster
uses: helm/kind-action@v1.2.0
- name: Set Up Minikube Cluster
uses: manusa/actions-setup-minikube@v2.6.0
Copy link
Member

Choose a reason for hiding this comment

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

What are the pros and cons of using this action vs manual steps(like in Kserve)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I used this action to change to Minikube Cluster with minimal changes.
Do you prefer this action or a manual installation?
If you prefer manual installation rather than this action, I will change the way to install Minkube.

Copy link
Member Author

Choose a reason for hiding this comment

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

WDYT? @johnugeorge

Copy link
Member

Choose a reason for hiding this comment

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

Can we keep the manual way as kserve? Do you see any red flags?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no difference in operation between this action and manual installation.
The only difference is whether we manage the scripts or the administrator of this action manages the scripts.

with:
version: v0.13.0
node_image: kindest/node:${{ inputs.kubernetes-version }}
cluster_name: ${{ inputs.cluster_name }}
wait: 120s
minikube version: "v1.25.2"
kubernetes version: ${{ inputs.kubernetes-version }}
start args: --driver none --wait-timeout=60s
github token: ${{ env.GITHUB_TOKEN }}

- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/tf-mnist-with-summaries-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: E2E Test with tf-mnist-with-summaries
on:
- pull_request

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
e2e:
runs-on: ubuntu-20.04
Expand All @@ -26,9 +29,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# Detail: https://hub.docker.com/r/kindest/node
# TODO (tenzen-y): We need to consider running tests on more kubernetes versions.
# kubernetes-version: ["v1.20.15", "v1.21.12", "v1.22.9", "v1.23.6", "v1.24.1"]
kubernetes-version: ["v1.21.12", "v1.22.9", "v1.23.6"]
# kubernetes-version: ["v1.20.15", "v1.21.13", "v1.22.10", "v1.23.7", "v1.24.1"]
kubernetes-version: ["v1.21.13", "v1.22.10", "v1.23.7"]
# Comma Delimited
experiments: ["tfjob-mnist-with-summaries"]
9 changes: 4 additions & 5 deletions test/e2e/v1beta1/scripts/gh-actions/build-load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ set -o nounset
cd "$(dirname "$0")"

TRIAL_IMAGES=${1:-""}
CLUSTER_NAME=${2:-""}
EXPERIMENTS=${3:-""}
DEPLOY_KATIB_UI=${4:-false}
EXPERIMENTS=${2:-""}
DEPLOY_KATIB_UI=${3:-false}

REGISTRY="docker.io/kubeflowkatib"
TAG="e2e-test"
Expand Down Expand Up @@ -55,8 +54,8 @@ _build_containers() {
_load_kind_cluster() {
CONTAINER_NAME=${1:-"katib-controller"}

echo -e "\nLoading $CONTAINER_NAME image to $CLUSTER_NAME...\n"
kind load docker-image "$REGISTRY/$CONTAINER_NAME:$TAG" --name "$CLUSTER_NAME"
echo -e "\n\nLoading $CONTAINER_NAME image...\n\n"
minikube image load "$REGISTRY/$CONTAINER_NAME:$TAG"
}

_install_tools() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ cd "$(dirname "$0")"

DEPLOY_KATIB_UI=${1:-false}
TRIAL_IMAGES=${2:-""}
CLUSTER_NAME=${3:-"katib-e2e-cluster"}
EXPERIMENTS=${4:-""}
EXPERIMENTS=${3:-""}

echo "Start to setup KinD Kubernetes Cluster"
kubectl wait --for condition=ready --timeout=5m node "$CLUSTER_NAME-control-plane"
echo "Start to setup Minikube Kubernetes Cluster"
kubectl version
kubectl cluster-info
kubectl get nodes

echo "Build and Load container images"
./build-load.sh "$TRIAL_IMAGES" "$CLUSTER_NAME" "$EXPERIMENTS" "$DEPLOY_KATIB_UI"
./build-load.sh "$TRIAL_IMAGES" "$EXPERIMENTS" "$DEPLOY_KATIB_UI"