Argo is the administrative interface to the Stanford Digital Repository.
- Install Docker
- Install Ruby
git clone https://github.com/sul-dlss/argo.git
cd argo
bundle install
Brings up app at localhost:3000 with some test data:
yarn install
docker compose up -d
bin/rails db:prepare
bin/dev
bin/rake argo:seed_data # run in separate terminal window
CI runs a series of steps; this the sequence to do it locally, along with some helpful info.
-
Pull down the latest docker containers
docker compose pull
-
Start up the docker services needed for testing
Once everything has been successfully pulled, start up the docker services needed for testing (all but the web container)
docker compose up -d
-
Install Chrome
You will need to have Google Chrome browser installed, as the tests use chrome for a headless browser.
-
Prepare rails for testing
bin/rails db:prepare test:prepare
-
Run the linters and the tests
bin/rake
To run just the linters, run bin/rake lint
. To run the linters individually, run bundle exec erb_lint --lint-all
, bundle exec rubocop
, and bundle exec rake jslint
Be sure all of the docker containers for dependent services are running in the background (e.g. solr, DSA) and stop the web container:
docker compose up -d
Create/prepare the dev/test databases:
bin/rails db:prepare
Start the development server - this should give you the Argo app on port 3000 mocking an admin login:
bin/dev
Most of the time (unless you already have data), you will want seed data and a single item. Note tha all servers must be running first, including web, and this will clear solr:
bin/rake argo:seed_data
For creating additional test data, see the section below "Creating fixture data".
When debugging locally, add a debugger
statement in the code and connect to the overmind process.
bin/overmind connect web
To run a headed browser, set the NO_HEADLESS
env variable. For example:
NO_HEADLESS=1 bundle exec rspec spec/system/item_view_spec.rb
To begin registering items in the Argo UI, there will need to be at least one agreement object and one APO object in the index. To create and index one of each of these objects, run the following command:
bin/rails db:seed
or if running on the docker container:
docker compose exec web bin/rails db:seed
To get these objects, in addition to a single item object (useful for development purposes), run this command (assumes local rails server):
bin/rake argo:seed_data
To register an arbitrary number of test item objects, specify the number you want:
bin/rake argo:register_items[1]
Note that in all cases, you will need a web server of some kind running (either in web docker container or a local rails server). Also note that creating the seed data will clear the existing Solr instance out (and you will have to confirm this).
Argo uses Blacklight and Solr to expose the repository contents, and dor-services-app
to enable editing and updating. Its key components include:
- Rails
- Blacklight
- dor-services-client
- RSolr
- Sidekiq
- Bootstrap
and in development or testing mode:
- RSpec
- Capybara
- Chrome
The Solr configuration is https://github.com/sul-dlss/sul-solr-configs/tree/master/argo_prod
To update this configuration, see the README.
When this configuration is updated, the configuration in solr_conf/
should also be updated for Argo testing using a Solr container.
Argo uses systemd to manage and monitor its Sidekiq-based background job workers in all deployed environments. See Sidekiq via systemd
- Reset the database
- Clear the bulk directory:
rm -fr /workspace/bulk/*
For information on how to profile the app in the event of performance issues, see PROFILING.md. This explains how to collect profiling info, how to analyze it, how to approach the issue generally, and alternatives/complements to Argo's main built-in profiling tool.
NOTE: The application is deployed continuously by our on-prem Jenkins service (sul-ci-prod
) to the staging environment on every merge to main
. See Jenkinsfile
for how that is wired up.