Skip to content

Commit

Permalink
for idaholab#389, used tagged images
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed May 9, 2024
1 parent 97a4d8a commit 7b69dab
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
eprint,
flatten,
LoadFileIfJson,
remove_prefix,
remove_suffix,
run_process,
same_file_or_dir,
Expand Down Expand Up @@ -2201,6 +2202,12 @@ def tweak_malcolm_runtime(self, malcolm_install_path):
# whether or not to restart services automatically (on boot, etc.)
line = f"{sectionIndents[currentSection] * 2}restart: {restartMode}"

elif re.match(r'^\s*image\s*:.*$', line):
# use architecture-specific images
imageLineSpit = line.rstrip().split(":")
imageLineSpit[-1] = imageLineSpit[-1].split("-", 1)[0] + args.imageArch
line = ":".join(imageLineSpit)

elif (currentService == 'arkime') or (currentService == 'arkime-live'):
# stuff specifically in the arkime section
if re.match(r'^\s*-.+:/data/pcap(:.+)?\s*$', line):
Expand Down Expand Up @@ -3485,6 +3492,15 @@ def main():
default=True,
help="Enable dark mode for OpenSearch Dashboards",
)
runtimeOptionsArgGroup.add_argument(
'--image-arch',
dest='imageArch',
required=False,
metavar='<amd64|arm64>',
type=str,
default=None,
help='Architecture for container image',
)

authencOptionsArgGroup = parser.add_argument_group('Entryption and authentication options')
authencOptionsArgGroup.add_argument(
Expand Down Expand Up @@ -4266,6 +4282,16 @@ def main():
else:
sys.tracebacklimit = 0

if args.imageArch is not None:
args.imageArch = (
'' if (args.imageArch.lower() == 'amd64') else ('-' + remove_suffix(args.imageArch.lower(), '-'))
)
else:
args.imageArch = ''
if rawPlatform := platform.machine().lower():
if rawPlatform == 'aarch64':
args.imageArch = '-arm64'

orchMode = OrchestrationFramework.UNKNOWN
if args.configFile and os.path.isfile(args.configFile):
if not (
Expand Down

0 comments on commit 7b69dab

Please sign in to comment.