To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

__main__.py 1.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3
# Copyright 2017 The Australian National University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import sys
Zixian Cai's avatar
Zixian Cai committed
18
19
import logging

20
21
import click

Zixian Cai's avatar
Zixian Cai committed
22
23
24
# Workaround
sys.path.insert(0, os.path.abspath(os.path.join(__file__, "..", "..")))

Zixian Cai's avatar
Zixian Cai committed
25
from mubench import __VERSION__
26
from mubench.frontend import frontends
27
from mubench.conf import settings
Zixian Cai's avatar
Zixian Cai committed
28
29
30

assert sys.version_info[:2] >= (3, 4), "Python 3.4+ is required."

31
32
LOGGING_FORMAT_DEFAULT = "[%(levelname)s] %(asctime)s %(module)s %(message)s"

Zixian Cai's avatar
Zixian Cai committed
33
logging.basicConfig(
34
    format=getattr(settings, 'LOGGING_FORMAT', LOGGING_FORMAT_DEFAULT),
35
    level=logging.INFO)
Zixian Cai's avatar
Zixian Cai committed
36
37


38
39
40
41
42
43
def print_version(ctx, param, value):
    if not value or ctx.resilient_parsing:
        return
    click.echo("Mu Performance Benchmarking Framework\n"
               "Version: {}".format(__VERSION__))
    ctx.exit()
Zixian Cai's avatar
Zixian Cai committed
44
45


46
47
48
49
50
51
@click.group()
@click.option('--version',
              is_flag=True,
              callback=print_version,
              expose_value=False,
              is_eager=True)
Zixian Cai's avatar
Zixian Cai committed
52
def main():
53
54
    pass

Zixian Cai's avatar
Zixian Cai committed
55

56
57
for frontend in frontends:
    main.add_command(frontend)
Zixian Cai's avatar
Zixian Cai committed
58

59
if __name__ == '__main__':
Zixian Cai's avatar
Zixian Cai committed
60
    main()