facebook/grocery-delivery

Missing install instructions

Opened this issue · 5 comments

There is no guidance on how to install gd. Ideally it would be a section in README.md or an INSTALL.md file could be added to the repo.

I'm willing to write the instructions once I figure out how to get it running myself 😄

bwann commented

Granted, it's not explicitly shown in the docs but there's not much to running g-d. After putting in the config file, run it with -v and/or look for messages in /var/log/messages. If it has problems checking out your repo, if there's a cookbook dependency problem (e.g. metadata requires a cookbook but it's not in the repo), or it can't connect to your chef server, it's pretty verbose about any errors. Then throw it in cron/systemd timer to run frequently forever.

[root@basic07 ~]# /opt/chef/embedded/bin/grocery-delivery
WARN: Attempting to acquire lock
WARN: Lock acquired
WARN: Updating repo
WARN: Determing changes... from 2108 to 2109
WARN: Added cookbooks: ["wn_homenet"]
WARN: Deleted cookbooks: []
WARN: Added roles: []
WARN: Deleted roles: []
WARN: Added databags: []
WARN: Deleted databags: []
WARN: Success at 2109
[root@basic07 ~]#

[root@basic07 ~]# /opt/chef/embedded/bin/grocery-delivery -v
WARN: Attempting to acquire lock
WARN: Lock acquired
WARN: Updating repo
INFO: Running "svn cleanup /var/chef/grocery_delivery_work/chef"
INFO: Running "svn revert -R /var/chef/grocery_delivery_work/chef"
INFO: Running "svn update /var/chef/grocery_delivery_work/chef"
INFO: Running "svn info /var/chef/grocery_delivery_work/chef"
WARN: Repo has not changed, nothing to do...
WARN: Success at 2109

Whichever user is running g-d, will also need a knife config to upload stuff to the chef user. If you're doing this as root, then root will need a ~/.chef/knife.rb config. You can go one step further and create a write-only validation key just for grocery-delivery uploads:

[root@basic07 .chef]# cat /root/.chef/knife.rb
# Knife configuration for Grocery Delivery to upload to a Chef Server.
#
# This file is managed by Chef.  Do not make any changes to this file or
# they will be overwritten.

log_level :info
log_location STDOUT
node_name 'wn_gd_uploader'
client_key '/root/.chef/wn_gd_uploader-priv.pem'
validation_client_name 'wannnet-validator'
validation_key '/etc/chef-server/wannnet-validation.pem'
cookbook_path '/var/chef/grocery_delivery_work/chef/cookbooks/'
# Beware of using something other than localhost, or you could unintentionally
# hork a different server than expected someday.
chef_server_url 'https://localhost:443'
ssl_verify_mode :verify_none

Thanks!

That part is easy to pick up, the trouble I ran into is figuring out how to land /opt/chef/embedded/bin/grocery-delivery on disk. I tried /opt/opscode/embedded/bin/gem install grocery_delivery from https://clburlison.com/chef-grocery-delivery-setup/ but due to my chef-workstation setup gd won't run. I didn't know about the chefdk dependency.

For anyone following along, install is broken right now due to an upstream bug and a workaround exists: Originally posted by @jaymzh in #48 (comment)

Install instructions to come soon.

@vladionescu are you still interested in contributing install instructions?