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

Remove cherrypy dependency #8026

Merged
merged 7 commits into from
May 4, 2021
Merged

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Apr 24, 2021

Summary

  • Removes cherrypy as a dependency
  • Replaces it with explicit use of cheroot and magicbus
  • Cleans up unused dependencies
  • Passes port to zeroconf listener registration once main server has completed serving
  • Has fallback for services command where it will pass in the set port once the process has started running
  • Consolidates all server start code in server.py
  • Uses pid file to track server status using ProcessBus life cycle hooks
  • Use pid file throughout start cycle rather than separate startup lock
  • Simplifies the stop procedure
  • Sets default zip port to 0 to allow it to be dynamically chosen
  • Creates a port cache to record previously available ports - port discovery slows startup time, so this helps to mitigate this
  • Directly connect server logging to kolibri logging

References

Depends on #8023
Fixes #8024
Supersedes #7714
This also contributes to fixing learningequality/kolibri-app#74 in a most general way, by allowing apps to just specify port 0, and allowing a free port to be chosen for use.

Reviewer guidance

Kolibri should run and serve as intended.
Appropriate logging happens for all events in the server life cycle.
Start Kolibri with --port=0 and verify that the port bound is the one reported, and that zeroconf registers that port


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles added TODO: needs review Waiting for review and removed work-in-progress Not ready for review labels Apr 30, 2021
@rtibbles rtibbles added this to the 0.15.0 milestone Apr 30, 2021
@rtibbles rtibbles marked this pull request as ready for review April 30, 2021 04:35
Copy link
Member

@jredrejo jredrejo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discovering of the zip port is not working fine, as it's not being assigned. Hashi does not work with this PR (and it did work in #8023)

Tested with PLIX, ASP, H5P... none of the html5 apps works as the browser is not using the right port to get the files:
image
it tries port 8080 while Zip port is 45739:

INFO     Starting on 0.0.0.0:45739
INFO     Waiting for 0.0.0.0:45739
INFO     Serving on 0.0.0.0:45739
INFO     Starting on 0.0.0.0:8080
INFO     Waiting for 0.0.0.0:8080
INFO     Serving on 0.0.0.0:8080
INFO     Registering ourselves to zeroconf network with id '9ad9ee5e19f80c03774f7d3d29dffdc3' and port '8080'
INFO     Kolibri running on: http://172.18.0.1:8080/
INFO     Kolibri running on: http://172.17.0.1:8080/
INFO     Kolibri running on: http://127.0.0.1:8080/
INFO     Kolibri running on: http://192.168.0.44:8080/
INFO     Bus state: RUN

Copy link
Member

@jredrejo jredrejo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running it forcing the zip port it works:
KOLIBRI_ZIP_CONTENT_PORT=8081 kolibri start --foreground

Copy link
Member

@jredrejo jredrejo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I DO want to delete this review comment but GH does not let me doing it unless I write something :(

Copy link
Member

@jredrejo jredrejo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now everything works fine, LGTM

@rtibbles rtibbles merged commit dfef3fb into learningequality:develop May 4, 2021
@rtibbles rtibbles deleted the schoolbus branch May 4, 2021 19:21
@rtibbles rtibbles mentioned this pull request May 27, 2021
9 tasks
@rtibbles rtibbles mentioned this pull request Aug 16, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop CherryPy and replace with cheroot and magicbus
2 participants