diff --git a/test/deploy-kubeflow.sh b/test/deploy-kubeflow.sh deleted file mode 100755 index e81fc26ed8f..00000000000 --- a/test/deploy-kubeflow.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - -TEST_CLUSTER_PREFIX=${WORKFLOW_FILE%.*} -TEST_CLUSTER=$(echo $TEST_CLUSTER_PREFIX | cut -d _ -f 1)-${PULL_PULL_SHA:0:7}-${RANDOM} - -# Install ksonnet -KS_VERSION="0.13.0" - -curl -LO https://github.com/ksonnet/ksonnet/releases/download/v${KS_VERSION}/ks_${KS_VERSION}_linux_amd64.tar.gz -tar -xzf ks_${KS_VERSION}_linux_amd64.tar.gz -chmod +x ./ks_${KS_VERSION}_linux_amd64/ks -# Add ks to PATH -PATH=$PATH:`pwd`/ks_${KS_VERSION}_linux_amd64 - -## Download latest kubeflow release source code -KUBEFLOW_SRC=${DIR}/kubeflow_latest_release -mkdir ${KUBEFLOW_SRC} -cd ${KUBEFLOW_SRC} -export KUBEFLOW_TAG=pipelines -curl https://raw.githubusercontent.com/kubeflow/kubeflow/${KUBEFLOW_TAG}/scripts/download.sh | bash - -export CLIENT_ID=${RANDOM} -export CLIENT_SECRET=${RANDOM} -KFAPP=${TEST_CLUSTER} - -function clean_up { - echo "Clean up..." - cd ${DIR}/${KFAPP} - ${KUBEFLOW_SRC}/scripts/kfctl.sh delete all - # delete the storage - gcloud deployment-manager --project=${PROJECT} deployments delete ${KFAPP}-storage --quiet -} -trap clean_up EXIT SIGINT SIGTERM - -cd ${DIR} -${KUBEFLOW_SRC}/scripts/kfctl.sh init ${KFAPP} --platform ${PLATFORM} --project ${PROJECT} --skipInitProject - -cd ${KFAPP} -${KUBEFLOW_SRC}/scripts/kfctl.sh generate platform -${KUBEFLOW_SRC}/scripts/kfctl.sh apply platform -${KUBEFLOW_SRC}/scripts/kfctl.sh generate k8s -${KUBEFLOW_SRC}/scripts/kfctl.sh apply k8s - -gcloud container clusters get-credentials ${TEST_CLUSTER} diff --git a/test/deploy-pipeline.sh b/test/deploy-pipeline.sh deleted file mode 100755 index 45063c41c53..00000000000 --- a/test/deploy-pipeline.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - - -usage() -{ - echo "usage: deploy.sh - [--gcr_image_base_dir the gcr image base directory including images such as apiImage and persistenceAgentImage] - [--gcr_image_tag the tags for images such as apiImage and persistenceAgentImage] - [-h help]" -} -GCR_IMAGE_TAG=latest - -while [ "$1" != "" ]; do - case $1 in - --gcr_image_base_dir ) shift - GCR_IMAGE_BASE_DIR=$1 - ;; - --gcr_image_tag ) shift - GCR_IMAGE_TAG=$1 - ;; - -h | --help ) usage - exit - ;; - * ) usage - exit 1 - esac - shift -done - -cd ${DIR}/${KFAPP} - -## Update pipeline component image -pushd ks_app -# Delete pipeline component first before applying so we guarantee the pipeline component is new. -ks delete default -c pipeline -sleep 60s - -ks param set pipeline apiImage ${GCR_IMAGE_BASE_DIR}/api-server:${GCR_IMAGE_TAG} -ks param set pipeline persistenceAgentImage ${GCR_IMAGE_BASE_DIR}/persistenceagent:${GCR_IMAGE_TAG} -ks param set pipeline scheduledWorkflowImage ${GCR_IMAGE_BASE_DIR}/scheduledworkflow:${GCR_IMAGE_TAG} -ks param set pipeline uiImage ${GCR_IMAGE_BASE_DIR}/frontend:${GCR_IMAGE_TAG} -# Swap the metadata/artifact storage PD to avoid reusing the old data. -# We should remove this hack when we deprecate ksonnet. -# See https://github.com/kubeflow/pipelines/pull/1805#issuecomment-520204987 for context -ks param set pipeline minioPd ${KFAPP}-storage-metadata-store -ks param set pipeline mysqlPd ${KFAPP}-storage-artifact-store -ks apply default -c pipeline -popd diff --git a/test/minikube/OWNERS b/test/minikube/OWNERS deleted file mode 100644 index 23d368bc30f..00000000000 --- a/test/minikube/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -approvers: - - vicaire - - IronPan -reviewers: - - vicaire - - IronPan \ No newline at end of file diff --git a/test/minikube/install_and_start_minikube_without_vm.sh b/test/minikube/install_and_start_minikube_without_vm.sh deleted file mode 100755 index 88736744ad4..00000000000 --- a/test/minikube/install_and_start_minikube_without_vm.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -ex -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#This scripts installs Minikube, configures it to run without root access and starts it without VM -#See https://github.com/kubernetes/minikube#linux-continuous-integration-without-vm-support - -MINIKUBE_VERSION=${MINIKUBE_VERSION:-latest} -KUBECTL_VERSION=${KUBECTL_VERSION:-$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)} -KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.12.2} - -curl -Lo minikube https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube -curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && sudo cp kubectl /usr/local/bin/ && rm kubectl - -export MINIKUBE_WANTUPDATENOTIFICATION=false -export MINIKUBE_WANTREPORTERRORPROMPT=false -export MINIKUBE_HOME=$HOME -export CHANGE_MINIKUBE_NONE_USER=true -mkdir -p $HOME/.kube -touch $HOME/.kube/config - -export KUBECONFIG=$HOME/.kube/config -sudo -E /usr/local/bin/minikube start --vm-driver=none --kubernetes-version=$KUBERNETES_VERSION - -# this for loop waits until kubectl can access the api server that Minikube has created -for i in {1..150}; do # timeout for 5 minutes - kubectl get po &> /dev/null - if [ $? -ne 1 ]; then - break - fi - sleep 2 -done - -# kubectl commands are now able to interact with Minikube cluster diff --git a/test/minikube/install_argo_client.sh b/test/minikube/install_argo_client.sh deleted file mode 100755 index d55772aa536..00000000000 --- a/test/minikube/install_argo_client.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -ex -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARGO_VERSION=${ARGO_VERSION:-v2.3.0} - -sudo curl -sSL -o /usr/local/bin/argo https://github.com/argoproj/argo/releases/download/${ARGO_VERSION}/argo-linux-amd64 -sudo chmod +x /usr/local/bin/argo diff --git a/test/minikube/install_docker.sh b/test/minikube/install_docker.sh deleted file mode 100755 index 7f2cb0110ac..00000000000 --- a/test/minikube/install_docker.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -ex -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DOCKER_VERSION=18.06.1~ce~3-0~$(. /etc/os-release; echo "$ID") - -sudo apt-get update -y -sudo apt-get install -y \ - apt-transport-https \ - ca-certificates \ - curl \ - software-properties-common - -curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add - - -sudo add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ - $(lsb_release -cs) \ - stable" - -sudo apt-get update -y -sudo apt-get install docker-ce="${DOCKER_VERSION}" -y diff --git a/test/minikube/install_docker_minikube_argo.sh b/test/minikube/install_docker_minikube_argo.sh deleted file mode 100755 index 3b88e188861..00000000000 --- a/test/minikube/install_docker_minikube_argo.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -ex -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -repo_test_dir=$(dirname $0) - -DOCKER_VERSION=18.06.1~ce~3-0~$(. /etc/os-release; echo "$ID") "${repo_test_dir}/install_docker.sh" -MINIKUBE_VERSION=v0.30.0 KUBECTL_VERSION=v1.12.2 KUBERNETES_VERSION=v1.12.2 "${repo_test_dir}/install_and_start_minikube_without_vm.sh" -ARGO_VERSION=v2.3.0 "${repo_test_dir}/install_argo_client.sh" -sudo apt-get install socat #needed for port forwarding diff --git a/test/presubmit-tests-gce-minikube.sh b/test/presubmit-tests-gce-minikube.sh deleted file mode 100755 index 1c683b0470f..00000000000 --- a/test/presubmit-tests-gce-minikube.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash -ex -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#set -o nounset - -#This script runs the presubmit tests on a Minikube cluster. -#The script creates a new GCE VM, sets up Minikube, copies the SSH keys and repo and and then runs the tests. -#This script is usually run from the PROW cluster, but it can be run locally: -#ssh_key_file=~/.ssh/id_rsa WORKSPACE=/var/tmp PULL_PULL_SHA=master test/presubmit-tests-gce-minikube.sh --workflow_file integration_test_gke.yaml --test_result_folder api_integration_test - -WORKSPACE=$WORKSPACE -PULL_PULL_SHA=$PULL_PULL_SHA -ARTIFACT_DIR=$WORKSPACE/_artifacts -PROJECT_ID=${PROJECT_ID:-ml-pipeline-test} -ZONE=${ZONE:-us-west1-a} - -repo_test_dir=$(dirname $0) - -instance_name=${instance_name:-test-minikube-${PULL_PULL_SHA:0:6}-$(date +%s)-$(echo "$@" | md5sum | cut -c 1-6)} - -firewall_rule_name=allow-prow-ssh-$instance_name - -# activating the service account -gcloud auth activate-service-account --key-file="${GOOGLE_APPLICATION_CREDENTIALS}" - -#Function to delete VM -function delete_vm { - if [ "$keep_created_vm" != true ]; then - echo "Deleting VM $instance_name" - gcloud compute instances delete $instance_name --zone=$ZONE --quiet - fi - echo "Deleting the SSH firewall rule $firewall_rule_name" - gcloud compute firewall-rules delete $firewall_rule_name -} - -#Setting the exit handler to delete VM. The VM will be deleted when the script exists (either completes or fails) -#TODO: Find a more resilent way to clean up VMs. Right now the VM is not deleted if the machine running this script fails. (See https://github.com/kubeflow/pipelines/issues/1064) -trap delete_vm EXIT - -#Creating the VM -gcloud config set project $PROJECT_ID -gcloud config set compute/zone $ZONE - -machine_type=n1-standard-16 -boot_disk_size=200GB - -gcloud compute instances create $instance_name --zone=$ZONE --machine-type=$machine_type --boot-disk-size=$boot_disk_size --scopes=storage-rw --tags=presubmit-test-vm - -#Adding firewall entry that allows the current instance to access the newly created VM using SSH. -#This is needed for cases when the current instance is in different project (e.g. in the Prow cluster project) -self_external_ip=$(curl -sSL "http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" -H "Metadata-Flavor: Google") -gcloud compute firewall-rules create $firewall_rule_name --allow tcp:22 --source-ranges=${self_external_ip}/32 --target-tags=presubmit-test-vm - -#Workaround the problems with prow cluster and GCE SSH access. -#Prow tests run as root. GCE instances do not allow SSH access for root. -if [ "$(whoami)" == root ]; then - export USER=not-root -fi - -#Copy service account keys -gcloud compute scp --zone=$ZONE --verbosity=error "$GOOGLE_APPLICATION_CREDENTIALS" $instance_name:"~/service-account.json" - -#Copy repo -tar --directory=.. -cz pipelines | gcloud compute ssh --zone=$ZONE $instance_name -- tar -xz #Assumes that the current directory on target VM is ~ - -#Installing software on VM -gcloud compute ssh --zone=$ZONE $instance_name -- "~/pipelines/test/minikube/install_docker_minikube_argo.sh" - -#Running the presubmit tests -gcloud compute ssh --zone=$ZONE $instance_name -- PULL_PULL_SHA="$PULL_PULL_SHA" PULL_BASE_SHA="$PULL_BASE_SHA" WORKSPACE="~/${WORKSPACE}" GOOGLE_APPLICATION_CREDENTIALS="~/service-account.json" "~/pipelines/test/presubmit-tests.sh" --cluster-type none "$@" - -#Copy back the artifacts -mkdir -p "${ARTIFACT_DIR}" -gcloud compute scp --zone=$ZONE --verbosity=error --recurse $instance_name:"~/${ARTIFACT_DIR}/*" "${ARTIFACT_DIR}/"