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
-
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.
awesim_branding
gem.
Diff Guide to removing the The AwesimBranding gem contains a number of helper methods that were available in AwesimRails
. These helpers have been deprecated and are replaced by similar functionality in the OodAppkit gem. The AwesimBranding gem allows for a smooth transition of existing applications to our OOD infrastructure, but ongoing support is limited and you are encouraged to update to OodAppkit.
awesim_branding
gem
Remove the -gem 'awesim_branding', :git => 'git@github.com:AweSim-OSC/awesim_branding.git', :tag => 'v1.0.0'
app/assets/stylesheets/application.css.scss
Update -@import "awesim";
+
+// this MUST occur before you import bootstrap
+@import "ood_appkit/bootstrap-overrides";
// Load up bootstrap style sheet
@import "bootstrap";
-// display header at top of app layout
-body {
- @extend .awesim-banner-background-img;
-}
-
+// this MUST occur after the bootstrap import
+@import "ood_appkit";
app/views/layouts/application.html.erb
Update
awesim_banner
Remove the <body>
-<%= awesim_banner "Container Fill", "SIM" %>
-
<header>
awesim_breadcrumbs
with OodAppkit navbar breadcrumbs
Replace - <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
+ <nav class="ood-appkit navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
. . . .
</button>
- <%= awesim_breadcrumbs 'Container Fill Sim' %>
+ <ul class="navbar-breadcrumbs">
+ <li><%= link_to OodAppkit.dashboard.title, OodAppkit.dashboard.url.to_s %></li>
+ <li><%= link_to 'Container Fill Sim', root_path %></li>
+ </ul>
</div>
docs_path
with wiki_path
Replace the - <%= link_to "Tutorial", docs_path('Home') %>
+ <%= link_to "Tutorial", wiki_path('Home') %>
Further information at OodAppkit