This repository is a set of examples using open source tools on IBM i.
Check out each sub directory for additional information specific to the example.
A set of examples for using open source tools on IBM i
License: Apache License 2.0
This is better suited to be in our docs repo: https://github.com/IBM/ibmi-oss-docs
Since this example requires dependencies installed from via yum
and pip
we should have a setup script that automates the process.
Investigate using pyodbc for database access rather than ibmdb2.
Jupyter Notebooks are great for stepping through and learning code as well as visualizing the output as it can display images and various other types right in the browser (would really help the Pillow example).
Currently the books examples hard codes servers to use as DSNs
ibmi-oss-examples/nodejs/express/books/views/login.ejs
Lines 12 to 23 in 74bfa17
We should instead check if there any DSNs defined by parsing the .odbc.ini file
If DSNs are not found then allow the user to specify the host, username, password to establish the odbc connectinon
When attempting to install the npm odbc on IBMi 7.4 it appears there might be a versioning issue. I followed the install instructions but when I attempt the npm install odbc
it comes back with this:
-bash-4.4$ npm install odbc
[email protected] install /home/DTJARED/odbctest/node_modules/odbc
node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/markdirish/node-odbc/releases/download/v2.3.5/odbc-v2.3.5-aix-ppc64-napi-v3.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: not found: gmake
gyp ERR! stack at getNotFoundError (/QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:176:21)
gyp ERR! System OS400 7.4
gyp ERR! command "/QOpenSys/pkgs/lib/nodejs14/bin/node" "/QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3/odbc.node" "--module_name=odbc" "--module_path=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /home/DTJARED/odbctest/node_modules/odbc
gyp ERR! node -v v14.11.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/QOpenSys/pkgs/lib/nodejs14/bin/node /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3/odbc.node --module_name=odbc --module_path=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3 --napi_version=6 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/DTJARED/odbctest/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1047:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System OS400 7.4
node-pre-gyp ERR! command "/QOpenSys/pkgs/lib/nodejs14/bin/node" "/home/DTJARED/odbctest/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/DTJARED/odbctest/node_modules/odbc
node-pre-gyp ERR! node -v v14.11.0
node-pre-gyp ERR! -v v0.14.0
node-pre-gyp ERR! not ok
Failed to execute '/QOpenSys/pkgs/lib/nodejs14/bin/node /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3/odbc.node --module_name=odbc --module_path=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3 --napi_version=6 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/DTJARED/.npm/_logs/2020-10-26T19_27_49_724Z-debug.log
Suggest visual recognition and personality insights
Describe the bug
I can´t clone
To Reproduce
Steps to reproduce the behavior:
PS D:\Users> cd .\workspace
PS D:\Users\workspace> git clone [email protected]:IBM/ibmi-oss-examples.git
Cloning into 'ibmi-oss-examples'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Expected behavior
clone the reposssitory
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Windows 10
C:\Users\eduar\AppData\Roaming\npm-cache_logs>node -v
v14.17.1
Could be based on https://app.gitbook.com/@testdemogitbook/s/koa/
test only
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
flask run
: https://flask.palletsprojects.com/en/2.2.x/quickstart/After merging #74 Looks like app-metrics is no longer used. The README still instructs to install dependencies like C++ and python to install app-metrics. README also mentions using demo.sh script which no longer exists. There is also a lingering appmetrics folder with screenshots which should also be removed. Also we switched to use node-odbc instead of idb-pconnector but docs talks about using idb-pconnector still. Also we now include a dockerfile we should now document how to start the container up.
The ODBC example for the IBM i environment now points to ibmi-oss-docs (here). That page states,
To get the driver, visit the IBM i Access Client Solutions page and select Downloads for IBM i Access Client Solutions. After logging in and redirected to the IBM I Access Client Solutions download page, ...
Following those instructions, the user clicks the link:
And is taken to the following page:
Clicking "View License", the user is shown a modal and told that there is no license available for the English [en]
language:
Clarify by adding license text, clarifying what the purpose of the agreement on that page is for, or removing the requirement for the user to agree to a license that is not available to read.
Hate to be the guy that creates an issue 20 minutes after repo creation, but I think the repo name should be changed to nodejs-examples-ibmi. Reasoning:
It looks like I can change it myself, but I'd hate to step on anyone's toes...
Describe the bug
Using example: https://github.com/IBM/ibmi-oss-examples/tree/master/nodejs/grafana-backend
Installing grafana-backend on an IBM i. After pulling the repo to the local machine and running npm i
I get a warning telling me that one of the node-modules included in the package is a typosquat
To Reproduce
Install the package as described in the getting started page
https://github.com/IBM/ibmi-oss-examples/tree/master/nodejs/grafana-backend
Expected behavior
Secure, no typosquatted packages.
Additional context
I see that on the index.js that
there is const _ = require('lodash');
but nothing for loadsh
is it possible to just npm un loadash from the project without obstructing the grafana project?
Configuring private key authentication within the db2util example leads to the following error:
> node index.js
~/ibmi-oss-examples/nodejs/db2util/config.js:19
config.privateKey = SSH_PRIVATE_KEY
^
ReferenceError: SSH_PRIVATE_KEY is not defined
This should read SSH_PRIVATE_KEY
from environement variable
It could be based on: https://app.gitbook.com/@testdemogitbook/s/restify/
I'm looking at developing a couple of python3 programs to read QUADJRN and QHST using the DB2 for i services to generate syslog entries.
I was hoping to use MQTT to have the entries persisted so that a third program can read the entries from the queue and send them to the syslog server.
I don't see MQTT in the repos for IBM i. Do we have any other message queue options available?
If not o suppose I could use itoolkit and utilise a *USRSPC.
-bash-4.4$ npm install odbc
[email protected] install /www/nodejs/odbc-test/node_modules/odbc
node-gyp configure build
gmake: Entering directory '/www/nodejs/odbc-test/node_modules/odbc/build'
CXX(target) Release/obj.target/odbc/src/odbc.o
In file included from ../src/odbc.cpp:19:0:
/www/nodejs/odbc-test/node_modules/node-addon-api/napi.h:5:22: fatal error: functional: No such file or directory
#include
^
compilation terminated.
gmake: *** [odbc.target.mk:133: Release/obj.target/odbc/src/odbc.o] Error 1
gmake: Leaving directory '/www/nodejs/odbc-test/node_modules/odbc/build'
gyp ERR! build error
gyp ERR! stack Error: gmake
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/QOpenSys/pkgs/lib/nodejs12/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System OS400 7.3
gyp ERR! command "/QOpenSys/pkgs/lib/nodejs12/bin/node" "/QOpenSys/pkgs/lib/nodejs12/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /www/nodejs/odbc-test/node_modules/odbc
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp configure build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/LUCA/.npm/_logs/2020-04-20T13_35_48_203Z-debug.log
-bash-4.4$
Investigate using pyodbc for database access rather than ibmdb2.
Need an example showing off the ORM capabilities of SQLAlchemy.
Apache POI looks like a decent option.
Since we now offer macos odbc driver we should include an install section for it.
Describe the bug
The SimpleJSON grafana plugin is deprecated and no longer appears in the "store". This renders the grafana-backend example nonfunctional.
To Reproduce
Search for SimpleJSON in the grafana plugin section
Expected behavior
When the SimpleJSON plugin was available, this example worked brilliantly. I found that "Infinity" is the replacement plugin, but it functions very differently from SimpleJSON. I think the grafana-backend example was implemented specifically for SimpleJSON, and the functionality of Infinity is very different.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I was able to use the Infinity plugin to pull some data from grafana-backend on IBM i into grafana, but it requires jumping through a lot of hoops for each and every piece of data. For example, the endpoint URL must be entered in the query editor for each query, rather than being defined once in the plugin config. Also with SimpleJSON all of the metrics were auto discovered and available automatically. With Infinity I have to provide the IBM i endpoint URL and also modify the request body in order to request any particular metric.
If anyone is interested in looking at this together, I'd be happy to get involved. I'm not a developer though, so I may only slow you down!
This: https://twitter.com/IBMJesseG/status/1381656679075475459
Looks like the Send-SMS-with-Twilio-from-IBM-i example uses older versions of itoolkit
and twilio
but the example does not include a package.json file. We should update the example to use the latest version of these packages.
@ThePrez IIRC you were also working on twilio example similar to this one. Do you wanna add your changes to this one?
Now that IBM/ibmi-oss-docs#23 is merged and considering at least one known article (https://www.itjungle.com/2020/06/15/more-open-source-databases-coming-to-ibm-i/) links to this page we should probably replace the page with a link to the new location instead of just deleting it.
We should link to the readthedocs webpage instead of the markdown file right?
Please add a README.md file and describe what this code and repo does.
Requires freetype-devel, libpng-devel, python3-devel and tk-devel (or is it just tk?).
https://matplotlib.org/users/installing.html#installing-from-source
When installing in to a virtual environment, best to install python3-numpy via yum and add --system-site-packages
, since numpy and its dependencies can take a bit to build from source.
The download on the IBM site got renamed to "ACS PASE App Pkg". Need to update the doc accordingly
All the Camel examples
RAW()
when neededmvn package
and java
rather than mvn exec::java
Remove un-needed deps like install vim, npm, node-pre-gyp.
No need to run repolist as well.
Should use ubi8/nodejs-14 instead of ubi8/nodejs-10
Should have an example of Node.js calling Db2 from a cloud-native application, using SSH and db2util
Looks like exceljs is pretty good package to demo.
Suggest personality insights
The dbtoxlsx example as currently written is a good "works out of the box" solution for people who have no interest in coding or setting stuff up (they just want data in a spreadsheet).
Sadly, using ODBC adds more setup task and makes this example much less useful in a ready-to-use utility use case.
Until we can make ODBC out-of-the-box ready, we should instead just make a second flavor of the example
Originally posted by @ThePrez in #35 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.