SPARC Wiki

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Wenjun He (Unlicensed) 1 (1999 days ago)

Set up Vagrant


Init

vagrant init centos/7

Config private network

config.vm.network "private_network", ip: "192.168.33.10"

Config memory and cpus

config.vm.provider "virtualbox" do |vb| vb.memory = "4096"
vb.cpus = 2 end

Add synced folder

mkdir data
config.vm.synced_folder "data/", "/vagrant_data"

Install Vagrant­vbguest

vagrant plugin install vagrant­vbguest vagrant vbguest

Reload

vagrant reload

Installation for Sparc­request


Reference

{+}https://github.com/sparc­request/sparc­request/blob/master/doc/easy_installation.pdf+

Update Yum

sudo yum update

Install Httpd

sudo yum install ­y httpd
sudo yum install ­y httpd­devel

Install and run MySQL

sudo yum install ­y wget cd /opt
sudo wget http://repo.mysql.com/mysql­community­release­el7­5.noarch.rpm sudo rpm ­ivh mysql­community­release­el7­5.noarch.rpm
sudo yum install ­y mysql­server sudo systemctl start mysqld sudo systemctl status mysqld

Temporarily give root permission to be connected remotely

mysql ­u root
GRANT ALL ON . TO 'root';
\q

Install Ruby

I installed ruby 2.4.2p198
Based on my conversation with the SparcRequest team, I don't think it has to be 1.9.3
sudo yum install ­y git­core zlib zlib­devel gcc­c++ patch readline readline­devel libyaml­devel libffi­devel openssl­devel make bzip2 autoconf automake libtool bison curl sqlite­devel vim
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
git clone https://github.com/rbenv/ruby­build.git ~/.rbenv/plugins/ruby­build echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init ­)"' >> ~/.bash_profile source ~/.bash_profile
rbenv install ­v 2.4.2 rbenv global 2.4.2 ruby ­v

Install Rails

gem install rails

Configure based on multi_institutional_documentation

{+}https://github.com/sparc­request/sparc­request/blob/master/doc/multi_institutional_documentatio+ n.md
I didn't do this, so the email function and single sign­on functions haven't been set up yet

Install bundle

gem install bundler ­­no­rdoc ­­no­ri

Install capybara­webkit 1.14.0

{+}https://github.com/thoughtbot/capybara­webkit/wiki/Installing­Qt­and­compiling­capybara­webkit+
{+}#centos­7+
sudo yum install ­y epel­release
sudo yum install ­y qt5­qtwebkit­devel
QMAKE=/usr/lib64/qt5/bin/qmake gem install capybara­webkit ­v 1.14.0 (The default is >= 1.15.0)
echo 'export PATH="/usr/lib64/qt5/bin:$PATH"' >> ~/.bash_profile

Install curl­devel

sudo yum install ­y curl­devel

Install curb 0.9.4

gem install curb ­v '0.9.4'

Install mysql­devel

sudo yum install ­y mysql­devel

Install mysql2 0.4.10

gem install mysql2 ­v '0.4.10'

Mkdir /var/www/rails

sudo mkdir /var/www/rails cd /var/www/rails

Chown permission on /var/www/rails

sudo chown vagrant:vagrant ­R /var/www/rails

Git Clone SPARC Request Repository

cd /var/www/rails
git clone {+}https://github.com/sparc­request/sparc­request.git+

Check out v3.2.0

cd sparc­request/
git checkout tags/release­3.2.0 ­b uci­local­test

Setup config/database.yml

cd sparc­request
cp config/database.yml.example config/database.yml

Set the env to be development

RAILS_ENV="development" bundle install RAILS_ENV="development" rake db:create RAILS_ENV="development" rake db:migrate

Install Phusion Passenger

gem install passenger NOTE Need to install Passenger in a different location that can only be modified by root

Disable selinux

{+}https://linuxhint.com/how­to­disable­selinux­on­centos­7/+

Install the Passenger Apache Module

passenger­install­apache2­module

Press enter

Press enter

Ctrl­c
chmod o+x ~
Rerun the passenger­install­apache2­module

Add these lines to /etc/httpd/conf/httpd.conf
sudo systemctl restart httpd

