-
Notifications
You must be signed in to change notification settings - Fork 65
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
Issue/279 heroku background worker #292
Issue/279 heroku background worker #292
Conversation
This isn't ready to merge yet, just opened it up while I work through a few remaining issues. |
* adds composer scripts for `lint`, `test`, `start` * adds background worker to Heroku Proc file * set default tests to skip functional tests * adds new table - job_queue for holding jobs for the worker * adds support for sqlite (mostly for fast unit testing) * adds mockery and vfsstream for testing * config options for workers added * reorganized configs and setting files * added config for tests * changed config/tests.php to only be loaded as needed * added UdoitDB database abstraction class that handles reconnecting for long running jobs * added UdoitJob class that manages running and creating queued jobs * expanded UdoitUtils to centeralize more functions of the application * added worker that processes jobs in the background * added a ton of unit tests * updated default.js to accomidate changes to background workers * updated a lot of rel require/include references to use absolute refs * heavily simplified index.php to act purely as an LTI launch target * simplified oauth2responce.php * updated parseResults.php to use GET rather then POST * changed process.php to simply store the jobs to do * changed progress.php to simply report on the status of jobs * added missing data from the sample report.json * moved the code used to display the scanner from index.php to a new file scanner.php * all .sh scripts moved to composer scripts * Adopted composer autoloading for all classes
6d8246d
to
d7af371
Compare
e4d8158
to
93c10f9
Compare
adds php CodeSniffer to dev requirements adds symfony 2 code standards to dev requirements adds custom phpcs rules applies all fixes required to pass errors for new phpcs rules removes file system mocks not needed any longer adds scripts for sniffing
93c10f9
to
1f673c3
Compare
This ended up being pretty huge and pushing the codebase forward quite a bit. I updated the pull request overview above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reviewing the PR now, but please merge in dev/v2.3.0 and resolve any conflicts.
Additionally, Heroku doesn't seem to see the app.json, meaning the database never gets built. Judging by the build log, the composer script gets run, installing all of the dependencies, but the database never gets set up. I've added you to my Heroku instance so you can take a look. |
I'm working on resolving the conflicts. Looks like I need to make a migration script to move to the worker version |
…eon/UDOIT into issue/279-heroku-background-worker
Migration added for the job_queue table and fixed all the problems from the merge. We should be able to get back to testing |
Detecting YouTube videos without captions doesn't work in Module URLs. |
* adds finished log * silence the worker sleeping msg * clean up canvas_api_domain to prevent multiple trailing slashes * fix module_urls api request * fix modules api url * update logo svg * fixes module_urls counts * moves api key into request header * adds finalize log report logging * add user id checking to process * change error to use json
Alright, that last commit contained a bunch of fixes for module_urls and other things. I updated the bulleted list of features in the pull PR. I think this is buttoned up at this point. Recommend final testing 🎉 |
I'm unable to complete a scan, receiving this error: Warning: Invalid argument supplied for foreach() in /app/lib/UdoitUtils.php on line 255 During the scan, announcements, assignments, etc. stacked up in the scan button without ever seeming to complete. I updated the composer.lock file since there were updates to the composer.json that heroku wasn't taking into account, but that didn't fix the issue. |
the conversion to using a background worker had a bunch of cleanup to the scanning code. It incorrectly dealt with files and syllabus. Thats all fixed now. Files were trying to use the auth header in the api requests, but they come with a temporary auth. And syllabus api was incorrectly assuming it had to loop of the results, which it doesnt.
I was able to fix the files being missed in the scanner. Also found syllabus wasn't scanning and was able to fix up the composer.json/lock files so composer update will work again. |
Just changing how we store the license file in the repository to work better with Github's tools
…cense Changes license docs to conform to github's practices
renames and changes default value for worker_sleep_seconds adds a process to expire old tasks makes sure course, course_id, and user_id are set on report make sure course data gets set on the report suppress pdf warnings fix pdf progress checker
…background-worker
e94d6e5
to
765b3ca
Compare
…ng error in test and code for unknown report section title. Removed extra comma from background queue migration file.
…eon/UDOIT into issue/279-heroku-background-worker
The main goal of this PR is to add a background worker mode to UDOIT. This allows UDOIT to support more simultaneous users and much larger courses. This is ideal for small Heroku accounts or web servers that support multiple applications.
The worker mode is an opt-in upgrade. UDOIT can be run in classic mode w/o any modifications by your server admin, but it will continue to be limited in the same way prior versions were limited.
Limitations present in Classic mode (and all versions prior to 2.3.0):
max_execution_time
can easily be exceeded before a course scan finishes.Changes in this PR:
Fixes #279