Public UI for the LAE Project.
MacOS with Homebrew:
$ brew update
$ brew install postgresql
$ brew services start postgresql
$ rake db:create
$ rake db:migrate
$ rake server
This will start Solr, index some sample data, and run the application.
Clear your solr index with:
$ rake lae:drop_index
Then index sample data with:
$ rake lae:index_fixtures
Note: This will take about an hour to finish indexing all data, but data will show up in your index after 500 records have been indexed.
$ rake ci
$ rake server:test
Then, in another terminal window:
$ rake spec
To run a specific test:
$ rake spec SPEC=path/to/your_spec.rb:linenumber
Default branch for deployment is main
. You can specify a branch using the BRANCH environment variable.
$ BRANCH=my_branch cap staging deploy # deploys my_branch to staging
$ cap staging deploy # deploys main branch to staging
Auto-update from Figgy (formerly Plum)
Figgy announces events to a durable RabbitMQ fanout exchange. In order to use them, do the following:
- Configure the
events
settings inconfig/config.yml
- Run
WORKERS=PlumEventHandler rake sneakers:run
This will subscribe to the figgy events and update the LAE records when they're created, updated, or deleted.
It takes about 5.5 hours.
- Create a new collection via the solr admin panel
- ssh to an lae box and start a tmux session. run
rake lae:reindex
If there's been any sort of interruption in the rabbitmq exchange, once it's restored you'll probably need to reindex on production. During the downtime things may have been deleted from figgy, so the preferred reindex process is to write a fresh index and then swap over to it.
- Create a new collection via the solr admin panel
- Turn off sneakers workers on prod machines. This keeps us from missing updates that happen while we're building the new index.
- ssh to an lae box and start a tmux session. run
rake lae:reindex_alternate SOLR_URL=[solr_url_with_new_collection]
- Once it's done, go to the solr admin panel and confirm that the index has the number of documents you expect. You have to submit an edismax query.
- On the solr admin panel, swap the lae-prod alias to point to the new collection.
- start sneakers workers again.