9/22/2016

Welcome to the Waitless World

The open book: Open Source on IBM i

Jesse . Gorzinski, MBA [email protected] IBM i Emerging Solutions

© 2015 IBM Corporation Session ID: Agenda Key:

http://blog.codeeval.com/codeevalblog/2016/2/2/most-popular-coding-languages-of-2016

© 2016 IBM Corporation 4

1 9/22/2016

Popular Open Source Languages: Tiobe

http://www.tiobe.com/tiobe-index/

© 2016 IBM Corporation

Business value? • Ease in finding skills • Time to market • May not have to change core business! Just use OSS to extend it to web services, mobile, etc. • It's very easy to enable web and mobile technologies.

© 2016 IBM Corporation

2 9/22/2016

What is IBM i doing?

9 © 2016 IBM Corporation

Open Source on i – a new concept?

• First open-source IBM i project was JTOpen (1998)

• People have been using perl since at least 1998

• Apache HTTP server shipped since 2002

• Also shipped in the past/present: – OpenSSL – OpenSSH – Apache Tomcat – Samba

© 2016 IBM Corporation

3 9/22/2016

Enabling software engineering on open source languages/runtimes

• Several new languages added. More in the future? • New tools delivered

11 © 2016 IBM Corporation

Enabling easy extension of OSS for IBM i - XMLService

• Allows access to IBM i programs, service programs, shell commands, and even DB2! • Can be called locally or remotely, stateful or stateless, very flexible! • Toolkits are written for several languages, to make it even easier!

12 © 2016 IBM Corporation

4 9/22/2016

Enabling easy extension of OSS for IBM i – IBM i Services

• Access system data through SQL! – PTF – Security – Message Handling – Librarian – Work Management – Communication – Storage – Product – Spool – System Health http://ibm.biz/DB2foriServices – Journal – • More being continuously added

© 2016 IBM Corporation

What IBM i is doing –partnership with (RogueWave)

for i – Preloaded with IBM i 7.1 and 6.1 – One year of Silver Support from Zend • Zend Server Development edition – Reduced cost – include Z-Ray and other dev tools • Zend Server for i – Available from Zend • Zend Studio for i – -based development environment – One year of Silver support from Zend • Zend DBi – MySQL implementation for IBM i – DB2 Storage Engine enables data storage in DB2

© 2016 IBM Corporation 15

5 9/22/2016

IBM i Shops using

ALLIED BEVERAGE GROUP

© 2016 IBM Corporation

What IBM i is doing – partnership with PowerRuby

• What is PowerRuby? – Freely available and commercially supported port of the Ruby language – Includes supporting infrastructure (i.e. Rails) for running Ruby web applications on IBM i – Available for download from PowerRuby.com – Includes native DB2 database driver – MySQL not necessary – Integrates with XMLSERVICE for access to IBM i programs and objects

