Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contributors
showCounttrue
showAnonymoustrue
showLastTimetrue

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 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


...




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




...

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


...

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

Sparc­request catalog manager for fulfillment

...

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:

...

  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

...