Skip to content
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
11 changes: 11 additions & 0 deletions installation_and_upgrade/ibex_install_utils/install_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def run_test_update(self) -> None:
self._client_tasks.install_ibex_client()
self._system_tasks.upgrade_notepad_pp()
self._server_tasks.setup_log_rotation()
self._server_tasks.update_journal_parser()

def remove_all_and_install_client_and_server(self) -> None:
"""Either install or upgrade the ibex client and server"""
Expand Down Expand Up @@ -192,6 +193,7 @@ def run_instrument_install(self) -> None:
self._system_tasks.put_autostart_script_in_startup_area()
self._python_tasks.update_script_definitions()
self._server_tasks.setup_log_rotation()
self._server_tasks.update_journal_parser()

def run_update_icp(self) -> None:
self._server_tasks.update_icp(self.icp_in_labview_modules())
Expand Down Expand Up @@ -250,6 +252,7 @@ def run_instrument_deploy_main(self) -> None:
self._python_tasks.update_script_definitions()
self._python_tasks.remove_instrument_script_githooks()
self._server_tasks.setup_log_rotation()
self._server_tasks.update_journal_parser()
self._system_tasks.update_kafka_topics()

def run_instrument_deploy_pre_stop(self) -> None:
Expand Down Expand Up @@ -285,6 +288,10 @@ def run_setup_log_rotation(self) -> None:
"""setup_log_rotation"""
self._server_tasks.setup_log_rotation()

def run_update_journal_parser(self) -> None:
"""update_journal_parser"""
self._server_tasks.update_journal_parser()

def run_developer_update(self) -> None:
"""Update all the developer tools to latest version"""
self._mysql_tasks.install_mysql(force=False)
Expand Down Expand Up @@ -404,6 +411,10 @@ def run_vhd_post_install(self) -> None:
UpgradeInstrument.run_setup_log_rotation,
"setup log rotation",
),
"update_journal_parser": (
UpgradeInstrument.run_update_journal_parser,
"update journal parser",
),
"developer_update": (UpgradeInstrument.run_developer_update, "install latest developer tools"),
"create_vhds": (
UpgradeInstrument.run_vhd_creation,
Expand Down
22 changes: 22 additions & 0 deletions installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,3 +733,25 @@ def setup_log_rotation(self) -> None:
expected_return_val=0,
)
admin_commands.run_all()

@task("Update journal parser")
def update_journal_parser(self) -> None:
"""Update journal parser binaries."""

def copy_overwrite_readonly(src: str, dst: str) -> None:
import stat

if os.path.exists(dst):
os.chmod(dst, stat.S_IWRITE)
shutil.copy2(src, dst)

jp_bin_dir = os.path.join(
EPICS_PATH, "ISIS", "JournalParser", "master", "bin", "windows-x64"
)
if os.path.isdir(jp_bin_dir):
shutil.copytree(
jp_bin_dir,
LABVIEW_DAE_DIR,
copy_function=copy_overwrite_readonly,
dirs_exist_ok=True,
)
24 changes: 24 additions & 0 deletions installation_and_upgrade/run_one_task.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
setlocal EnableDelayedExpansion
set "SOURCE=\\isis.cclrc.ac.uk\inst$\Kits$\CompGroup\ICP\Releases"

call "%~dp0set_epics_ca_addr_list.bat"
call "%~dp0install_or_update_uv.bat"
call "%~dp0set_up_venv.bat"

IF %errorlevel% neq 0 EXIT /b %errorlevel%

set "STOP_IBEX=C:\Instrument\Apps\EPICS\stop_ibex_server"
set "START_IBEX=C:\Instrument\Apps\EPICS\start_ibex_server"

start /wait cmd /c "%STOP_IBEX%"

python -u "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --confirm_step %1

IF %errorlevel% neq 0 (
set errcode = %ERRORLEVEL%
rmdir /s /q %UV_TEMP_VENV%
EXIT /b !errcode!
)

start /wait cmd /c "%START_IBEX%"
rmdir /s /q %UV_TEMP_VENV%
21 changes: 1 addition & 20 deletions installation_and_upgrade/upgrade_mysql.bat
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
setlocal EnableDelayedExpansion
set "SOURCE=\\isis.cclrc.ac.uk\inst$\Kits$\CompGroup\ICP\Releases"

call "%~dp0install_or_update_uv.bat"
call "%~dp0set_up_venv.bat"

call %~dp0run_one_task.bat force_upgrade_mysql
IF %errorlevel% neq 0 EXIT /b %errorlevel%

set "STOP_IBEX=C:\Instrument\Apps\EPICS\stop_ibex_server"
set "START_IBEX=C:\Instrument\Apps\EPICS\start_ibex_server"

start /wait cmd /c "%STOP_IBEX%"

call python -u "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --confirm_step force_upgrade_mysql

IF %errorlevel% neq 0 (
set errcode = %ERRORLEVEL%
call rmdir /s /q %UV_TEMP_VENV%
EXIT /b !errcode!
)

start /wait cmd /c "%START_IBEX%"
call rmdir /s /q %UV_TEMP_VENV%
Loading