Giter Club home page Giter Club logo

ibmi-oss-examples's Introduction

ryver-chat ryver-signup

IBM i OSS Examples

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.

ibmi-oss-examples's People

Contributors

abmusse avatar ajshedivy avatar dependabot[bot] avatar dmabupt avatar edmundreinhardt avatar eric-simpson avatar gavingzhang avatar imgbot[bot] avatar imgbotapp avatar jbh avatar kadler avatar kingharrison avatar markdirish avatar naveen-ram avatar richardschoen avatar rohithsharma84 avatar theprez avatar v-for-vasili avatar zheddie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ibmi-oss-examples's Issues

Add Jupyter Notebooks for all Python examples

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).

[Node Books Example] Parse ini file to determine Systems

Currently the books examples hard codes servers to use as DSNs

<div class="form-group">
<label for="username">Server:</label>
<div class="btn-group">
<button id="server_selection" type="button" class="btn btn-secondary dropdown-toggle"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">oss72dev</button>
<div class="dropdown-menu dropdown-menu-right">
<button id="server_oss72dev" class="dropdown-item" type="button">oss72dev</button>
<button id="server_oss73dev" class="dropdown-item" type="button">oss73dev</button>
<button id="server_oss74dev" class="dropdown-item" type="button">oss74dev</button>
</div>
</div>
</div>

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

Can't get npm odbc to install on IBMi 7.4

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

Can´t clone repossitory

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

test issue

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.

[Fixup] Python examples should follow best practices

What improvement(s) could be made?

Update README for Books Example

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.

[Fixup] ODBC Example - Downloads for IBM i Access Client Solutions lacks License

What example(s) need improvement?

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:

image

And is taken to the following page:

image

Clicking "View License", the user is shown a modal and told that there is no license available for the English [en] language:

image

What improvement(s) could be made?

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.

Change repo name to nodejs-examples-ibmi

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:

  • The python examples repository is named python-examples-ibmi. These should be consistent.
  • It is unclear with the current name that these are examples for the IBM i or just general Node.js examples produced by IBM (and I myself wasn't sure until I read the repo description).

It looks like I can change it myself, but I'd hate to step on anyone's toes...

Fix long options for DBTOXLSX example

image

From the usage you can see that long options are the same as the short variants.

Also options like -b should not require a value rahter just a boolean to store if its set (true)

npm WARN deprecated [email protected]: This is a typosquat on the popular Lodash pack age. This is not maintained nor is the original Lodash package

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?

Unable to configure private key in db2util example

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

OSS package for message queues

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.

Error installing on ibmi

-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$

The nodejs grafana-backend example is broken due to the SimpleJSON plugin being deprecated

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!

[Fixup] Camel examples need cleanup

What example(s) need improvement?

All the Camel examples

What improvement(s) could be made?

  • All should wait on a loop that checks if the context is stopped, rather than just sleeping forever (even better = use the main support shutdown policy that has a wait function)
  • Update dependency versions to latest
  • Stop doing URL encoding in the properties helper class (like so) and instead use RAW() when needed
  • Include the Maven plugin to build in all dependencies into a single jar (example)
  • Update the documentation to use mvn package and java rather than mvn exec::java

Create separate Xlsxwriter example that uses PyODBC

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.