browserstack / browserstack-local-nodejs

NodeJS bindings for BrowserStack Local
https://www.browserstack.com
MIT License
71 stars 56 forks source link

Release a BrowserStackLocal binary for Alpine Linux? #32

Closed pmeinhardt closed 7 years ago

pmeinhardt commented 7 years ago

Hey there. I was having some issues, getting the BrowserStackLocal binary to run on Alpine Linux (in a Docker container).

The browserstack-local npm package will automatically download the linux-x64 binary, which does not work on Alpine (which is based on musl instead of GNU C lib).

I got it working with: https://github.com/sgerrand/alpine-pkg-glibc (you'll need at least glibc-2.25-r0.apk, glibc-bin-2.25-r0.apk)

However, it would be a much better experience if BrowserStack just published another build for Alpine/musl and have the node package download that one.

Thanks a lot 🙂

lots0logs commented 7 years ago

@AnkurGel @vedharish Any movement on this? We want to begin using docker containers based on Alpine Linux for our automated testing but we can't because the browserstack binary won't run in them currently.

punitx commented 7 years ago

@pmeinhardt @lots0logs At the moment, we have no plans for supporting Alpine Linux. We will inform you once we have support for it. Closing this issue for now.

pmeinhardt commented 7 years ago

Okay. Thanks for the update @punitx 👍

For everyone who needs to run BrowserStackLocal on Alpine in the meantime, check out sgerrand/alpine-pkg-glibc as noted in the issue description above.

Cheers

lots0logs commented 7 years ago

@punitx I've tried that solution and it doesn't work. I think choosing not to support Alpine is a mistake TBH. Alpine is the default recommended container base image from Docker. Since BrowserStack Automate is going to primarily be used in containers, you guys should support Alpine.

shripadbothaleAvalara commented 7 years ago

Any updates on this as I am not able to get going with local testing using alpine image

punitx commented 7 years ago

@shripadbothaleAvalara Currently, supporting Alpine Linux is not on our product roadmap. Should there be any update regarding this, we will post it here.

LKay commented 7 years ago

@punitx Well, it should be on your roadmap as most of people using alpine based images for automated tests in CI servers if possible. This is very not wise approach. Maybe at least you could release sources which could be compiled against Alpine linux platform?

micheletest commented 6 years ago

I suggest that you add to your README on all these browserstack-local-* projects that alpine is not supported, so that others don't waste time trying to get it to work. I am also another +1 for supporting this in the future.

scottspeers-scu commented 6 years ago

Completely agree, supporting this in the future would be very awesome.

tomekit commented 6 years ago

Having same issue on docker:latest image.

Installed glibc

RUN apk --no-cache add ca-certificates wget
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.apk
RUN apk add glibc-2.27-r0.apk

Now getting: /usr/local/bin/BrowserStackLocal: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

Installed libstdc++

RUN apk add libstdc++

Still no luck.

chippison commented 6 years ago

@tomekit I just got this working using https://github.com/sgerrand/alpine-pkg-glibc. I think you are just missing: RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-bin-2.27-r0.apk RUN apk add glibc-bin-2.27-r0.apk.

This should work fine. No need to install libstdc++

Cheers

lbergman commented 5 years ago

Not having any luck with alpine-pkg-glibc, and find the response from very disappointing. This SHOULD be high up on the roadmap. Pretty much everyone publishes alpine images nowadays, and when running docker images for CI build, size really matters. Seems like the only option for us if we would like to stick with browserstack will be to redo all our images based on another distro, which will be a lot of work and lead to slower CI pipelines. That is certainly a huge minus for us when selecting provider.

tomekit commented 5 years ago

@lbergman

Try this, works for me. Feel free to remove stuff you don't need, openssh, bash, docker-compose etc.

Dockerfile


FROM docker:latest

RUN apk update
RUN apk add --no-cache py-pip git openssh bash

RUN pip install docker-compose
RUN pip install selenium

# Copied from https://github.com/sgerrand/alpine-pkg-glibc
# Need to run BrowserStack
RUN apk --no-cache add ca-certificates wget
RUN wget -q -O  /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk
RUN apk add glibc-2.28-r0.apk

RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-bin-2.28-r0.apk
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-i18n-2.28-r0.apk
RUN apk add glibc-bin-2.28-r0.apk glibc-i18n-2.28-r0.apk
RUN /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8

RUN apk add libstdc++

RUN wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip \
    && unzip BrowserStackLocal-linux-x64.zip \
    && chmod +x BrowserStackLocal \
    && mv BrowserStackLocal /usr/local/bin \
    && rm BrowserStackLocal-linux-x64.zip

PS. Don't get frustrated so easily. Dealing with stuff like this, day as usual. :)

lbergman commented 5 years ago

Thanks, seems to be a couple of lines in there which wasn't in the solutions I found. Will try it out on Monday, have a nice weekend!

On Fri, 26 Oct 2018, 18:40 tomekit, notifications@github.com wrote:

@lbergman https://github.com/lbergman

Try this, works for me. Feel free to remove stuff you don't need, openssh, bash, docker-compose etc. FROM docker:latest

RUN apk update RUN apk add --no-cache py-pip git openssh bash

RUN pip install docker-compose RUN pip install selenium Copied from https://github.com/sgerrand/alpine-pkg-glibc Need to run BrowserStack

RUN apk --no-cache add ca-certificates wget RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk RUN apk add glibc-2.28-r0.apk

RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-bin-2.28-r0.apk RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-i18n-2.28-r0.apk RUN apk add glibc-bin-2.28-r0.apk glibc-i18n-2.28-r0.apk RUN /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8

RUN apk add libstdc++

RUN wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip && unzip BrowserStackLocal-linux-x64.zip && chmod +x BrowserStackLocal && mv BrowserStackLocal /usr/local/bin && rm BrowserStackLocal-linux-x64.zip `

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/browserstack/browserstack-local-nodejs/issues/32#issuecomment-433469904, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtPMqN0QIcyWM0R6l6GklMoGFDPcv_Kks5uozrugaJpZM4NTzxu .

lbergman commented 5 years ago

No luck, still getting /root/.browserstack/BrowserStackLocal: /usr/lib/libstdc++.so.6: no version information available (required by /root/.browserstack/BrowserStackLocal) Using Alpine 3.8 as base.

tomekit commented 5 years ago

Sure I am getting this message as well, but it doesn't stop BrowserStackLocal from running.

lbergman commented 5 years ago

I see, thanks! Since process exits with a 1, which kills the ci run, I figured it was fatal. So then I just have to make gitlab ci swallow the error...

On Mon, 29 Oct 2018, 17:25 tomekit, notifications@github.com wrote:

Sure I am getting this message as well, but it doesn't stop BrowserStackLocal from running.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/browserstack/browserstack-local-nodejs/issues/32#issuecomment-433975390, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtPMo0SpMghwZd6GSNuwiV3wPdhbrZEks5upyvogaJpZM4NTzxu .

tomekit commented 5 years ago

No problem, however if it exits with a 1 then it actually doesn't work for you. Did you test your tunnel on your machine? It might be easier to debug any issues with BrowserStackLocal before setting up Gitlab CI.

lbergman commented 5 years ago

Sure, the tunnel works fine locally and when using a debian based image.