Skip to content

Commit 1936f4a

Browse files
committed
Merge branch 'release/v3.5.0'
2 parents e7ee485 + 2913674 commit 1936f4a

Some content is hidden

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

42 files changed

+2280
-1993
lines changed

Dockerfile

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
11
FROM python:3.6-alpine3.7
22

3-
RUN apk update
4-
RUN apk add supervisor
5-
RUN apk add --update py2-pip
6-
73
# Upgrade and install basic Python dependencies
84
# This block added because of the trouble installing gevent on many systems
95
# 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
17-
18-
# reqs layer
19-
ADD requirements.txt .
20-
RUN pip3 install -U -r requirements.txt
21-
RUN pip3 install gunicorn==19.7.1
22-
23-
# Bundle app source
24-
ADD . /src
25-
26-
COPY ./deployment/logging.conf /src/logging.conf
27-
COPY ./deployment/gunicorn.conf /src/gunicorn.conf
28-
6+
RUN apk update && \
7+
apk add supervisor && \
8+
apk add --update py2-pip && \
9+
apk add --no-cache bash && \
10+
apk add --no-cache --virtual .build-deps bzip2-dev gcc libc-dev
11+
12+
# Copy project sources
13+
COPY . /src
14+
15+
# Set working directory
16+
WORKDIR /src
17+
18+
# Install app dependencies and create supervisord dirs
19+
RUN pip3 install -U -r requirements.txt && \
20+
pip3 install gunicorn==19.7.1 && \
21+
mkdir -p /etc/supervisor/conf.d /var/log/supervisor /var/run/supervisor
22+
23+
# Copy configuration files
24+
RUN cp /src/deployment/logging.conf /src/logging.conf && \
25+
cp /src/deployment/gunicorn.conf /src/gunicorn.conf && \
26+
cp /src/deployment/supervisord.conf /etc/supervisor/supervisord.conf && \
27+
cp /src/deployment/gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf
28+
29+
# Fix permissions
30+
RUN chgrp -R 0 /src /var/log/supervisor /var/run/supervisor && \
31+
chmod -R g=u /src /var/log/supervisor /var/run/supervisor
32+
33+
# Expose service port
2934
EXPOSE 5000
3035

31-
# Setup supervisord
32-
RUN mkdir -p /var/log/supervisor
33-
COPY ./deployment/supervisord.conf /etc/supervisor/supervisord.conf
34-
COPY ./deployment/gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf
35-
3636
# Start processes
3737
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
38-
39-
40-
#ENTRYPOINT ["python"]
41-
#CMD ["src/application.py"]

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Simplified Monitoring and Management for ElasticSearch clusters.
1212

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

15-
15+
1616
## Key Features
1717

1818
* Works with 2.x, 5.x, 6.x and current versions of Elasticsearch.
@@ -46,9 +46,12 @@ For further installation and configuration help, please read the docs: [ElasticH
4646

4747
## Docker Installation
4848

49-
We are hosted on Dockerhub: [ElasticHQ on Dockerhub](https://hub.docker.com/r/elastichq/elasticsearch-hq/)
49+
We are hosted on Dockerhub: [ElasticHQ on Dockerhub](https://hub.docker.com/r/elastichq/elasticsearch-hq/)
50+
51+
1. ``docker run -p 5000:5000 elastichq/elasticsearch-hq``
52+
2. Access HQ with: `` http://localhost:5000 ``
5053

51-
Please see relevant documentation: [Docker Images](http://docs.elastichq.org/installation.html#docker-images).
54+
For further instructions, please see relevant documentation: [Docker Images](http://docs.elastichq.org/installation.html#docker-images).
5255

5356
## Useful Links
5457

application.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# import argparse
22
import optparse
33
import os
4-
4+
import logging
5+
import logging.config
56
from elastichq import create_app
67
from elastichq.globals import socketio
8+
from elastichq.utils import find_config
79

810
default_host = '0.0.0.0'
911
default_port = 5000
@@ -45,7 +47,14 @@
4547
application.config['CA_CERTS'] = os.environ.get('HQ_CA_CERTS', options.ca_certs)
4648

4749
if is_gunicorn:
50+
if options.debug:
51+
config = find_config('logger_debug.json')
52+
logging.config.dictConfig(config)
53+
4854
# we set reloader False so gunicorn doesn't call two instances of all the Flask init functions.
4955
socketio.run(application, host=options.host, port=options.port, debug=options.debug, use_reloader=False)
5056
else:
57+
if options.debug:
58+
config = find_config('logger_debug.json')
59+
logging.config.dictConfig(config)
5160
socketio.run(application, host=options.host, port=options.port, debug=options.debug)

deployment/supervisord.conf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
[supervisord]
22
nodaemon=true
3+
logfile=/var/log/supervisor/supervisord.log
4+
pidfile=/var/run/supervisor/supervisord.pid
35

46
[program:gunicorn]
57
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
68
directory=/src
7-
stdout_logfile=/var/log/supervisor/stdout.log
8-
stderr_logfile=/var/log/supervisor/stderr.log
9+
# Uncomment the following lines and comment those after if you want to
10+
# save stdout and stderr logs in seperate files.
11+
# stdout_logfile=/var/log/supervisor/elastichq_stdout.log
12+
# stderr_logfile=/var/log/supervisor/elastichq_stderr.log
13+
stdout_logfile=/dev/fd/1
14+
stdout_logfile_maxbytes=0
15+
redirect_stderr=true

docs/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: fd1e7fa5cfedfe6f8f3e6bb6c5e9d514
3+
config: 975bbf0704e836cd18ad12bc8c255959
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
531 Bytes
Binary file not shown.

docs/.doctrees/environment.pickle

4.69 KB
Binary file not shown.

docs/.doctrees/faq.doctree

151 Bytes
Binary file not shown.

docs/.doctrees/index.doctree

167 Bytes
Binary file not shown.
2.45 KB
Binary file not shown.

0 commit comments

Comments
 (0)