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

Restructuring test scripts for v1alpha1 and v1alpha2 #449

Merged
merged 2 commits into from
Apr 2, 2019
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ test:

# Build Katib images
build:
sh scripts/build.sh
sh scripts/v1alpha1/build.sh

# Deploy katib manifests into a k8s cluster
deploy:
sh scripts/deploy.sh
sh scripts/v1alpha1/deploy.sh

# Run go fmt against code
fmt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -x
set -e
minikube start --disk-size 50g --memory 4096 --cpus 4
bash ../../scripts/deploy.sh
bash ../../../scripts/v1alpha1/deploy.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
45 changes: 0 additions & 45 deletions scripts/deploy.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/build.sh → scripts/v1alpha1/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -o pipefail
PREFIX="katib"
CMD_PREFIX="cmd"

SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../..

cd ${SCRIPT_ROOT}

Expand Down
45 changes: 45 additions & 0 deletions scripts/v1alpha1/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

# Copyright 2018 The Kubeflow Authors.
#
# 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 errexit
set -o nounset
set -o pipefail
set -o xtrace

SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../..

cd ${SCRIPT_ROOT}
kubectl apply -f manifests/v1alpha1/0-namespace.yaml
kubectl apply -f manifests/v1alpha1/pv
kubectl apply -f manifests/v1alpha1/vizier/db
kubectl apply -f manifests/v1alpha1/vizier/core
kubectl apply -f manifests/v1alpha1/vizier/core-rest
kubectl apply -f manifests/v1alpha1/vizier/ui
kubectl apply -f manifests/v1alpha1/vizier/suggestion/random
kubectl apply -f manifests/v1alpha1/vizier/suggestion/grid
kubectl apply -f manifests/v1alpha1/vizier/suggestion/hyperband
kubectl apply -f manifests/v1alpha1/vizier/suggestion/bayesianoptimization
kubectl apply -f manifests/v1alpha1/vizier/suggestion/nasrl
kubectl apply -f manifests/v1alpha1/vizier/earlystopping/medianstopping
kubectl apply -f manifests/v1alpha1/studyjobcontroller/crd.yaml
kubectl apply -f manifests/v1alpha1/studyjobcontroller/tfjobsCrd.yaml
kubectl apply -f manifests/v1alpha1/studyjobcontroller/pytorchjobsCrd.yaml
kubectl apply -f manifests/v1alpha1/studyjobcontroller/rbac.yaml
kubectl apply -f manifests/v1alpha1/studyjobcontroller/mcrbac.yaml
kubectl apply -f manifests/v1alpha1/studyjobcontroller/workerConfigMap.yaml
kubectl apply -f manifests/v1alpha1/studyjobcontroller/metricsControllerConfigMap.yaml
kubectl apply -f manifests/v1alpha1/studyjobcontroller/studyjobcontroller.yaml
cd - > /dev/null
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 15 additions & 15 deletions test/scripts/run-tests.sh → test/scripts/v1alpha1/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ echo "REGISTRY ${REGISTRY}"
echo "REPO_NAME ${REPO_NAME}"
echo "VERSION ${VERSION}"

sed -i -e "s@image: katib\/vizier-core@image: ${REGISTRY}\/${REPO_NAME}\/vizier-core:${VERSION}@" manifests/vizier/core/deployment.yaml
sed -i -e "s@image: katib\/vizier-core-rest@image: ${REGISTRY}\/${REPO_NAME}\/vizier-core-rest:${VERSION}@" manifests/vizier/core-rest/deployment.yaml
sed -i -e "s@image: katib\/katib-ui@image: ${REGISTRY}\/${REPO_NAME}\/katib-ui:${VERSION}@" manifests/vizier/ui/deployment.yaml
sed -i -e "s@type: NodePort@type: ClusterIP@" -e "/nodePort: 30678/d" manifests/vizier/core/service.yaml
sed -i -e "s@image: katib\/studyjob-controller@image: ${REGISTRY}\/${REPO_NAME}\/studyjob-controller:${VERSION}@" manifests/studyjobcontroller/studyjobcontroller.yaml
sed -i -e "s@image: katib\/suggestion-random@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-random:${VERSION}@" manifests/vizier/suggestion/random/deployment.yaml
sed -i -e "s@image: katib\/suggestion-grid@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-grid:${VERSION}@" manifests/vizier/suggestion/grid/deployment.yaml
sed -i -e "s@image: katib\/suggestion-hyperband@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-hyperband:${VERSION}@" manifests/vizier/suggestion/hyperband/deployment.yaml
sed -i -e "s@image: katib\/suggestion-bayesianoptimization@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-bayesianoptimization:${VERSION}@" manifests/vizier/suggestion/bayesianoptimization/deployment.yaml
sed -i -e "s@image: katib\/suggestion-nasrl@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-nasrl:${VERSION}@" manifests/vizier/suggestion/nasrl/deployment.yaml
sed -i -e "s@image: katib\/earlystopping-medianstopping@image: ${REGISTRY}\/${REPO_NAME}\/earlystopping-medianstopping:${VERSION}@" manifests/vizier/earlystopping/medianstopping/deployment.yaml
sed -i -e '/volumeMounts:/,$d' manifests/vizier/db/deployment.yaml

