Skip to content

Commit 7ea9daf

Browse files
authored
Merge pull request #281 from ISISComputingGroup/upadte_journal_parser
Update journal parser
2 parents 14c3dc0 + 0ccd3e2 commit 7ea9daf

File tree

4 files changed

+58
-20
lines changed

4 files changed

+58
-20
lines changed

installation_and_upgrade/ibex_install_utils/install_tasks.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def run_test_update(self) -> None:
133133
self._client_tasks.install_ibex_client()
134134
self._system_tasks.upgrade_notepad_pp()
135135
self._server_tasks.setup_log_rotation()
136+
self._server_tasks.update_journal_parser()
136137

137138
def remove_all_and_install_client_and_server(self) -> None:
138139
"""Either install or upgrade the ibex client and server"""
@@ -192,6 +193,7 @@ def run_instrument_install(self) -> None:
192193
self._system_tasks.put_autostart_script_in_startup_area()
193194
self._python_tasks.update_script_definitions()
194195
self._server_tasks.setup_log_rotation()
196+
self._server_tasks.update_journal_parser()
195197

196198
def run_update_icp(self) -> None:
197199
self._server_tasks.update_icp(self.icp_in_labview_modules())
@@ -250,6 +252,7 @@ def run_instrument_deploy_main(self) -> None:
250252
self._python_tasks.update_script_definitions()
251253
self._python_tasks.remove_instrument_script_githooks()
252254
self._server_tasks.setup_log_rotation()
255+
self._server_tasks.update_journal_parser()
253256
self._system_tasks.update_kafka_topics()
254257

255258
def run_instrument_deploy_pre_stop(self) -> None:
@@ -285,6 +288,10 @@ def run_setup_log_rotation(self) -> None:
285288
"""setup_log_rotation"""
286289
self._server_tasks.setup_log_rotation()
287290

291+
def run_update_journal_parser(self) -> None:
292+
"""update_journal_parser"""
293+
self._server_tasks.update_journal_parser()
294+
288295
def run_developer_update(self) -> None:
289296
"""Update all the developer tools to latest version"""
290297
self._mysql_tasks.install_mysql(force=False)
@@ -404,6 +411,10 @@ def run_vhd_post_install(self) -> None:
404411
UpgradeInstrument.run_setup_log_rotation,
405412
"setup log rotation",
406413
),
414+
"update_journal_parser": (
415+
UpgradeInstrument.run_update_journal_parser,
416+
"update journal parser",
417+
),
407418
"developer_update": (UpgradeInstrument.run_developer_update, "install latest developer tools"),
408419
"create_vhds": (
409420
UpgradeInstrument.run_vhd_creation,

installation_and_upgrade/ibex_install_utils/tasks/server_tasks.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,3 +733,25 @@ def setup_log_rotation(self) -> None:
733733
expected_return_val=0,
734734
)
735735
admin_commands.run_all()
736+
737+
@task("Update journal parser")
738+
def update_journal_parser(self) -> None:
739+
"""Update journal parser binaries."""
740+
741+
def copy_overwrite_readonly(src: str, dst: str) -> None:
742+
import stat
743+
744+
if os.path.exists(dst):
745+
os.chmod(dst, stat.S_IWRITE)
746+
shutil.copy2(src, dst)
747+
748+
jp_bin_dir = os.path.join(
749+
EPICS_PATH, "ISIS", "JournalParser", "master", "bin", "windows-x64"
750+
)
751+
if os.path.isdir(jp_bin_dir):
752+
shutil.copytree(
753+
jp_bin_dir,
754+
LABVIEW_DAE_DIR,
755+
copy_function=copy_overwrite_readonly,
756+
dirs_exist_ok=True,
757+
)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
setlocal EnableDelayedExpansion
2+
set "SOURCE=\\isis.cclrc.ac.uk\inst$\Kits$\CompGroup\ICP\Releases"
3+
4+
call "%~dp0set_epics_ca_addr_list.bat"
5+
call "%~dp0install_or_update_uv.bat"
6+
call "%~dp0set_up_venv.bat"
7+
8+
IF %errorlevel% neq 0 EXIT /b %errorlevel%
9+
10+
set "STOP_IBEX=C:\Instrument\Apps\EPICS\stop_ibex_server"
11+
set "START_IBEX=C:\Instrument\Apps\EPICS\start_ibex_server"
12+
13+
start /wait cmd /c "%STOP_IBEX%"
14+
15+
python -u "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --confirm_step %1
16+
17+
IF %errorlevel% neq 0 (
18+
set errcode = %ERRORLEVEL%
19+
rmdir /s /q %UV_TEMP_VENV%
20+
EXIT /b !errcode!
21+
)
22+
23+
start /wait cmd /c "%START_IBEX%"
24+
rmdir /s /q %UV_TEMP_VENV%
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
11
setlocal EnableDelayedExpansion
2-
set "SOURCE=\\isis.cclrc.ac.uk\inst$\Kits$\CompGroup\ICP\Releases"
3-
4-
call "%~dp0install_or_update_uv.bat"
5-
call "%~dp0set_up_venv.bat"
62

3+
call %~dp0run_one_task.bat force_upgrade_mysql
74
IF %errorlevel% neq 0 EXIT /b %errorlevel%
8-
9-
set "STOP_IBEX=C:\Instrument\Apps\EPICS\stop_ibex_server"
10-
set "START_IBEX=C:\Instrument\Apps\EPICS\start_ibex_server"
11-
12-
start /wait cmd /c "%STOP_IBEX%"
13-
14-
call python -u "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --confirm_step force_upgrade_mysql
15-
16-
IF %errorlevel% neq 0 (
17-
set errcode = %ERRORLEVEL%
18-
call rmdir /s /q %UV_TEMP_VENV%
19-
EXIT /b !errcode!
20-
)
21-
22-
start /wait cmd /c "%START_IBEX%"
23-
call rmdir /s /q %UV_TEMP_VENV%

0 commit comments

Comments
 (0)