Create a virtual host entry for the application

{+}http://seagullproject.org/Installation/SettingUpApacheVirtualHosts.html+ This is not working with sparc request (port is taken error), which needs to be fixed later

<VirtualHost *:80> ServerNamelocalhost

DocumentRoot/var/www/rails/sparc­request/public
<Directory /var/www/rails/sparc­request/public> Options FollowSymLinks MultiViews AllowOverride all
Allow from all
</Directory>
</VirtualHost>
sudo systemctl restart httpd


Depending on your settings you may need to chmod the application directory ( I had to chmod ­R 777 the directory to get write permissions for log and cache files to work with apache)




Initial Invoke for Sparc­request
Create the initial institution and user
cd /var/www/rails/sparc­request/ RAILS_ENV="development" rails console require 'initial_cm_creation' run_initial_setup
Or: cd /var/www/rails/sparc­request/
RAILS_ENV="development" rails console initial_cm_creation

Fix the error URL







Import the missing values (not in the reference)
cd /var/www/rails/sparc­request/ cd lib/tasks/
rake import_permissible_values




Set up Super User
{+}https://sparcrequest.atlassian.net/wiki/spaces/AG/pages/144572417/SPARCRequest+and+SPA+ RCFulfillment+User+Rights

Create Provider











Create Program






Create Service









Status Options (Editable status)
At provider level, we can just use the default
At the program level, we need to checkout the status that we allow pi or other user to edit




Installation for Sparc­fulfillment

Red words are supplements to original README.md

Git Clone SPARC Fulfillment Repository

cd /var/www/rails
git clone {+}https://github.com/sparc­request/sparc­fulfillment.git+

Check out v2.7.5

cd sparc­fulfillment/
git checkout tags/release­2.7.5 ­b uci­local­test

Install Ruby (Skipped since has been done in request)

rvm install ruby­2.1.5
rvm use ruby­2.1.5
Install bundle
cd sparc­fulfillment
RAILS_ENV="development" bundle install
Create local database for rails server
mysql ­u root
CREATE SCHEMA sparc_fulfillment; GRANT ALL ON sparc_fulfillment.* TO 'sparc'@'localhost'; (original from doc)
GRANT ALL ON sparc_fulfillment.* TO 'root'; (Update)
CREATE SCHEMA test_sparc_fulfillment; GRANT ALL ON test_sparc_fulfillment.* TO 'sparc'@'localhost'; (original from doc)
GRANT ALL ON test_sparc_fulfillment.* TO 'root'; (Update)
These cannot be done since the database exists. CREATE SCHEMA test_sparc_request; GRANT ALL ON test_sparc_request.* TO 'sparc'@'localhost';
Configure local databases named sparc_fulfillment, test_sparc_fulfillment, and test_sparc_request
database.yml
configure config/database.yml to connect to your dev(sparc_fulfillment) and test databases(test_sparc_fulfillment)
For version 2.7.5


shards.yml
configure config/shards.yml to connect to your dev(sparc_rails_development) and test sparc­request databases(test_sparc_request)
faye.yml

.env
Configure .env by copying from dotenv.example
Specify SPARC_API_HOST(video 53:20) to be a specific IP address instead of localhost, and replace :5000 with :3000. Since this is not for Fulfillment, but for Request

Copy these to SparcRequest's settings table
SPARC_API_USERNAME=iyqu2bm3T4rDWWpnwYfEl2i6o2Sphpuq_TKvFnIOTA0 SPARC_API_PASSWORD=qL1oZmdMi7OU7G1f0q6aCTVR6HrmoNmpZVNc8DfHqek remote_service_notifier_username
remote_service_notifier_password

DB Migrate

RAILS_ENV="development" rake db:migrate
Run Test
bundle exec rspec (Failures may occur, just proceed to following steps)
Configure fulfillment url in sparc­request's settings table
remote_service_notifier_host: fulfillment host address
"192.168.33.10:5000"
host: sparcrequest host address
"192.168.33.10:3000"
clinical_work_fulfillment_url: fulfillment url http://192.168.33.10:5000
Sparc­request rails server
cd /var/www/rails/sparc­request rails server


