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

Ticket8576 vc redist install #214

Merged
merged 9 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 12 additions & 6 deletions installation_and_upgrade/IBEX_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
import re
import sys

import semantic_version
import ibex_install_utils.default_args
import semantic_version # pyright: ignore
from ibex_install_utils.exceptions import ErrorInTask, UserStop
from ibex_install_utils.file_utils import FileUtils
from ibex_install_utils.install_tasks import UPGRADE_TYPES, UpgradeInstrument
from ibex_install_utils.logger import Logger
from ibex_install_utils.user_prompt import UserPrompt


def _get_latest_release_path(release_dir):
def _get_latest_release_path(release_dir: str) -> str:
regex = re.compile(r"^\d+\.\d+\.\d+$")

releases = [
Expand All @@ -31,7 +32,7 @@ def _get_latest_release_path(release_dir):
return os.path.join(release_dir, f"{current_release}")


def _get_latest_existing_dir_path(release_dir, component):
def _get_latest_existing_dir_path(release_dir: str, component: str) -> str:
regex = re.compile(r"^\d+\.\d+\.\d+$")

releases = [
Expand Down Expand Up @@ -108,7 +109,10 @@ def _get_latest_existing_dir_path(release_dir, component):
)
parser.add_argument("--kits_icp_dir", default=None, help="Directory of kits/ICP")
parser.add_argument(
"--server_arch", default="x64", choices=["x64", "x86"], help="Server build architecture."
"--server_arch",
default=ibex_install_utils.default_args.SERVER_ARCH,
choices=["x64", "x86"],
help="Server build architecture.",
)

deployment_types = [
Expand All @@ -122,6 +126,8 @@ def _get_latest_existing_dir_path(release_dir, component):

args = parser.parse_args()

ibex_install_utils.default_args.SERVER_ARCH = args.server_arch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you reassign default_args ? It feels it is not really a default arg then - if you need to cache what was passed on the command line maybe create ibex_install_utils.current_args or similarly named

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good idea. will make flash review to rename

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not args.no_log_to_var:
Logger.set_up()

Expand Down Expand Up @@ -165,8 +171,8 @@ def _get_latest_existing_dir_path(release_dir, component):
)
except UserStop:
print(
"To specify the directory you want use --server_dir, --client_dir, and --genie_python3_dir "
"when running the IBEX_upgrade.py script."
"To specify the directory you want use --server_dir, --client_dir, and"
" --genie_python3_dir when running the IBEX_upgrade.py script."
)
sys.exit(2)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SERVER_ARCH = "x64"
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def run_instrument_deploy_main(self) -> None:
self._server_tasks.update_icp(self.icp_in_labview_modules())
self._python_tasks.install_genie_python3()
self._mysql_tasks.install_mysql()
self._system_tasks.install_or_upgrade_vc_redist()

self._client_tasks.install_ibex_client()
self._git_tasks.checkout_to_release_branch()
Expand Down
Loading
Loading