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

Add Flag to Disable Automatic Upgrades in Script #233

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 8 additions & 1 deletion rtwcli/rtw_cmds/rtw_cmds/workspace/create_verb.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class CreateVerbArgs:
repos_no_skip_existing: bool = False
disable_nvidia: bool = False
docker: bool = False
disable_upgrade: bool = False

@property
def ws_name(self) -> str:
Expand Down Expand Up @@ -385,6 +386,12 @@ def add_arguments(self, parser: argparse.ArgumentParser, cli_name: str):
help="Disable nvidia rocker flag",
default=False,
)
parser.add_argument(
"--disable-upgrade",
action="store_true",
help="Disable upgrade flag",
mamueluth marked this conversation as resolved.
Show resolved Hide resolved
default=False,
)
parser.add_argument(
"--ws-repos-file-name",
type=str,
Expand Down Expand Up @@ -601,7 +608,7 @@ def generate_intermediate_dockerfile_content(self, create_args: CreateVerbArgs)
return textwrap.dedent(
f"""
FROM {create_args.base_image_name}
RUN apt-get update && apt-get upgrade -y
RUN apt-get update {"&& apt-get upgrade -y" if not create_args.disable_upgrade else ""}
{apt_packages_cmd}
{python_packages_cmd}
{rtw_clone_cmd}
Expand Down
8 changes: 8 additions & 0 deletions rtwcli/rtw_cmds/rtw_cmds/workspace/import_verb.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ImportVerbArgs:
standalone_docker_image: str
docker: bool = True
disable_nvidia: bool = False
disable_upgrade: bool = False
standalone: bool = True
final_image_name: str = ""
container_name: str = ""
Expand Down Expand Up @@ -88,6 +89,12 @@ def add_arguments(self, parser: argparse.ArgumentParser, cli_name: str):
help="Disable nvidia rocker flag",
default=False,
)
parser.add_argument(
"--disable-upgrade",
action="store_true",
help="Disable upgrade flag",
mamueluth marked this conversation as resolved.
Show resolved Hide resolved
default=False,
)
parser.add_argument(
"--final-image-name",
type=str,
Expand Down Expand Up @@ -134,6 +141,7 @@ def main(self, *, args):
import_args = ImportVerbArgs(**filtered_args)
rocker_flags = generate_rocker_flags(
disable_nvidia=import_args.disable_nvidia,
disable_upgrade=import_args.disable_upgrade,
container_name=import_args.container_name,
hostname=import_args.hostname,
ssh_abs_path=import_args.ssh_abs_path,
Expand Down
Loading