Update to AweSim Appkit 1.0
To transition your app to the OOD infrastructure, your app must be compatible with the AweSim appkit v1.0.
To upgrade to the AweSim appkit v1.0, please see the guide.
Update Rails
Due to changes in the OOD gems, OOD applications will need to have a minimum Rails version of 4.1.15
, you can also update to the latest version of Rails 4.2
. Rails 5.0 is not yet supported.
We will be replacing the awesim_rails
gem with the ood_appkit
gem, and updating the rest of the OOD dependencies to work with the latest version of OodAppkit.
/awesim/share
1. Clone the existing app to
Gemfile
2. Update the Update Rails
-gem 'rails', '4.0.0'
+gem 'rails', '4.1.15' # You may also use a newer version
sass-rails
Update -gem 'sass-rails', '4.0.2'
+gem 'sass-rails', '~> 5.0'
bootstrap-sass
Update -gem 'bootstrap-sass', '3.3.1.0'
+gem 'bootstrap-sass', '~> 3.3'
redcarpet
Update OodAppkit dependency.
-gem 'redcarpet', '~> 3.2.2'
+gem 'redcarpet', '~> 3.3'
require: 'dotenv/rails-now
Use OodAppkit requires environment variables to be set before Rails loads. Modify or add your 'dotenv-rails' gem as follows:
+gem 'dotenv-rails', '~> 2.1', require: 'dotenv/rails-now'
Update OSC gems
-gem 'osc-machete', '~> 1.0.0', :git => 'git@github.com:OSC/osc-machete.git', :tag => 'v1.0.1'
+gem 'osc-machete', '~> 1.2'
-gem 'osc_machete_rails', '~> 1.0.0', :git => 'git@github.com:OSC/osc_machete_rails.git', :tag => 'v1.0.1'
+gem 'osc_machete_rails', '~> 1.2'
-gem 'osc-vnc', '~> 1.0.0', :git => 'git@github.com:OSC/osc-vnc.git', :tag => 'v1.0.8'
+gem 'osc-vnc', '~> 1.1'
ood_appkit
, pbs
, and awesim_branding
gems
Add For details, see:
-
ood_appkit package of utility functions and engines for applications running on the Open OnDemand platform
-
pbs Ruby wrapper for the Torque C Library
-
awesim_branding (optional) Replaces some AwesimRails helpers
+gem 'ood_appkit', '~> 0.3.0'
+gem 'awesim_branding', :git => 'git@github.com:AweSim-OSC/awesim_branding.git', :tag => 'v1.0.0'
Note: if you do not wish to add the awesim_branding
gem, you will need to update your application to use the application features in OodAppkit described at https://github.com/OSC/ood_appkit#branding-features
awesim_rails
and awesim_rails_logging
gems, these are not supported on OOD
Remove -gem 'awesim_rails', '~> 1.0.0', :git => 'git@github.com:AweSim-OSC/awesim_rails.git', :tag => 'v1.0.0'
-gem 'awesim_rails_logging', '~> 1.0.0', :git => 'git@github.com:AweSim-OSC/awesim_rails_logging.git', :tag => 'v1.0.0'
AwesimRails
in the app code and modify to OodAppkit
3. Find all references to
AwesimRails.dataroot
, which is now handled by OodAppkit.dataroot
Note particularly any references to Examples:
-outdir: File.join(AwesimRails.dataroot, "vnc", "paraview"),
+outdir: File.join(OodAppkit.dataroot, "vnc", "paraview"),
-Paperclip::Attachment.default_options[:path] = "#{AwesimRails.dataroot}/uploads/:class/:id/:created_at/:attachment/:filename"
+Paperclip::Attachment.default_options[:path] = "#{OodAppkit.dataroot}/uploads/:class/:id/:created_at/:attachment/:filename"
Gemfile.lock
4. Delete 5. Run Bundler
$ scl enable git19 rh-ruby22 -- bin/bundle install --path=vendor/bundle
6. Perform database migrations
$ scl enable git19 rh-ruby22 -- bin/rake db:setup RAILS_ENV=development
Test Changes
Test to make sure everything's working properly.