• Components – Ruby 2.0.0 and 1.9.3 (MRI implementation, a.k.a CRuby) – ibm_db (IBM supported - http://rubyforge.org/projects/rubyibm/) – Apache + Thin ← the web server stack (more Ruby app servers options coming) – Rails 3.2.x and 4.0.0 (Coffeescript support in the works)

• Learn more – PowerRuby.com for updates and news – twitter.com/rubyonpower

© 2016 IBM Corporation 17

6 9/22/2016

Open Source for IBM i

– New LPO – 5733OPS Open Source for IBM i o New license program option o Designed for Open Source offerings on IBM i

© 2016 IBM Corporation

5733-OPS: a bit unconventional?

• 5733-OPS has 15 options available NOW!

• The options themselves are placeholders

• Function will be delivered via PTF

• We now have a PTF group for each IBM i release!!

SF99123 (7.1) SF99223 (7.2) SF99225 (7.3)

© 2016 IBM Corporation

7 9/22/2016

Things we deliver with every new language/version

• FastCGI • Allows fast connection from HTTP server to backend PASE environment

• ILE Object Toolkit • Toolkit for each environment to easily allow connections to ILE objects and information – Built on XMLService

• SQL Connector • Easy integrated (from the open source language) way to transfer data to and from DB2 for i leveraging SQL

© 2016 IBM Corporation

Node.JS – 5733OPS Option 1

• What’s Node.JS? – Simply put, Node.js is server-side JavaScript – Based on Google Chrome V8 Engine.

• Why Node.JS? – Great for web development! o JavaScript is already widely used on the client side of web development o Can now do both – High Performance o Node.js is designed to maximize throughput and efficiency. – Increasing popularity: o More than 70,000 third-party extensions are available on www.npmjs.org now. © 2016 IBM Corporation

8 9/22/2016

Leverage the community with Node Package Manager (npm)

$ npm install jshint [email protected] node_modules/jshint ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ├── [email protected] ([email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) $ ls node_modules/ jshint $ ls node_modules/jshint/ README.md bin data dist node_modules package.json src $ ls node_modules/jshint/node_modules/ cli exit minimatch strip-json-comments console-browserify htmlparser2 shelljs underscore

© 2016 IBM Corporation

Python 3 – 5733OPS Option 2

• What’s Python? – A powerful general-purpose language – Interpreted

• Why Python? – Easy to use o Language is designed to be a "fun" language o Can be considered the 'CL language for the modern ' o Easy for IBM i to learn

– Very, very popular o Over 85,000 third-party extensions are available on http://pypi.org

© 2016 IBM Corporation

9 9/22/2016

Leverage the community with the Preferred Installer for Python (pip/pip3)

© 2016 IBM Corporation

Python success stories!

• https://www.python.org/about/success/

• 41+ real-life success stories across multiple domains

© 2016 IBM Corporation

10 9/22/2016

Origin of the "Python" name?

"Now, it's quite simple to defend yourself against a man armed with a banana. First of all you force him to drop the banana; then, second, you eat the banana, thus disarming him. You have now rendered him helpless."

"This parrot is no more! He has ceased to be!"

"I’m sorry to have kept you waiting, but I’m afraid my walk has become rather sillier recently."

"I don't like Spam©!"

"That rabbit's dynamite!"

© 2016 IBM Corporation

IBM i chroot (change '/' location), 5733OPS Option 3

Ranger chroot /QOpenSys/ranger '/' is … /usr/bin/bsh /QOpenSys/ranger/(*) Bobby chroot /QOpenSys/bobby '/' is … /usr/bin/bsh /QOpenSys/bobby/(*) Lefty chroot /QOpenSys/lefty /usr/bin/bsh '/' is … /QOpenSys/lefty/(*)

Wild Bill '/' is ... chroot /QOpenSys/wildbill /QOpenSys/wildbill/(*) /usr/bin/bsh admin No chroot, '/' is … /(*) No problem, but you are not going to mess up my system, so chroot you.

( http://yips.idevcloud.com/wiki/index.php/PASE/OpenSourceBeta ) © 2016 IBM Corporation

11 9/22/2016

IBM i compilation environment, 5733OPS Option 3

• Scripts to set up gcc and other popular build tools

• PASE has XLC, not free, and not very compatible for Open Source

• Not only can you get a real build environment, you can do so inside a "chroot" and have isolated, sandboxed versions of the build environment!

© 2016 IBM Corporation

5733 OPS – Lots delivered in June 2016!

• Option 1 – Node.JS 2.x • Option 2 - Python 3 Enhanced • Option 3 – GCC / chroot

29 © 2016 IBM Corporation

12 9/22/2016

June 2016 enhancements to option 2 – Python 3.4

• Python v3.4 was initially delivered June 2015 • Key updates in June – Wheel (updated packaging mechanism) – Package add-ons as wheels – Rebuild with gcc technology to allow easier integration with community – Better support for Django, a powerful for Python o Django requires a database o Only solution previously was to use Zend DBi (out of process), PyMySQL, and a spec of MySQL that doesn't meet Django requirements o Now we have a solution that goes straight to DB2

© 2016 IBM Corporation

5733 OPS – Lots delivered in June 2016!

• Option 1 – Node.JS 2.x • Option 2 - Python 3.4 • Option 3 – GCC / chroot • Option 4 – Python 2.7 • Option 5 – Node.JS 4.x • Option 6 – New • Option 7 – Tools • Option 8 – Orion • Option 9 – cloud-init

31 © 2016 IBM Corporation

13 9/22/2016

Option 4 – Python 2.7

• Python v2.7 (option 4) to be delivered 1H2015 – initial delivery, built with GCC – Wheel – toolkit and database connector

– Why? o Python 2 and Python 3 are not fully compatible o Python 3 not fully accepted by the Python community o Many applications still built on Python 2

© 2016 IBM Corporation

Option 5 – Node v4

• Previously shipped Node.js v0.x (option 1)

• Node v4 move is important – New Javascript engine (much better performance) – New Javascript language features (classes, among other things)

© 2016 IBM Corporation 33

14 9/22/2016

Option 6- Git

• Open Source distributed version control system • Source control for virtually any language • Powerful and flexible • Can have hooks to perform custom actions when new code is integrated • Already in use in the IBM i community

© 2016 IBM Corporation 34

Option 7 - Tools • Some of the packages downloaded via GCC tool kit are core to the success of Open Source development for IBM i

• In June, we shipped key packages – bash – zip – unzip

• Others that are being considered… – shellinabox – gzip – bz2 – tar – perl

© 2016 IBM Corporation 35

15 9/22/2016

shellinabox – future?

• Candidate for OPS option 7 • Access an SSH terminal through virtually any web browser • No browser plugins required, just CSS and JavaScript support

© 2016 IBM Corporation

Option 8 – Eclipse Orion

• Provides a web enabled editor interface • Rich git integration • BlueMix integration • Targeting Node, Python and Modern RPG developers • Not meant to compete with RDi, more complementary – Hope to attract and supplant more green screen SEU users • Contains base open source Orion with a RPG syntax highlighter supporting Fully Free Form RPG only (along with an SQL subset) • Integration story with RDi will be based on Git

© 2016 IBM Corporation 37

16 9/22/2016

Option 9 – Cloud-init for IBM i

• Cloud-init is a script that enables virtual machine activation and initialization • Additive to the PowerVC/PowerVM offering

http://www.ibm.com/support/knowledgecenter/SSXK2N_1.3.1/com.ibm.powerv .standard.help.doc/powervc_install_cloudinit_ibmi_hmc.html

© 2016 IBM Corporation

Welcome to the Waitless World

Which language to choose?

© 2015 IBM Corporation

17 9/22/2016

Ruby

• The language: – Everything (yes, everything) is an object – Blocks (closures) integral to the language – Easy to create domain-specific languages • Pros: – Powerful language – Very expressive, “Beautiful” – Rails very popular web development • Cons: – Not as popular as Python outside of web – Language warts not tolerated, will break things to make them better → you must keep up – Paradigm shift from traditional RPG/C/Java

© 2016 IBM Corporation

Python

• The language – Indentation determines block level (love it or hate it) – Easy to integrate with C/C++ code → many packages created • Pros – Easy to pick up for RPG/C/Java developers – “Conservative”: slow change, compatibility a goal, straight-forward syntax – Many packages available – Has an IBM i toolkit with direct-call capability (iLibCall) – Taught in many colleges • Cons – Not as popular for web (but capable: Django, Bottle) – Python 2 vs Python 3 incompatibilities (improving)

© 2016 IBM Corporation

18 9/22/2016

Node.JS (JavaScript)

• The language – Curly-brace style language (C/C++/Java) – Prototype-based, not Class-based (no inheritance) – Highly asynchronous, event-driven • Pros – Use same language for frontend and backend – Lots of buzz around Node.js now – Node.js uses JIT, not interpreted (good performance) • Cons – Syntax is “awful” (projects to compile to JS: CoffeeScript, TypeScript, …) – Asynchronous more difficult than synchronous, requires different mindset, “Callback hell” (Promises improves things) – Event-driven IO not unique to Node, see EventMachine (Ruby), Twisted (Python), ... – Not as popular outside of web

© 2016 IBM Corporation

PHP

• The language – Often embedded into HTML • Pros – The "granddaddy" of open source languages on i – The most IBM i shops running PHP, the most community – Comes with a robust Development Environment – Can get a support contract from Zend (1 year free) • Cons – Currently not as quickly-moving – Typically only used for serving up web pages

© 2016 IBM Corporation

19 9/22/2016

The right answer?

• It depends….

• Things to consider: – popularity/momentum – packages available – What are you using it for? (typically wouldn't use Node.JS or PHP for general purpose scripting, for instance) – tooling – skills

© 2016 IBM Corporation

The wrong answer?

• There is no wrong answer!!

• likely not your last language decision…

© 2016 IBM Corporation

20 9/22/2016

Welcome to the Waitless World

Open Source – an IBM i community

© 2015 IBM Corporation

some of the key community members…

• Aaron Bartell • Bill Gravelle • Jack Woehr • Mike Pavlak • Alan Seiden • Dave Dressler • Pete Helgren • Liam Allen

© 2016 IBM Corporation

21 9/22/2016

Welcome to the Waitless World

IBM i Open Source projects

© 2015 IBM Corporation

Dash for IBM i

• Written entirely in Node.JS • Strongly leverages IBM i Services through the DB2 connector

© 2016 IBM Corporation

22 9/22/2016

Dash for IBM i

© 2016 IBM Corporation

Dash for IBM i

© 2016 IBM Corporation

23 9/22/2016

Dash for IBM i

© 2016 IBM Corporation

Python toolkit for i

• Built on top of XMLService, like the other "toolkit" offerings • Many other subcomponents of 5733OPS are open source (like the Python DB2 connector!)

• https://bitbucket.org/litmis/python-itoolkit

© 2016 IBM Corporation

24 9/22/2016

Swift toolkit for i

• Talk to IBM i directly from Swift applications (yes, even your iPhone!)

• https://t.co/RyCoQHT6ft

© 2016 IBM Corporation

vlang-rpg

• Embed PHP within RPG • Allow PHP to access and manipulate RPG variables!

https://bitbucket.org/inext/vlang-rpg RPG

© 2016 IBM Corporation

25 9/22/2016

Ublu

• A programming language, made for IBM i! • An "object-disoriented" language • implemented in Java, so runs anywhere with Java runtime

• https://github.com/jwoehr/ublu

© 2016 IBM Corporation

Relic package manager

• Allows for easy builds of ILE Open Source • Download packages from the internet in one command (RELICGET) • Will download and compile a package for you - no need to touch the source • Usable as a build tool (*BUILDONLY)

© 2016 IBM Corporation

26 9/22/2016

Want to open source your ILE code?

• You can integrate with Relic Package Manager!

• Steps are simple: 1) Get your source code into GitHub (Relic comes with a SYNC tool to make this easy) 2) Create a build file (Liam can help with this if needed)

http://www.shieldadvanced.com/Blog/application- modernization/adding-a-bldrelic-clp-to-the-relic- package-manager/

© 2016 IBM Corporation

© 2016 IBM Corporation

27 9/22/2016

© 2016 IBM Corporation

Coming soon…

© 2016 IBM Corporation

28 9/22/2016

CRTFRMSTMF

• The desire: – store source in IFS • The problem: – many CRT____ commands don't support IFS paths! (e.g.: CRTCLMOD)

Open source to the rescue!! CRTFRMSTMF, written in RPG https://bitbucket.org/BrianGarland/crtfrmstmf

(by the way, also wired into the Relic package manager)

© 2016 IBM Corporation

OSSILE

• Created with partnership to host more ILE open source code • Populated today with UDTF's from Christian Jørgensen – Machine info – Cartridge info – Image catalog details

• Will absort CRTFRMSTMF

• Code queued up with help from the Large User Group (LUG), more specifically: Michael P. Scott

• Key points: – Will compile into a library called "OSSILE" – Will be integrated with the Relic Package manager

© 2016 IBM Corporation https://github.com/OSSILE/OSSILE

29 9/22/2016

OSSILE

• Coming…. – User-defined table functions (UDTF's). Nature of services includes: o Process Control Locks o Interrogate all kinds of IBM i object types o Activation group garbage collector o Table Spaces o XML Services o Block Fetching – Other handy utilities o CLRPFMSBX – Clear a physical file even if it has triggers or referential integrity constraints. o ENDOBJLCK – An interactive command that collects all the jobs that are holding locks on an object and ends them elegantly o GENSRVLYR – A template-based code generator that builds a service program for a table, providing all the basic CRUDE operations plus Table Space support

© 2016 IBM Corporation

Many, many more…..

• Non-exhaustive list can be found here:

https://bitbucket.org/ibmi/opensource/wiki/Home#markdown-header-ibm-i- open-source-repos-alphabetical

© 2016 IBM Corporation

30 9/22/2016

Many, many more…..

• Non-exhaustive list can be found here: https://bitbucket.org/ibmi/opensource/wiki/Home#markdown-header-ibm-i- open-source-repos-alphabetical

© 2016 IBM Corporation

Is IBM i contributing to open source projects?

© 2016 IBM Corporation

31 9/22/2016

Is IBM i contributing to open source projects? YES!!

• GNU tar • Python-ibm-db • OpenSSL • swift-itoolkit • OpenSSH • portlibfori • git • ibmiperzl • Bottle.py • ruby-itoolkit • PumpkinLB • nodejs-itoolkit • python-itoolkit • ruby-ibm_db • Dash for IBM i • xmlservice_examples • db2sock • OSSILE • ibmichroot • -ibmi_netstat_py • db2util • python-for-IBM-i-examples • Python • shellinabox • vlang_rpg

© 2016 IBM Corporation

Welcome to the Waitless World

How can I contribute?

© 2015 IBM Corporation

32 9/22/2016

Use it!

© 2016 IBM Corporation

Submit RFE's

• https://www.ibm.com/developerworks/rfe/ • Use product "IBM i", component "Pase/Open Source"

© 2016 IBM Corporation

33 9/22/2016

Submit RFE's

© 2016 IBM Corporation

Participate in the community!

• Ask questions

• Give advice

• Share code, tips, tricks, etc!

© 2016 IBM Corporation

34 9/22/2016

OPENSOURCE mailing list at Midrange

• midrange.com hosts a very well-established community covering a wide array of IBM i topics. There's an open source one!

http://archive.midrange.com/opensource/

© 2016 IBM Corporation

LinkedIn IBM i OSS group

• Great starting point for the latest news and events.

• Large member base

https://www.linkedin.com/groups/8531863

© 2016 IBM Corporation

35 9/22/2016

Ryver IBM i OSS team

• Forums, chat, links to social media

• Invite only!! • Invite link (here you go): https://ibmioss.ryver.com/application/signup/members/9tJsXDG7_iSSi1Q

© 2016 IBM Corporation

Ryver IBM i OSS team

© 2016 IBM Corporation

36 9/22/2016

gitter chat at Club Seiden

https://gitter.im/Club-Seiden/IBMiOSS_Public

© 2016 IBM Corporation

Club Seiden forums

• http://club.alanseiden.com/community/

© 2016 IBM Corporation

37 9/22/2016

• For the latest news:

– watch #IBMiOSS – Follow @IBMJesseG and other community members

• Information or questions, just tweet with #IBMiOSS!

© 2016 IBM Corporation

Community interlocks and panel discussions

• Community-hosted conference calls and panel discussions.

• Most recent used crowdcast.io technology – Live audio and webcam – Live chat – Live Q&A with voting system

© 2016 IBM Corporation

38 9/22/2016

Write and contribute code

• Remember: lots of OSS repositories!

• Unsure how to help? Just ask!

© 2016 IBM Corporation

Spread the word!

• Write or contribute to articles, blogs, etc.

• Speak at user groups and conferences

• Tweet with the #IBMiOSS hashtag!

© 2016 IBM Corporation

39 9/22/2016

Open Source on IBM i

© 2016 IBM Corporation

Open Source on IBM i

• Apache • OpenSSL • OpenSSH • JTOpen • etc.

Legacy offerings

© 2016 IBM Corporation

40 9/22/2016

Open Source on IBM i

• Apache • Python • OpenSSL • Node.JS • OpenSSH • git • JTOpen • Orion • etc. • etc.

Legacy 5733OPS offerings

© 2016 IBM Corporation

Open Source on IBM i

• Apache • Python • OpenSSL • Node.JS • OpenSSH • git • JTOpen • Orion • etc. • etc.

Legacy 5733OPS offerings

Integration

• XMLService • Language toolkits • IBM i services (SQL) • etc.

© 2016 IBM Corporation

41 9/22/2016

Open Source on IBM i

• Apache • Python • OpenSSL • Node.JS • OpenSSH • git • JTOpen • Orion • etc. • etc.

Legacy 5733OPS offerings

Community Integration

• Many i OSS • XMLService projects • Language toolkits • Active collaboration • IBM i services • Blogs, articles (SQL) • etc. • etc.

© 2016 IBM Corporation

Welcome to the Waitless World

© 2015 IBM Corporation

42