-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathsystem-setup.py
executable file
·92 lines (70 loc) · 2.93 KB
/
system-setup.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python3
import sys
import os
import argparse
HERE = os.path.abspath(os.path.dirname(__file__))
ROOT = os.path.abspath(os.path.join(HERE, ".."))
READIES = os.path.join(ROOT, "opt/readies")
sys.path.insert(0, READIES)
import paella
#----------------------------------------------------------------------------------------------
class RedisAISetup(paella.Setup):
def __init__(self, nop=False):
paella.Setup.__init__(self, nop)
def common_first(self):
self.install_downloaders()
self.pip_install("wheel")
self.install("git unzip patchelf")
if self.osnick != 'centos8':
self.install("coreutils") # for realpath
def debian_compat(self):
self.run("%s/bin/enable-utf8" % READIES)
self.run("%s/bin/getgcc" % READIES)
self.install("gawk")
self.install("libssl-dev")
self.install("python3-regex")
self.install("python3-psutil python3-networkx python3-numpy")
self.install("libegl1-mesa-dev libgles2-mesa-dev")
if self.platform.is_arm():
self.install("python3-dev") # python3-skimage
self.install("libmpich-dev libopenblas-dev") # for libtorch
self.install_git_lfs_on_linux()
def redhat_compat(self):
self.run("%s/bin/enable-utf8" % READIES)
self.run("%s/bin/getepel" % READIES)
self.install("redhat-lsb-core")
self.run("%s/bin/getgcc --modern" % READIES)
if self.arch == 'x64':
self.install_linux_gnu_tar()
if not self.dist == "amzn":
self.install("epel-release")
self.install("python3-devel libaec-devel")
else:
self.run("amazon-linux-extras install epel", output_on_error=True)
self.install("python3-devel")
self.install_git_lfs_on_linux()
def fedora(self):
self.run("%s/bin/getepel" % READIES)
self.install("python3-networkx")
self.install_git_lfs_on_linux()
def linux_last(self):
self.install("valgrind")
def macos(self):
self.install_gnu_utils()
self.install("git-lfs")
self.install("redis")
def common_last(self):
self.run("%s/bin/getclang --format" % READIES)
if self.platform == "arm":
self.run("%s/bin/getcmake" % READIES)
else:
self.run("%s/bin/getcmake --no-repo" % READIES)
self.run("{PYTHON} {READIES}/bin/getrmpytools".format(PYTHON=self.python, READIES=READIES))
self.pip_install("-r %s/tests/flow/test_requirements.txt" % ROOT)
self.pip_install("awscli")
self.pip_install("mkdocs mkdocs-material mkdocs-extensions")
#----------------------------------------------------------------------------------------------
parser = argparse.ArgumentParser(description='Set up system for build.')
parser.add_argument('-n', '--nop', action="store_true", help='no operation')
args = parser.parse_args()
RedisAISetup(nop=args.nop).setup()