Merge lp:~nataliabidart/magicicada-server/use-venv-dependencies into lp:magicicada-server
- use-venv-dependencies
- Merge into trunk
Proposed by
Natalia Bidart
Status: | Merged |
---|---|
Approved by: | Natalia Bidart |
Approved revision: | 92 |
Merged at revision: | 86 |
Proposed branch: | lp:~nataliabidart/magicicada-server/use-venv-dependencies |
Merge into: | lp:magicicada-server |
Diff against target: |
1048 lines (+186/-427) 29 files modified
.bzrignore (+1/-2) .travis.yml (+7/-7) Dockerfile (+15/-0) Makefile (+48/-56) README.rst (+0/-6) config-manager.txt (+0/-4) dependencies-devel.txt (+5/-10) dependencies.txt (+1/-15) dev-scripts/check_readme.sh (+0/-8) dev-scripts/cmd_client.py (+2/-6) dev-scripts/dev_launcher.py (+0/-87) dev-scripts/sd_test.sh (+0/-29) dev-scripts/start-dbus.sh (+0/-1) dev-scripts/stop-dbus.sh (+1/-2) dev-scripts/supervisor-config-dev.py (+57/-13) dev-scripts/supervisor-dev.conf.tpl (+5/-5) dev-scripts/supervisor_templates.py (+0/-65) dev-scripts/supervisorctl-dev (+0/-6) lib/ubuntuone/supervisor/config_helpers.py (+3/-1) lib/ubuntuone/supervisor/heartbeat_listener.py (+1/-1) lib/ubuntuone/supervisor/start-supervisord.py (+7/-5) magicicada/metrics/services.py (+0/-34) magicicada/metrics/tests/test_services.py (+0/-38) magicicada/server/server.py (+3/-12) magicicada/server/ssl_proxy.py (+2/-2) magicicada/server/tests/test_basic.py (+0/-9) requirements-devel.txt (+8/-0) requirements.txt (+17/-0) test (+3/-3) |
To merge this branch: | bzr merge lp:~nataliabidart/magicicada-server/use-venv-dependencies |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Facundo Batista | Approve | ||
Review via email: mp+342653@code.launchpad.net |
Commit message
- Use devel and non-devel dependencies from a virtualenv.
- Clean former usage of revno from versioninfo.
- Provide travis and docker files so tests can be run in Travis using a xenial image.
Description of the change
To post a comment you must log in.
- 92. By Natalia Bidart
-
One extra iteration of cleaning:
- use the storageprotocol from the wheel (dropping build deps for it)
- check the readme.rst with a Makefile file without needing a bash script
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2016-07-13 22:18:34 +0000 | |||
3 | +++ .bzrignore 2018-04-12 02:08:49 +0000 | |||
4 | @@ -1,5 +1,4 @@ | |||
7 | 1 | env | 1 | .env |
6 | 2 | lib/versioninfo.py | ||
8 | 3 | tmp/* | 2 | tmp/* |
9 | 4 | twistd.pid | 3 | twistd.pid |
10 | 5 | .sourcecode/* | 4 | .sourcecode/* |
11 | 6 | 5 | ||
12 | === modified file '.travis.yml' | |||
13 | --- .travis.yml 2016-09-01 17:10:04 +0000 | |||
14 | +++ .travis.yml 2018-04-12 02:08:49 +0000 | |||
15 | @@ -1,13 +1,13 @@ | |||
18 | 1 | addons: | 1 | sudo: required |
19 | 2 | postgresql: "9.5" | 2 | dist: trusty |
20 | 3 | language: bash | ||
21 | 3 | 4 | ||
22 | 4 | services: | 5 | services: |
24 | 5 | - postgresql | 6 | - docker |
25 | 6 | 7 | ||
26 | 7 | before_install: | 8 | before_install: |
29 | 8 | - sudo apt-get update | 9 | - docker pull ubuntu:16.04 |
30 | 9 | - make bootstrap | 10 | - docker build -t magicicada-test-run . |
31 | 10 | 11 | ||
32 | 11 | script: | 12 | script: |
35 | 12 | - make clean-sourcedeps | 13 | - docker run magicicada-test-run make test SOURCEDEPS_DIR=sourcedeps |
34 | 13 | - make test SOURCEDEPS_DIR=sourcedeps | ||
36 | 14 | 14 | ||
37 | === added file 'Dockerfile' | |||
38 | --- Dockerfile 1970-01-01 00:00:00 +0000 | |||
39 | +++ Dockerfile 2018-04-12 02:08:49 +0000 | |||
40 | @@ -0,0 +1,15 @@ | |||
41 | 1 | FROM ubuntu:16.04 | ||
42 | 2 | |||
43 | 3 | ADD . /home/ubuntu/magicicada | ||
44 | 4 | COPY . /home/ubuntu/magicicada | ||
45 | 5 | WORKDIR /home/ubuntu/magicicada | ||
46 | 6 | |||
47 | 7 | RUN apt-get update && apt-get install make -y | ||
48 | 8 | RUN make docker-bootstrap | ||
49 | 9 | |||
50 | 10 | RUN useradd -ms /bin/bash ubuntu | ||
51 | 11 | RUN chown -R ubuntu:ubuntu /home/ubuntu | ||
52 | 12 | |||
53 | 13 | USER ubuntu | ||
54 | 14 | ENV HOME /home/ubuntu | ||
55 | 15 | ENV PG_HOST /home/ubuntu/pg_data | ||
56 | 0 | 16 | ||
57 | === modified file 'Makefile' | |||
58 | --- Makefile 2018-04-05 20:57:19 +0000 | |||
59 | +++ Makefile 2018-04-12 02:08:49 +0000 | |||
60 | @@ -17,11 +17,11 @@ | |||
61 | 17 | # For further info, check http://launchpad.net/magicicada-server | 17 | # For further info, check http://launchpad.net/magicicada-server |
62 | 18 | 18 | ||
63 | 19 | DJANGO_SETTINGS_MODULE ?= magicicada.settings | 19 | DJANGO_SETTINGS_MODULE ?= magicicada.settings |
66 | 20 | FLAKE8 = flake8 | 20 | ENV = $(CURDIR)/.env |
67 | 21 | PYTHON = python | 21 | PYTHON = $(ENV)/bin/python |
68 | 22 | SRC_DIR = $(CURDIR)/magicicada | 22 | SRC_DIR = $(CURDIR)/magicicada |
69 | 23 | LIB_DIR = $(CURDIR)/lib | 23 | LIB_DIR = $(CURDIR)/lib |
71 | 24 | ENV = $(CURDIR)/env | 24 | PATH := $(ENV)/bin:$(PATH) |
72 | 25 | PYTHONPATH := $(SRC_DIR):$(LIB_DIR):$(CURDIR):$(PYTHONPATH) | 25 | PYTHONPATH := $(SRC_DIR):$(LIB_DIR):$(CURDIR):$(PYTHONPATH) |
73 | 26 | DJANGO_ADMIN = $(LIB_DIR)/django/bin/django-admin.py | 26 | DJANGO_ADMIN = $(LIB_DIR)/django/bin/django-admin.py |
74 | 27 | DJANGO_MANAGE = $(PYTHON) manage.py | 27 | DJANGO_MANAGE = $(PYTHON) manage.py |
75 | @@ -32,7 +32,9 @@ | |||
76 | 32 | PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2 | 32 | PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2 |
77 | 33 | 33 | ||
78 | 34 | START_SUPERVISORD = lib/ubuntuone/supervisor/start-supervisord.py | 34 | START_SUPERVISORD = lib/ubuntuone/supervisor/start-supervisord.py |
79 | 35 | SUPERVISOR_CTL = $(ENV)/bin/supervisorctl | ||
80 | 35 | 36 | ||
81 | 37 | export PATH | ||
82 | 36 | export PYTHONPATH | 38 | export PYTHONPATH |
83 | 37 | export DJANGO_SETTINGS_MODULE | 39 | export DJANGO_SETTINGS_MODULE |
84 | 38 | export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION | 40 | export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION |
85 | @@ -44,8 +46,6 @@ | |||
86 | 44 | SOURCEDEPS_SOURCECODE_DIR = $(SOURCEDEPS_DIR)/sourcecode | 46 | SOURCEDEPS_SOURCECODE_DIR = $(SOURCEDEPS_DIR)/sourcecode |
87 | 45 | TARGET_SOURCECODE_DIR = $(CURDIR)/.sourcecode | 47 | TARGET_SOURCECODE_DIR = $(CURDIR)/.sourcecode |
88 | 46 | 48 | ||
89 | 47 | BUILD_DEPLOY_SOURCEDEPS=magicicada-protocol | ||
90 | 48 | |||
91 | 49 | TESTFLAGS= | 49 | TESTFLAGS= |
92 | 50 | 50 | ||
93 | 51 | TAR_EXTRA = --exclude 'tmp/*' --exclude tags | 51 | TAR_EXTRA = --exclude 'tmp/*' --exclude tags |
94 | @@ -65,53 +65,49 @@ | |||
95 | 65 | ifndef EXPORT_FROM_BZR | 65 | ifndef EXPORT_FROM_BZR |
96 | 66 | $(MAKE) link-sourcedeps | 66 | $(MAKE) link-sourcedeps |
97 | 67 | endif | 67 | endif |
98 | 68 | $(MAKE) build-sourcedeps | ||
99 | 69 | touch $(SOURCEDEPS_TAG) | 68 | touch $(SOURCEDEPS_TAG) |
100 | 70 | 69 | ||
101 | 71 | build: link-sourcedeps build-sourcedeps version | ||
102 | 72 | |||
103 | 73 | link-sourcedeps: | 70 | link-sourcedeps: |
104 | 74 | @echo "Checking out external source dependencies..." | 71 | @echo "Checking out external source dependencies..." |
105 | 75 | dev-scripts/link-external-sourcecode -p $(SOURCEDEPS_SOURCECODE_DIR)/ \ | 72 | dev-scripts/link-external-sourcecode -p $(SOURCEDEPS_SOURCECODE_DIR)/ \ |
106 | 76 | -t $(TARGET_SOURCECODE_DIR) -c config-manager.txt | 73 | -t $(TARGET_SOURCECODE_DIR) -c config-manager.txt |
107 | 77 | 74 | ||
113 | 78 | # no need to link sourcedeps before building them, as rollout process | 75 | build-clientdefs: |
109 | 79 | # handles config-manager.txt automatically | ||
110 | 80 | build-for-deployment: build-deploy-sourcedeps version | ||
111 | 81 | |||
112 | 82 | build-sourcedeps: build-deploy-sourcedeps | ||
114 | 83 | @echo "Building client clientdefs.py" | 76 | @echo "Building client clientdefs.py" |
116 | 84 | @cd .sourcecode/magicicada-client/ubuntuone/ && sed \ | 77 | @cd $(TARGET_SOURCECODE_DIR)/magicicada-client/ubuntuone/ && sed \ |
117 | 85 | -e 's|\@localedir\@|/usr/local/share/locale|g' \ | 78 | -e 's|\@localedir\@|/usr/local/share/locale|g' \ |
118 | 86 | -e 's|\@libexecdir\@|/usr/local/libexec|g' \ | 79 | -e 's|\@libexecdir\@|/usr/local/libexec|g' \ |
119 | 87 | -e 's|\@GETTEXT_PACKAGE\@|ubuntuone-client|g' \ | 80 | -e 's|\@GETTEXT_PACKAGE\@|ubuntuone-client|g' \ |
120 | 88 | -e 's|\@VERSION\@|0.0.0|g' < clientdefs.py.in > clientdefs.py | 81 | -e 's|\@VERSION\@|0.0.0|g' < clientdefs.py.in > clientdefs.py |
121 | 89 | 82 | ||
122 | 90 | build-deploy-sourcedeps: | ||
123 | 91 | @echo "Building Python extensions" | ||
124 | 92 | |||
125 | 93 | @for sourcedep in $(BUILD_DEPLOY_SOURCEDEPS) ; do \ | ||
126 | 94 | d=".sourcecode/$$sourcedep" ; \ | ||
127 | 95 | if test -e "$$d/setup.py" ; then \ | ||
128 | 96 | (cd "$$d" && $(PYTHON) \ | ||
129 | 97 | setup.py build build_ext --inplace > /dev/null) ; \ | ||
130 | 98 | fi ; \ | ||
131 | 99 | done | ||
132 | 100 | |||
133 | 101 | @echo "Generating twistd plugin cache" | ||
134 | 102 | @$(PYTHON) -c "from twisted.plugin import IPlugin, getPlugins; list(getPlugins(IPlugin));" | ||
135 | 103 | |||
136 | 104 | tarball: build-for-deployment | ||
137 | 105 | tar czf ../filesync-server.tgz $(TAR_EXTRA) . | ||
138 | 106 | |||
139 | 107 | bootstrap: | 83 | bootstrap: |
140 | 108 | cat dependencies.txt | sudo xargs apt-get install -y --no-install-recommends | 84 | cat dependencies.txt | sudo xargs apt-get install -y --no-install-recommends |
141 | 109 | cat dependencies-devel.txt | sudo xargs apt-get install -y --no-install-recommends | 85 | cat dependencies-devel.txt | sudo xargs apt-get install -y --no-install-recommends |
142 | 86 | $(MAKE) $(ENV) | ||
143 | 87 | $(MAKE) sourcedeps build-clientdefs | ||
144 | 88 | mkdir -p tmp | ||
145 | 89 | |||
146 | 90 | docker-bootstrap: clean | ||
147 | 91 | cat dependencies.txt | xargs apt-get install -y --no-install-recommends | ||
148 | 92 | cat dependencies-devel.txt | xargs apt-get install -y --no-install-recommends | ||
149 | 93 | $(MAKE) $(ENV) | ||
150 | 94 | $(MAKE) sourcedeps build-clientdefs | ||
151 | 95 | mkdir -p tmp | ||
152 | 96 | |||
153 | 97 | $(ENV): $(ENV)/bin/activate | ||
154 | 98 | |||
155 | 99 | # only runs when requirements.txt or requirements-devel.txt changes | ||
156 | 100 | $(ENV)/bin/activate: requirements.txt requirements-devel.txt | ||
157 | 101 | test -d $(ENV) || virtualenv $(ENV) | ||
158 | 102 | $(ENV)/bin/pip install -Ur requirements.txt | ||
159 | 103 | $(ENV)/bin/pip install -Ur requirements-devel.txt | ||
160 | 104 | $(ENV)/bin/pip install ubuntuone-storageprotocol --no-deps -t $(TARGET_SOURCECODE_DIR) | ||
161 | 105 | touch $(ENV)/bin/activate | ||
162 | 110 | 106 | ||
163 | 111 | raw-test: | 107 | raw-test: |
165 | 112 | ./test $(TESTFLAGS) | 108 | $(PYTHON) test $(TESTFLAGS) |
166 | 113 | 109 | ||
168 | 114 | test: lint sourcedeps clean version start-db start-base start-dbus raw-test stop | 110 | test: lint sourcedeps start-db start-base start-dbus raw-test stop |
169 | 115 | 111 | ||
170 | 116 | ci-test: | 112 | ci-test: |
171 | 117 | $(MAKE) test TESTFLAGS="-1 $(TESTFLAGS)" | 113 | $(MAKE) test TESTFLAGS="-1 $(TESTFLAGS)" |
172 | @@ -119,16 +115,13 @@ | |||
173 | 119 | clean: | 115 | clean: |
174 | 120 | rm -rf tmp/* _trial_temp $(ENV) | 116 | rm -rf tmp/* _trial_temp $(ENV) |
175 | 121 | 117 | ||
179 | 122 | lint: | 118 | check-readme: |
180 | 123 | virtualenv $(ENV) | 119 | $(ENV)/bin/rst2html5 README.rst --exit-status=warning > /dev/null && echo "README.rst OK"|| ( echo "ERROR: README.rst format is incorrect!!!!!" && exit 1) |
181 | 124 | $(ENV)/bin/pip install flake8 rst2html5 | 120 | |
182 | 121 | lint: $(ENV) check-readme | ||
183 | 125 | $(ENV)/bin/flake8 --filename='*.py' --exclude='migrations' $(SRC_DIR) | 122 | $(ENV)/bin/flake8 --filename='*.py' --exclude='migrations' $(SRC_DIR) |
190 | 126 | dev-scripts/check_readme.sh | 123 | |
191 | 127 | 124 | start: $(ENV) start-base start-filesync-server-group publish-api-port | |
186 | 128 | version: | ||
187 | 129 | bzr version-info --format=python > lib/versioninfo.py || true | ||
188 | 130 | |||
189 | 131 | start: build start-base start-filesync-server-group publish-api-port | ||
192 | 132 | 125 | ||
193 | 133 | resume: start-base start-filesync-server-group | 126 | resume: start-base start-filesync-server-group |
194 | 134 | 127 | ||
195 | @@ -138,7 +131,7 @@ | |||
196 | 138 | start-base: | 131 | start-base: |
197 | 139 | $(MAKE) start-supervisor && $(MAKE) start-dbus || ( $(MAKE) stop ; exit 1 ) | 132 | $(MAKE) start-supervisor && $(MAKE) start-dbus || ( $(MAKE) stop ; exit 1 ) |
198 | 140 | 133 | ||
200 | 141 | stop: stop-filesync-dummy-group stop-supervisor stop-dbus | 134 | stop: stop-supervisor stop-dbus |
201 | 142 | 135 | ||
202 | 143 | start-dbus: | 136 | start-dbus: |
203 | 144 | dev-scripts/start-dbus.sh | 137 | dev-scripts/start-dbus.sh |
204 | @@ -147,28 +140,28 @@ | |||
205 | 147 | dev-scripts/stop-dbus.sh | 140 | dev-scripts/stop-dbus.sh |
206 | 148 | 141 | ||
207 | 149 | start-supervisor: | 142 | start-supervisor: |
209 | 150 | @python dev-scripts/supervisor-config-dev.py | 143 | $(PYTHON) dev-scripts/supervisor-config-dev.py |
210 | 151 | -@$(START_SUPERVISORD) dev-scripts/supervisor-dev.conf.tpl | 144 | -@$(START_SUPERVISORD) dev-scripts/supervisor-dev.conf.tpl |
211 | 152 | 145 | ||
212 | 153 | stop-supervisor: | 146 | stop-supervisor: |
214 | 154 | -@dev-scripts/supervisorctl-dev shutdown | 147 | $(SUPERVISOR_CTL) -c $(CURDIR)/tmp/supervisor-dev.conf shutdown |
215 | 155 | 148 | ||
216 | 156 | start-%-group: | 149 | start-%-group: |
218 | 157 | -@dev-scripts/supervisorctl-dev start $*: | 150 | $(SUPERVISOR_CTL) -c $(CURDIR)/tmp/supervisor-dev.conf start $*: |
219 | 158 | 151 | ||
220 | 159 | stop-%-group: | 152 | stop-%-group: |
222 | 160 | -@dev-scripts/supervisorctl-dev stop $*: | 153 | $(SUPERVISOR_CTL) -c $(CURDIR)/tmp/supervisor-dev.conf stop $*: |
223 | 161 | 154 | ||
224 | 162 | start-%: | 155 | start-%: |
226 | 163 | -@dev-scripts/supervisorctl-dev start $* | 156 | $(SUPERVISOR_CTL) -c $(CURDIR)/tmp/supervisor-dev.conf start $* |
227 | 164 | 157 | ||
228 | 165 | stop-%: | 158 | stop-%: |
230 | 166 | -@dev-scripts/supervisorctl-dev stop $* | 159 | $(SUPERVISOR_CTL) -c $(CURDIR)/tmp/supervisor-dev.conf stop $* |
231 | 167 | 160 | ||
232 | 168 | publish-api-port: | 161 | publish-api-port: |
236 | 169 | python -c 'from magicicada import settings; print >> file("tmp/filesyncserver.port", "w"), settings.TCP_PORT' | 162 | $(PYTHON) -c 'from magicicada import settings; print >> file("tmp/filesyncserver.port", "w"), settings.TCP_PORT' |
237 | 170 | python -c 'from magicicada import settings; print >> file("tmp/filesyncserver.port.ssl", "w"), settings.SSL_PORT' | 163 | $(PYTHON) -c 'from magicicada import settings; print >> file("tmp/filesyncserver.port.ssl", "w"), settings.SSL_PORT' |
238 | 171 | python -c 'from magicicada import settings; print >> file("tmp/filesyncserver-status.port", "w"), settings.API_STATUS_PORT' | 164 | $(PYTHON) -c 'from magicicada import settings; print >> file("tmp/filesyncserver-status.port", "w"), settings.API_STATUS_PORT' |
239 | 172 | 165 | ||
240 | 173 | shell: | 166 | shell: |
241 | 174 | $(DJANGO_MANAGE) shell | 167 | $(DJANGO_MANAGE) shell |
242 | @@ -179,7 +172,6 @@ | |||
243 | 179 | admin: | 172 | admin: |
244 | 180 | $(DJANGO_ADMIN) $(ARGS) | 173 | $(DJANGO_ADMIN) $(ARGS) |
245 | 181 | 174 | ||
250 | 182 | .PHONY: sourcedeps link-sourcedeps build-sourcedeps build-deploy-sourcedeps \ | 175 | .PHONY: sourcedeps link-sourcedeps clean lint test ci-test clean-sourcedeps \ |
251 | 183 | build clean version lint test ci-test build-for-deployment \ | 176 | start stop publish-api-port start-supervisor stop-supervisor \ |
252 | 184 | clean-sourcedeps tarball start stop publish-api-port start-supervisor \ | 177 | start-dbus stop-dbus start-heapy check-readme |
249 | 185 | stop-supervisor start-dbus stop-dbus start-heapy | ||
253 | 186 | 178 | ||
254 | === modified file 'README.rst' | |||
255 | --- README.rst 2017-04-22 21:07:36 +0000 | |||
256 | +++ README.rst 2018-04-12 02:08:49 +0000 | |||
257 | @@ -75,12 +75,6 @@ | |||
258 | 75 | access):: | 75 | access):: |
259 | 76 | 76 | ||
260 | 77 | make bootstrap | 77 | make bootstrap |
261 | 78 | make sourcedeps | ||
262 | 79 | |||
263 | 80 | If you are in Xenial, please also install virtualenv (didn't include it in | ||
264 | 81 | the previous step as it doesn't exist as a separate package in older systems):: | ||
265 | 82 | |||
266 | 83 | sudo apt-get install virtualenv | ||
267 | 84 | 78 | ||
268 | 85 | Ensure the files 'privkey.pem' and 'cacert.pem' produced in the "Before server | 79 | Ensure the files 'privkey.pem' and 'cacert.pem' produced in the "Before server |
269 | 86 | or client" section are copied into the ~/magicicada/magicicada-server/certs | 80 | or client" section are copied into the ~/magicicada/magicicada-server/certs |
270 | 87 | 81 | ||
271 | === modified file 'config-manager.txt' | |||
272 | --- config-manager.txt 2018-04-05 20:57:19 +0000 | |||
273 | +++ config-manager.txt 2018-04-12 02:08:49 +0000 | |||
274 | @@ -21,9 +21,5 @@ | |||
275 | 21 | # | 21 | # |
276 | 22 | # make clean-sourcedeps sourcedeps | 22 | # make clean-sourcedeps sourcedeps |
277 | 23 | 23 | ||
278 | 24 | ./.sourcecode/configglue ~configglue/configglue/trunk;revno=1 | ||
279 | 25 | ./.sourcecode/dirspec ~ubuntuone-control-tower/dirspec/trunk;revno=14 | ||
280 | 26 | ./.sourcecode/django ~ubuntuone-pqm-team/django/stable;revno=17 | ||
281 | 27 | ./.sourcecode/u1sync ~facundo/u1sync/opensourcing;revno=10 | 24 | ./.sourcecode/u1sync ~facundo/u1sync/opensourcing;revno=10 |
282 | 28 | ./.sourcecode/magicicada-client ~chicharreros/magicicada-client/trunk;revno=1440 | 25 | ./.sourcecode/magicicada-client ~chicharreros/magicicada-client/trunk;revno=1440 |
283 | 29 | ./.sourcecode/magicicada-protocol ~chicharreros/magicicada-protocol/trunk;revno=169 | ||
284 | 30 | 26 | ||
285 | === modified file 'dependencies-devel.txt' | |||
286 | --- dependencies-devel.txt 2017-04-22 21:07:36 +0000 | |||
287 | +++ dependencies-devel.txt 2018-04-12 02:08:49 +0000 | |||
288 | @@ -1,12 +1,7 @@ | |||
289 | 1 | dbus | 1 | dbus |
291 | 2 | openssl | 2 | libcairo2-dev |
292 | 3 | libdbus-1-dev | ||
293 | 4 | libdbus-glib-1-dev | ||
294 | 5 | libgirepository1.0-dev | ||
295 | 6 | pkg-config | ||
296 | 3 | postgresql-client-9.5 | 7 | postgresql-client-9.5 |
297 | 4 | python-dbus | ||
298 | 5 | python-gobject | ||
299 | 6 | python-httplib2 | ||
300 | 7 | python-mock | ||
301 | 8 | python-mocker | ||
302 | 9 | python-pyinotify | ||
303 | 10 | python-testtools | ||
304 | 11 | python-twisted-names | ||
305 | 12 | python-virtualenv | ||
306 | 13 | 8 | ||
307 | === modified file 'dependencies.txt' | |||
308 | --- dependencies.txt 2017-04-22 21:07:36 +0000 | |||
309 | +++ dependencies.txt 2018-04-12 02:08:49 +0000 | |||
310 | @@ -4,19 +4,5 @@ | |||
311 | 4 | postgresql-9.5 | 4 | postgresql-9.5 |
312 | 5 | postgresql-contrib | 5 | postgresql-contrib |
313 | 6 | postgresql-plpython-9.5 | 6 | postgresql-plpython-9.5 |
314 | 7 | protobuf-compiler | ||
315 | 8 | python-boto | ||
316 | 9 | python-bson | ||
317 | 10 | python-dev | 7 | python-dev |
330 | 11 | python-iso8601 | 8 | virtualenv |
319 | 12 | python-meliae | ||
320 | 13 | python-openssl | ||
321 | 14 | python-protobuf | ||
322 | 15 | python-psutil | ||
323 | 16 | python-psycopg2 | ||
324 | 17 | python-setuptools | ||
325 | 18 | python-twisted-web | ||
326 | 19 | python-tz | ||
327 | 20 | python-virtualenv | ||
328 | 21 | python-yaml | ||
329 | 22 | supervisor | ||
331 | 23 | 9 | ||
332 | === removed file 'dev-scripts/check_readme.sh' | |||
333 | --- dev-scripts/check_readme.sh 2015-12-27 22:18:59 +0000 | |||
334 | +++ dev-scripts/check_readme.sh 1970-01-01 00:00:00 +0000 | |||
335 | @@ -1,8 +0,0 @@ | |||
336 | 1 | #/bin/bash | ||
337 | 2 | |||
338 | 3 | OUTPUT=$(env/bin/rst2html5 README.rst 2>&1 >/dev/null) | ||
339 | 4 | if [ -n "$OUTPUT" ]; then | ||
340 | 5 | echo -e "README.rst format is incorrect!!!!!\n" | ||
341 | 6 | echo -e "Errors: \n$OUTPUT" | ||
342 | 7 | exit 1 | ||
343 | 8 | fi | ||
344 | 9 | 0 | ||
345 | === modified file 'dev-scripts/cmd_client.py' | |||
346 | --- dev-scripts/cmd_client.py 2018-04-05 20:57:19 +0000 | |||
347 | +++ dev-scripts/cmd_client.py 2018-04-12 02:08:49 +0000 | |||
348 | @@ -33,12 +33,8 @@ | |||
349 | 33 | from threading import Thread | 33 | from threading import Thread |
350 | 34 | from optparse import OptionParser | 34 | from optparse import OptionParser |
351 | 35 | 35 | ||
358 | 36 | try: | 36 | from twisted.internet import gireactor |
359 | 37 | from twisted.internet import gireactor | 37 | gireactor.install() |
354 | 38 | gireactor.install() | ||
355 | 39 | except ImportError: | ||
356 | 40 | from twisted.internet import glib2reactor | ||
357 | 41 | glib2reactor.install() | ||
360 | 42 | 38 | ||
361 | 43 | from dbus.mainloop.glib import DBusGMainLoop | 39 | from dbus.mainloop.glib import DBusGMainLoop |
362 | 44 | DBusGMainLoop(set_as_default=True) | 40 | DBusGMainLoop(set_as_default=True) |
363 | 45 | 41 | ||
364 | === removed file 'dev-scripts/dev_launcher.py' | |||
365 | --- dev-scripts/dev_launcher.py 2018-04-05 20:58:20 +0000 | |||
366 | +++ dev-scripts/dev_launcher.py 1970-01-01 00:00:00 +0000 | |||
367 | @@ -1,87 +0,0 @@ | |||
368 | 1 | #!/usr/bin/env python | ||
369 | 2 | |||
370 | 3 | # Copyright 2008-2015 Canonical | ||
371 | 4 | # Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros) | ||
372 | 5 | # | ||
373 | 6 | # This program is free software: you can redistribute it and/or modify | ||
374 | 7 | # it under the terms of the GNU Affero General Public License as | ||
375 | 8 | # published by the Free Software Foundation, either version 3 of the | ||
376 | 9 | # License, or (at your option) any later version. | ||
377 | 10 | # | ||
378 | 11 | # This program is distributed in the hope that it will be useful, | ||
379 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
380 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
381 | 14 | # GNU Affero General Public License for more details. | ||
382 | 15 | # | ||
383 | 16 | # You should have received a copy of the GNU Affero General Public License | ||
384 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
385 | 18 | # | ||
386 | 19 | # For further info, check http://launchpad.net/magicicada-server | ||
387 | 20 | |||
388 | 21 | """Script to execute client stuff in dev environment.""" | ||
389 | 22 | |||
390 | 23 | import os | ||
391 | 24 | import sys | ||
392 | 25 | |||
393 | 26 | import _pythonpath | ||
394 | 27 | |||
395 | 28 | # fix environment before further imports | ||
396 | 29 | os.environ["DJANGO_SETTINGS_MODULE"] = "magicicada.settings" | ||
397 | 30 | |||
398 | 31 | from utilities import dev_launcher | ||
399 | 32 | |||
400 | 33 | |||
401 | 34 | def usage(): | ||
402 | 35 | """Return the usage.""" | ||
403 | 36 | return ("dev_launcher PROGNAME USERNAME [--machine=N] [args*]\n" | ||
404 | 37 | "runs PROGNAME with args plus:\n" | ||
405 | 38 | " --port with the local server port\n" | ||
406 | 39 | " --host localhost\n" | ||
407 | 40 | " --auth username and password for user USERNAME\n") | ||
408 | 41 | |||
409 | 42 | |||
410 | 43 | def main(args): | ||
411 | 44 | """run devlauncher""" | ||
412 | 45 | from optparse import OptionParser | ||
413 | 46 | if len(args) < 3: | ||
414 | 47 | print usage() | ||
415 | 48 | return | ||
416 | 49 | |||
417 | 50 | parser = OptionParser(usage=usage()) | ||
418 | 51 | parser.add_option('-p', '--port', dest='port', | ||
419 | 52 | help="The port to where connect") | ||
420 | 53 | parser.add_option('-t', '--host', dest='host', | ||
421 | 54 | help="The host to where connect") | ||
422 | 55 | parser.add_option('-a', '--auth', dest='auth', | ||
423 | 56 | help="Auth data") | ||
424 | 57 | parser.add_option('-m', '--machine', dest='machine', | ||
425 | 58 | help="Machine number (to have multiple launchers with " | ||
426 | 59 | "the same user)") | ||
427 | 60 | |||
428 | 61 | # check to see if we have extra params for the command to execute | ||
429 | 62 | if "--" in args: | ||
430 | 63 | pos = args.index("--") | ||
431 | 64 | params = args[pos + 1:] | ||
432 | 65 | args = args[:pos] | ||
433 | 66 | else: | ||
434 | 67 | params = [] | ||
435 | 68 | |||
436 | 69 | (options, pargs) = parser.parse_args(args[1:]) | ||
437 | 70 | progname, username = pargs | ||
438 | 71 | if options.machine: | ||
439 | 72 | machine_suffix = "_" + options.machine | ||
440 | 73 | else: | ||
441 | 74 | machine_suffix = None | ||
442 | 75 | |||
443 | 76 | lib_dir = _pythonpath.get_lib_dir() | ||
444 | 77 | d = dict( | ||
445 | 78 | PYTHONPATH=lib_dir, | ||
446 | 79 | XDG_CACHE_HOME="tmp/xdg_cache", | ||
447 | 80 | ) | ||
448 | 81 | |||
449 | 82 | dev_launcher.launch(progname, username, params, environ=d, verbose=True, | ||
450 | 83 | machine_suffix=machine_suffix, host=options.host, | ||
451 | 84 | api_port=options.port, auth_data=options.auth) | ||
452 | 85 | |||
453 | 86 | if __name__ == "__main__": | ||
454 | 87 | main(sys.argv) | ||
455 | 88 | 0 | ||
456 | === removed file 'dev-scripts/sd_test.sh' | |||
457 | --- dev-scripts/sd_test.sh 2018-04-05 20:57:19 +0000 | |||
458 | +++ dev-scripts/sd_test.sh 1970-01-01 00:00:00 +0000 | |||
459 | @@ -1,29 +0,0 @@ | |||
460 | 1 | #!/bin/bash | ||
461 | 2 | |||
462 | 3 | # Copyright 2008-2015 Canonical | ||
463 | 4 | # Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros) | ||
464 | 5 | # | ||
465 | 6 | # This program is free software: you can redistribute it and/or modify | ||
466 | 7 | # it under the terms of the GNU Affero General Public License as | ||
467 | 8 | # published by the Free Software Foundation, either version 3 of the | ||
468 | 9 | # License, or (at your option) any later version. | ||
469 | 10 | # | ||
470 | 11 | # This program is distributed in the hope that it will be useful, | ||
471 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
472 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
473 | 14 | # GNU Affero General Public License for more details. | ||
474 | 15 | # | ||
475 | 16 | # You should have received a copy of the GNU Affero General Public License | ||
476 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
477 | 18 | # | ||
478 | 19 | # For further info, check http://launchpad.net/magicicada-server | ||
479 | 20 | |||
480 | 21 | # run the minimal infraestructure to run the sdtests isolated from the current session | ||
481 | 22 | ROOTDIR=${ROOTDIR:-`bzr root`} | ||
482 | 23 | ADDRESS_FILE="${ROOTDIR}/tmp/dbus.address" | ||
483 | 24 | make start-dbus | ||
484 | 25 | env DEBUG="file $DEBUG" SERVER_DEBUG="$SERVER_DEBUG" ROOTDIR=$ROOTDIR DBUS_SESSION_BUS_ADDRESS=$(cat $ADDRESS_FILE) XDG_CACHE_HOME="${ROOTDIR}/tmp/xdg_cache" \ | ||
485 | 26 | ${PYTHON:-python} -Wignore ./test $@ | ||
486 | 27 | EXIT_VAL=$? | ||
487 | 28 | make stop-dbus | ||
488 | 29 | exit $EXIT_VAL | ||
489 | 30 | 0 | ||
490 | === modified file 'dev-scripts/start-dbus.sh' | |||
491 | --- dev-scripts/start-dbus.sh 2018-04-05 20:57:19 +0000 | |||
492 | +++ dev-scripts/start-dbus.sh 2018-04-12 02:08:49 +0000 | |||
493 | @@ -41,4 +41,3 @@ | |||
494 | 41 | exec 4>&- | 41 | exec 4>&- |
495 | 42 | 42 | ||
496 | 43 | echo "DBUS_SESSION_BUS_ADDRESS=$(cat $ADDRESS_FILE)" | 43 | echo "DBUS_SESSION_BUS_ADDRESS=$(cat $ADDRESS_FILE)" |
497 | 44 | |||
498 | 45 | 44 | ||
499 | === modified file 'dev-scripts/stop-dbus.sh' | |||
500 | --- dev-scripts/stop-dbus.sh 2018-04-05 20:57:19 +0000 | |||
501 | +++ dev-scripts/stop-dbus.sh 2018-04-12 02:08:49 +0000 | |||
502 | @@ -23,7 +23,6 @@ | |||
503 | 23 | ADDRESS_FILE="${ROOTDIR}/tmp/dbus.address" | 23 | ADDRESS_FILE="${ROOTDIR}/tmp/dbus.address" |
504 | 24 | 24 | ||
505 | 25 | /sbin/start-stop-daemon -v --stop --oknodo --pidfile $PID_FILE | 25 | /sbin/start-stop-daemon -v --stop --oknodo --pidfile $PID_FILE |
507 | 26 | kill `cat $PID_FILE` | 26 | kill `cat $PID_FILE` || true |
508 | 27 | # cleanup the files created on start | 27 | # cleanup the files created on start |
509 | 28 | rm -f $PID_FILE $ADDRESS_FILE | 28 | rm -f $PID_FILE $ADDRESS_FILE |
510 | 29 | |||
511 | 30 | 29 | ||
512 | === modified file 'dev-scripts/supervisor-config-dev.py' | |||
513 | --- dev-scripts/supervisor-config-dev.py 2018-04-05 20:57:19 +0000 | |||
514 | +++ dev-scripts/supervisor-config-dev.py 2018-04-12 02:08:49 +0000 | |||
515 | @@ -20,24 +20,68 @@ | |||
516 | 20 | 20 | ||
517 | 21 | import os | 21 | import os |
518 | 22 | import socket | 22 | import socket |
519 | 23 | import sys | ||
520 | 23 | 24 | ||
521 | 24 | import _pythonpath # NOQA | 25 | import _pythonpath # NOQA |
522 | 25 | 26 | ||
523 | 26 | from ubuntuone.supervisor.config_helpers import generate_server_config | 27 | from ubuntuone.supervisor.config_helpers import generate_server_config |
533 | 27 | from utilities import utils | 28 | from utilities.utils import get_rootdir, get_tmpdir |
534 | 28 | 29 | ||
535 | 29 | from supervisor_templates import TEMPLATES | 30 | |
536 | 30 | 31 | ROOT_DIR = get_rootdir() | |
537 | 31 | ROOTDIR = utils.get_rootdir() | 32 | TMP_DIR = get_tmpdir() |
538 | 32 | TMPDIR = os.path.join(ROOTDIR, 'tmp') | 33 | |
539 | 33 | if not os.path.exists(TMPDIR): | 34 | |
540 | 34 | os.mkdir(TMPDIR) | 35 | FILESYNC_TEMPLATE = ( |
541 | 35 | 36 | '[program:%(instance_name)s]\n' | |
542 | 37 | 'command=%(basepath)s/dev-scripts/set_rlimits.sh -d %(fs_memory_limit)s ' | ||
543 | 38 | '-m %(fs_memory_limit)s -v %(fs_memory_limit)s -n %(open_fds)s ' | ||
544 | 39 | '%(basepath)s/.env/bin/twistd --pidfile %(pid_folder)s/fsync_slave_%(instance)s.pid ' | ||
545 | 40 | '-n -y %(basepath)s/magicicada/server/server.tac ' | ||
546 | 41 | '--reactor=epoll\n' | ||
547 | 42 | 'environment=DJANGO_SETTINGS_MODULE="magicicada.settings",' | ||
548 | 43 | 'PYTHONPATH="%(pythonpath)s",' | ||
549 | 44 | 'FSYNC_INSTANCE_ID=%(instance)03d,' | ||
550 | 45 | 'CONFIG="%(basepath)s/configs/%(config)s"%(environment_vars)s\n' | ||
551 | 46 | 'autostart=false\n' | ||
552 | 47 | 'stdout_capture_maxbytes=%(stdout_capture_maxbytes)s\n' | ||
553 | 48 | 'stopsignal=INT\n' | ||
554 | 49 | ) | ||
555 | 50 | |||
556 | 51 | SSL_PROXY_TEMPLATE = ( | ||
557 | 52 | '[program:%(instance_name)s]\n' | ||
558 | 53 | 'command=%(basepath)s/dev-scripts/set_rlimits.sh -d %(ssl_memory_limit)s ' | ||
559 | 54 | '-m %(ssl_memory_limit)s -v %(ssl_memory_limit)s -n %(open_fds)s ' | ||
560 | 55 | '%(basepath)s/.env/bin/twistd --pidfile %(pid_folder)s/ssl-proxy-%(instance)s.pid ' | ||
561 | 56 | '-n -y %(basepath)s/magicicada/server/ssl_proxy.tac ' | ||
562 | 57 | '--reactor=epoll\n' | ||
563 | 58 | 'environment=DJANGO_SETTINGS_MODULE="magicicada.settings",' | ||
564 | 59 | 'PYTHONPATH="%(pythonpath)s",' | ||
565 | 60 | 'FSYNC_INSTANCE_ID=%(instance)03d,' | ||
566 | 61 | 'CONFIG="%(basepath)s/configs/%(config)s",' | ||
567 | 62 | 'FSYNC_SERVICE_NAME="ssl-proxy"%(environment_vars)s\n' | ||
568 | 63 | 'autostart=false\n' | ||
569 | 64 | 'stdout_capture_maxbytes=%(stdout_capture_maxbytes)s\n' | ||
570 | 65 | 'stopsignal=INT\n' | ||
571 | 66 | ) | ||
572 | 67 | |||
573 | 68 | |||
574 | 69 | TEMPLATES = { | ||
575 | 70 | 'filesync': { | ||
576 | 71 | 'name': "filesync-worker-%(instance)d", | ||
577 | 72 | 'config': FILESYNC_TEMPLATE, | ||
578 | 73 | }, | ||
579 | 74 | 'ssl-proxy': { | ||
580 | 75 | 'name': "ssl-proxy-%(instance)d", | ||
581 | 76 | 'config': SSL_PROXY_TEMPLATE, | ||
582 | 77 | }, | ||
583 | 78 | } | ||
584 | 36 | 79 | ||
585 | 37 | config_spec = { | 80 | config_spec = { |
589 | 38 | "basepath": ROOTDIR, | 81 | "basepath": ROOT_DIR, |
590 | 39 | "log_folder": TMPDIR, | 82 | "log_folder": TMP_DIR, |
591 | 40 | "pid_folder": TMPDIR, | 83 | "pid_folder": TMP_DIR, |
592 | 84 | "pythonpath": ':'.join(filter(None, sys.path)), | ||
593 | 41 | } | 85 | } |
594 | 42 | 86 | ||
595 | 43 | workers = {} | 87 | workers = {} |
596 | @@ -52,5 +96,5 @@ | |||
597 | 52 | config_content = generate_server_config( | 96 | config_content = generate_server_config( |
598 | 53 | hostname, services, config_spec, TEMPLATES, None, | 97 | hostname, services, config_spec, TEMPLATES, None, |
599 | 54 | with_heartbeat=False, with_header=False) | 98 | with_heartbeat=False, with_header=False) |
601 | 55 | with open(os.path.join(TMPDIR, 'services-supervisor.conf'), 'w') as f: | 99 | with open(os.path.join(TMP_DIR, 'services-supervisor.conf'), 'w') as f: |
602 | 56 | f.write(config_content) | 100 | f.write(config_content) |
603 | 57 | 101 | ||
604 | === modified file 'dev-scripts/supervisor-dev.conf.tpl' | |||
605 | --- dev-scripts/supervisor-dev.conf.tpl 2017-04-22 21:07:36 +0000 | |||
606 | +++ dev-scripts/supervisor-dev.conf.tpl 2018-04-12 02:08:49 +0000 | |||
607 | @@ -25,20 +25,20 @@ | |||
608 | 25 | 25 | ||
609 | 26 | [eventlistener:heartbeat] | 26 | [eventlistener:heartbeat] |
610 | 27 | command=python %(basepath)s/lib/ubuntuone/supervisor/heartbeat_listener.py --interval=10 --timeout=20 --log_level=DEBUG --log_file=%(tmp_dir)s/heartbeat.log --groups=filesync-server | 27 | command=python %(basepath)s/lib/ubuntuone/supervisor/heartbeat_listener.py --interval=10 --timeout=20 --log_level=DEBUG --log_file=%(tmp_dir)s/heartbeat.log --groups=filesync-server |
612 | 28 | environment=PYTHONPATH="%(basepath)s:%(basepath)s/lib" | 28 | environment=PYTHONPATH="%(pythonpath)s" |
613 | 29 | events=PROCESS_COMMUNICATION,TICK_5 | 29 | events=PROCESS_COMMUNICATION,TICK_5 |
614 | 30 | buffer_size=42 | 30 | buffer_size=42 |
615 | 31 | 31 | ||
616 | 32 | [program:filesync] | 32 | [program:filesync] |
619 | 33 | command=/usr/bin/twistd --pidfile %(tmp_dir)s/filesync.pid -n -y %(basepath)s/magicicada/server/server.tac --reactor=epoll | 33 | command=%(basepath)s/.env/bin/twistd --pidfile %(tmp_dir)s/filesync.pid -n -y %(basepath)s/magicicada/server/server.tac --reactor=epoll |
620 | 34 | environment=PYTHONPATH="%(basepath)s:%(basepath)s/lib",DJANGO_SETTINGS_MODULE="magicicada.settings",PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp | 34 | environment=PYTHONPATH="%(pythonpath)s",DJANGO_SETTINGS_MODULE="magicicada.settings",PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp |
621 | 35 | stdout_capture_maxbytes=16384 | 35 | stdout_capture_maxbytes=16384 |
622 | 36 | autostart=false | 36 | autostart=false |
623 | 37 | stopsignal=INT | 37 | stopsignal=INT |
624 | 38 | 38 | ||
625 | 39 | [program:ssl-proxy] | 39 | [program:ssl-proxy] |
628 | 40 | command=/usr/bin/twistd --pidfile %(tmp_dir)s/ssl-proxy.pid -n -y %(basepath)s/magicicada/server/ssl_proxy.tac --reactor=epoll | 40 | command=%(basepath)s/.env/bin/twistd --pidfile %(tmp_dir)s/ssl-proxy.pid -n -y %(basepath)s/magicicada/server/ssl_proxy.tac --reactor=epoll |
629 | 41 | environment=PYTHONPATH="%(basepath)s:%(basepath)s/lib",DJANGO_SETTINGS_MODULE="magicicada.settings" | 41 | environment=PYTHONPATH="%(pythonpath)s",DJANGO_SETTINGS_MODULE="magicicada.settings" |
630 | 42 | stdout_capture_maxbytes=16384 | 42 | stdout_capture_maxbytes=16384 |
631 | 43 | autostart=false | 43 | autostart=false |
632 | 44 | stopsignal=INT | 44 | stopsignal=INT |
633 | 45 | 45 | ||
634 | === removed file 'dev-scripts/supervisor_templates.py' | |||
635 | --- dev-scripts/supervisor_templates.py 2018-04-05 20:57:19 +0000 | |||
636 | +++ dev-scripts/supervisor_templates.py 1970-01-01 00:00:00 +0000 | |||
637 | @@ -1,65 +0,0 @@ | |||
638 | 1 | # Copyright 2008-2015 Canonical | ||
639 | 2 | # Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros) | ||
640 | 3 | # | ||
641 | 4 | # This program is free software: you can redistribute it and/or modify | ||
642 | 5 | # it under the terms of the GNU Affero General Public License as | ||
643 | 6 | # published by the Free Software Foundation, either version 3 of the | ||
644 | 7 | # License, or (at your option) any later version. | ||
645 | 8 | # | ||
646 | 9 | # This program is distributed in the hope that it will be useful, | ||
647 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
648 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
649 | 12 | # GNU Affero General Public License for more details. | ||
650 | 13 | # | ||
651 | 14 | # You should have received a copy of the GNU Affero General Public License | ||
652 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
653 | 16 | # | ||
654 | 17 | # For further info, check http://launchpad.net/magicicada-server | ||
655 | 18 | |||
656 | 19 | """Templates to generate supervisor config.""" | ||
657 | 20 | |||
658 | 21 | FILESYNC_TEMPLATE = ( | ||
659 | 22 | '[program:%(instance_name)s]\n' | ||
660 | 23 | 'command=%(basepath)s/dev-scripts/set_rlimits.sh -d %(fs_memory_limit)s ' | ||
661 | 24 | '-m %(fs_memory_limit)s -v %(fs_memory_limit)s -n %(open_fds)s ' | ||
662 | 25 | '/usr/bin/twistd --pidfile %(pid_folder)s/fsync_slave_%(instance)s.pid ' | ||
663 | 26 | '-n -y %(basepath)s/magicicada/server/server.tac ' | ||
664 | 27 | '--reactor=epoll\n' | ||
665 | 28 | 'environment=DJANGO_SETTINGS_MODULE="magicicada.settings",' | ||
666 | 29 | 'PYTHONPATH="%(basepath)s/lib",' | ||
667 | 30 | 'FSYNC_INSTANCE_ID=%(instance)03d,' | ||
668 | 31 | 'CONFIG="%(basepath)s/configs/%(config)s"%(environment_vars)s\n' | ||
669 | 32 | 'autostart=false\n' | ||
670 | 33 | 'stdout_capture_maxbytes=%(stdout_capture_maxbytes)s\n' | ||
671 | 34 | 'stopsignal=INT\n' | ||
672 | 35 | ) | ||
673 | 36 | |||
674 | 37 | SSL_PROXY_TEMPLATE = ( | ||
675 | 38 | '[program:%(instance_name)s]\n' | ||
676 | 39 | 'command=%(basepath)s/dev-scripts/set_rlimits.sh -d %(ssl_memory_limit)s ' | ||
677 | 40 | '-m %(ssl_memory_limit)s -v %(ssl_memory_limit)s -n %(open_fds)s ' | ||
678 | 41 | '/usr/bin/twistd ' | ||
679 | 42 | '--pidfile %(pid_folder)s/ssl-proxy-%(instance)s.pid ' | ||
680 | 43 | '-n -y %(basepath)s/magicicada/server/ssl_proxy.tac ' | ||
681 | 44 | '--reactor=epoll\n' | ||
682 | 45 | 'environment=DJANGO_SETTINGS_MODULE="magicicada.settings",' | ||
683 | 46 | 'PYTHONPATH="%(basepath)s/lib",' | ||
684 | 47 | 'FSYNC_INSTANCE_ID=%(instance)03d,' | ||
685 | 48 | 'CONFIG="%(basepath)s/configs/%(config)s",' | ||
686 | 49 | 'FSYNC_SERVICE_NAME="ssl-proxy"%(environment_vars)s\n' | ||
687 | 50 | 'autostart=false\n' | ||
688 | 51 | 'stdout_capture_maxbytes=%(stdout_capture_maxbytes)s\n' | ||
689 | 52 | 'stopsignal=INT\n' | ||
690 | 53 | ) | ||
691 | 54 | |||
692 | 55 | |||
693 | 56 | TEMPLATES = { | ||
694 | 57 | 'filesync': { | ||
695 | 58 | 'name': "filesync-worker-%(instance)d", | ||
696 | 59 | 'config': FILESYNC_TEMPLATE, | ||
697 | 60 | }, | ||
698 | 61 | 'ssl-proxy': { | ||
699 | 62 | 'name': "ssl-proxy-%(instance)d", | ||
700 | 63 | 'config': SSL_PROXY_TEMPLATE, | ||
701 | 64 | }, | ||
702 | 65 | } | ||
703 | 66 | 0 | ||
704 | === removed file 'dev-scripts/supervisorctl-dev' | |||
705 | --- dev-scripts/supervisorctl-dev 2015-08-05 13:10:02 +0000 | |||
706 | +++ dev-scripts/supervisorctl-dev 1970-01-01 00:00:00 +0000 | |||
707 | @@ -1,6 +0,0 @@ | |||
708 | 1 | #!/bin/bash | ||
709 | 2 | ROOT=$(dirname $0)/.. | ||
710 | 3 | NAME=$(basename $0) | ||
711 | 4 | |||
712 | 5 | export PYTHONPATH="$ROOT/lib" | ||
713 | 6 | /usr/bin/supervisorctl -c $ROOT/tmp/${NAME/supervisorctl/supervisor}.conf $* | ||
714 | 7 | 0 | ||
715 | === removed symlink 'lib/configglue' | |||
716 | === target was u'../.sourcecode/configglue/configglue/' | |||
717 | === removed symlink 'lib/dirspec' | |||
718 | === target was u'../.sourcecode/dirspec/dirspec' | |||
719 | === removed symlink 'lib/django' | |||
720 | === target was u'../.sourcecode/django/django' | |||
721 | === removed symlink 'lib/mock.py' | |||
722 | === target was u'../.sourcecode/mock/mock.py' | |||
723 | === removed symlink 'lib/oauthlib' | |||
724 | === target was u'../.sourcecode/oauthlib/oauthlib/' | |||
725 | === removed symlink 'lib/requests' | |||
726 | === target was u'../.sourcecode/requests/requests' | |||
727 | === removed symlink 'lib/requests_oauthlib' | |||
728 | === target was u'../.sourcecode/requests_oauthlib/requests_oauthlib' | |||
729 | === removed symlink 'lib/ubuntuone/status' | |||
730 | === target was u'../../.sourcecode/magicicada-client/ubuntuone/status/' | |||
731 | === modified symlink 'lib/ubuntuone/storageprotocol' | |||
732 | === target changed u'../../.sourcecode/magicicada-protocol/ubuntuone/storageprotocol' => u'../../.sourcecode/ubuntuone/storageprotocol' | |||
733 | === modified file 'lib/ubuntuone/supervisor/config_helpers.py' | |||
734 | --- lib/ubuntuone/supervisor/config_helpers.py 2018-04-05 20:57:19 +0000 | |||
735 | +++ lib/ubuntuone/supervisor/config_helpers.py 2018-04-12 02:08:49 +0000 | |||
736 | @@ -20,6 +20,7 @@ | |||
737 | 20 | 20 | ||
738 | 21 | import os | 21 | import os |
739 | 22 | import platform | 22 | import platform |
740 | 23 | import sys | ||
741 | 23 | 24 | ||
742 | 24 | from utilities.utils import get_rootdir | 25 | from utilities.utils import get_rootdir |
743 | 25 | 26 | ||
744 | @@ -34,7 +35,7 @@ | |||
745 | 34 | HEARTBEAT_LISTENER_TEMPLATE = '\n'.join(( | 35 | HEARTBEAT_LISTENER_TEMPLATE = '\n'.join(( |
746 | 35 | "[eventlistener:heartbeat]", | 36 | "[eventlistener:heartbeat]", |
747 | 36 | "command=python %(basepath)s/lib/ubuntuone/supervisor/heartbeat_listener.py --interval=%(interval)s --timeout=%(timeout)s --log_level=%(log_level)s --log_file=%(log_folder)s/heartbeat_listener.log --groups=%(groups)s %(processes)s", # NOQA | 37 | "command=python %(basepath)s/lib/ubuntuone/supervisor/heartbeat_listener.py --interval=%(interval)s --timeout=%(timeout)s --log_level=%(log_level)s --log_file=%(log_folder)s/heartbeat_listener.log --groups=%(groups)s %(processes)s", # NOQA |
749 | 37 | 'environment=PYTHONPATH="%(basepath)s:%(basepath)s/lib",DJANGO_SETTINGS_MODULE="magicicada.settings"', # NOQA | 38 | 'environment=PYTHONPATH="%(pythonpath)s",DJANGO_SETTINGS_MODULE="magicicada.settings"', # NOQA |
750 | 38 | "events=PROCESS_COMMUNICATION,TICK_5", | 39 | "events=PROCESS_COMMUNICATION,TICK_5", |
751 | 39 | "buffer_size=%(buffer_size)s", | 40 | "buffer_size=%(buffer_size)s", |
752 | 40 | )) | 41 | )) |
753 | @@ -68,6 +69,7 @@ | |||
754 | 68 | "log_folder": "/srv/%(base_dir)s/%(env)s-logs", | 69 | "log_folder": "/srv/%(base_dir)s/%(env)s-logs", |
755 | 69 | "pid_folder": "/srv/%(base_dir)s/var", | 70 | "pid_folder": "/srv/%(base_dir)s/var", |
756 | 70 | "stdout_capture_maxbytes": 16384, | 71 | "stdout_capture_maxbytes": 16384, |
757 | 72 | "pythonpath": ':'.join(filter(None, sys.path)), | ||
758 | 71 | } | 73 | } |
759 | 72 | 74 | ||
760 | 73 | base_heartbeat_listener_spec = { | 75 | base_heartbeat_listener_spec = { |
761 | 74 | 76 | ||
762 | === modified file 'lib/ubuntuone/supervisor/heartbeat_listener.py' | |||
763 | --- lib/ubuntuone/supervisor/heartbeat_listener.py 2018-04-05 20:57:19 +0000 | |||
764 | +++ lib/ubuntuone/supervisor/heartbeat_listener.py 2018-04-12 02:08:49 +0000 | |||
765 | @@ -219,7 +219,7 @@ | |||
766 | 219 | 219 | ||
767 | 220 | # main entry point, parse args and start the service. | 220 | # main entry point, parse args and start the service. |
768 | 221 | if __name__ == '__main__': | 221 | if __name__ == '__main__': |
770 | 222 | from configglue import configglue | 222 | from configglue.inischema.glue import configglue |
771 | 223 | from StringIO import StringIO | 223 | from StringIO import StringIO |
772 | 224 | config_file = StringIO() | 224 | config_file = StringIO() |
773 | 225 | config_file.write(default_config) | 225 | config_file.write(default_config) |
774 | 226 | 226 | ||
775 | === modified file 'lib/ubuntuone/supervisor/start-supervisord.py' | |||
776 | --- lib/ubuntuone/supervisor/start-supervisord.py 2018-04-05 20:57:19 +0000 | |||
777 | +++ lib/ubuntuone/supervisor/start-supervisord.py 2018-04-12 02:08:49 +0000 | |||
778 | @@ -36,10 +36,12 @@ | |||
779 | 36 | """Write out filled in conf template in tmp.""" | 36 | """Write out filled in conf template in tmp.""" |
780 | 37 | template = open(os.path.join(ROOT_DIR, tpl)).read() | 37 | template = open(os.path.join(ROOT_DIR, tpl)).read() |
781 | 38 | 38 | ||
786 | 39 | template_vars = {} | 39 | template_vars = { |
787 | 40 | template_vars['inet_http_server_port'] = inet_http_server_port | 40 | 'inet_http_server_port': inet_http_server_port, |
788 | 41 | template_vars['basepath'] = ROOT_DIR | 41 | 'basepath': ROOT_DIR, |
789 | 42 | template_vars['tmp_dir'] = TMP_DIR | 42 | 'tmp_dir': TMP_DIR, |
790 | 43 | 'pythonpath': ':'.join(filter(None, sys.path)), | ||
791 | 44 | } | ||
792 | 43 | 45 | ||
793 | 44 | conf = template % template_vars | 46 | conf = template % template_vars |
794 | 45 | 47 | ||
795 | @@ -79,7 +81,7 @@ | |||
796 | 79 | except OSError: | 81 | except OSError: |
797 | 80 | pass | 82 | pass |
798 | 81 | 83 | ||
800 | 82 | os_exec("/usr/bin/supervisord", "-c", conf_file_path) | 84 | os_exec(".env/bin/supervisord", "-c", conf_file_path) |
801 | 83 | 85 | ||
802 | 84 | 86 | ||
803 | 85 | if __name__ == "__main__": | 87 | if __name__ == "__main__": |
804 | 86 | 88 | ||
805 | === removed file 'magicicada/metrics/services.py' | |||
806 | --- magicicada/metrics/services.py 2018-04-05 20:57:19 +0000 | |||
807 | +++ magicicada/metrics/services.py 1970-01-01 00:00:00 +0000 | |||
808 | @@ -1,34 +0,0 @@ | |||
809 | 1 | # Copyright 2008-2015 Canonical | ||
810 | 2 | # Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros) | ||
811 | 3 | # | ||
812 | 4 | # This program is free software: you can redistribute it and/or modify | ||
813 | 5 | # it under the terms of the GNU Affero General Public License as | ||
814 | 6 | # published by the Free Software Foundation, either version 3 of the | ||
815 | 7 | # License, or (at your option) any later version. | ||
816 | 8 | # | ||
817 | 9 | # This program is distributed in the hope that it will be useful, | ||
818 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
819 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
820 | 12 | # GNU Affero General Public License for more details. | ||
821 | 13 | # | ||
822 | 14 | # You should have received a copy of the GNU Affero General Public License | ||
823 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
824 | 16 | # | ||
825 | 17 | # For further info, check http://launchpad.net/magicicada-server | ||
826 | 18 | |||
827 | 19 | """Metric services.""" | ||
828 | 20 | |||
829 | 21 | from __future__ import unicode_literals | ||
830 | 22 | |||
831 | 23 | from metrics import get_meter | ||
832 | 24 | try: | ||
833 | 25 | from versioninfo import version_info | ||
834 | 26 | except ImportError: | ||
835 | 27 | version_info = {'revno': 'Undefined'} | ||
836 | 28 | |||
837 | 29 | meter = get_meter('service') | ||
838 | 30 | |||
839 | 31 | |||
840 | 32 | def revno(): | ||
841 | 33 | """Trigger a service revision number update.""" | ||
842 | 34 | meter.gauge('revno', version_info['revno']) | ||
843 | 35 | 0 | ||
844 | === removed file 'magicicada/metrics/tests/test_services.py' | |||
845 | --- magicicada/metrics/tests/test_services.py 2018-04-05 20:57:19 +0000 | |||
846 | +++ magicicada/metrics/tests/test_services.py 1970-01-01 00:00:00 +0000 | |||
847 | @@ -1,38 +0,0 @@ | |||
848 | 1 | # Copyright 2008-2015 Canonical | ||
849 | 2 | # Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros) | ||
850 | 3 | # | ||
851 | 4 | # This program is free software: you can redistribute it and/or modify | ||
852 | 5 | # it under the terms of the GNU Affero General Public License as | ||
853 | 6 | # published by the Free Software Foundation, either version 3 of the | ||
854 | 7 | # License, or (at your option) any later version. | ||
855 | 8 | # | ||
856 | 9 | # This program is distributed in the hope that it will be useful, | ||
857 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
858 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
859 | 12 | # GNU Affero General Public License for more details. | ||
860 | 13 | # | ||
861 | 14 | # You should have received a copy of the GNU Affero General Public License | ||
862 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
863 | 16 | # | ||
864 | 17 | # For further info, check http://launchpad.net/magicicada-server | ||
865 | 18 | |||
866 | 19 | """Tests for metric services.""" | ||
867 | 20 | |||
868 | 21 | from __future__ import unicode_literals | ||
869 | 22 | |||
870 | 23 | from mock import patch | ||
871 | 24 | from testtools import TestCase | ||
872 | 25 | |||
873 | 26 | from metrics import get_meter | ||
874 | 27 | from metrics.services import revno, version_info | ||
875 | 28 | |||
876 | 29 | |||
877 | 30 | class ServicesTest(TestCase): | ||
878 | 31 | """Tests for metric services.""" | ||
879 | 32 | |||
880 | 33 | def test_meters_revno_with_gauge_meter(self): | ||
881 | 34 | """The service is able to meter a revision by gauge meter.""" | ||
882 | 35 | service_meter = get_meter('service') | ||
883 | 36 | with patch.object(service_meter, 'gauge') as gauge: | ||
884 | 37 | revno() | ||
885 | 38 | gauge.assert_called_with('revno', version_info['revno']) | ||
886 | 39 | 0 | ||
887 | === modified file 'magicicada/server/server.py' | |||
888 | --- magicicada/server/server.py 2018-04-05 20:57:19 +0000 | |||
889 | +++ magicicada/server/server.py 2018-04-12 02:08:49 +0000 | |||
890 | @@ -41,7 +41,6 @@ | |||
891 | 41 | import twisted.web.error | 41 | import twisted.web.error |
892 | 42 | 42 | ||
893 | 43 | import metrics | 43 | import metrics |
894 | 44 | import metrics.services | ||
895 | 45 | 44 | ||
896 | 46 | from twisted.application.service import MultiService, Service | 45 | from twisted.application.service import MultiService, Service |
897 | 47 | from twisted.application.internet import TCPServer | 46 | from twisted.application.internet import TCPServer |
898 | @@ -60,14 +59,6 @@ | |||
899 | 60 | from magicicada.server import auth, content, errors, stats | 59 | from magicicada.server import auth, content, errors, stats |
900 | 61 | from magicicada.server.diskstorage import DiskStorage | 60 | from magicicada.server.diskstorage import DiskStorage |
901 | 62 | 61 | ||
902 | 63 | try: | ||
903 | 64 | from versioninfo import version_info | ||
904 | 65 | except ImportError: | ||
905 | 66 | version_info = { | ||
906 | 67 | 'branch_nick': 'Unavailable', | ||
907 | 68 | 'revno': 'Unavailable', | ||
908 | 69 | } | ||
909 | 70 | |||
910 | 71 | 62 | ||
911 | 72 | # this is the minimal cap we support (to avoid hardcoding it in the code) | 63 | # this is the minimal cap we support (to avoid hardcoding it in the code) |
912 | 73 | MIN_CAP = frozenset(['no-content', 'account-info', 'resumable-uploads', | 64 | MIN_CAP = frozenset(['no-content', 'account-info', 'resumable-uploads', |
913 | @@ -85,6 +76,8 @@ | |||
914 | 85 | # frozenset(['example2']): dict(srv_record='_https._tcp.fs.server.com') | 76 | # frozenset(['example2']): dict(srv_record='_https._tcp.fs.server.com') |
915 | 86 | } | 77 | } |
916 | 87 | 78 | ||
917 | 79 | FILESYNC_STATUS_MSG = 'filesync server' | ||
918 | 80 | |||
919 | 88 | logger = logging.getLogger(__name__) | 81 | logger = logging.getLogger(__name__) |
920 | 89 | 82 | ||
921 | 90 | 83 | ||
922 | @@ -381,8 +374,7 @@ | |||
923 | 381 | request.RequestHandler.connectionMade(self) | 374 | request.RequestHandler.connectionMade(self) |
924 | 382 | self.factory.protocols.append(self) | 375 | self.factory.protocols.append(self) |
925 | 383 | self.log.info('Connection Made') | 376 | self.log.info('Connection Made') |
928 | 384 | msg = '%d filesync server revision %s.\r\n' % ( | 377 | msg = '%d %s.\r\n' % (self.PROTOCOL_VERSION, FILESYNC_STATUS_MSG) |
927 | 385 | self.PROTOCOL_VERSION, version_info['revno']) | ||
929 | 386 | self.transport.write(msg) | 378 | self.transport.write(msg) |
930 | 387 | self.ping_loop.start() | 379 | self.ping_loop.start() |
931 | 388 | self.factory.metrics.meter('connection_made', 1) | 380 | self.factory.metrics.meter('connection_made', 1) |
932 | @@ -2685,7 +2677,6 @@ | |||
933 | 2685 | self.factory.rpc_dal = self.rpc_dal | 2677 | self.factory.rpc_dal = self.rpc_dal |
934 | 2686 | self.metrics.meter('server_start') | 2678 | self.metrics.meter('server_start') |
935 | 2687 | self.metrics.increment('services_active') | 2679 | self.metrics.increment('services_active') |
936 | 2688 | metrics.services.revno() | ||
937 | 2689 | 2680 | ||
938 | 2690 | self._reactor_inspector.start() | 2681 | self._reactor_inspector.start() |
939 | 2691 | # only start the HeartbeatWriter if the interval is > 0 | 2682 | # only start the HeartbeatWriter if the interval is > 0 |
940 | 2692 | 2683 | ||
941 | === modified file 'magicicada/server/ssl_proxy.py' | |||
942 | --- magicicada/server/ssl_proxy.py 2018-04-05 20:57:19 +0000 | |||
943 | +++ magicicada/server/ssl_proxy.py 2018-04-12 02:08:49 +0000 | |||
944 | @@ -34,7 +34,7 @@ | |||
945 | 34 | import metrics | 34 | import metrics |
946 | 35 | 35 | ||
947 | 36 | from magicicada import settings | 36 | from magicicada import settings |
949 | 37 | from magicicada.server.server import get_service_port | 37 | from magicicada.server.server import FILESYNC_STATUS_MSG, get_service_port |
950 | 38 | from magicicada.server.ssl import disable_ssl_compression | 38 | from magicicada.server.ssl import disable_ssl_compression |
951 | 39 | from ubuntuone.supervisor import utils as supervisor_utils | 39 | from ubuntuone.supervisor import utils as supervisor_utils |
952 | 40 | 40 | ||
953 | @@ -164,7 +164,7 @@ | |||
954 | 164 | 164 | ||
955 | 165 | def lineReceived(self, line): | 165 | def lineReceived(self, line): |
956 | 166 | """Handle a single line received.""" | 166 | """Handle a single line received.""" |
958 | 167 | if "filesync server revision" in line: | 167 | if FILESYNC_STATUS_MSG in line: |
959 | 168 | self.factory.deferred.callback(line) | 168 | self.factory.deferred.callback(line) |
960 | 169 | else: | 169 | else: |
961 | 170 | self.factory.deferred.errback(ValueError(line)) | 170 | self.factory.deferred.errback(ValueError(line)) |
962 | 171 | 171 | ||
963 | === modified file 'magicicada/server/tests/test_basic.py' | |||
964 | --- magicicada/server/tests/test_basic.py 2018-04-05 20:57:19 +0000 | |||
965 | +++ magicicada/server/tests/test_basic.py 2018-04-12 02:08:49 +0000 | |||
966 | @@ -35,9 +35,6 @@ | |||
967 | 35 | from ubuntuone.storageprotocol import request | 35 | from ubuntuone.storageprotocol import request |
968 | 36 | from ubuntuone.supervisor import utils as supervisor_utils | 36 | from ubuntuone.supervisor import utils as supervisor_utils |
969 | 37 | 37 | ||
970 | 38 | import metrics | ||
971 | 39 | import metrics.services | ||
972 | 40 | |||
973 | 41 | from magicicada.filesync.models import StorageUser | 38 | from magicicada.filesync.models import StorageUser |
974 | 42 | from magicicada.server.server import logger | 39 | from magicicada.server.server import logger |
975 | 43 | from magicicada.server.testing.testcase import TestWithDatabase | 40 | from magicicada.server.testing.testcase import TestWithDatabase |
976 | @@ -120,9 +117,6 @@ | |||
977 | 120 | service_meter = mocker.mock(name='meter') | 117 | service_meter = mocker.mock(name='meter') |
978 | 121 | self.service.metrics = service_meter | 118 | self.service.metrics = service_meter |
979 | 122 | 119 | ||
980 | 123 | revno = mocker.mock(name='revno') | ||
981 | 124 | self.patch(metrics.services, 'revno', revno) | ||
982 | 125 | |||
983 | 126 | service_meter.meter('server_stop') | 120 | service_meter.meter('server_stop') |
984 | 127 | service_meter.decrement('services_active') | 121 | service_meter.decrement('services_active') |
985 | 128 | service_meter.meter('server_start') | 122 | service_meter.meter('server_start') |
986 | @@ -131,9 +125,6 @@ | |||
987 | 131 | service_meter.timing("busy.ping", ANY) | 125 | service_meter.timing("busy.ping", ANY) |
988 | 132 | mocker.count(0, None) | 126 | mocker.count(0, None) |
989 | 133 | 127 | ||
990 | 134 | revno() | ||
991 | 135 | mocker.count(0, None) | ||
992 | 136 | |||
993 | 137 | with mocker: | 128 | with mocker: |
994 | 138 | yield self.service.stopService() | 129 | yield self.service.stopService() |
995 | 139 | yield self.service.startService() | 130 | yield self.service.startService() |
996 | 140 | 131 | ||
997 | === added file 'requirements-devel.txt' | |||
998 | --- requirements-devel.txt 1970-01-01 00:00:00 +0000 | |||
999 | +++ requirements-devel.txt 2018-04-12 02:08:49 +0000 | |||
1000 | @@ -0,0 +1,8 @@ | |||
1001 | 1 | flake8 | ||
1002 | 2 | dbus-python | ||
1003 | 3 | pygobject | ||
1004 | 4 | meliae | ||
1005 | 5 | mock | ||
1006 | 6 | mocker | ||
1007 | 7 | pyinotify | ||
1008 | 8 | rst2html5 | ||
1009 | 0 | 9 | ||
1010 | === added file 'requirements.txt' | |||
1011 | --- requirements.txt 1970-01-01 00:00:00 +0000 | |||
1012 | +++ requirements.txt 2018-04-12 02:08:49 +0000 | |||
1013 | @@ -0,0 +1,17 @@ | |||
1014 | 1 | Django<1.10 | ||
1015 | 2 | bzr | ||
1016 | 3 | configglue | ||
1017 | 4 | cython | ||
1018 | 5 | pyOpenSSL | ||
1019 | 6 | protobuf | ||
1020 | 7 | psycopg2-binary | ||
1021 | 8 | # From twisted UserWarning: You do not have a working installation of the | ||
1022 | 9 | # service_identity module: 'No module named service_identity'. Please install | ||
1023 | 10 | # it from <https://pypi.python.org/pypi/service_identity> and make sure all of | ||
1024 | 11 | # its dependencies are satisfied. Without the service_identity module, Twisted | ||
1025 | 12 | # can perform only rudimentary TLS client hostname verification. Many valid | ||
1026 | 13 | # certificate/hostname mappings may be rejected. | ||
1027 | 14 | service_identity | ||
1028 | 15 | supervisor | ||
1029 | 16 | twisted | ||
1030 | 17 | https://launchpad.net/dirspec/stable-13-10/13.10/+download/dirspec-13.10.tar.gz | ||
1031 | 0 | 18 | ||
1032 | === modified file 'test' | |||
1033 | --- test 2018-04-05 20:57:19 +0000 | |||
1034 | +++ test 2018-04-12 02:08:49 +0000 | |||
1035 | @@ -54,10 +54,10 @@ | |||
1036 | 54 | with open(dbus_address_file) as fh: | 54 | with open(dbus_address_file) as fh: |
1037 | 55 | os.environ["DBUS_SESSION_BUS_ADDRESS"] = fh.read().strip() | 55 | os.environ["DBUS_SESSION_BUS_ADDRESS"] = fh.read().strip() |
1038 | 56 | 56 | ||
1040 | 57 | # install the glib2reactor before any import of the reactor to avoid | 57 | # install the twisted reactor before any import of the reactor to avoid |
1041 | 58 | # using the default SelectReactor and be able to run the dbus tests | 58 | # using the default SelectReactor and be able to run the dbus tests |
1044 | 59 | from twisted.internet import glib2reactor | 59 | from twisted.internet import gireactor |
1045 | 60 | glib2reactor.install() | 60 | gireactor.install() |
1046 | 61 | 61 | ||
1047 | 62 | 62 | ||
1048 | 63 | if __name__ == "__main__": | 63 | if __name__ == "__main__": |
Looks fine