Auto status change to "Under Review"
Show More
@@ -1,105 +1,100 b'' | |||||
1 | AppEnlight |
|
1 | AppEnlight | |
2 | ----------- |
|
2 | ----------- | |
3 |
|
3 | |||
4 | Automatic Installation |
|
4 | Automatic Installation | |
5 | ====================== |
|
5 | ====================== | |
6 |
|
6 | |||
7 | Use the ansible scripts in the `automation` repository to build complete instance of application |
|
7 | Use the ansible scripts in the `automation` repository to build complete instance of application | |
8 | You can also use `packer` files in `automation/packer` to create whole VM's for KVM and VMWare. |
|
8 | You can also use `packer` files in `automation/packer` to create whole VM's for KVM and VMWare. | |
9 |
|
9 | |||
10 | Manual Installation |
|
10 | Manual Installation | |
11 | =================== |
|
11 | =================== | |
12 |
|
12 | |||
13 | To run the app you need to have meet prerequsites: |
|
13 | To run the app you need to have meet prerequsites: | |
14 |
|
14 | |||
15 | - python 3.5+ (currently 3.6 tested) |
|
15 | - python 3.5+ (currently 3.6 tested) | |
16 | - running elasticsearch (6.6.2 tested) |
|
16 | - running elasticsearch (6.6.2 tested) | |
17 | - running postgresql (9.5+ required, tested 9.6 and 10.6) |
|
17 | - running postgresql (9.5+ required, tested 9.6 and 10.6) | |
18 | - running redis |
|
18 | - running redis | |
19 |
|
19 | |||
20 | Install the app by performing |
|
20 | Install the app by performing | |
21 |
|
21 | |||
22 | pip install -r requirements.txt |
|
22 | pip install -r requirements.txt | |
23 |
|
23 | |||
24 | python setup.py develop |
|
24 | python setup.py develop | |
25 |
|
25 | |||
26 | Install the appenlight uptime plugin (`ae_uptime_ce` package from `appenlight-uptime-ce` repository). |
|
26 | Install the appenlight uptime plugin (`ae_uptime_ce` package from `appenlight-uptime-ce` repository). | |
27 |
|
27 | |||
28 | For production usage you can do: |
|
28 | For production usage you can do: | |
29 |
|
29 | |||
30 | pip install appenlight |
|
30 | pip install appenlight | |
31 | pip install ae_uptime_ce |
|
31 | pip install ae_uptime_ce | |
32 |
|
32 | |||
33 |
|
33 | |||
34 | After installing the application you need to perform following steps: |
|
34 | After installing the application you need to perform following steps: | |
35 |
|
35 | |||
36 | 1. (optional) generate production.ini (or use a copy of development.ini) |
|
36 | 1. (optional) generate production.ini (or use a copy of development.ini) | |
37 |
|
37 | |||
38 |
|
||||
39 | appenlight-make-config production.ini |
|
38 | appenlight-make-config production.ini | |
40 |
|
39 | |||
41 | 2. Setup database structure: |
|
40 | 2. Setup database structure: | |
42 |
|
41 | |||
43 |
|
||||
44 | appenlight-migratedb -c FILENAME.ini |
|
42 | appenlight-migratedb -c FILENAME.ini | |
45 |
|
43 | |||
46 | 3. To configure elasticsearch: |
|
44 | 3. To configure elasticsearch: | |
47 |
|
45 | |||
48 |
|
||||
49 | appenlight-reindex-elasticsearch -t all -c FILENAME.ini |
|
46 | appenlight-reindex-elasticsearch -t all -c FILENAME.ini | |
50 |
|
47 | |||
51 | 4. Create base database objects |
|
48 | 4. Create base database objects | |
52 |
|
49 | |||
53 | (run this command with help flag to see how to create administrator user) |
|
50 | (run this command with help flag to see how to create administrator user) | |
54 |
|
51 | |||
55 |
|
||||
56 | appenlight-initializedb -c FILENAME.ini |
|
52 | appenlight-initializedb -c FILENAME.ini | |
57 |
|
53 | |||
58 | 5. Generate static assets |
|
54 | 5. Generate static assets | |
59 |
|
55 | |||
60 |
|
||||
61 | appenlight-static -c FILENAME.ini |
|
56 | appenlight-static -c FILENAME.ini | |
62 |
|
57 | |||
63 | Running application |
|
58 | Running application | |
64 | =================== |
|
59 | =================== | |
65 |
|
60 | |||
66 | To run the main app: |
|
61 | To run the main app: | |
67 |
|
62 | |||
68 | pserve development.ini |
|
63 | pserve development.ini | |
69 |
|
64 | |||
70 | To run celery workers: |
|
65 | To run celery workers: | |
71 |
|
66 | |||
72 | celery worker -A appenlight.celery -Q "reports,logs,metrics,default" --ini FILENAME.ini |
|
67 | celery worker -A appenlight.celery -Q "reports,logs,metrics,default" --ini FILENAME.ini | |
73 |
|
68 | |||
74 | To run celery beat: |
|
69 | To run celery beat: | |
75 |
|
70 | |||
76 | celery beat -A appenlight.celery --ini FILENAME.ini |
|
71 | celery beat -A appenlight.celery --ini FILENAME.ini | |
77 |
|
72 | |||
78 | To run appenlight's uptime plugin: |
|
73 | To run appenlight's uptime plugin: | |
79 |
|
74 | |||
80 | appenlight-uptime-monitor -c FILENAME.ini |
|
75 | appenlight-uptime-monitor -c FILENAME.ini | |
81 |
|
76 | |||
82 | Real-time Notifications |
|
77 | Real-time Notifications | |
83 | ======================= |
|
78 | ======================= | |
84 |
|
79 | |||
85 | You should also run the `channelstream websocket server for real-time notifications |
|
80 | You should also run the `channelstream websocket server for real-time notifications | |
86 |
|
81 | |||
87 | channelstream -i filename.ini |
|
82 | channelstream -i filename.ini | |
88 |
|
83 | |||
89 | Testing |
|
84 | Testing | |
90 | ======= |
|
85 | ======= | |
91 |
|
86 | |||
92 | To run test suite: |
|
87 | To run test suite: | |
93 |
|
88 | |||
94 | py.test appenlight/tests/tests.py --cov appenlight (this looks for testing.ini in repo root) |
|
89 | py.test appenlight/tests/tests.py --cov appenlight (this looks for testing.ini in repo root) | |
95 |
|
90 | |||
96 |
|
91 | |||
97 | Development |
|
92 | Development | |
98 | =========== |
|
93 | =========== | |
99 |
|
94 | |||
100 | To develop appenlight frontend: |
|
95 | To develop appenlight frontend: | |
101 |
|
96 | |||
102 | cd frontend |
|
97 | cd frontend | |
103 | npm install |
|
98 | npm install | |
104 | grunt watch |
|
99 | grunt watch | |
105 |
|
100 |
@@ -1,88 +1,95 b'' | |||||
1 | import os |
|
1 | import os | |
2 | import re |
|
2 | import re | |
3 |
|
3 | |||
4 | from setuptools import setup, find_packages |
|
4 | from setuptools import setup, find_packages | |
5 |
|
5 | |||
6 | here = os.path.abspath(os.path.dirname(__file__)) |
|
6 | here = os.path.abspath(os.path.dirname(__file__)) | |
7 | README = open(os.path.join(here, "README.md")).read() |
|
7 | README = open(os.path.join(here, "README.md")).read() | |
8 | CHANGES = open(os.path.join(here, "CHANGELOG.md")).read() |
|
8 | CHANGES = open(os.path.join(here, "CHANGELOG.md")).read() | |
9 |
|
9 | |||
10 | REQUIREMENTS = open(os.path.join(here, "requirements.txt")).readlines() |
|
10 | REQUIREMENTS = open(os.path.join(here, "requirements.txt")).readlines() | |
11 |
|
11 | |||
12 | compiled = re.compile("([^=><]*).*") |
|
12 | compiled = re.compile("([^=><]*).*") | |
13 |
|
13 | |||
14 |
|
14 | |||
15 | def parse_req(req): |
|
15 | def parse_req(req): | |
16 | return compiled.search(req).group(1).strip() |
|
16 | return compiled.search(req).group(1).strip() | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | requires = [_f for _f in map(parse_req, REQUIREMENTS) if _f] |
|
19 | requires = [_f for _f in map(parse_req, REQUIREMENTS) if _f] | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | def _get_meta_var(name, data, callback_handler=None): |
|
22 | def _get_meta_var(name, data, callback_handler=None): | |
23 | import re |
|
23 | import re | |
24 |
|
24 | |||
25 | matches = re.compile(r"(?:%s)\s*=\s*(.*)" % name).search(data) |
|
25 | matches = re.compile(r"(?:%s)\s*=\s*(.*)" % name).search(data) | |
26 | if matches: |
|
26 | if matches: | |
27 | if not callable(callback_handler): |
|
27 | if not callable(callback_handler): | |
28 | callback_handler = lambda v: v |
|
28 | callback_handler = lambda v: v | |
29 |
|
29 | |||
30 | return callback_handler(eval(matches.groups()[0])) |
|
30 | return callback_handler(eval(matches.groups()[0])) | |
31 |
|
31 | |||
32 |
|
32 | |||
33 | with open(os.path.join(here, "src", "appenlight", "__init__.py"), "r") as _meta: |
|
33 | with open(os.path.join(here, "src", "appenlight", "__init__.py"), "r") as _meta: | |
34 | _metadata = _meta.read() |
|
34 | _metadata = _meta.read() | |
35 |
|
35 | |||
36 | __license__ = _get_meta_var("__license__", _metadata) |
|
36 | __license__ = _get_meta_var("__license__", _metadata) | |
37 | __author__ = _get_meta_var("__author__", _metadata) |
|
37 | __author__ = _get_meta_var("__author__", _metadata) | |
38 | __url__ = _get_meta_var("__url__", _metadata) |
|
38 | __url__ = _get_meta_var("__url__", _metadata) | |
39 |
|
39 | |||
40 | found_packages = find_packages("src") |
|
40 | found_packages = find_packages("src") | |
41 | found_packages.append("appenlight.migrations.versions") |
|
41 | found_packages.append("appenlight.migrations.versions") | |
42 | setup( |
|
42 | setup( | |
43 | name="appenlight", |
|
43 | name="appenlight", | |
44 | description="appenlight", |
|
44 | description="appenlight", | |
45 | long_description=README, |
|
45 | long_description=README, | |
46 | classifiers=[ |
|
46 | classifiers=[ | |
|
47 | "Framework :: Pyramid", | |||
|
48 | "License :: OSI Approved :: Apache Software License", | |||
47 | "Programming Language :: Python", |
|
49 | "Programming Language :: Python", | |
48 | "Framework :: Pylons", |
|
50 | "Programming Language :: Python :: 3 :: Only", | |
|
51 | "Programming Language :: Python :: 3.6", | |||
|
52 | "Topic :: System :: Monitoring", | |||
|
53 | "Topic :: Software Development", | |||
|
54 | "Topic :: Software Development :: Bug Tracking", | |||
|
55 | "Topic :: Internet :: Log Analysis", | |||
49 | "Topic :: Internet :: WWW/HTTP", |
|
56 | "Topic :: Internet :: WWW/HTTP", | |
50 | "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", |
|
57 | "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", | |
51 | ], |
|
58 | ], | |
52 |
version= |
|
59 | version="2.0.0rc1", | |
53 | license=__license__, |
|
60 | license=__license__, | |
54 | author=__author__, |
|
61 | author=__author__, | |
55 | url=__url__, |
|
62 | url=__url__, | |
56 | keywords="web wsgi bfg pylons pyramid flask django monitoring apm instrumentation appenlight", |
|
63 | keywords="web wsgi bfg pylons pyramid flask django monitoring apm instrumentation appenlight", | |
57 | python_requires=">=3.5", |
|
64 | python_requires=">=3.5", | |
58 | long_description_content_type="text/markdown", |
|
65 | long_description_content_type="text/markdown", | |
59 | package_dir={"": "src"}, |
|
66 | package_dir={"": "src"}, | |
60 | packages=found_packages, |
|
67 | packages=found_packages, | |
61 | include_package_data=True, |
|
68 | include_package_data=True, | |
62 | zip_safe=False, |
|
69 | zip_safe=False, | |
63 | test_suite="appenlight", |
|
70 | test_suite="appenlight", | |
64 | install_requires=requires, |
|
71 | install_requires=requires, | |
65 | extras_require={ |
|
72 | extras_require={ | |
66 | "dev": [ |
|
73 | "dev": [ | |
67 | "coverage", |
|
74 | "coverage", | |
68 | "pytest", |
|
75 | "pytest", | |
69 | "pyramid", |
|
76 | "pyramid", | |
70 | "tox", |
|
77 | "tox", | |
71 | "mock", |
|
78 | "mock", | |
72 | "pytest-mock", |
|
79 | "pytest-mock", | |
73 | "webtest", |
|
80 | "webtest", | |
74 | ], |
|
81 | ], | |
75 | "lint": ["black"], |
|
82 | "lint": ["black"], | |
76 | }, |
|
83 | }, | |
77 | entry_points={ |
|
84 | entry_points={ | |
78 | "paste.app_factory": ["main = appenlight:main"], |
|
85 | "paste.app_factory": ["main = appenlight:main"], | |
79 | "console_scripts": [ |
|
86 | "console_scripts": [ | |
80 | "appenlight-cleanup = appenlight.scripts.cleanup:main", |
|
87 | "appenlight-cleanup = appenlight.scripts.cleanup:main", | |
81 | "appenlight-initializedb = appenlight.scripts.initialize_db:main", |
|
88 | "appenlight-initializedb = appenlight.scripts.initialize_db:main", | |
82 | "appenlight-migratedb = appenlight.scripts.migratedb:main", |
|
89 | "appenlight-migratedb = appenlight.scripts.migratedb:main", | |
83 | "appenlight-reindex-elasticsearch = appenlight.scripts.reindex_elasticsearch:main", |
|
90 | "appenlight-reindex-elasticsearch = appenlight.scripts.reindex_elasticsearch:main", | |
84 | "appenlight-static = appenlight.scripts.static:main", |
|
91 | "appenlight-static = appenlight.scripts.static:main", | |
85 | "appenlight-make-config = appenlight.scripts.make_config:main", |
|
92 | "appenlight-make-config = appenlight.scripts.make_config:main", | |
86 | ], |
|
93 | ], | |
87 | }, |
|
94 | }, | |
88 | ) |
|
95 | ) |
General Comments 4
Auto status change to "Under Review"
You need to be logged in to leave comments.
Login now