vagrant init centos/7
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb| vb.memory = "4096"
vb.cpus = 2 end
mkdir data
config.vm.synced_folder "data/", "/vagrant_data"
vagrant plugin install vagrantvbguest vagrant vbguest
vagrant reload
{+}https://github.com/sparcrequest/sparcrequest/blob/master/doc/easy_installation.pdf+
sudo yum update
sudo yum install y httpd
sudo yum install y httpddevel
sudo yum install y wget cd /opt
sudo wget http://repo.mysql.com/mysqlcommunityreleaseel75.noarch.rpm sudo rpm ivh mysqlcommunityreleaseel75.noarch.rpm
sudo yum install y mysqlserver sudo systemctl start mysqld sudo systemctl status mysqld
mysql u root
GRANT ALL ON . TO 'root';
\q
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 gitcore zlib zlibdevel gccc++ patch readline readlinedevel libyamldevel libffidevel openssldevel make bzip2 autoconf automake libtool bison curl sqlitedevel vim
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
git clone https://github.com/rbenv/rubybuild.git ~/.rbenv/plugins/rubybuild 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
gem install rails
{+}https://github.com/sparcrequest/sparcrequest/blob/master/doc/multi_institutional_documentatio+ n.md
I didn't do this, so the email function and single signon functions haven't been set up yet
gem install bundler nordoc nori
{+}https://github.com/thoughtbot/capybarawebkit/wiki/InstallingQtandcompilingcapybarawebkit+
{+}#centos7+
sudo yum install y epelrelease
sudo yum install y qt5qtwebkitdevel
QMAKE=/usr/lib64/qt5/bin/qmake gem install capybarawebkit v 1.14.0 (The default is >= 1.15.0)
echo 'export PATH="/usr/lib64/qt5/bin:$PATH"' >> ~/.bash_profile
sudo yum install y curldevel
gem install curb v '0.9.4'
sudo yum install y mysqldevel
gem install mysql2 v '0.4.10'
sudo mkdir /var/www/rails cd /var/www/rails
sudo chown vagrant:vagrant R /var/www/rails
cd /var/www/rails
git clone {+}https://github.com/sparcrequest/sparcrequest.git+
cd sparcrequest/
git checkout tags/release3.2.0 b ucilocaltest
cd sparcrequest
cp config/database.yml.example config/database.yml
RAILS_ENV="development" bundle install RAILS_ENV="development" rake db:create RAILS_ENV="development" rake db:migrate
gem install passenger NOTE Need to install Passenger in a different location that can only be modified by root
{+}https://linuxhint.com/howtodisableselinuxoncentos7/+
passengerinstallapache2module
Press enter
Press enter
Ctrlc
chmod o+x ~ Rerun the passengerinstallapache2module
Add these lines to /etc/httpd/conf/httpd.conf
sudo systemctl restart httpd
{+}http://seagullproject.org/Installation/SettingUpApacheVirtualHosts.html+ This is not working with sparc request (port is taken error), which needs to be fixed later
DocumentRoot/var/www/rails/sparcrequest/public
<Directory /var/www/rails/sparcrequest/public> Options FollowSymLinks MultiViews AllowOverride all
Allow from all
</Directory>
</VirtualHost>
sudo systemctl restart httpd
Initial Invoke for Sparcrequest
Create the initial institution and user
cd /var/www/rails/sparcrequest/ RAILS_ENV="development" rails console require 'initial_cm_creation' run_initial_setup
Or: cd /var/www/rails/sparcrequest/
RAILS_ENV="development" rails console initial_cm_creation
Import the missing values (not in the reference)
cd /var/www/rails/sparcrequest/ 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 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
cd /var/www/rails
git clone {+}https://github.com/sparcrequest/sparcfulfillment.git+
cd sparcfulfillment/
git checkout tags/release2.7.5 b ucilocaltest
rvm install ruby2.1.5
rvm use ruby2.1.5
Install bundle
cd sparcfulfillment
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 sparcrequest 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
RAILS_ENV="development" rake db:migrate
Run Test
bundle exec rspec (Failures may occur, just proceed to following steps)
Configure fulfillment url in sparcrequest'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
Sparcrequest rails server
cd /var/www/rails/sparcrequest rails server
cd /var/www/rails/sparcrequest bundle exec script/delayed_job start
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
cd /var/www/rails/sparcfulfillment/ rails server p 5000 b 0.0.0.0
Sparcfulfillment delayed_job
bundle exec bin/delayed_job start
Sparcfulfillment start faye
thin C config/faye.yml start
Questions:
Should I run Sparcrequest delayed_job start ? This will generate error in sparcrequest delayed jobs
cd /var/www/rails/sparcrequest bundle exec script/delayed_job start
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/passenger5.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/passenger5.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/passenger5.3.3/buildout/apache 2/mod_passenger.so into server:
/home/vagrant/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/passenger5.3.3/buildout/apache 2/mod_passenger.so: cannot open shared object *file:* Permission denied...
Reference: {+}https://www.linuxquestions.org/questions/linuxsoftware2/cannotopensharedobjectfilepermis+ {+}siondenied335104/+
Disable selinux: {+}https://linuxhint.com/howtodisableselinuxoncentos7/+
)
Home Page:
SPARC Dashboard→New Protocal
Cannot proceed in shopping
SPARCCatalog
(For checking port status, also consider the following command, which might not work on MacOS
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)
Update remote service notifier host from 127.0.0.1:5000 to 192.168.33.10:5000
sparcfulfillment/config/database.yml
fulfillment/current/log/fulfillment_faye_thin.9292.log
RAILS_ENV=development bundle exec rake jobs:clear
Log appears after thin C config/faye.yml start sparcfulfillment/config/faye.yml
sparcfulfillment/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