Skip to content

Commit

Permalink
Make the deploy scripts more efficient and other fixes. (kubeflow#1174)
Browse files Browse the repository at this point in the history
* Make the deploy scripts more efficient and other fixes.

* Download tarballs of the repo; this avoids GITHUB API token limits
  and is much faster because it avoids GitHistory

* Install most of the packages into the app so that the user won't
  have to do that step to start using other packages.

Fix kubeflow#1154

* Enable anonymous usage collection.
  • Loading branch information
jlewi authored and k8s-ci-robot committed Jul 11, 2018
1 parent 27fced1 commit 50c093b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 10 deletions.
31 changes: 25 additions & 6 deletions scripts/minikube/deploy.sh → scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ set -xe

KUBEFLOW_REPO=${KUBEFLOW_REPO:-"`pwd`/kubeflow_repo"}
KUBEFLOW_VERSION=${KUBEFLOW_VERSION:-"master"}
KUBEFLOW_DEPLOY=${KUBEFLOW_DEPLOY:-true}

if [[ ! -d "${KUBEFLOW_REPO}" ]]; then
git clone https://github.com/kubeflow/kubeflow.git "${KUBEFLOW_REPO}"
cd "${KUBEFLOW_REPO}"
git checkout "${KUBEFLOW_VERSION}"
cd -
if [ "${KUBEFLOW_VERSION}" == "master" ]; then
TAG=${KUBEFLOW_VERSION}
else
TAG=v${KUBEFLOW_VERSION}
fi
curl -L -o /tmp/kubeflow.${KUBEFLOW_VERSION}.tar.gz https://github.com/kubeflow/kubeflow/archive/${TAG}.tar.gz
tar -xzvf /tmp/kubeflow.${KUBEFLOW_VERSION}.tar.gz -C /tmp
mv /tmp/kubeflow-${TAG} "${KUBEFLOW_REPO}"
fi

source "${KUBEFLOW_REPO}/scripts/util.sh"
Expand All @@ -33,11 +38,25 @@ cd "${KUBEFLOW_KS_DIR}"
# Add the local registry
ks registry add kubeflow "${KUBEFLOW_REPO}/kubeflow"

# Install all required packages
# Install packages
ks pkg install kubeflow/argo
ks pkg install kubeflow/core
ks pkg install kubeflow/examples
ks pkg install kubeflow/katib
ks pkg install kubeflow/mpi-job
ks pkg install kubeflow/pytorch-job
ks pkg install kubeflow/seldon
ks pkg install kubeflow/tf-serving

# Generate all required components
ks generate kubeflow-core kubeflow-core

# Enable collection of anonymous usage metrics
# Skip this step if you don't want to enable collection.
ks param set kubeflow-core reportUsage true
ks param set kubeflow-core usageId $(uuidgen)

# Apply the components generated
ks apply default
if ${KUBEFLOW_DEPLOY}; then
ks apply default
fi
24 changes: 20 additions & 4 deletions scripts/gke/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ KUBEFLOW_REPO=${KUBEFLOW_REPO:-"`pwd`/kubeflow_repo"}
KUBEFLOW_VERSION=${KUBEFLOW_VERSION:-"master"}

if [[ ! -d "${KUBEFLOW_REPO}" ]]; then
git clone https://github.com/kubeflow/kubeflow.git "${KUBEFLOW_REPO}"
cd "${KUBEFLOW_REPO}"
git checkout "${KUBEFLOW_VERSION}"
cd -
if [ "${KUBEFLOW_VERSION}" == "master" ]; then
TAG=${KUBEFLOW_VERSION}
else
TAG=v${KUBEFLOW_VERSION}
fi
curl -L -o /tmp/kubeflow.${KUBEFLOW_VERSION}.tar.gz https://github.com/kubeflow/kubeflow/archive/${TAG}.tar.gz
tar -xzvf /tmp/kubeflow.${KUBEFLOW_VERSION}.tar.gz -C /tmp
mv /tmp/kubeflow-${TAG} "${KUBEFLOW_REPO}"
fi

source "${KUBEFLOW_REPO}/scripts/util.sh"
Expand Down Expand Up @@ -128,14 +132,26 @@ ks env set default --namespace "${K8S_NAMESPACE}"
ks registry add kubeflow "${KUBEFLOW_REPO}/kubeflow"

# Install all required packages
ks pkg install kubeflow/argo
ks pkg install kubeflow/core
ks pkg install kubeflow/examples
ks pkg install kubeflow/katib
ks pkg install kubeflow/mpi-job
ks pkg install kubeflow/pytorch-job
ks pkg install kubeflow/seldon
ks pkg install kubeflow/tf-serving

# Generate all required components
ks generate kubeflow-core kubeflow-core --jupyterHubAuthenticator iap
ks generate cloud-endpoints cloud-endpoints
ks generate cert-manager cert-manager --acmeEmail=${EMAIL}
ks generate iap-ingress iap-ingress --ipName=${KUBEFLOW_IP_NAME} --hostname=${KUBEFLOW_HOSTNAME}

# Enable collection of anonymous usage metrics
# Skip this step if you don't want to enable collection.
ks param set kubeflow-core reportUsage true
ks param set kubeflow-core usageId $(uuidgen)

# Apply the components generated
ks apply default -c kubeflow-core
ks apply default -c cloud-endpoints
Expand Down

0 comments on commit 50c093b

Please sign in to comment.