From dfa94616d4a6819f9547877d2c641d76b1b1fe1d Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 5 May 2020 09:19:29 -0700 Subject: [PATCH] Image build script flag and remove 2.7 from travis, bug for serialize (#106) --- .travis.yml | 1 - flytekit/__init__.py | 2 +- flytekit/clis/sdk_in_container/serialize.py | 6 +++++- scripts/flytekit_build_image.sh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9bdc9e33f6..8186b425cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "2.7" - "3.6" install: - pip install -r requirements.txt diff --git a/flytekit/__init__.py b/flytekit/__init__.py index 0efd14117e..409e7f757e 100644 --- a/flytekit/__init__.py +++ b/flytekit/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import import flytekit.plugins -__version__ = '0.7.1b0' +__version__ = '0.7.1b1' diff --git a/flytekit/clis/sdk_in_container/serialize.py b/flytekit/clis/sdk_in_container/serialize.py index 96d32701b4..5730bd07c4 100644 --- a/flytekit/clis/sdk_in_container/serialize.py +++ b/flytekit/clis/sdk_in_container/serialize.py @@ -51,6 +51,8 @@ def serialize_tasks_only(project, domain, pkgs, version, folder=None): fname_index = str(i).zfill(zero_padded_length) fname = '{}_{}.pb'.format(fname_index, entity._id.name) click.echo(' Writing {} to\n {}'.format(entity._id, fname)) + if folder: + fname = _os.path.join(folder, fname) _write_proto_to_file(serialized, fname) identifier_fname = '{}_{}.identifier.pb'.format(fname_index, entity._id.name) @@ -62,7 +64,7 @@ def serialize_tasks_only(project, domain, pkgs, version, folder=None): @system_entry_point def serialize_all(project, domain, pkgs, version, folder=None): """ - In order to register, we have to comply with Admin's endpoints. Those endpoints take the following object. These + In order to register, we have to comply with Admin's endpoints. Those endpoints take the following objects. These flyteidl.admin.launch_plan_pb2.LaunchPlanSpec flyteidl.admin.workflow_pb2.WorkflowSpec flyteidl.admin.task_pb2.TaskSpec @@ -105,6 +107,8 @@ def serialize_all(project, domain, pkgs, version, folder=None): fname_index = str(i).zfill(zero_padded_length) fname = '{}_{}.pb'.format(fname_index, entity._id.name) click.echo(' Writing {} to\n {}'.format(entity._id, fname)) + if folder: + fname = _os.path.join(folder, fname) _write_proto_to_file(serialized, fname) # Not everything serialized will necessarily have an identifier field in it, even though some do (like the diff --git a/scripts/flytekit_build_image.sh b/scripts/flytekit_build_image.sh index 074a4417cd..15ee4c9468 100755 --- a/scripts/flytekit_build_image.sh +++ b/scripts/flytekit_build_image.sh @@ -58,7 +58,7 @@ if [ -n "$REGISTRY" ]; then echo "${IMAGE_NAME}:latest also tagged with ${FLYTE_INTERNAL_IMAGE}" # Also push if there's a registry to push to - if [[ "${REGISTRY}" == "docker.io"* ]]; then + if [[ "${REGISTRY}" == "docker.io"* && -z "${NOPUSH}" ]]; then docker login --username="${DOCKERHUB_USERNAME}" --password="${DOCKERHUB_PASSWORD}" fi docker push "${FLYTE_INTERNAL_IMAGE}"