Discovery application for Emory's Cor repository.
-
Ruby version 2.7.5, Rails version 5.1
-
Blacklight 7
-
MySQL 5.7.22
- Install and start up MySQL 5.7
- Clone the git repo:
git clone git@github.com:emory-libraries/dlp-lux.git cd ./dlp-lux- Install the required gems:
bundle install - Configure the MySQL development and test databases. This is accomplished by setting the environment variables that
database.ymlexpects. In the root directory of the application, create a.envfile and add the lineDATABASE_USERNAME=root. (By default, MySQL has the usernamerootwith no password.) Also create a.env.developmentfile and a.env.testfile and add the linesDATABASE_NAME=dlp-lux_developmentandDATABASE_NAME=dlp-lux_test, respectively. - In order to be able to sign into the application locally, the environment variable
DATABASE_AUTH=truemust be set in your development environment.
- You must create a user via the rails console:
bundle exec rails c
u = User.new
u.uid = "user"
u.display_name = "User Name"
u.email = "email@testdomain.com"
u.password = "password"
u.password_confirmation = "password"
u.save- In order to see objects with a visibility of "Rose High View", your IP must match an address on the server in
config/reading_room_ips.yml. See the existing file for the example setup. - Create and migrate the development database:
rails db:create db:migrate - Create and migrate the test database:
RAILS_ENV=test rails db:create db:migrate - Migrate the database:
rails db:migrate - Install UV and any other JS dependencies:
yarn install - Launch development instance of solr:
solr_wrapper - Launch test instance of solr:
solr_wrapper --config config/solr_wrapper_test.yml - Run the tests to ensure everything is working as expected:
rspec spec - Launch a rails server:
rails server - You should now be able to go to
http://localhost:3000and see the application
- The
IIIF_MANIFEST_URLenvironment variable needs to be set. This URL is the base URL for the Hyrax instance that serves the Work's IIIF manifest. An example:https://curate-qa.curationexperts.com/concern/curate_generic_works/. - The
THUMBNAIL_URLenvironment variable needs to be set. This URL is the base URL for the Hyrax instance that serves the Work's thumbnail images. An example:https://curate-qa.curationexperts.com
In order to prevent search engine crawling of the system before it's ready to launch, we use HTTP password protection. This is set via environment variables.
Set HTTP_PASSWORD_PROTECT='true' to enable this feature.
Set HTTP_PASSWORD_PROTECT='false' to disable this feature.
Set the login and password via environment variables HTTP_USERNAME and HTTP_PASSWORD
- Connect to
vpn.emory.edu - Pull the latest version of
main - Stub AWS' environment variables for
Emory Account 70within the same terminal window. These can be found in the page loaded after logging into Emory's AWS. Directions below: a. After logging in, the page should be theAWS access portal. A table of multiple accounts should be presesnt (typically three). Expand theEmory Account 70option. b. Clicking onAccess keyswill open a modal with multiple credential options. Option 1 (Set AWS environment variables) is necessary for successful deployment. c. Copy the variables in Option 1, paste them into the terminal window that the deployment script will be processed, and press enter. - To deploy, run
BRANCH={BRANCH_NAME_OR_TAG} bundle exec cap {ENVIRONMENT} deploy. To deploy main to the arch environment, for instance, you runBRANCH=main bundle exec cap arch deploy.
If errors occur when running the deployment script, there could be a couple of factors causing them:
- Ensure you are authorized to access the server you are deploying to. You can verify your access by trying to ssh into the server e.g.
ssh deploy@SERVER_IP_ADDRESS. - The server IP lookup processing may not be working. In this case, stub the backup environment variables for the desired server in the local
.env.developmentfile. The list of backup environment variables are below:
ARCH_SERVER_IP=
TEST_SERVER_IP=
PROD_SERVER_IP=
- Run
rspec specto run the default test suite - To run only specific tests, include
- the directory, e.g.
rspec spec/system, - or the path to the test, e.g.
rspec spec/system/search_catalog_spec.rb, - or, if you want to be super specific, you can even add the line number the spec starts on at the beginning, e.g.
rspec spec/system/search_catalog_spec.rb:178 - Can also run with tags, e.g.
rspec spec --tag relevancy:true
- the directory, e.g.
- Run
PROD_LIKE_ENV=qa|test|arch|prod rake lux:relevancy - This rake task takes a prod-like environment as a variable and runs specs to ensure that search and indexing of active data are running as expected.
- Before your announced testing time window:
- Install Apache Jmeter https://jmeter.apache.org/
- From the project jmeter directory, run jmeter in GUI mode (
jmeterwith no command-line arguments on unix-like systems). - Open
jmeter/blacklight.jmxfrom the file menu. - In the
User Defined Variablespanel, set the values ofthreadsandloopsto 1 for initial smoke-test run. - Check that the server name in the
HTTP Request Defaultsmatches the server you want to run against (digital.library.emory.edufor production) - Add a username and password to the
HTTP Authorization Managerif running against a system with HTTP basic auth in place. - "Save test plan as" and a temporary filename (blacklight-tmp.jmx for instance)
- Run jmeter from the command line, replacing "trialname" with an unused filename:
jmeter -n -t blacklight-tmp.jmx -l trialname.jtl -e -o report-trialname - Look for "Err: 0 (0.00%)" in the jmeter output; if there were errors, troubleshoot those before continuing to load testing.
- During your announced testing time window:
- Re-open your temporary copy of the test plan in the jmeter GUI
- In the
User Defined Variablespanel, set the value ofthreadsto the initial number of simultaneous users you want to simulate, and the value ofloopsto the number of times you want each simulated user to run through the suite of pages. Save your changes. - Run jmeter from the command line, replacing "trialname" with a new unused filename:
jmeter -n -t blacklight-tmp.jmx -l trialname.jtl -e -o report-trialname - Repeat the previous two steps for each level of load to be simulated.
- Install and run Apache Jmeter in GUI mode as above.
- Open
jmeter/smoke-test.jmxfrom the file menu. - Add a username and password to the
HTTP Authorization Managerif running against a system with HTTP basic auth in place. - Hit the green forward arrow to start the tests running.
- View the results in "View Results Tree" (green with a checkmark for successes, red with an x for failures)