-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
125 lines (114 loc) · 4.65 KB
/
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/env python
from version import VERSION
from setuptools import setup
from setuptools.command.install import install
import distutils.archive_util
import os
# apt-get install python-mysqldb
# tar xfz cluesonebindings-0.28.tar.gz
# cd cluesonebindings-0.28
# python setup.py install
# cd ..
# tar xfz CLUES-2.0.1.tar.gz
# cd CLUES-2.0.1
# python setup.py install
# /etc/init.d/cluesd start
# crear configuracion /etc/clues2/clues2.cfg y /etc/clues2/conf.d/plugin-one.cfg
#mkdir -p /var/log/clues/ /var/lib/clues2/ /etc/clues2/
#cp etc/conf.d/plugin-example.cfg /etc/clues2/
#cp etc/clues2.cfg /etc/clues2/
#wget https://github.com/grycap/cpyutils/archive/master.zip
#unzip master.zip
#cd cpyutils-master
#python setup.py install --record installed-files.txt
#cd ..
#easy_install ply
#easy_install web.py
# oneuser create clues cluespass
# oneuser chgrp clues oneadmin
# cp conf.d/plugin-one.cfg-example conf.d/plugin-ipmi.cfg-example /etc/clues2/conf.d/
class my_install(install):
def touch(self, fname):
if os.path.exists(fname):
os.utime(fname, None)
else:
open(fname, 'a').close()
def run(self):
install.run(self)
# We create the /var/log/clues2 directory to be the default log directory
distutils.archive_util.mkpath("/var/log/clues2", mode=0o0777)
self.touch("/var/log/clues2/clues2.log")
self.touch("/var/log/clues2/clues2-cli.log")
# We set the file /var/log/clues2/clues2.log file to 0o666 to be able to be written when the users submit the jobs using the pbs filter
os.chmod("/var/log/clues2/clues2.log", 0o666)
os.chmod("/var/log/clues2/clues2-cli.log", 0o666)
# We create the /var/lib/clues2 directory to be the default for pid file and db
distutils.archive_util.mkpath("/var/lib/clues2", mode=0o0750)
# We set the permissions of the configuration folder to be only readable by the one that installs CLUES (to avoid users to use commandline)
os.chmod("/etc/clues2", 0o750)
distutils.archive_util.mkpath("/etc/clues2/scripts", mode=0o0777)
setup(name='CLUES',
version=VERSION,
description='CLUES - CLUster Energy-saving System - version 2',
author='Carlos de Alfonso',
author_email='[email protected]',
url='http://www.grycap.upv.es/clues',
# package_dir = {'cluesonebindings':'../cluesonebindings'},
packages = [ 'clueslib', 'cluesplugins', 'clues' ],
package_dir = { 'clues': '.' },
# py_modules = [ 'configcli', 'configserver' ],
data_files = [
('/etc/clues2/', [
'etc/clues2.cfg-example',
'etc/clues2.cfg-full-example',
'etc/clues2.cfg-cli-example',
'etc/virtualonecluster.hosts-example',
'etc/ipmi.hosts-example'
] ),
('/etc/clues2/conf.d/', [
'etc/conf.d/plugin-one.cfg-example',
'etc/conf.d/wrapper-one.cfg-example',
'etc/conf.d/plugin-im.cfg-example',
'etc/conf.d/plugin-pbs.cfg-example',
'etc/conf.d/plugin-sge.cfg-example',
'etc/conf.d/wrapper-sge.cfg-example',
'etc/conf.d/plugin-slurm.cfg-example',
'etc/conf.d/plugin-commandline.cfg-example',
'etc/conf.d/hooks.cfg-example',
'etc/conf.d/plugin-wol.cfg-example',
'etc/conf.d/plugin-kubernetes.cfg-example',
'etc/conf.d/plugin-nomad.cfg-example',
'etc/conf.d/plugin-ipmi.cfg-example',
'etc/conf.d/plugin-mesos.cfg-example',
'etc/conf.d/schedulers.cfg-example']),
('/etc/clues2/reports/', [
'etc/reports/cluescharts.js',
'etc/reports/cluesdata.js',
'etc/reports/cluesstats.js',
'etc/reports/minibarchart.js',
'etc/reports/cluesprocess.js',
'etc/reports/piechart.js',
'etc/reports/randomColor.js',
'etc/reports/index.html']),
('/etc/clues2/simulator', [
'etc/simulator/simple.sim',
'etc/simulator/platform.sim'
]),
('/etc/logrotate.d/', [
'etc/clues-logrotate'
]),
('/etc/init.d', [
'cluesd'
]),
# force cluesserver to be in /usr/bin
('/usr/bin', [
'cluesserver'
]),
('/etc/systemd/system', [
'cluesd.service'
])
],
scripts = [ 'clues', 'cluesserver', 'cluesreports', 'addons/pbs/clues-pbs-wrapper', 'addons/one/clues-one-wrapper', 'addons/sge/clues-sge-wrapper', 'addons/slurm/clues-slurm-wrapper' ],
requires = [ 'cpyutils (>= 0.40)' ],
cmdclass={'install': my_install}
)