Information Systems:IBM i open-source development conventions
Jump to navigation
Jump to search
This page outlines the conventions established for modern (post-2017) development on IBM i. While other, related articles are exploratory, this page will be kept to documenting stuff that is more-or-less set in stone.
Starting Principles
For developers programming on/for this system (IBM i), or for technical staff wanting to understand the development guidelines that were used to make the modern extensions that exist on the system.
- Python on IBM i is used to develop new business programs/software. Prior to this (pre-2018), the RPG language was used. WebSmart PML (ProGen Markup Language) and CL (Control Language) were also used to support solutions that were primarily RPG-based.
- Django is the web framework used to make the front end of these new programs.
- Python and Django together can thus be regarded as the development platform for making new ERP extensions, in place of RPG/DDS (green screen interactive programs/extensions) and PML/RPG/CL (i.e. current Infonet programs).
- "Python-Django" is used to make web apps. Python (without Django) can and will also be used to make batch/scheduled programs (with no user interface). This replaces what was formerly done through RPG/CL.
- Command-line interactive Python programs will not be made (at least not for general use e.g. maybe some admin utilities). Developing such programs is not part of the modernization strategy, and generally does not make sense for the company, since we are trying to replace green-screen. Whenever a business need calls for an interactive program/extension, Django will be used to make the front-end of said program, and the resulting app will be interacted with through the web.
- Since Python-Django creates web applications, newly developed extensions can be regarded as 'extending' Infonet. However, as will be explained, this 'extending' of Infonet merely refers to presentation. There are two separate technologies driving programs of both platforms.
- Infonet (or more accurately, the entire collection of WebSmart programs we consider the company intranet site), will not be replaced. It will continue to run and be maintained using WebSmart. Addition of functionality will have to be assessed by a steering committee to determine whether it is a major enough change to warrant rewriting the program in Python-Django vs. making the changes in WebSmart.
- Infonext (abbr. INX) is the proposed name for referring to the collection of new Python/Django programs/extensions that will be added to Infonet. The term will mostly be used internally to begin with, so as to not cause confusion amongst users.
- Despite being programmed differently (Infonet in WebSmart PML/RPG and Infonext in Python/Django), the users will interact with the intranet site the same way. The concept of a web front-end (HTML/CSS/Javascript), which is common to both platforms, is what enables presenting it all as a unified site to the end user.
- Python/Django apps will not be web-served using the built-in IBM i HTTP server (Apache), the same way WebSmart is currently hosted. This is for performance/compatibility reasons. Instead, an alternative web server will be used and Infonext programs will be accessed through this server that will run on a different port.
- IBM i HTTP Server / Apache will be used as a reverse proxy, so it can route requests (by URL path e.g. /carrierint) to either Infonet or Infonext programs.
Program Environment
- The flavor of Python used is an official IBM i release that belongs to (and was installed through) the 5733-OPS IBM i Open Source Solutions licensed program.
Theory: It is likely the same Python code you would run in Linux or Windows, but packaged differently. It is almost certainly CPython.
- Currently, the version of Python is 3.4.6.
- Python is updated through PTFs - through Technology Refreshes and the specific PTF Group for open source (SF99223 for IBM i 7.2).
- Python runs within a special environment on the i called PASE. To put simply, it is an area of the system carved out to operate like a Linux/Unix system, using the IFS as its 'home'. More info on that here.
- Python modules are installed/maintained through the native Python package manager pip. The following modules are exceptions, which should not be managed/upgraded through pip: ibm_db, ibm_db_django.
- PASE is best accessed through SSH. Administrative functions, such as pip installations, can be done in the bash terminal through SSH.
- Git will be used for version control and source code management. The free git hosting provider, BitBucket, will be used as the cloud repository.
ibm_db
- ibm_db and ibm_db_dbi are Python modules used to access the Db2 database running on i (production database).
Data Libraries
- The INX_D library will house data/tables used for INX programs. It will be automatically journaled (QDFTJRN) for compatibility with Django.
- The UWDX_D library will house data (tables) that is less directly involved with Infonet. This parallels the current conventions where we have WEBPRDD for data used in WebSmart programs and UWDASWPRDD for general extensions data.