diff --git a/proxy/Dockerfile b/proxy/Dockerfile index c5773e90b1..dc457dddfa 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -13,12 +13,12 @@ # limitations under the License. # Pin to a specific version of invert proxy agent -FROM gcr.io/inverting-proxy/agent@sha256:762c500f748e00753e6b1af0a273e0097130344a793258108b3886789e2fe744 +FROM gcr.io/inverting-proxy/agent@sha256:c875588c1be53b1bc0c7183653347acf7887ab32a299a2e9b292bd6188a4e26b # We need --allow-releaseinfo-change, because of https://github.com/kubeflow/pipelines/issues/6311#issuecomment-899224137. -RUN apt update --allow-releaseinfo-change && apt-get install -y curl jq python-pip +RUN apt update --allow-releaseinfo-change && apt-get install -y curl jq python3-pip COPY requirements.txt . -RUN python2 -m pip install -r \ +RUN python3 -m pip install -r \ requirements.txt --quiet --no-cache-dir \ && rm -f requirements.txt diff --git a/proxy/attempt-register-vm-on-proxy.sh b/proxy/attempt-register-vm-on-proxy.sh index 4e7ed0d1fc..62751816c0 100755 --- a/proxy/attempt-register-vm-on-proxy.sh +++ b/proxy/attempt-register-vm-on-proxy.sh @@ -61,7 +61,7 @@ INSTANCE_ZONE="${INSTANCE_ZONE##/*/}" if [[ -z "${PROXY_URL}" ]]; then # Get latest Proxy server URL wget https://storage.googleapis.com/ml-pipeline/proxy-agent-config.json - PROXY_URL=$(python ${DIR}/get_proxy_url.py --config-file-path "proxy-agent-config.json" --location "${INSTANCE_ZONE}" --version "latest") + PROXY_URL=$(python3 ${DIR}/get_proxy_url.py --config-file-path "proxy-agent-config.json" --location "${INSTANCE_ZONE}" --version "latest") fi if [[ -z "${PROXY_URL}" ]]; then echo "Proxy URL for the zone ${INSTANCE_ZONE} no found, exiting." diff --git a/proxy/get_proxy_url.py b/proxy/get_proxy_url.py index acc55cc3eb..619a239733 100644 --- a/proxy/get_proxy_url.py +++ b/proxy/get_proxy_url.py @@ -14,7 +14,6 @@ # limitations under the License. """CLI tool that returns URL of the proxy for particular zone and version.""" import argparse -import functools import json import logging import re @@ -73,11 +72,10 @@ def urls_for_zone(zone, location_to_urls_map): def main(): - unicode_type = functools.partial(unicode, encoding="utf8") parser = argparse.ArgumentParser(description="Get proxy URL") - parser.add_argument("--config-file-path", required=True, type=unicode_type) - parser.add_argument("--location", required=True, type=unicode_type) - parser.add_argument("--version", required=True, type=unicode_type) + parser.add_argument("--config-file-path", required=True, type=str) + parser.add_argument("--location", required=True, type=str) + parser.add_argument("--version", required=True, type=str) args = parser.parse_args() with open(args.config_file_path, "r") as config_file: