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

fix bunch of issues in prow test #866

Merged
merged 5 commits into from
Feb 27, 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
2 changes: 2 additions & 0 deletions test/check-argo-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -ex

ARTIFACT_DIR=$WORKSPACE/_artifacts
WORKFLOW_COMPLETE_KEYWORD="completed=true"
WORKFLOW_FAILED_KEYWORD="phase=Failed"
Expand Down
12 changes: 7 additions & 5 deletions test/deploy-kubeflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -x

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
set -ex

TEST_CLUSTER_PREFIX=${WORKFLOW_FILE%.*}
TEST_CLUSTER=$(echo $TEST_CLUSTER_PREFIX | cut -d _ -f 1)-${PULL_BASE_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
Expand Down Expand Up @@ -49,13 +50,14 @@ KFAPP=${TEST_CLUSTER}

function clean_up {
echo "Clean up..."
cd ${KFAPP}
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}
Expand All @@ -64,4 +66,4 @@ ${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}
gcloud container clusters get-credentials ${TEST_CLUSTER}
5 changes: 2 additions & 3 deletions test/deploy-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -x
set -ex


usage()
Expand Down Expand Up @@ -43,8 +43,7 @@ while [ "$1" != "" ]; do
shift
done

cd ${KUBEFLOW_SRC}
cd ${KFAPP}
cd ${DIR}/${KFAPP}

## Update pipeline component image
pushd ks_app
Expand Down
2 changes: 2 additions & 0 deletions test/install-argo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -ex

kubectl config set-context $(kubectl config current-context) --namespace=default
echo "Add necessary cluster role bindings"
ACCOUNT=$(gcloud info --format='value(config.account)')
Expand Down
4 changes: 2 additions & 2 deletions test/postsubmit-tests-with-pipeline-deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -x
set -ex

usage()
{
Expand Down Expand Up @@ -61,7 +61,7 @@ while [ "$1" != "" ]; do
shift
done

#Variables
# Variables
# Refer to https://github.com/kubernetes/test-infra/blob/e357ffaaeceafe737bd6ab89d2feff132d92ea50/prow/jobs.md for the Prow job environment variables
TEST_RESULTS_GCS_DIR=gs://${TEST_RESULT_BUCKET}/${PULL_BASE_SHA}/${TEST_RESULT_FOLDER}
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
Expand Down
2 changes: 1 addition & 1 deletion test/presubmit-tests-with-pipeline-deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -x
set -ex

usage()
{
Expand Down
3 changes: 0 additions & 3 deletions test/test-prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ remote_code_archive_uri="${code_archive_prefix}_${PULL_BASE_SHA}_${date_string}.

tar -czf "$local_code_archive_file" .
gsutil cp "$local_code_archive_file" "$remote_code_archive_uri"

Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why we move these two variables out of the test-prep script

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 was having a hard time trace those environment variable as they are spread across multiple files. It's better to locate them in the same top level script.

Copy link
Contributor

@gaoning777 gaoning777 Feb 27, 2019

Choose a reason for hiding this comment

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

In fact, that is why I tried to move all shared env variable in the test_prep script, which also reduced code duplication.

Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't the environment variable be determined by the caller? how is it different from other env variables in the top level script?

Copy link
Contributor

Choose a reason for hiding this comment

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

For env variables, yes. I mean, local variables such as PROJECT and GCR_IMAGE_BASE_DIR are not from the caller. TEST_CLUSTER_PREFIX and TEST_CLUSTER are also local variables that are used by these test scripts.

Above all, there are env variables that are from the caller and there are local variables that presubmit and postsubmit creates. My point was to move these shared local variables in the same script for better reference.

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 moved them to deploy-kubeflow.sh since it's only used there.

The variable passing in these scripts start to become a bit casual. Given the complexity of the test script I think we might also consider switching to go/python based binary.

Copy link
Contributor

Choose a reason for hiding this comment

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

SG. Let's create an issue to keep track: #875

TEST_CLUSTER_PREFIX=${WORKFLOW_FILE%.*}
TEST_CLUSTER=$(echo $TEST_CLUSTER_PREFIX | cut -d _ -f 1)-${PULL_BASE_SHA:0:7}-${RANDOM}