From 725ef6b9395a5dcb57327928bb0c2d9911b4f2a5 Mon Sep 17 00:00:00 2001 From: Xuyang Tao Date: Thu, 3 Oct 2019 13:54:34 -0700 Subject: [PATCH 1/7] Replace oauth2client with google-auth --- script/linux-install-software | 2 +- start_esp/BUILD | 2 +- start_esp/fetch_service_config.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/script/linux-install-software b/script/linux-install-software index ce245d6e9..1acb0f594 100755 --- a/script/linux-install-software +++ b/script/linux-install-software @@ -101,7 +101,7 @@ ${SUDO} apt-get clean retry install_packages || error_exit 'Cannot install required packages.' retry ${SUDO} pip install --upgrade python-gflags || error_exit 'Cannot install gflags.' retry ${SUDO} pip install --upgrade certifi || error_exit 'Cannot install certifi.' -retry ${SUDO} pip install --upgrade oauth2client || error_exit 'Cannot install oauth2client.' +retry ${SUDO} pip install --upgrade google-auth google-auth-httplib2 google-api-python-client || error_exit 'Cannot install google-auth.' retry ${SUDO} pip install --upgrade urllib3 || error_exit 'Cannot install urllib3.' retry ${SUDO} pip install --upgrade prettytable Mako pyaml dateutils || error_exit 'Cannot install prettytable Mako pyaml dateutils.' diff --git a/start_esp/BUILD b/start_esp/BUILD index 082e34f65..7cda56e49 100644 --- a/start_esp/BUILD +++ b/start_esp/BUILD @@ -53,7 +53,7 @@ pex_binary( reqs = [ "certifi", "mako>=1.0.4", - "oauth2client>=3.0.0", + "google-auth>=1.6.3", "pyasn1>=0.1.9", "pyasn1-modules>=0.0.8", "urllib3>=1.16", diff --git a/start_esp/fetch_service_config.py b/start_esp/fetch_service_config.py index 97c8f8f3e..0ae6a2fe0 100755 --- a/start_esp/fetch_service_config.py +++ b/start_esp/fetch_service_config.py @@ -29,7 +29,7 @@ import json import logging import urllib3 -from oauth2client.service_account import ServiceAccountCredentials +from google.oauth2.service_account import Credentials # Service management service SERVICE_MGMT_ROLLOUTS_URL_TEMPLATE = ( @@ -144,7 +144,7 @@ def fetch_metadata_attributes(metadata): def make_access_token(secret_token_json): """Construct an access token from service account token.""" logging.info("Constructing an access token with scope " + _GOOGLE_API_SCOPE) - credentials = ServiceAccountCredentials.from_json_keyfile_name( + credentials = Credentials.from_service_account_info( secret_token_json, scopes=[_GOOGLE_API_SCOPE]) logging.info("Service account email: " + credentials.service_account_email) From 3d976fa4d9628b7354db5d27e1e694ed56cef618 Mon Sep 17 00:00:00 2001 From: Xuyang Tao Date: Thu, 3 Oct 2019 16:27:28 -0700 Subject: [PATCH 2/7] update image --- Jenkinsfile | 2 +- jenkins/slaves/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 27424ea19..dfdb37eb2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,7 +52,7 @@ SUPPORTED_STAGES = [ ] // Supported VM Images -SLAVE_IMAGE = 'gcr.io/endpoints-jenkins/debian-9:0.10' +SLAVE_IMAGE = 'gcr.io/endpoints-jenkins/debian-9:0.11' // Release Qualification end to end tests. // If RAPTURE_REPO build parameter is set only those test will run. diff --git a/jenkins/slaves/Makefile b/jenkins/slaves/Makefile index 3b79fd868..fad56ab04 100644 --- a/jenkins/slaves/Makefile +++ b/jenkins/slaves/Makefile @@ -1,5 +1,5 @@ PROJECT = endpoints-jenkins -VERSION = 0.10 +VERSION = 0.11 TOOLS_BUCKET = endpoints-tools # Note: The build directory is the root of the istio/test-infra repository, not ./ From 5c80c33e90fb1200e0fe2755a341d029e4bc87ed Mon Sep 17 00:00:00 2001 From: Xuyang Tao Date: Mon, 7 Oct 2019 10:28:32 -0700 Subject: [PATCH 3/7] check if other containers also fail --- test/docker/docker_test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/docker/docker_test.sh b/test/docker/docker_test.sh index a94fbec84..e6da7f95e 100755 --- a/test/docker/docker_test.sh +++ b/test/docker/docker_test.sh @@ -146,14 +146,15 @@ CONTROL_PORT=$(get_port "${CONTROL_CONTAINER}" 8080) \ MANAGEMENT_PORT=$(get_port "${MANAGEMENT_CONTAINER}" 8080) \ || error_exit 'Cannot get management port number.' -wait_for "${METADATA_PORT}/computeMetadata/v1/instance/service-accounts/default/token" \ - || error_exit 'Metadata container failed to start.' + wait_for "${APP_PORT}/shelves" \ || error_exit 'Gaeapp failed to start.' wait_for "${CONTROL_PORT}/" \ || error_exit 'Service control failed to start.' wait_for "${MANAGEMENT_PORT}/" \ || error_exit 'Management failed to start.' +wait_for "${METADATA_PORT}/computeMetadata/v1/instance/service-accounts/default/token" \ + || error_exit 'Metadata container failed to start.' printf "\nCalling metadata.\n" curl -v ${METADATA_PORT}/computeMetadata/v1/instance/service-accounts/default/token From 44f89bdeeccb80893a217456d432c5a6f8124731 Mon Sep 17 00:00:00 2001 From: Xuyang Tao Date: Mon, 7 Oct 2019 11:37:18 -0700 Subject: [PATCH 4/7] Revert "update image" This reverts commit 3d976fa4d9628b7354db5d27e1e694ed56cef618. --- Jenkinsfile | 2 +- jenkins/slaves/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dfdb37eb2..27424ea19 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,7 +52,7 @@ SUPPORTED_STAGES = [ ] // Supported VM Images -SLAVE_IMAGE = 'gcr.io/endpoints-jenkins/debian-9:0.11' +SLAVE_IMAGE = 'gcr.io/endpoints-jenkins/debian-9:0.10' // Release Qualification end to end tests. // If RAPTURE_REPO build parameter is set only those test will run. diff --git a/jenkins/slaves/Makefile b/jenkins/slaves/Makefile index fad56ab04..3b79fd868 100644 --- a/jenkins/slaves/Makefile +++ b/jenkins/slaves/Makefile @@ -1,5 +1,5 @@ PROJECT = endpoints-jenkins -VERSION = 0.11 +VERSION = 0.10 TOOLS_BUCKET = endpoints-tools # Note: The build directory is the root of the istio/test-infra repository, not ./ From fee9e0940f721034edd05b42e329689fb4f438a4 Mon Sep 17 00:00:00 2001 From: Xuyang Tao Date: Mon, 7 Oct 2019 11:38:09 -0700 Subject: [PATCH 5/7] remove docker release --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 27424ea19..852304c60 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -221,7 +221,6 @@ def presubmit() { 'release': { BuildNode { presubmitTests('release') - presubmitTests('docker-tests', false) } }, 'tsan': { From d01764892cc82750ebd9547ff89df213841fd94f Mon Sep 17 00:00:00 2001 From: Xuyang Tao Date: Mon, 7 Oct 2019 11:39:37 -0700 Subject: [PATCH 6/7] Revert "Revert "update image"" This reverts commit 44f89bdeeccb80893a217456d432c5a6f8124731. --- Jenkinsfile | 2 +- jenkins/slaves/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 852304c60..a969e6d20 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,7 +52,7 @@ SUPPORTED_STAGES = [ ] // Supported VM Images -SLAVE_IMAGE = 'gcr.io/endpoints-jenkins/debian-9:0.10' +SLAVE_IMAGE = 'gcr.io/endpoints-jenkins/debian-9:0.11' // Release Qualification end to end tests. // If RAPTURE_REPO build parameter is set only those test will run. diff --git a/jenkins/slaves/Makefile b/jenkins/slaves/Makefile index 3b79fd868..fad56ab04 100644 --- a/jenkins/slaves/Makefile +++ b/jenkins/slaves/Makefile @@ -1,5 +1,5 @@ PROJECT = endpoints-jenkins -VERSION = 0.10 +VERSION = 0.11 TOOLS_BUCKET = endpoints-tools # Note: The build directory is the root of the istio/test-infra repository, not ./ From 3cdbd61cd4f6cc76ee45d671e60cf89134aed988 Mon Sep 17 00:00:00 2001 From: Xuyang Tao Date: Mon, 7 Oct 2019 11:40:15 -0700 Subject: [PATCH 7/7] Revert "check if other containers also fail" This reverts commit 5c80c33e90fb1200e0fe2755a341d029e4bc87ed. --- test/docker/docker_test.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/docker/docker_test.sh b/test/docker/docker_test.sh index e6da7f95e..a94fbec84 100755 --- a/test/docker/docker_test.sh +++ b/test/docker/docker_test.sh @@ -146,15 +146,14 @@ CONTROL_PORT=$(get_port "${CONTROL_CONTAINER}" 8080) \ MANAGEMENT_PORT=$(get_port "${MANAGEMENT_CONTAINER}" 8080) \ || error_exit 'Cannot get management port number.' - +wait_for "${METADATA_PORT}/computeMetadata/v1/instance/service-accounts/default/token" \ + || error_exit 'Metadata container failed to start.' wait_for "${APP_PORT}/shelves" \ || error_exit 'Gaeapp failed to start.' wait_for "${CONTROL_PORT}/" \ || error_exit 'Service control failed to start.' wait_for "${MANAGEMENT_PORT}/" \ || error_exit 'Management failed to start.' -wait_for "${METADATA_PORT}/computeMetadata/v1/instance/service-accounts/default/token" \ - || error_exit 'Metadata container failed to start.' printf "\nCalling metadata.\n" curl -v ${METADATA_PORT}/computeMetadata/v1/instance/service-accounts/default/token