Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment error on IBM Z, air-gapped system #113

Open
pgzisis opened this issue Feb 10, 2021 · 7 comments
Open

Deployment error on IBM Z, air-gapped system #113

pgzisis opened this issue Feb 10, 2021 · 7 comments

Comments

@pgzisis
Copy link

pgzisis commented Feb 10, 2021

Hi mq-mqi-nodejs team

We have a node.js application that makes use of mq-mqi-nodejs. As mentioned in the title, not having an internet connection in an air-gapped environment as well as the target architecture which is s390x has added some additional complexity. The issue rises once we try to build our docker image.

Version of mq-mqi-nodejs:
0.9.16

Part of the relevant Dockerfile:

FROM .../s390x/node:14 AS build

ENV LD_LIBRARY_PATH=/usr/mqc9100/lib64
ENV MQIJS_NOREDIST=true

ADD 9.2.0.0-IBM-MQC-Redist-LinuxX64.tar.gz /usr/mqc9100

WORKDIR /usr/src/app

COPY package.json ./

COPY node-v14.15.4-headers.tar.gz .

RUN npm config set registry .../ && \
    npm config set tarball /usr/src/app/node-v14.15.4-headers.tar.gz

RUN npm install --only=prod

Part of the error logs, errors occur on step RUN npm install --only=prod:

> [email protected] install /usr/src/app/node_modules/ffi-napi
> node-gyp-build

make: Entering directory '/usr/src/app/node_modules/ffi-napi/build'
  CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
  AR(target) Release/obj.target/../node-addon-api/src/nothing.a
  COPY Release/nothing.a
  CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o
In file included from ../deps/libffi/src/prep_cif.c:27:0:
../deps/libffi/include/ffi_common.h:17:23: fatal error: fficonfig.h: No such file or directory
 #include <fficonfig.h>
                       ^
compilation terminated.
make: *** [Release/obj.target/ffi/deps/libffi/src/prep_cif.o] Error 1
deps/libffi/ffi.target.mk:131: recipe for target 'Release/obj.target/ffi/deps/libffi/src/prep_cif.o' failed
make: Leaving directory '/usr/src/app/node_modules/ffi-napi/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 4.18.0-193.23.1.el8_2.s390x
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/src/app/node_modules/ffi-napi
gyp ERR! node -v v14.5.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

Lastly, the same error appears when using 9.2.0.0-IBM-MQC-UbuntuLinuxS390X.tar.gz. It contains .deb installation files that we are able to install on Z-Linux using:

RUN /tmp/MQClient/mqlicense.sh -accept & \
    apt install /tmp/MQClient/ibmmq-*.deb
@ibmmqmet
Copy link
Collaborator

It looks like the problem is actually due to lack of full support in the ffi-napi package for buliding on the s390x platform. I've opened an issue against that, but until it gets resolved, integrated and a new version released, automatic building is not going to work.

@pgzisis
Copy link
Author

pgzisis commented Feb 11, 2021

Thank you for looking into this.

Would you have any suggestions on how we could build everything manually?

@ibmmqmet
Copy link
Collaborator

ibmmqmet commented Feb 11, 2021

Not something I've tried or will spend any time on experimenting with, but I might suggest something like npm install --ignore-scripts to get all the prereqs at least downloaded. Then for all the packages with a script:build or script:install stage named in their package.json I'd look to run those pieces manually. Which might in turn mean running node-gyp build. And for the specific compile error, then I'd look at the linked issues in the ffi-napi repository to see what might need to be done to patch up the s390x build.

@pgzisis
Copy link
Author

pgzisis commented Feb 11, 2021

In your extensive documentation, you mention Alternative JavaScript routes into MQ. Within that section, MQTT is mentioned as an alternative way to communicate with MQ. We have a Nest.js application and there is built-in integration with MQTT https://docs.nestjs.com/microservices/mqtt.

We are using mq.Connx, mq.Open, mq.Close, mq.Disc, mq.Put, mq.CrtMh, mq.DltMh, mq.InqMp and mq.Get from your API.

In your experience, would you see this as a possible solution?

@ibmmqmet
Copy link
Collaborator

Unlikely that MQTT would help - it's a pub/sub model. The other alternative is the MQ REST messaging interface but suitability of that would depend on exact messaging requirements including things like formats and transactionality. And since you imply using message properties, it's very unlikely that would be flexible enough.

@srihakum
Copy link

Can we raise an RFE or an issue to enable support for Z and P architecture for this module. We need this to support the MQ capabilities of our product on multiple platforms. Manually compiling may be unreliable it will be great if the module supports all native platforms for consumption.

@ibmmqmet
Copy link
Collaborator

The key prereq that needs "compiling" for other platforms is the ffi-napi component that links to the native C libraries. That's not something that can be provided directly here, but instead you can lobby in the ffi-napi repo for more platforms. Though I know people have asked for s390x to be integrated already without a lot of success - perhaps you can submit a PR there to assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants