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

mount sidekiq dashboard #2772

Merged
merged 30 commits into from
Jul 3, 2018
Merged

Conversation

ViditChitkara
Copy link
Member

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.

Thanks!

@ViditChitkara
Copy link
Member Author

Hi @jywarren , sidekiq ran perfectly on my local machine. On production we could use sidekiq dashboard (could be used to verify if sidekiq is working). Would be adding a cron job for digest mails in this pr.

@jywarren
Copy link
Member

jywarren commented Jun 5, 2018

OH cool -- anything we need to do to secure the sidekiq dashboard?

@ViditChitkara
Copy link
Member Author

There maybe some authentication feature or something, looking into it.

@plotsbot
Copy link
Collaborator

plotsbot commented Jun 5, 2018

1 Warning
⚠️ It looks like you merged from master in this pull request. Please rebase to get rid of the merge commits – you may want to rewind the master branch and rebase instead of merging in from master, which can cause problems when accepting new code!
2 Messages
📖 @ViditChitkara Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 It looks like you haven’t marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a ‘Work in progresss’, please include ‘[WIP]’ in the title.

Generated by 🚫 Danger

@namangupta01
Copy link
Member

namangupta01 commented Jun 5, 2018

@ViditChitkara Its good that you have added password protection on this route so that only specific person could see it.

puts Dir.pwd
command "date -u" #This will print utc time every 1 min in log/cron_log.log file
end
# every 1.minutes do
Copy link
Member

Choose a reason for hiding this comment

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

I think we should not comment this? The only thing it is doing here is printing the time every one minute so that we can make sure that it is running. What do you say?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I was testing something, forgot to uncomment it. Will do!

@ViditChitkara
Copy link
Member Author

@jywarren , @icarito Some tests are failing :-
There was a test error at: Failure: test_digest_emails(Minitest::Result) [/usr/local/bundle/gems/redis-4.0.1/lib/redis/client.rb:344]: Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)
Is there something we need for travis tests to pass, regarding redis in docker-compose.yml?
Also, is there any other way with which we could confirm if docker-compose.yml was built successfully and redis is running?

@jywarren
Copy link
Member

@icarito this coming week if you have a moment to look at this, we'd love your help - thanks!

@jywarren
Copy link
Member

Vidit, I think it maybe an issue of routing between containers. I'm not an expert on this but you may be able to search stack overflow a bit to try to resolve it?

@ViditChitkara
Copy link
Member Author

Yep, I'll try and search it. It appears to be just a small tweak, but we have to search deeper for this. I would be needing @icarito 's help. Going to do this, coming week. Side by side would be working on the 'like with multiple reactions' follow-ups. Currently we are not showing usernames of those who have liked a particular comment, my next pr would be for this. Does this sound good?

@jywarren
Copy link
Member

jywarren commented Jun 23, 2018 via email

@icarito
Copy link
Member

icarito commented Jun 23, 2018 via email

@icarito
Copy link
Member

icarito commented Jun 25, 2018

Hi @ViditChitkara please review this patch ViditChitkara#1 it produced a different error apparently unrelated to Redis. Hope that helps!

@ghost ghost assigned icarito Jun 25, 2018
@icarito
Copy link
Member

icarito commented Jun 25, 2018

ERROR["test_digest_emails", Minitest::Result, 55.16748498300001]
 test_digest_emails#Minitest::Result (55.17s)
NoMethodError:         NoMethodError: undefined method `perform_later' for DigestMailJob:Class
            test/functional/users_controller_test.rb:254:in `block (2 levels) in <class:UsersControllerTest>'
            test/functional/users_controller_test.rb:253:in `block in <class:UsersControllerTest>'

Hopefully this helps!

@ViditChitkara
Copy link
Member Author

Hi @icarito, Sorry for the delay, was reinstalling plots on my system. This is related to tests I guess, hope redis will work now!! I'll push a patch to fix these tests.

@ViditChitkara
Copy link
Member Author

The tests are passing now and we haven't got any redis related errors. Let's see if redis would work on production now. @jywarren , @icarito shall we merge this?

@namangupta01
Copy link
Member

@ViditChitkara How we can check this dashboard?

@ViditChitkara
Copy link
Member Author

The changes seem good to me. Just wanted to ask if the contents of docker-compose-testing need to be copied to docker-compose-production??
Also, I would be needing sidekiq dashboard access to keep a check on errors. Can we keep it unauthenticated for sometime?? It is not a security issue as it gives stats of processed and erroneous requests.
@icarito, @jywarren?
Once this gets merged I'll work on digest email template improvement and any sidekiq follow-ups, if required.

@jywarren
Copy link
Member

jywarren commented Jun 30, 2018 via email

@ViditChitkara
Copy link
Member Author

@jywarren I don't see the db container in production docker compose file. However it is there in all other containers. Any particular reason for that?
And regarding sidekiq dashboard, it does not show any kind of usernames (usernames are not present in requests as well). However, I have found a way to password protect it. Using basic auth (https://github.com/mperham/sidekiq/wiki/Monitoring#standalone-with-basic-auth), but we need to put username and password as our server's environment variables.

@ViditChitkara
Copy link
Member Author

Shall I do the auth thing in next pr??

@icarito
Copy link
Member

icarito commented Jun 30, 2018 via email

@ViditChitkara
Copy link
Member Author

Got it @icarito , I have made the final changes. If you want to have a look??

@ViditChitkara
Copy link
Member Author

Okay, the tests are passing now!! @icarito , @jywarren I guess this is ready!

Copy link
Member

@jywarren jywarren left a comment

Choose a reason for hiding this comment

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

If this looks good to @icarito it looks good to me!

@ViditChitkara
Copy link
Member Author

cool! 👍

@jywarren jywarren requested a review from icarito June 30, 2018 16:13
@jywarren
Copy link
Member

jywarren commented Jul 3, 2018

Ack, sorry, this drifted out of sync as we merged a couple other things. @ViditChitkara can you resolve the conflicts and we can go ahead and merge this? Thanks!

@jywarren
Copy link
Member

jywarren commented Jul 3, 2018

I went ahead and resolved the issue, i hope this passes!

@jywarren jywarren merged commit b3defd3 into publiclab:master Jul 3, 2018
@ghost ghost removed the review-me label Jul 3, 2018
@jywarren
Copy link
Member

jywarren commented Jul 3, 2018

Should resolve #2779... but maybe it didn't? I see in stable:

+ make build
cp config/database.yml.example config/database.yml
cp db/schema.rb.example db/schema.rb
docker-compose down --remove-orphans
Circular dependency between web and db

Did I do something wrong in my resolving the conflicts here? It did pass Travis...

@ViditChitkara
Copy link
Member Author

Oops I guess I missed a lot, sorry couldn't do much as I was out yesterday!! I'll have a look at circular dependency.

@icarito
Copy link
Member

icarito commented Jul 4, 2018

I got it @ViditChitkara ! New PR in #2977

@icarito
Copy link
Member

icarito commented Jul 4, 2018

If this was working in unstable and wasn't anymore there was a difference between docker-compose-unstable and docker-compose-stable.

Currently the difference is only the port number so I'll make a PR for making this also configurable by environment variable.

@ViditChitkara
Copy link
Member Author

cool

@ViditChitkara
Copy link
Member Author

also, if you could have a look at production container. It looks good from my side though!

@icarito
Copy link
Member

icarito commented Jul 4, 2018

ok this should work in stable with #2977 - I'll work on production one now.

@ViditChitkara
Copy link
Member Author

ViditChitkara commented Jul 4, 2018 via email

@jywarren
Copy link
Member

jywarren commented Jul 7, 2018

https://publiclab.org/sidekiq 🎉

SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* changes in docker-compose.yml for redis fixes

* minor chnanges

* minor tweak

* add redis url to web container

* minor chane for testing

* minor chane for testing

* merge with master

* changes in tests

* Fix link to redis container

* Fix directory reference for sidekiq volume

* Fix circular dependency.

* Add link to redis container to testing compose file

* remove sidekiq admin constraints for testing

* sample cron job for testing on unstable

* changes for testing

* minor changes

* mysql connection fix

* mysql connection fix 2

* mysql connection fix 3

* mysql connection fix 4

* Try link to db.

* Add rails environment

* Update users_controller_test.rb

* minor chane for testing

* merge with master

* Fix circular dependency.

* Add link to redis container to testing compose file

* made docker-compose changes for production

* minor change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants