Skip to content

Commit cc721bd

Browse files
committed
Merge branch 'release/v3.1.0'
2 parents 364b106 + 7c4bf11 commit cc721bd

File tree

86 files changed

+2205
-635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2205
-635
lines changed

AUTHORS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Roy Russo <royrusso@gmail.com>
2+
23
Will McGinnis
34

5+
And other authors: https://github.com/ElasticHQ/elasticsearch-HQ/graphs/contributors
6+
47
This project also draws upon the work of the elasticsearch-py author:
58

69
Honza Král

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
6+
## Pull Request Process
7+
8+
For new features or bug fixes, please make your changes on the ``master`` branch.

DEVELOPMENT.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
11
# Development Instructions
22

3-
See README for this version until a GA release.
4-
5-
6-
## DEVELOPMENT
7-
8-
1. Use Python 3.4+
9-
2. We advise that you create a virtual environment for this project.
10-
11-
12-
## CHANGELOG
13-
14-
...
15-
3+
See the development section in the docs for details: http://docs.elastichq.org/developer-guide.html

Dockerfile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,39 @@ FROM python:3.6-alpine3.7
33
RUN apk update
44
RUN apk add supervisor
55
RUN apk add --update py2-pip
6-
RUN pip install gunicorn
6+
7+
# Upgrade and install basic Python dependencies
8+
# This block added because of the trouble installing gevent on many systems
9+
# https://hub.docker.com/r/openwhisk/dockerskeleton/~/dockerfile/
10+
RUN apk add --no-cache bash \
11+
&& apk add --no-cache --virtual .build-deps \
12+
bzip2-dev \
13+
gcc \
14+
libc-dev
15+
# && pip install --no-cache-dir gevent \
16+
# && apk del .build-deps
717

818
# reqs layer
919
ADD requirements.txt .
1020
RUN pip3 install -U -r requirements.txt
21+
RUN pip3 install gunicorn
1122

1223
# Bundle app source
1324
ADD . /src
1425

15-
# Expose
16-
EXPOSE 5000
17-
1826
COPY ./deployment/logging.conf /src/logging.conf
1927
COPY ./deployment/gunicorn.conf /src/gunicorn.conf
2028

29+
EXPOSE 5000
30+
2131
# Setup supervisord
2232
RUN mkdir -p /var/log/supervisor
2333
COPY ./deployment/supervisord.conf /etc/supervisor/supervisord.conf
2434
COPY ./deployment/gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf
2535

2636
# Start processes
27-
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
37+
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
38+
39+
40+
#ENTRYPOINT ["python"]
41+
#CMD ["src/application.py"]

