openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.17k stars 2.71k forks source link

is STF 3.1.0 available soon on ARM ? #729

Closed denis99999 closed 6 years ago

denis99999 commented 6 years ago

It is not an issue just a question: is STF 3.1.0 available soon on ARM from docker hub in order to get the Android O compatibility ?

sorccu commented 6 years ago

Sigh, the builder has died again...

denis99999 commented 6 years ago

Arrgh, do you have a trail about the error causing the build to fail ? My target is raspberry Pi3, may be I can try to build on it ?

sorccu commented 6 years ago

I think it was just out of disk space. It's building now, let's see if it works.

sorccu commented 6 years ago

Should be working again.

denis99999 commented 6 years ago

Thanks, I currently download the latest image !

De : Simo Kinnunen [mailto:notifications@github.com] Envoyé : mercredi 11 octobre 2017 15:16 À : openstf/stf Cc : BARBARON Denis IMT/OLS; Author Objet : Re: [openstf/stf] is STF 3.1.0 available soon on ARM ? (#729)

Should be working again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/openstf/stf/issues/729#issuecomment-335805692, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVtkCrjCY6L2f_orUPx8HUrcwc7pFzd-ks5srL-ogaJpZM4P1EhN.


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

denis99999 commented 6 years ago

It works well !

From my side, I tried to build the docker image on Raspberry Pi3, but it seems to be blocked on the compilation of a file at “building app” step:

g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.3.6"' -I/home/stf/.node-gyp/6.11.2/include/node -I/home/stf/.node-gyp/6.11.2/src -I/home/stf/.node-gyp/6.11.2/deps/uv/include -I/home/stf/.node-gyp/6.11.2/deps/v8/include -I../src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -std=gnu++0x -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/context.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/context.o ../src/libsass/src/context.cpp

Do you what it means ?

De : BARBARON Denis IMT/OLS Envoyé : mercredi 11 octobre 2017 15:18 À : 'openstf/stf' Objet : RE: [openstf/stf] is STF 3.1.0 available soon on ARM ? (#729)

Thanks, I currently download the latest image !

De : Simo Kinnunen [mailto:notifications@github.com] Envoyé : mercredi 11 octobre 2017 15:16 À : openstf/stf Cc : BARBARON Denis IMT/OLS; Author Objet : Re: [openstf/stf] is STF 3.1.0 available soon on ARM ? (#729)

Should be working again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/openstf/stf/issues/729#issuecomment-335805692, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVtkCrjCY6L2f_orUPx8HUrcwc7pFzd-ks5srL-ogaJpZM4P1EhN.


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

sorccu commented 6 years ago

It might just take a super long time. RPi is not very powerful. The full build can take several hours.

denis99999 commented 6 years ago

Hi,

Thanks for your answer, this morning I saw that the build failed: Killed The command '/bin/sh -c set -xo pipefail && echo '--- Updating repositories' && apk update && echo '--- Building node' && apk add curl make gcc g++ binutils-gold python linux-headers paxctl libgcc libstdc++ && curl -sSL https://nodejs.org/dist/v6.11.2/node-v6.11.2.tar.gz | tar -xz && cd /node-v && ./configure --prefix=/usr && make -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && make install && paxctl -cm /usr/bin/node && echo '--- Building app' && addgroup -S stf && adduser -S -G stf stf && chown -R stf:stf /tmp/build && cd /tmp/build && export PATH=$PWD/node_modules/.bin:$PATH && sed -i'' -e '/phantomjs/d' package.json && apk add git zeromq-dev protobuf-dev graphicsmagick && export JOBS=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && echo 'npm install --no-optional' | su stf -s /bin/sh && echo '--- Assembling app' && echo 'npm pack' | su stf -s /bin/sh && tar -xzf stf-.tgz && mv package /app && echo 'bower cache clean' | su stf -s /bin/sh && echo 'npm prune --production' | su stf -s /bin/sh && mv node_modules /app && chown -R root:root /app && echo '--- Cleaning up' && echo 'npm cache clean' | su stf -s /bin/sh && rm -rf /home/stf/.node-gyp && apk del curl make gcc g++ binutils-gold python linux-headers paxctl && rm -rf /node-v /usr/share/man /tmp/ /var/cache/apk/* /root/.npm /root/.node-gyp /usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html' returned a non-zero code: 137

I have no problem of disk space on my SD Card (64 Go), so do you have any idea about this fail ? Sure the raspberry is not enough powerful, so what do you advise me to use as ARM hardware to build ? Do you think a cross compilation may be a good solution ? Thanks.

De : Simo Kinnunen [mailto:notifications@github.com] Envoyé : mercredi 11 octobre 2017 19:27 À : openstf/stf Cc : BARBARON Denis IMT/OLS; Author Objet : Re: [openstf/stf] is STF 3.1.0 available soon on ARM ? (#729)

It might just take a super long time. RPi is not very powerful. The full build can take several hours.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/openstf/stf/issues/729#issuecomment-335885018, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVtkCgC4OTrsqpzCIfCNrEd3-fiK8fdqks5srPpNgaJpZM4P1EhN.


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

sorccu commented 6 years ago

Yes that may work, docker makes it fairly easy nowadays. We use a Scaleway C1 which is only 2.99EUR per month. Build still takes an hour or more but it does at least finish. An ODROID XU4 is also able to finish the build, and relatively quickly too.

denis99999 commented 6 years ago

Thanks !

De : Simo Kinnunen [mailto:notifications@github.com] Envoyé : jeudi 12 octobre 2017 09:07 À : openstf/stf Cc : BARBARON Denis IMT/OLS; Author Objet : Re: [openstf/stf] is STF 3.1.0 available soon on ARM ? (#729)

Yes that may work, docker makes it fairly easy nowadays. We use a Scaleway C1 which is only 2.99EUR per month. Build still takes an hour or more but it does at least finish. An ODROID XU4 is also able to finish the build, and relatively quickly too.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/openstf/stf/issues/729#issuecomment-336040266, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVtkChBzcAxnvrUg3dTbJ-DYx6U3DUbMks5srbqZgaJpZM4P1EhN.


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

denis99999 commented 6 years ago

Just a detail perhaps, but I changed the release tag in “Dockerfile” from “3.5” to “edge” because in “mkimage-alpine.sh” file the “edge” tag is configured, otherwise the build fails at starting, do you think this changing may fails the build ? If I set the “3.5” tag in “mkimage-alpine.sh” file then the image building fails also at starting..

De : BARBARON Denis IMT/OLS Envoyé : jeudi 12 octobre 2017 09:11 À : 'openstf/stf' Objet : RE: [openstf/stf] is STF 3.1.0 available soon on ARM ? (#729)

Thanks !

De : Simo Kinnunen [mailto:notifications@github.com] Envoyé : jeudi 12 octobre 2017 09:07 À : openstf/stf Cc : BARBARON Denis IMT/OLS; Author Objet : Re: [openstf/stf] is STF 3.1.0 available soon on ARM ? (#729)

Yes that may work, docker makes it fairly easy nowadays. We use a Scaleway C1 which is only 2.99EUR per month. Build still takes an hour or more but it does at least finish. An ODROID XU4 is also able to finish the build, and relatively quickly too.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/openstf/stf/issues/729#issuecomment-336040266, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVtkChBzcAxnvrUg3dTbJ-DYx6U3DUbMks5srbqZgaJpZM4P1EhN.


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

sorccu commented 6 years ago

Check out https://github.com/openstf/stf/blob/master/docker/armv7l/stf-armv7l-baseimage%40.service. As you can see it sets an environment variable and also passes some options to the script.

denis99999 commented 6 years ago

Sorry, I read the README.md only, I will try that ! Thanks.

De : Simo Kinnunen [mailto:notifications@github.com] Envoyé : jeudi 12 octobre 2017 11:47 À : openstf/stf Cc : BARBARON Denis IMT/OLS; Author Objet : Re: [openstf/stf] is STF 3.1.0 available soon on ARM ? (#729)

Check out https://github.com/openstf/stf/blob/master/docker/armv7l/stf-armv7l-baseimage%40.service. As you can see it sets an environment variable and also passes some options to the script.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/openstf/stf/issues/729#issuecomment-336078231, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVtkChLp4oA_MLtZM9oWXF1wyruIiR3Bks5srd_5gaJpZM4P1EhN.


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

denis99999 commented 6 years ago

Finally, I took the Dockerfile for x86_64 architecture and adapted it for ARM, after what I successed to build the docker image for raspberry Pi3 in less than 40 mn, and it works well !

Obviously, the image size is about 714 MB while it is 311 MB for alpine, but it does not matter, do you see some potential drawbacks about this build ?

sorccu commented 6 years ago

Well if it works for you I'm not going to complain :) File size is an issue but could perhaps be solved by flattening the image.

Mind sharing your Dockerfile and the steps you took? Might be useful for other people as well.

denis99999 commented 6 years ago

Whatis the best way to share ? through a pull request ?

sorccu commented 6 years ago

I think the easiest way right now would be to just copypaste it here. Put it between three backticks and it should get syntax highlighting, too.

```Dockerfile
FROM alpine
```

Results in:

FROM alpine
denis99999 commented 6 years ago

you mean through docker hub ?

denis99999 commented 6 years ago

ok, I took a debian source image but it should works well also with an ubuntu one:

FROM armv7/armhf-debian:latest

# Sneak the stf executable into $PATH.
ENV PATH /app/bin:$PATH

# Work in app dir by default.
WORKDIR /app

# Export default app port, not enough for all processes but it should do
# for now.
EXPOSE 3000

# Install app requirements. Trying to optimize push speed for dependant apps
# by reducing layers as much as possible. Note that one of the final steps
# installs development files for node-gyp so that npm install won't have to
# wait for them on the first native module installation.
RUN export DEBIAN_FRONTEND=noninteractive && \
    useradd --system \
      --create-home \
      --shell /usr/sbin/nologin \
      stf-build && \
    useradd --system \
      --create-home \
      --shell /usr/sbin/nologin \
      stf && \
    apt-get update && \
    apt-get -y install wget python build-essential && \
    cd /tmp && \
    wget --progress=dot:mega \
      https://nodejs.org/dist/v6.11.2/node-v6.11.2-linux-armv7l.tar.xz && \
    tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local && \
    rm node-v*.tar.xz && \
    su stf-build -s /bin/bash -c '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js install' && \
    apt-get -y install libzmq3-dev libprotobuf-dev git graphicsmagick yasm && \
    apt-get clean && \
    rm -rf /var/cache/apt/* /var/lib/apt/lists/*

# Copy app source.
COPY . /tmp/build/

# Give permissions to our build user.
RUN mkdir -p /app && \
    chown -R stf-build:stf-build /tmp/build /app

# Switch over to the build user.
USER stf-build

# Run the build.
RUN set -x && \
    cd /tmp/build && \
    export PATH=$PWD/node_modules/.bin:$PATH && \
    sed -i'' -e '/phantomjs/d' package.json && \
    npm install --loglevel http && \
    npm pack && \
    tar xzf stf-*.tgz --strip-components 1 -C /app && \
    bower cache clean && \
    npm prune --production && \
    mv node_modules /app && \
    npm cache clean && \
    rm -rf ~/.node-gyp && \
    cd /app && \
    rm -rf /tmp/*

# Switch to the app user.
USER stf

# Show help by default.
CMD stf --help
denis99999 commented 6 years ago

In synthesis, I just made the following modifications:

sorccu commented 6 years ago

Thanks!