Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated README application instructions #134

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Records are arranged alphabetically with authors, titles, and subjects interfile

This project uses [asdf](https://asdf-vm.com/) (see .tool-versions for the current ruby version)

`bundle install` will install the dependencies for this project.
`bundle install` will install the dependencies for this project. Use `bundle install` also when updating ruby gems for this project.

## Database Setup

Expand All @@ -27,23 +27,51 @@ Startup: `rake servers:start`

## How to start application locally

Run the `bin/rails server` command, then in a browser connect to [localhost:3000](http://localhost:3000/)
Run the `bin/rails server` or `rails s` command, then in a browser connect to [localhost:3000](http://localhost:3000/)

## How to run the test suite

`bundle exec rspec spec`
`bundle exec rspec <spec/**/*>`

## Deploying

Currently, this application can not be deployed with pulbot. You must use Capistrano on the command line.
You may use Capistrano on the command line.

`BRANCH=branch_name bundle exec cap staging deploy`

`BRANCH=branch_name bundle exec cap production deploy`

Alternatively, you may deploy from [ansible-tower](https://ansible-tower.princeton.edu/).

## How to load data

We want to load in CSV files that contain GuideCards and SubGuides data, which was exported from the legacy version of this application. The data lives in the `data` folder of this project.
We want to load in CSV files that contain GuideCard and SubGuideCard data, which was exported from the legacy version of this application. The data lives in the `data` folder of this project.

To list all import services for the application: `rake -T | grep import`

To import the GuideCard records: `rake import:import_guide_cards`
To import the SubGuideCard records: `rake import:import_sub_guide_cards`

The CardImage records are the images that are included in the GuideCard and SubGuideCard records. These will take the longest to import (totaling ~1.5 million images).

To import the CardImage records: `rake import:import_card_images`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this requires some aws profile configuration; maybe that's worth noting here and fleshing out in the future when someone else tries to do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Anna,

I have updated the file with the requested changes. I included some instructions on setting up aws for a local machine (instructions based on onboarding.md). Do you think I should just leave it as a note, that aws setup is required, or that these instructions are detailed enough. Thanks!


*Note*: AWS configuration will be required for your local machine to access the AWS lambda service (puliiif-production s3 bucket where the images are stored).

### 1. Set up AWS account

1. Go to [https://princeton.edu/aws](https://princeton.edu/aws) and log in with Princeton credentials.
2. From the "Services" menu, select "IAM". (You might need to search for IAM in the search bar.) Under the "User" menu, create a new user. Use any user name you prefer, as long as it would be clear to your team mates that this name is associated with you. Choose AWS credential type "Access Key".

3. Record the Access Key ID and the Secret access key you'll get on the `Success` screen. You will need to add these to your local user profile when you set up AWS command line access.

### 2. Install and configure aws cli

1. Install the aws cli: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

2. Configure it using the Access key ID and Secret Access key attached to your account. Do this by running `aws configure` or following instructions [here](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html).

To import the GuideCards records: `rake import:import_guide_cards`
- Use default region `us-east-1`

## Install lux

Expand Down