ISSUE_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### General information
2+
3+
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
4+
- **ElasticHQ Version**:
5+
- **Elasticsearch Version**:
6+
- **Python version**:
7+
- **Browser Vendor and Version (if applicable)**:
8+
9+
### Issue Description
10+
11+
Describe the problem clearly here. Be sure to convey here why it's a bug in ElasticHQ or a feature request.
12+
13+
### Source Code / Logs
14+
15+
Include any logs or source code that would be helpful to diagnose the problem. If including stacktrace, please include the full stacktrace.
16+
17+
Large logs and files should be attached. Try to provide a reproducible test case or steps that are the bare minimum necessary to generate the problem.

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Simplified Monitoring and Management for ElasticSearch clusters.
1010
[![License](https://img.shields.io/badge/license-ASL-blue.svg)](https://opensource.org/licenses/ASL)
1111

1212

13-
![alt text](main_dashboard.png)
13+
![alt text](https://raw.githubusercontent.com/ElasticHQ/elasticsearch-HQ/master/main_dashboard.png)
1414

1515

1616
Key Features
@@ -21,6 +21,7 @@ Key Features
2121
* Create and perform maintenance on Elasticsearch Indices.
2222
* One-Click access to common ES API endpoints.
2323
* Well-documented REST API for extensibility.
24+
* Real-time monitoring charts of important metrics.
2425
* Active project used by Fortune 100 companies around the world.
2526
* Free. ;-)
2627

@@ -43,19 +44,14 @@ For **full** installation and configuration instructions, see [Getting Started](
4344

4445
For further installation and configuration help, please read the docs: [ElasticHQ Documentation](http://docs.elastichq.org)
4546

46-
Docs + Support
47-
---------------
48-
* Documentation can be found here: http://docs.elastichq.org
49-
* Google Group can be found here: https://groups.google.com/d/forum/elastichq
50-
* If you need sample index + documents, see here: https://github.com/royrusso/elasticsearch-sample-index
51-
* If you find a bug, **please** create an issue and report it, or fix it and submit a pull request. ;-)
52-
53-
Legal Stuff
54-
-----------
55-
56-
* [License File](LICENSE.md).
57-
* [TOS and Privacy](TERMS.md).
47+
For those of you wanting to use Docker: [ElasticHQ on Dockerhub](https://hub.docker.com/r/elastichq/elasticsearch-hq/)
5848

49+
Useful Links
50+
------------
51+
* [Documentation](http://docs.elastichq.org)
52+
* [Official Website](http://www.elastichq.org)
53+
* [Docker Images](https://hub.docker.com/r/elastichq/elasticsearch-hq/)
54+
* [Google Group](https://groups.google.com/d/forum/elastichq)
5955

6056

6157

__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__author__ = 'royrusso'

application.py

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
1-
from elastichq import factory
2-
import argparse
1+
# import argparse
2+
import optparse
3+
4+
from elastichq import create_app
5+
from elastichq.globals import socketio
6+
7+
default_host = '0.0.0.0'
8+
default_port = 5000
9+
default_debug = False
10+
11+
application = create_app()
312

4-
application = factory.create_app()
5-
613
if __name__ == '__main__':
7-
parser = argparse.ArgumentParser()
8-
parser.add_argument("--port", help="The port to listen to", type=int,default=5000)
9-
parser.add_argument("--host", help="local IP address to bind to",default="localhost")
10-
args = parser.parse_args()
11-
12-
application.run(debug=False, threaded=True, use_reloader=True,host=args.host,port=args.port)
13-
#application.run(debug=False, threaded=True, use_reloader=False)
14-
#application.run(debug=True, threaded=True, use_reloader=True)
14+
# Set up the command-line options
15+
parser = optparse.OptionParser()
16+
parser.add_option("-H", "--host",
17+
help="Hostname of the Flask app " + \
18+
"[default %s]" % default_host,
19+
default=default_host)
20+
parser.add_option("-P", "--port",
21+
help="Port for the Flask app " + \
22+
"[default %s]" % default_port,
23+
default=default_port)
24+
parser.add_option("-d", "--debug",
25+
action="store_true", dest="debug", default=default_debug,
26+
help=optparse.SUPPRESS_HELP)
27+
28+
options, _ = parser.parse_args()
29+
30+
socketio.run(application, host=options.host, port=options.port, debug=options.debug)
31+

deployment/supervisord.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
nodaemon=true
33

44
[program:gunicorn]
5-
command=/usr/local/bin/gunicorn application:application -w 4 --config /src/gunicorn.conf --log-config /src/logging.conf --bind 0.0.0.0:5000
5+
command=/usr/local/bin/gunicorn application:application -w 1 --worker-class eventlet --config /src/gunicorn.conf --log-config /src/logging.conf --bind 0.0.0.0:5000
66
directory=/src
2.4 KB
Binary file not shown.

docs/.doctrees/developers.doctree

-3.29 KB
Binary file not shown.

docs/.doctrees/environment.pickle

-14.9 KB
Binary file not shown.

docs/.doctrees/faq.doctree

-879 Bytes
Binary file not shown.

docs/.doctrees/index.doctree

1 Byte
Binary file not shown.

docs/.doctrees/installation.doctree

9.52 KB
Binary file not shown.

docs/.doctrees/rest-api.doctree

-3.15 KB
Binary file not shown.
0 Bytes
Binary file not shown.

docs/.doctrees/user-guide.doctree

-122 Bytes
Binary file not shown.

docs/_modules/elastichq/service/ClusterService.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ <h1>Source code for elastichq.service.ClusterService</h1><div class="highlight">
131131
<span class="sd">&quot;&quot;&quot;</span>
132132
<span class="sd"> cc</span>
133133
<span class="sd"> &quot;&quot;&quot;</span>
134+
134135
<span class="k">def</span> <span class="nf">get_cluster_health</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cluster_name</span><span class="p">):</span>
135136
<span class="n">connection</span> <span class="o">=</span> <span class="n">ConnectionService</span><span class="p">()</span><span class="o">.</span><span class="n">get_connection</span><span class="p">(</span><span class="n">cluster_name</span><span class="p">)</span>
136137
<span class="k">return</span> <span class="n">connection</span><span class="o">.</span><span class="n">cluster</span><span class="o">.</span><span class="n">health</span><span class="p">(</span><span class="n">request_timeout</span><span class="o">=</span><span class="n">REQUEST_TIMEOUT</span><span class="p">)</span>
@@ -160,7 +161,7 @@ <h1>Source code for elastichq.service.ClusterService</h1><div class="highlight">
160161
<span class="k">return</span> <span class="n">connection</span><span class="o">.</span><span class="n">cluster</span><span class="o">.</span><span class="n">put_settings</span><span class="p">(</span><span class="n">body</span><span class="o">=</span><span class="n">settings</span><span class="p">,</span> <span class="n">request_timeout</span><span class="o">=</span><span class="n">REQUEST_TIMEOUT</span><span class="p">)</span>
161162

162163
<span class="k">def</span> <span class="nf">get_clusters</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">create_if_missing</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
163-
<span class="n">clusters</span> <span class="o">=</span> <span class="n">ConnectionService</span><span class="p">()</span><span class="o">.</span><span class="n">get_connections</span><span class="p">()</span>
164+
<span class="n">clusters</span> <span class="o">=</span> <span class="n">ConnectionService</span><span class="p">()</span><span class="o">.</span><span class="n">get_connections</span><span class="p">(</span><span class="n">create_if_missing</span><span class="o">=</span><span class="n">create_if_missing</span><span class="p">)</span>
164165
<span class="k">for</span> <span class="n">cluster</span> <span class="ow">in</span> <span class="n">clusters</span><span class="p">:</span>
165166
<span class="k">if</span> <span class="n">cluster</span><span class="o">.</span><span class="n">cluster_connected</span> <span class="ow">is</span> <span class="bp">True</span><span class="p">:</span>
166167
<span class="n">cluster</span><span class="o">.</span><span class="n">cluster_health</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_cluster_health</span><span class="p">(</span><span class="n">cluster_name</span><span class="o">=</span><span class="n">cluster</span><span class="o">.</span><span class="n">cluster_name</span><span class="p">)</span>
@@ -185,7 +186,11 @@ <h1>Source code for elastichq.service.ClusterService</h1><div class="highlight">
185186
<span class="n">nodes</span> <span class="o">=</span> <span class="n">NodeService</span><span class="p">()</span><span class="o">.</span><span class="n">get_node_summary</span><span class="p">(</span><span class="n">cluster_name</span><span class="p">)</span>
186187
<span class="n">summary</span><span class="p">[</span><span class="s1">&#39;nodes&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">nodes</span>
187188

188-
<span class="k">return</span> <span class="n">summary</span></div></div>
189+
<span class="k">return</span> <span class="n">summary</span></div>
190+
191+
<span class="k">def</span> <span class="nf">get_cluster_tasks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cluster_name</span><span class="p">):</span>
192+
<span class="n">connection</span> <span class="o">=</span> <span class="n">ConnectionService</span><span class="p">()</span><span class="o">.</span><span class="n">get_connection</span><span class="p">(</span><span class="n">cluster_name</span><span class="p">)</span>
193+
<span class="k">return</span> <span class="n">connection</span><span class="o">.</span><span class="n">cluster</span><span class="o">.</span><span class="n">pending_tasks</span><span class="p">(</span><span class="n">request_timeout</span><span class="o">=</span><span class="n">REQUEST_TIMEOUT</span><span class="p">)</span></div>
189194
</pre></div>
190195

191196
</div>

docs/_modules/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ <h1>All modules for which code is available</h1>
113113
<ul><li><a href="elastichq/common/api_response.html">elastichq.common.api_response</a></li>
114114
<li><a href="elastichq/common/exceptions.html">elastichq.common.exceptions</a></li>
115115
<li><a href="elastichq/model/ClusterModel.html">elastichq.model.ClusterModel</a></li>
116-
<li><a href="elastichq/service/ClusterService.html">elastichq.service.ClusterService</a></li>
117116
</ul>
118117

119118
</div>

docs/_sources/developer-guide.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ For Developers
66
:depth: 3
77
:local:
88

9+
Contributing
10+
------------
11+
12+
Please read the `Contributing guidelines <https://github.com/ElasticHQ/elasticsearch-HQ/blob/master/CONTRIBUTING.md>`_ before working on a pull request.
13+
914
Building Pre-Releases
1015
---------------------
1116

@@ -65,6 +70,12 @@ Notes
6570
Building Documentation
6671
----------------------
6772

73+
Sphinx requires specific libraries that are not in the default ``requirements.txt``.
74+
75+
First install the sphinx requirements: ``pip install -r sphinx-requirements.txt``
76+
77+
To generate the documentation:
78+
6879
``./sphinx-build -b html /path/to/docs/source /path/to/docs``
6980

7081
HTTP Responses

docs/_sources/faq.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ How do I...
2020
You can access the REST API under http://localhost:5000/api
2121

2222
Using ElasticHQ with...
23-
--------------------
23+
-----------------------
2424

2525
X-Pack
2626
We have added instructions on X-Pack authentication, see :any:`xpack integration`.

docs/_sources/installation.txt

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ Install ElasticHQ
3131

3232
.. note:: Alternatively, you can start the server with ``python manage.py runserver``
3333

34+
Docker Images
35+
^^^^^^^^^^^^^
36+
37+
Docker images are offered on the `ElasticHQ Dockerhub <https://hub.docker.com/r/elastichq/elasticsearch-hq/>`_.
38+
39+
The ``latest`` tag deploys the latest stable release. Where ``develop`` is the latest unstable working branch.
40+
3441
Pre-Releases
3542
^^^^^^^^^^^^
3643

@@ -87,10 +94,21 @@ ElasticHQ ships with SQLLite integration to store clusters you have connected to
8794

8895
.. note:: In the event you want to start with a clean slate, simply delete the ``elastichq.db`` file. ElasticHQ will recreate it at next startup.
8996

90-
Directory Structure
91-
^^^^^^^^^^^^^^^^^^^
97+
Startup Parameters
98+
^^^^^^^^^^^^^^^^^^
99+
100+
The ``application.py`` start script takes parameters passed in as arguments from the command line:
101+
102+
103+
104+
=========== ============== ====================================================================
105+
Arg Default Value Definition
106+
=========== ============== ====================================================================
107+
``--host`` 127.0.0.1 Host the HQ server should be reachable on.
108+
``--port`` 5000 Port to reach HQ server.
109+
``--debug`` False If True, exposes debug data to UI and causes reload on code changes.
110+
=========== ============== ====================================================================
92111

93-
TODO
94112

95113
Upgrading
96114
---------
@@ -127,6 +145,24 @@ Upgrading Minor and Patch versions
127145
3. (Re)Start the server: ``python application.py``
128146
4. Point your browser to: http://localhost:5000
129147

148+
149+
Running in Production
150+
---------------------
151+
152+
We advise that under any considerable usage/load, this application should be run with a multithreaded server. The current flask implemenation by itself should not be run in production without this, as it is a single-threaded process.
153+
154+
We recommend running this WSGI application with gunicorn. Install gunicorn by either commenting out the line in the ``requirements.txt`` file or simply running ``pip install gunicorn``
155+
156+
In console, run gunicorn with:
157+
158+
``gunicorn -w 1 -b :5000 --worker-class eventlet application:application``
159+
160+
The application will be accessible under http://127.0.0.1:5000
161+
162+
Read the `Gunicorn Docs <http://docs.gunicorn.org/en/stable/configure.html>`_ for further command line options.
163+
164+
.. note:: For the *Metrics* section to broadcast via websocket, you must have gunicorn set to 1 worker.
165+
130166
License
131167
-------
132168

docs/_static/basic.css

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ div.sphinxsidebar {
5252
width: 230px;
5353
margin-left: -100%;
5454
font-size: 90%;
55+
word-wrap: break-word;
56+
overflow-wrap : break-word;
5557
}
5658

5759
div.sphinxsidebar ul {
@@ -83,10 +85,6 @@ div.sphinxsidebar #searchbox input[type="text"] {
8385
width: 170px;
8486
}
8587

86-
div.sphinxsidebar #searchbox input[type="submit"] {
87-
width: 30px;
88-
}
89-
9088
img {
9189
border: 0;
9290
max-width: 100%;
@@ -187,6 +185,13 @@ div.genindex-jumpbox {
187185

188186
/* -- general body styles --------------------------------------------------- */
189187

188+
div.body p, div.body dd, div.body li, div.body blockquote {
189+
-moz-hyphens: auto;
190+
-ms-hyphens: auto;
191+
-webkit-hyphens: auto;
192+
hyphens: auto;
193+
}
194+
190195
a.headerlink {
191196
visibility: hidden;
192197
}
@@ -489,6 +494,13 @@ pre {
489494
overflow-y: hidden; /* fixes display issues on Chrome browsers */
490495
}
491496

497+
span.pre {
498+
-moz-hyphens: none;
499+
-ms-hyphens: none;
500+
-webkit-hyphens: none;
501+
hyphens: none;
502+
}
503+
492504
td.linenos pre {
493505
padding: 5px 0px;
494506
border: 0;

0 commit comments

Comments
 (0)