Sparc­request delayed_job start

cd /var/www/rails/sparc­request bundle exec script/delayed_job start

Sparc­request catalog manager for fulfillment

In catalog manager: turn on "Fulfillment" for an Institution, Provider, Program, or Core and give yourself "Fulfillment Provider Rights"


Configure this for both provider and program



Sparc­fulfillment rails server

cd /var/www/rails/sparc­fulfillment/ rails server ­p 5000 ­b 0.0.0.0
Sparc­fulfillment delayed_job
bundle exec bin/delayed_job start
Sparc­fulfillment start faye
thin ­C config/faye.yml start



Questions:
Should I run Sparc­request delayed_job start ? This will generate error in sparcrequest delayed jobs
cd /var/www/rails/sparc­request bundle exec script/delayed_job start

What is Order


What is incomplete status
What is service level component
Understand the relationship between two tables in MySQL: sparc_fulfillment/identity_counters
sparc_rails_development/identities
(after clicking "send to fulfillment", data updated based on the current user who conduct the push)



Appendix
Issue by SELinux when install the Passenger Apache Module
(which requires: Load passenger_module "Almost there!
Please edit your Apache configuration file, and add these lines: LoadModule passenger_module
/home/vagrant/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/passenger­5.3.3/buildout/apache
2/mod_passenger.so
<IfModule mod_passenger.c> PassengerRoot
/home/vagrant/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/passenger­5.3.3 PassengerDefaultRuby /home/vagrant/.rbenv/versions/2.4.2/bin/ruby
</IfModule>
After you restart Apache, you are ready to deploy any number of web applications on Apache, with a minimum amount of configuration!
Press ENTER when you are done editing." Problem appeared:
Jul 10 01:29:25 localhost.localdomain httpd[8872]: httpd: Syntax error on line 356 of
/etc/httpd/conf/httpd.conf: Cannot load
/home/vagrant/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/passenger­5.3.3/buildout/apache 2/mod_passenger.so into server:
/home/vagrant/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/passenger­5.3.3/buildout/apache 2/mod_passenger.so: cannot open shared object *file:* Permission denied...
Reference: {+}https://www.linuxquestions.org/questions/linux­software­2/cannot­open­shared­object­file­permis+ {+}sion­denied­335104/+
Disable selinux: {+}https://linuxhint.com/how­to­disable­selinux­on­centos­7/+
)



Issues occurred before import_permissible_values:


Home Page:

  1. Link: "localhost" does not work, should be changed to 192.168.33.10


SPARC Dashboard→New Protocal

  1. Cannot select funding status


  1. Not sure what is this

  1. Values missed


  1. Cannot find PI


Cannot proceed in shopping

  1. Service Calendar


SPARCCatalog

    1. Status Options don't contain specific values

    1. Provider % Service Provider: Confusion







Trouble shooting video takeaways:




(For checking port status, also consider the following command, which might not work on MacOS(smile)

Copy SPARC_API_USERNAME & SPARC_API_PASSWORD in .env(video 35:25) to remote_service_notifier_userame & remote_service_notifier_password in config/application.yml(video 38:10)
Delayed_job and thin server should be running(video 11:30) (Video 46:00)
Specify SPARC_API_HOST(video 53:20) to be a specific IP address instead of localhost, and replace :5000 with :3000(Since this is not for Fulfillment, but for Request). After restarting fulfillment and request, bundle exec bin/delayed_job start working.
(Video 59:47)



2018.9.4 19:35 Try

Update remote service notifier host from 127.0.0.1:5000 to 192.168.33.10:5000

2018.9.5 13:17 Try

sparc­fulfillment/config/database.yml
fulfillment/current/log/fulfillment_faye_thin.9292.log

Clean delayed_jobs in database

RAILS_ENV=development bundle exec rake jobs:clear


Log appears after thin ­C config/faye.yml start sparc­fulfillment/config/faye.yml

sparc­fulfillment/config/shards.yml
Logs appearing after "send to fulfillment" and "go to fulfillment"


Data appears in sparc_rails_development/delayed_jobs after "send to fulfillment" and "go to fulfillment"
While sparc_fulfillment/delayed_jobs remains the same

  • No labels