Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC Updates #57

Merged
merged 5 commits into from
Feb 28, 2019
Merged

RFC Updates #57

merged 5 commits into from
Feb 28, 2019

Conversation

clsulliv
Copy link
Contributor

@clsulliv clsulliv commented Feb 2, 2019

Several updates for the backend.

Removed some of the uninstall functionality. Removing packages was causing breakage, see issue #56. This was the primary culprit, but maybe we should remove more of it? The pip3 uninstall command might also should be removed, for example.

Updated psycopg2, as that version was not working on either Ubuntu 18 or new versions of Clear. Have not tested on Ubuntu 16, so might not be safe there.

Added caching! This massively improves performance of the UI. In some cases the gains were around two orders of magnitude, in others a mere 200%ish.

Updated installation scripts for new requirements. Clear Linux doesn't currently have a redis service file, which will need to be fixed for it to work properly there.

These could be required for other software on the system, not just the
telemetryui, and should not be unconditionally removed. Instead just
tell the user that they can remove them if they wish.

Signed-off-by: California Sullivan <[email protected]>
v2.7.3 does not work on Ubuntu 18 or recent versions of Clear. Use
v2.7.6 instead.

Signed-off-by: California Sullivan <[email protected]>
Use redis to cache query results where appropriate. Examples include
classification drop downs, build drop downs, and tables that don't need
updated in real time.

Most of the changes were done in views.py, where a shim was added which
can be used to get cached data if it exists, or query directly and put
the result in the cache with an expiration time.

One change was necessary in model.py: having Record.get_update_msgs
actually execute the query instead of just returning the query. This is
consistent with the majority of other Record functions, and was needed
in order to properly cache that data.

Signed-off-by: California Sullivan <[email protected]>
The caching additions require redis and the redis python module. Add
them to the requirements, and also enable/start redis where appropriate.

Signed-off-by: California Sullivan <[email protected]>
With the upgraded psycopg2 version this no longer works and in fact
causes the following error:

Command "/var/www/telemetry/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-froo6p21/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-bv0up7o3/install-record.txt --single-version-externally-managed --compile --install-headers /var/www/telemetry/venv/include/site/python3.7/psycopg2" failed with error code 1 in /tmp/pip-install-froo6p21/psycopg2/

Signed-off-by: California Sullivan <[email protected]>
@clsulliv
Copy link
Contributor Author

The force push was removing the WIP comment in the commit message about fixing clear, as I've added the redis service file needed for the install to happen successfully.

@alexjch alexjch merged commit 4dd3fac into clearlinux:master Feb 28, 2019
@clsulliv clsulliv deleted the updates branch March 22, 2019 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants