Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
working-directory: ./server
ruby-version: '3.1'
ruby-version: '4.0.3'
bundler-cache: true

- name: Deploy
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.1.2'
ruby-version: '4.0.3'
working-directory: ./server

- name: 'Set up DB'
env:
CI_BUILD: true
RAILS_ENV: test
run: bundle exec rails db:create db:structure:load
run: bundle exec rails db:create db:schema:load
working-directory: ./server

- name: 'Run tests'
Expand Down
36 changes: 13 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ A from-scratch rewrite of the [Drug-Gene Interaction Database](https://dgidb.org

First, make sure you have all of the following installed:

- [RVM](https://rvm.io/rvm/install#any-other-system) -- choose the stable version
- [mise](https://mise.jdx.dev/). The easiest method is `brew install mise`. You will likely also want to [automatically activate it in your shell](https://mise.jdx.dev/getting-started.html#activate-mise).
- PostgreSQL, either from [here](https://wiki.postgresql.org/wiki/Homebrew) or [here](http://postgresapp.com)
- [NPM/Node](https://nodejs.org/en/download/)

Clone and enter the repository:

Expand All @@ -19,29 +18,22 @@ git clone https://github.com/dgidb/dgidb-v5
cd dgidb-v5
```

### Server setup

First, you may need to switch your Ruby version with RVM to match the version declared in the first few lines of the [Gemfile](server/Gemfile). For example, to switch to version 3.1.0:
Then install the correct versions of node, ruby, and python by running the following:

```shell
rvm install 3.1.0
rvm 3.1.0
mise trust
mise install
```
This will also automaticaly set up and activate a python virtualenv.

### Server setup

From the repo root, enter the [server subdirectory](server/):

```shell
cd server
```

If RVM is properly installed, you should expect to encounter a warning message here:

```
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore ./Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.
```

Next, install Rails and other required gems with `bundle`:

```shell
Expand All @@ -55,13 +47,13 @@ pg_ctl -D /opt/homebrew/var/postgres start
# on older macs you may need to use a different path instead, eg "pg_ctl -D /usr/local/var/postgres start"
```

The database must be constructed manually. This command will also vary, but it should be something like this:
Create the database and load in the schema:

```
createdb -U postgres dgidb
```shell
rails db:setup
```

Next, back in the main shell, import a database dump file (ask on Slack if you need the latest file):
Next, import a database dump file (ask on Slack if you need the latest file):

```shell
psql -d dgidb -f dgidb_dump_20220526.psql # provide path to data dump
Expand All @@ -83,18 +75,16 @@ To perform a data load from scratch, first run the `reset` task to provide a cle
rake db:reset
```

Some Python libraries are required for importing data. From the repo root, create a Python virtual environment and install required dependencies:
Some Python libraries are required for importing data. From the repo root, install required dependencies:

```shell
python3 -m venv .venv
source .venv/bin/activate
pip install -r scripts/requirements.txt
```

A Python script is supplied to ensure that primary source data is available. This can also be used to acquire new versions of data that supply discrete releases (like ChEMBL):

```
python3 scripts/download_files.py
python scripts/download_files.py
```

Then, load claims:
Expand Down
12 changes: 12 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[tools]
node = "24"
ruby = "4.0.3"
python = "3.14"


[env]
_.python.venv = {
path = ".venv",
create = true
}

40 changes: 17 additions & 23 deletions server/Gemfile
Original file line number Diff line number Diff line change
@@ -1,57 +1,51 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "~>3.1.0"
ruby "4.0.3"
gem "rack-cors"

gem "rails", "~> 6.1.3", ">= 6.1.3.1"
gem "pg", "~>1.2.3"
gem "puma"
gem "rails", "~> 8.1.3"
gem "pg", "~> 1.6"
gem "puma", "~> 7.2"
gem "rufo"
gem "propshaft"

gem "graphql", "~> 2.3.14"
gem 'graphql-batch', '~>0.5.3'
gem "graphiql-rails", "~> 1.7.0"
gem "graphql", "~> 2.6"
gem "graphql-batch", "~> 0.6.1"
gem "graphiql-rails", "~> 1.10"
gem "search_object_graphql", "~> 1.0.5"

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.4.4", require: false

# Background job processing
gem 'sidekiq', '~> 7.1.2'
gem "sidekiq", "~> 8.1"

# versions pinned for security vulnerability reasons
gem "actionpack", ">= 6.1.4.6"
gem "activestorage", ">= 6.1.4.7"
# version pinned for security vulnerability reasons
gem "nokogiri", ">= 1.13.2"

# Importer dependencies
gem "graphql-client", "~> 0.23.0"
gem "graphql-client", "~> 0.26"
gem "ruby-progressbar"
gem "csv"
gem "sqlite3", require: false
gem "zlib", require: false
gem "net-ftp", require: false
gem "rubyzip", require: false

# loading workaround until we update rails to 7
gem "net-smtp", require: false
gem "net-imap", require: false
gem "net-pop", require: false

# required for ssh tasks
gem 'ed25519'
gem 'bcrypt_pbkdf'
gem "ed25519"
gem "bcrypt_pbkdf"

group :development, :test do
gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
gem "rspec-rails", "~> 5.1"
gem "debug", platforms: [:mri, :windows]
gem "rspec-rails", "~> 8.0"
gem "factory_bot", "~> 6.2"
gem "capybara"
end

group :development do
gem "listen", "~> 3.3"
gem "spring"
gem "rack-mini-profiler"

gem "capistrano"
Expand All @@ -60,4 +54,4 @@ group :development do
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "tzinfo-data", platforms: [:windows, :jruby]
Loading
Loading