Closed aknuds1 closed 6 years ago
The client used to build/run on Alpine Linux in the past. However, I can reproduce the issue using your Dockerfile. There are at least two issues that are currently causing the build to fail:
(1) In binding.gyp
I need to add -lssl
to link against libssl explicitly.
(2) The Aerospike C client recently added a call to pthread_attr_setaffinity_np
- this function does not seem to be supported on Alpine Linux.
I'll fix (1) but I'll need to talk to our C client developer re (2).
I've temporarily patched both issues in my docker image and am able to run the client.
Thanks @jhecking! I'll experiment based on your suggestions.
How do you patch (2) though?
How do you patch (2) though?
By patching the as_cpu.h header file in the Aerospike C client to remove the problematic function call.
On 31 Oct 2018, at 8:25 PM, Arve Knudsen notifications@github.com wrote:
Thanks @jhecking! I'll experiment based on your suggestions.
How do you patch (2) though?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@jhecking I made a PR for the ssl linking.
Can you explain exactly how you patched as_cpu.h? Did you just avoid calling pthread_attr_setaffinity_np
(and return 0 instead)?
Did you just avoid calling pthread_attr_setaffinity_np (and return 0 instead)?
Exactly.
On 31 Oct 2018, at 8:43 PM, Arve Knudsen notifications@github.com wrote:
@jhecking I made a PR for the ssl linking.
Can you explain exactly how you patched as_cpu.h? Did you just avoid calling pthread_attr_setaffinity_np (and return 0 instead)?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Thanks!
@aknuds1, thanks for the PR!
The good news is that I have talked to our C client developer, and he will fix the issues with the C client on Alpine Linux, incl. the pthread_attr_setaffinity_np function dependency. (Apparently, there is a different way to set CPU affinity on Alpine Linux.)
The bad news is that we'll probably see a new C client release only next week. Once that's done, I can update the Node.js client to include the fixed C client version.
Thanks @jhecking for fixing this! I made my own package of the Node.js client in the meantime, so I'm OK in the meantime :)
This issue is fixed in v3.7.2. I was able to build an Alpine Linux docker image using this slightly modified Dockerfile:
FROM node:10-alpine
MAINTAINER Me
WORKDIR /app
RUN apk add --no-cache python2 make gcc g++ git libtool autoconf automake linux-headers \
openssl-dev zlib-dev libuv-dev
RUN git clone https://github.com/aerospike/aerospike-client-c.git && \
cd aerospike-client-c && \
git checkout --detach 4.3.20 && \
git submodule update --init && \
make EVENT_LIB=libuv
ENV PREFIX=/app/aerospike-client-c/target/Linux-x86_64
RUN npm install aerospike@3.7.2
RUN node -e "require('aerospike')"
Note the extra step git checkout --detach 4.3.20
in the C client build instructions. This is to ensure the right version of the C client is used for the given Node.js client version.
Thanks @jhecking!
I'm trying to install aerospike-client-nodejs on Alpine Linux, using C library built from source, but it fails due to a mysterious relocation error. Please help me figure this one out!
The below Dockerfile reproduces the error (given a package.json file in the current directory):
You should see an error like