cat manifests/vizier/core/deployment.yaml
./scripts/deploy.sh
sed -i -e "s@image: katib\/vizier-core@image: ${REGISTRY}\/${REPO_NAME}\/vizier-core:${VERSION}@" manifests/v1alpha1/vizier/core/deployment.yaml
sed -i -e "s@image: katib\/vizier-core-rest@image: ${REGISTRY}\/${REPO_NAME}\/vizier-core-rest:${VERSION}@" manifests/v1alpha1/vizier/core-rest/deployment.yaml
sed -i -e "s@image: katib\/katib-ui@image: ${REGISTRY}\/${REPO_NAME}\/katib-ui:${VERSION}@" manifests/v1alpha1/vizier/ui/deployment.yaml
sed -i -e "s@type: NodePort@type: ClusterIP@" -e "/nodePort: 30678/d" manifests/v1alpha1/vizier/core/service.yaml
sed -i -e "s@image: katib\/studyjob-controller@image: ${REGISTRY}\/${REPO_NAME}\/studyjob-controller:${VERSION}@" manifests/v1alpha1/studyjobcontroller/studyjobcontroller.yaml
sed -i -e "s@image: katib\/suggestion-random@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-random:${VERSION}@" manifests/v1alpha1/vizier/suggestion/random/deployment.yaml
sed -i -e "s@image: katib\/suggestion-grid@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-grid:${VERSION}@" manifests/v1alpha1/vizier/suggestion/grid/deployment.yaml
sed -i -e "s@image: katib\/suggestion-hyperband@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-hyperband:${VERSION}@" manifests/v1alpha1/vizier/suggestion/hyperband/deployment.yaml
sed -i -e "s@image: katib\/suggestion-bayesianoptimization@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-bayesianoptimization:${VERSION}@" manifests/v1alpha1/vizier/suggestion/bayesianoptimization/deployment.yaml
sed -i -e "s@image: katib\/suggestion-nasrl@image: ${REGISTRY}\/${REPO_NAME}\/suggestion-nasrl:${VERSION}@" manifests/v1alpha1/vizier/suggestion/nasrl/deployment.yaml
sed -i -e "s@image: katib\/earlystopping-medianstopping@image: ${REGISTRY}\/${REPO_NAME}\/earlystopping-medianstopping:${VERSION}@" manifests/v1alpha1/vizier/earlystopping/medianstopping/deployment.yaml
sed -i -e '/volumeMounts:/,$d' manifests/v1alpha1/vizier/db/deployment.yaml

cat manifests/v1alpha1/vizier/core/deployment.yaml
./scripts/v1alpha1/deploy.sh

TIMEOUT=120
PODNUM=$(kubectl get deploy -n kubeflow | grep -v NAME | wc -l)
Expand Down
File renamed without changes.
32 changes: 16 additions & 16 deletions test/workflows/components/workflows.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@
},
}, // checkout
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("setup-cluster",testWorkerImage, [
"test/scripts/create-cluster.sh",
"test/scripts/v1alpha1/create-cluster.sh",
]), // setup cluster
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("python-tests", pythonImage, [
"test/scripts/python-tests.sh",
"test/scripts/v1alpha1/python-tests.sh",
]), // run python tests
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("run-tests", helmImage, [
"test/scripts/run-tests.sh",
"test/scripts/v1alpha1/run-tests.sh",
]), // run tests
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("create-pr-symlink", testWorkerImage, [
"python",
Expand All @@ -334,7 +334,7 @@
"--bucket=" + bucket,
]), // create-pr-symlink
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("teardown-cluster",testWorkerImage, [
"test/scripts/delete-cluster.sh",
"test/scripts/v1alpha1/delete-cluster.sh",
]), // teardown cluster
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("copy-artifacts", testWorkerImage, [
"python",
Expand All @@ -345,40 +345,40 @@
"--bucket=" + bucket,
]), // copy-artifacts
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("dep-ensure", testWorkerImage, [
"test/scripts/get-vendor-packages.sh",
"test/scripts/v1alpha1/get-vendor-packages.sh",
]), // dep ensure
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-manager", testWorkerImage, [
"test/scripts/build-manager.sh",
"test/scripts/v1alpha1/build-manager.sh",
]), // build-manager
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-manager-rest", testWorkerImage, [
"test/scripts/build-manager-rest.sh",
"test/scripts/v1alpha1/build-manager-rest.sh",
]), // build-manager-rest
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-studyjobctr", testWorkerImage, [
"test/scripts/build-studyjobctr.sh",
"test/scripts/v1alpha1/build-studyjobctr.sh",
]), // build-studyjobctr
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-suggestion-random", testWorkerImage, [
"test/scripts/build-suggestion-random.sh",
"test/scripts/v1alpha1/build-suggestion-random.sh",
]), // build-suggestion-random
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-suggestion-grid", testWorkerImage, [
"test/scripts/build-suggestion-grid.sh",
"test/scripts/v1alpha1/build-suggestion-grid.sh",
]), // build-suggestion-grid
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-suggestion-hyperband", testWorkerImage, [
"test/scripts/build-suggestion-hyperband.sh",
"test/scripts/v1alpha1/build-suggestion-hyperband.sh",
]), // build-suggestion-hyperband
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-suggestion-bo", testWorkerImage, [
"test/scripts/build-suggestion-bo.sh",
"test/scripts/v1alpha1/build-suggestion-bo.sh",
]), // build-suggestion-bo
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-suggestion-nasrl", testWorkerImage, [
"test/scripts/build-suggestion-nasrl.sh",
"test/scripts/v1alpha1/build-suggestion-nasrl.sh",
]), // build-suggestion-nasrl
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-earlystopping-median", testWorkerImage, [
"test/scripts/build-earlystopping-median.sh",
"test/scripts/v1alpha1/build-earlystopping-median.sh",
]), // build-earlystopping-median
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-ui", testWorkerImage, [
"test/scripts/build-ui.sh",
"test/scripts/v1alpha1/build-ui.sh",
]), // build-ui
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("unit-test", testWorkerImage, [
"test/scripts/unit-test.sh",
"test/scripts/v1alpha1/unit-test.sh",
]), // unit test
], // templates
},
Expand Down