interactiveaudiolab / CAQE

Crowdsourced Audio Quality Evaluation Toolkit
MIT License
48 stars 17 forks source link

Paying bonuses does not work when hosting on Heroku #33

Open jfsantos opened 6 years ago

jfsantos commented 6 years ago

Paying bonuses does not work because the participant list is on the remote DB (on Heroku) but not available locally. Since one is not supposed to upload their AWS secrets to Heroku, this makes it very awkward to pay bonuses (need to get a database dump from Heroku just to figure out which participants to pay, and then update the database at Heroku).

mcartwright commented 6 years ago

Hmmm... it's been a long time since I've used this (and I have a terribly memory), so I can't remember the details. But I don't recall this being an issue. Can't you run some commands directly on Heroku? e.g. heroku run bash to get a shell and then run whichever commands you want, no?

@pseeth you've used CAQE recently, right? did you pay bonuses? how'd you do it?

jfsantos commented 6 years ago

That is possible, but it would require storing AMT secrets on Heroku. I'm solving it by setting DATABASE_URL on the local computer to match the database URI from Heroku. There are still some other minor issues that I'm trying to track now but if there's a correct way of doing it I would appreciate it, as following the documentation as it is currently does not work.

-- João Felipe Santos

On Thu, 21 Jun 2018 at 15:10, Mark Cartwright notifications@github.com wrote:

Hmmm... it's been a long time since I've used this (and I have a terribly memory), so I can't remember the details. But I don't recall this being an issue. Can't you run some commands directly on Heroku? e.g. heroku run bash to get a shell and then run whichever commands you want, no?

@pseeth https://github.com/pseeth you've used CAQE recently, right? did you pay bonuses? how'd you do it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/interactiveaudiolab/CAQE/issues/33#issuecomment-399211949, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAWZT3HrDiT2u95XCgUU6SG8REpG2fXks5t---sgaJpZM4UylpJ .

mcartwright commented 6 years ago

What about a getpass prompt for the secret key if it isn't in the file?

jfsantos commented 6 years ago

Setting DATABASE_URL to Heroku's URL works and does not require keeping secrets on the remote, but there was actually an issue on the code that made paying bonuses not work. The API call to create_participant was expecting arguments assignmentId and hitId, but was called with crowd_assignment_id and crowd_assignment_type instead.

I also improved the code by adding a bonus_paid column to the Participant class, and using that to track whether bonuses were paid to a person or not. I'll eventually clean up my code (it's full of debug messages now) and submit a PR.