From 957d18a15bddb5d095b97d2093e44a56feff6906 Mon Sep 17 00:00:00 2001 From: Vanshika Chowdhary Date: Thu, 8 Sep 2022 16:25:58 -0700 Subject: [PATCH] Added flag to register as well Signed-off-by: Vanshika Chowdhary --- flytekit/clis/sdk_in_container/register.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flytekit/clis/sdk_in_container/register.py b/flytekit/clis/sdk_in_container/register.py index 03e00d7896..024b70edde 100644 --- a/flytekit/clis/sdk_in_container/register.py +++ b/flytekit/clis/sdk_in_container/register.py @@ -99,6 +99,12 @@ type=str, help="Version the package or module is registered with", ) +@click.option( + "--deref-symlinks", + default=False, + is_flag=True, + help="Enables symlink dereferencing when packaging files in fast registration", +) @click.argument("package-or-module", type=click.Path(exists=True, readable=True, resolve_path=True), nargs=-1) @click.pass_context def register( @@ -111,6 +117,7 @@ def register( service_account: str, raw_data_prefix: str, version: typing.Optional[str], + deref_symlinks: bool, package_or_module: typing.Tuple[str], ): """ @@ -142,7 +149,7 @@ def register( # Create a zip file containing all the entries. detected_root = find_common_root(package_or_module) cli_logger.debug(f"Using {detected_root} as root folder for project") - zip_file = fast_package(detected_root, output) + zip_file = fast_package(detected_root, output, deref_symlinks) # Upload zip file to Admin using FlyteRemote. md5_bytes, native_url = remote._upload_file(pathlib.Path(zip_file))