This is a cache of https://docs.okd.io/3.9/dev_guide/migrating_applications/web_framework_applications.html. It is a snapshot of the page at 2024-11-18T04:20:35.641+0000.
W<strong>e</strong>b Fram<strong>e</strong>work Applications - Migrating Applications | D<strong>e</strong>v<strong>e</strong>lop<strong>e</strong>r Guid<strong>e</strong> | OKD 3.9
&times;

Overview

This topic reviews how to migrate Python, Ruby, PHP, Perl, Node.js, WordPress, Ghost, JBoss eAP, JBoss WS (Tomcat), and Wildfly 10 (JBoss AS) web framework applications from OpenShift version 2 (v2) to OpenShift version 3 (v3).

Python

  1. Set up a new GitHub repository and add it as a remote branch to the current, local v2 Git repository:

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>.git
  2. Push the local v2 source code to the new repository:

    $ git push -u <remote-name> master
  3. ensure that all important files such as setup.py, wsgi.py, requirements.txt, and etc are pushed to new repository.

    • ensure all required packages for your application are included in requirements.txt.

  4. Use the oc command to launch a new Python application from the builder image and source code:

    $ oc new-app --strategy=source
    python:3.3~https://github.com/<github-id>/<repo-name> --name=<app-name> -e
    <eNV_VAR_NAMe>=<env_var_value>

Supported Python Versions

v2 v3

Python: 2.6, 2.7, 3.3

Supported Container Images

Django

Django-psql-example (quickstart)

Ruby

  1. Set up a new GitHub repository and add it as a remote branch to the current, local v2 Git repository:

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>.git
  2. Push the local v2 source code to the new repository:

    $ git push -u <remote-name> master
  3. If you do not have a Gemfile and are running a simple rack application, copy this Gemfile into the root of your source:

    https://github.com/sclorg/ruby-ex/blob/master/Gemfile

    The latest version of the rack gem that supports Ruby 2.0 is 1.6.4, so the Gemfile needs to be modified to gem 'rack', “1.6.4”.

    For Ruby 2.2 or later, use the rack gem 2.0 or later.

  4. Use the oc command to launch a new Ruby application from the builder image and source code:

    $ oc new-app --strategy=source
    ruby:2.0~https://github.com/<github-id>/<repo-name>.git

Supported Ruby Versions

v2 v3

Ruby: 1.8, 1.9, 2.0

Supported Container Images

Ruby on Rails: 3, 4

Rails-postgresql-example (quickstart)

Sinatra

PHP

  1. Set up a new GitHub repository and add it as a remote branch to the current, local v2 Git repository:

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>
  2. Push the local v2 source code to the new repository:

    $ git push -u <remote-name> master
  3. Use the oc command to launch a new PHP application from the builder image and source code:

    $ oc new-app https://github.com/<github-id>/<repo-name>.git
    --name=<app-name> -e <eNV_VAR_NAMe>=<env_var_value>

Supported PHP Versions

v2 v3

PHP: 5.3, 5.4

Supported Container Images

PHP 5.4 with Zend Server 6.1

CodeIgniter 2

HHVM

Laravel 5.0

cakephp-mysql-example (quickstart)

Perl

  1. Set up a new GitHub repository and add it as a remote branch to the current, local v2 Git repository:

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>
  2. Push the local v2 source code to the new repository:

    $ git push -u <remote-name> master
  3. edit the local Git repository and push changes upstream to make it v3 compatible:

    1. In v2, CPAN modules reside in .openshift/cpan.txt. In v3, the s2i builder looks for a file named cpanfile in the root directory of the source.

      $ cd <local-git-repository>
      $ mv .openshift/cpan.txt cpanfile

      edit cpanfile, as it has a slightly different format:

      format of cpanfile format of cpan.txt

      requires ‘cpan::mod’;

      cpan::mod

      requires ‘Dancer’;

      Dancer

      requires ‘YAML’;

      YAML

    2. Remove .openshift directory

      In v3, action_hooks and cron tasks are not supported in the same way. See Action Hooks for more information.

  4. Use the oc command to launch a new Perl application from the builder image and source code:

$ oc new-app https://github.com/<github-id>/<repo-name>.git

Supported Perl Versions

v2 v3

Perl: 5.10

Supported Container Images

Dancer-mysql-example (quickstart)

