facebook / grocery-delivery

The Grocery Delivery utility for managing cookbook uploads to distributed Chef backends.
Apache License 2.0
154 stars 55 forks source link

Missing install instructions #49

Open vladionescu opened 5 years ago

vladionescu commented 5 years ago

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 5 years ago

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
vladionescu commented 5 years ago

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.

vladionescu commented 5 years ago

For anyone following along, install is broken right now due to an upstream bug and a workaround exists: Originally posted by @jaymzh in https://github.com/facebook/grocery-delivery/issues/48#issuecomment-460344253

Install instructions to come soon.

jaymzh commented 5 years ago

@vladionescu are you still interested in contributing install instructions?

vladionescu commented 5 years ago

I am, apologies for forgetting this. My host got borked a few months ago and I haven't gotten around to fixing it yet.

On Mon, May 6, 2019, 14:11 Phil Dibowitz notifications@github.com wrote:

@vladionescu https://github.com/vladionescu are you still interested in contributing install instructions?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/grocery-delivery/issues/49#issuecomment-489778081, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJRRFNVT45SLZXEPSBCZ73PUCNF7ANCNFSM4GUBCNPA .