-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
58 lines (42 loc) · 1.64 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# SPDX-FileCopyrightText: 2022 Renaissance Computing Institute. All rights reserved.
# SPDX-FileCopyrightText: 2023 Renaissance Computing Institute. All rights reserved.
# SPDX-FileCopyrightText: 2024 Renaissance Computing Institute. All rights reserved.
#
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-License-Identifier: LicenseRef-RENCI
# SPDX-License-Identifier: MIT
"""
Main entry point for the APSViz collaborator synchronizer.
Author: Phil Owen, 05/10/2023
"""
import sys
import argparse
from src.sync.psc_sync import PSCDataSync
def run_psc_collab_sync(run_id: str, physical_location: str) -> bool:
"""
Runs thd PSC collaborator sync
:param run_id
:param physical_location:
:return:
"""
# create the PSC data sync component
psc_sync = PSCDataSync()
# initiate the PSC sync. return value of True indicates success
retval: bool = psc_sync.run(run_id, physical_location)
# return to the caller
return retval
if __name__ == '__main__':
#
# main entry point for the sync run.
#
# create a command line parser
parser = argparse.ArgumentParser(description='help', formatter_class=argparse.RawDescriptionHelpFormatter)
# assign the expected input args
parser.add_argument('-r', '--run_id', help='Input is a valid APSViz supervisor run ID.')
parser.add_argument('-p', '--physical_location', help='The name of the physical location of the compute cluster.')
# parse the command line
args = parser.parse_args()
# execute the rule file(s)
ret_val: bool = run_psc_collab_sync(args.run_id, args.physical_location)
# exit with pass/fail
sys.exit(0)