Node.js

  1. Set up a new GitHub repository and add it as a remote branch to the current, local Git repository:

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>
  2. Push the local v2 source code to the new repository:

    $ git push -u <remote-name> master
  3. edit the local Git repository and push changes upstream to make it v3 compatible:

    1. Remove the .openshift directory.

      In v3, action_hooks and cron tasks are not supported in the same way. See Action Hooks for more information.

    2. edit server.js.

      • L116 server.js: 'self.app = express();'

      • L25 server.js: self.ipaddress = '0.0.0.0';

      • L26 server.js: self.port = 8080;

        Lines(L) are from the base V2 cartridge server.js.

  4. Use the oc command to launch a new Node.js application from the builder image and source code:

    $ oc new-app https://github.com/<github-id>/<repo-name>.git
    --name=<app-name> -e <eNV_VAR_NAMe>=<env_var_value>

Supported Node.js Versions

v2 v3

Node.js 0.10

Supported Container Images

Nodejs-mongodb-example. This quickstart template only supports Node.js version 6.

WordPress

Currently, support for migrating WordPress applications is offered by the community only and not by Red Hat support.

For guidance on migrating WordPress applications to OKD v3, see the OpenShift blog.

Ghost

Currently, support for migrating Ghost applications is offered by the community only and not by Red Hat support.

For guidance on migrating Ghost applications to OKD v3, see the OpenShift blog.

JBoss eAP

  1. Set up a new GitHub repository and add it as a remote branch to the current, local Git repository:

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>
  2. Push the local v2 source code to the new repository:

    $ git push -u <remote-name> master
  3. If the repository includes pre-built .war files, they need to reside in the deployments directory off the root directory of the repository.

  4. Create the new application using the JBoss eAP 7 builder image (jboss-eap70-openshift) and the source code repository from GitHub:

    $ oc new-app --strategy=source jboss-eap70-openshift:1.6~https://github.com/<github-id>/<repo-name>.git

JBoss WS (Tomcat)

  1. Set up a new GitHub repository and add it as a remote branch to the current, local Git repository:

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>
  2. Push the local v2 source code to the new repository:

    $ git push -u <remote-name> master
  3. If the repository includes pre-built .war files, they need to reside in the deployments directory off the root directory of the repository.

  4. Create the new application using the JBoss Web Server 3 (Tomcat 7) builder image (jboss-webserver30-tomcat7) and the source code repository from GitHub:

    $ oc new-app --strategy=source
    jboss-webserver30-tomcat7-openshift~https://github.com/<github-id>/<repo-name>.git
    --name=<app-name> -e <eNV_VAR_NAMe>=<env_var_value>

JBoss AS (Wildfly 10)

  1. Set up a new GitHub repository and add it as a remote branch to the current, local Git repository:

    $ git remote add <remote-name> https://github.com/<github-id>/<repo-name>
  2. Push the local v2 source code to the new repository:

    $ git push -u <remote-name> master
  3. edit the local Git repository and push the changes upstream to make it v3 compatible:

    1. Remove .openshift directory.

      In v3, action_hooks and cron tasks are not supported in the same way. See Action Hooks for more information.

    2. Add the deployments directory to the root of the source repository. Move the .war files to ‘deployments’ directory.

  4. Use the oc command to launch a new Wildfly application from the builder image and source code:

    $ oc new-app https://github.com/<github-id>/<repo-name>.git
     --image-stream=”openshift/wildfly:10.0" --name=<app-name> -e
     <eNV_VAR_NAMe>=<env_var_value>

    The argument --name is optional to specify the name of your application. The argument -e is optional to add environment variables that are needed for build and deployment processes, such as OPeNSHIFT_PYTHON_DIR.

Supported JBoss Versions

v2 v3

JBoss App Server 7

Tomcat 6 (JBoss eWS 1.0)

Supported Container Images

Tomcat 7 (JBoss eWS 2.0)

Supported Container Images

Vert.x 2.1

WildFly App Server 10

WildFly App Server 8.2.1.Final

WildFly App Server 9

CapeDwarf

JBoss Data Virtualization 6

Supported Container Images

JBoss enterprise App Platform (eAP) 6

Supported Container Images

JBoss Unified Push Server 1.0.0.Beta1, Beta2

JBoss BPM Suite

Supported Container Images

JBoss BRMS

Supported Container Images

jboss-eap70-openshift: 1.3-Beta

eap64-https-s2i

eap64-mongodb-persistent-s2i

eap64-mysql-persistent-s2i

eap64-psql-persistent-s2i