Commit Graph

7 Commits

Author SHA1 Message Date
Ian Wienand 368466730c Migrate codesearch site to container
The hound project has undergone a small re-birth and moved to

 https://github.com/hound-search/hound

which has broken our deployment.  We've talked about leaving
codesearch up to gitea, but it's not quite there yet.  There seems to
be no point working on the puppet now.

This builds a container than runs houndd.  It's an opendev specific
container; the config is pulled from project-config directly.

There's some custom scripts that drive things.  Some points for
reviewers:

 - update-hound-config.sh uses "create-hound-config" (which is in
   jeepyb for historical reasons) to generate the config file.  It
   grabs the latest projects.yaml from project-config and exits with a
   return code to indicate if things changed.

 - when the container starts, it runs update-hound-config.sh to
   populate the initial config.  There is a testing environment flag
   and small config so it doesn't have to clone the entire opendev for
   functional testing.

 - it runs under supervisord so we can restart the daemon when
   projects are updated.  Unlike earlier versions that didn't start
   listening till indexing was done, this version now puts up a "Hound
   is not ready yet" message when while it is working; so we can drop
   all the magic we were doing to probe if hound is listening via
   netstat and making Apache redirect to a status page.

 - resync-hound.sh is run from an external cron job daily, and does
   this update and restart check.  Since it only reloads if changes
   are made, this should be relatively rare anyway.

 - There is a PR to monitor the config file
   (https://github.com/hound-search/hound/pull/357) which would mean
   the restart is unnecessary.  This would be good in the near and we
   could remove the cron job.

 - playbooks/roles/codesearch is unexciting and deploys the container,
   certificates and an apache proxy back to localhost:6080 where hound
   is listening.

I've combined removal of the old puppet bits here as the "-codesearch"
namespace was already being used.

Change-Id: I8c773b5ea6b87e8f7dfd8db2556626f7b2500473
2020-11-20 07:41:12 +11:00
Monty Taylor d5c68c5131 Split codesearch into its own playbook
Make a service playbook, manifest and jobs for codesearch.

Remove openstack_project::server - it doesn't do anything.

Change-Id: I44c140de4ae0b283940f8e23e8c47af983934471
2020-04-21 13:18:28 -05:00
Ian Wienand d66ebca331 Fix codesearch stderr capturing
Fix the stderr capture

Update the script slightly to be more robust cleaning up with an exit
trap, and put a date stamp in when the script starts to differentiate
runs in the logs.

Change-Id: Ie7a75d9151734799c4e4767e75f750b05957205b
2017-12-20 16:02:38 +11:00
Ian Wienand de79f06585 Put hound sync lock in /var/run
/var/run/hound isn't a directory, so this fails.  It was supposed to
just be in /var/run.

Also, we don't want to run it every minute of 4am ...

Change-Id: I7298a0e18a63bf8331686bd4c44e3a12b9c77176
2017-12-18 15:14:07 +11:00
Ian Wienand 795bf1c971 Fixes for codesearch resync
This provides a script to resync the hound configuration for
codesearch.

It checks if the config needs updating, and if so, puts the new config
file in place, takes the reindex lock from
I9d28201bca75b624e07cbba14c870151094fc7ae and restarts the service,
waiting until it sees it is up.

puppet is currently disabled on this host because updates are tied to
project-config changes; since restarting takes the service down this
is obviously not great.

Change-Id: Iaebf50836607da447dcf1765ec01d0121537b0da
Depends-On: I9d28201bca75b624e07cbba14c870151094fc7ae
2017-12-14 09:48:01 +11:00
Paul Belanger 58148d3f21 Subscribe to project_config for create-hound-config
In an effort to reduce how often this runs.  A future patch would add
better support into jeepyb to detect if the file actually changes, if
so return a different return code and have puppet only notify the
hound servce to reload.

Change-Id: I29c7e41ee0e605d290dc360db10149e157d09a0d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-03-03 15:01:22 -05:00
Emma Barber 17b4cbc317 Add codesearch.o.o node and module
puppet-hound is in working order. This adds puppet-hound to
INTEGRATION_MODULES, creates a new codesearch.o.o node,
and installs hound on it.

Depends-On: Ie4b6509947f58407c4cc6f5a2c7c2bc84c619ce9
Change-Id: I238b05e8b25229d7dcf840441cd9d3af09f3e249
2015-10-29 17:20:58 -07:00