Contributors | ||||||
---|---|---|---|---|---|---|
|
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 Vagrantvbguest
vagrant plugin install vagrantvbguest vagrant vbguest
Reload
vagrant reload
Installation for Sparcrequest
Reference
{+}https://github.com/sparcrequest/sparcrequest/blob/master/doc/easy_installation.pdf+
Update Yum
sudo yum update
Install Httpd
sudo yum install y httpd
sudo yum install y httpddevel
Install and run MySQL
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
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/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
Install bundle
gem install bundler nordoc nori
Install capybarawebkit 1.14.0
{+}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
Install curldevel
sudo yum install y curldevel
Install curb 0.9.4
gem install curb v '0.9.4'
Install mysqldevel
sudo yum install y mysqldevel
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/sparcrequest/sparcrequest.git+
Check out v3.2.0
cd sparcrequest/
git checkout tags/release3.2.0 b ucilocaltest
Setup config/database.yml
cd sparcrequest
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/howtodisableselinuxoncentos7/+
Install the Passenger Apache Module
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
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/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
Fix the error URL
Import the missing values (not in the reference)
cd /var/www/rails/sparcrequest/ cd lib/tasks/
rake import_permissible_values
Update navbar_links
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/sparcrequest/sparcfulfillment.git+
Check out v2.7.5
cd sparcfulfillment/
git checkout tags/release2.7.5 b ucilocaltest
Install Ruby (Skipped since has been done in request)
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
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 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
Sparcrequest catalog manager for fulfillment
...
Sparcfulfillment rails server
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 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/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/+
)
Issues occurred before import_permissible_values:
...
- Cannot select funding status
- Not sure what is this
- Values missed
- Cannot find PI
Cannot proceed in shopping
- Service Calendar
SPARCCatalog
- Status Options don't contain specific values
- Provider % Service Provider: Confusion
...