noVNC customised HTML with Jmeter - custom local scaling in settings and hiding fluxbox toolbar

522 views Asked by At

I tried customising noVNC html to better scale the workspace to hide grey area(toolbar) of fluxbox, I was successful in that as you can see in below image.

enter image description here and default screen is smaller than this

this is my dockerfile for customized version of noVNC- image name in docker hub repo -> ddddv1/nonvcj

FROM alpine:edge

RUN \
    # Install required packages
    echo "http://dl-3.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
    apk --update --upgrade add \
      bash \
      fluxbox \
      git \
      supervisor \
      xvfb \
      x11vnc \
      && \
    # Install noVNC
    # customised github repo code -> https://github.com/gg-gg-v1/noVNCJmeter.git
    git clone --depth 1 https://github.com/gg-gg-v1/noVNCJmeter.git /root/noVNC && \
    git clone --depth 1 https://github.com/novnc/websockify /root/noVNC/utils/websockify && \
    rm -rf /root/noVNC/.git && \
    rm -rf /root/noVNC/utils/websockify/.git && \
    apk del git && \
    sed -i -- "s/ps -p/ps -o pid | grep/g" /root/noVNC/utils/launch.sh

# here adding  external site-packages since default python3.9 does not have site-packages
ADD site-packages/ /usr/lib/python3.9/
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
EXPOSE 8080

# Setup environment variables ~/.fluxbox/init
ENV HOME=/root \
    DEBIAN_FRONTEND=noninteractive \
    LANG=en_US.UTF-8 \
    LANGUAGE=en_US.UTF-8 \
    LC_ALL=C.UTF-8 \
    DISPLAY=:0.0 \
    DISPLAY_WIDTH=1024 \
    DISPLAY_HEIGHT=768

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

But when I run Jmeter inside my customized noVNC docker, again good scaling is gone and I am back with small scaling which does not look good, see below image for that

enter image description here

why this went to small scale and there is a black color border which is wrapping jmeter ? can we launch Jmeter in good scaling ?

I am using above custsomised docker image(ddddv1/nonvcj) in below docker file and launching it in docker

 
FROM ddddv1/nonvcj
 
RUN \
    apk add --no-cache curl openjdk8-jre bash nss \
    # && apk add ca-certificates \
    # && update-ca-certificates \
    # && apk add --no-cache nss \
    && curl -L https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.4.1.tgz >  /tmp/jmeter.tgz \
    && mkdir -p /opt \
    && tar -xvf /tmp/jmeter.tgz -C /opt \
    && rm /tmp/jmeter.tgz \
    && cd /etc/supervisor/conf.d \
    && echo '[program:jmeter]' >> supervisord.conf \
    && echo 'command=/opt/apache-jmeter-5.4.1/bin/./jmeter' >> supervisord.conf \
    && echo 'autorestart=true' >> supervisord.conf
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk/
RUN export JAVA_HOME
  1. Am I using something outdated here (apk or alpine, will it make difference) or some extra thing ?
  2. How can I remove or hide the fluxbox toolbar [Workspace 1] which is shown in the downside, I manually did hide toolbar with fluxbox configurations but I want to do this with docker file any help ?
1

There are 1 answers

0
Dmitri T On

I don't know what is good scaling but it seems that you're setting VNC resolution to 1024x768

DISPLAY_WIDTH=1024 \
DISPLAY_HEIGHT=768

and your desktop/browser resolution is higher, just adjust this to match your browser window and that would be it.

With regards to hiding the toolbar you can create ~/.fluxbox/init file and put session.screen0.toolbar.visible=false line there, something like:

echo 'session.screen0.toolbar.visible=false' >> ~/.fluxbox/init

Also it's not clear what you're trying to achieve, running JMeter in docker in GUI mode doesn't make a lot of sense as GUI is for tests development and debugging and it will be way more convenient to do this locally instead of working in a browser window as you're able to use keyboard shortcuts and context menus.

If you're going to use docker swarm or k8s for tests scaling you will need to run JMeter in command-line non-GUI mode which makes your image not suitable for this purpose.