0

I run the selenium grid on container and would like to apply opentracing to this container.Here are my Dockerfile for test image and docker-compose file .

Docker_compose file:

version: "3"
services:
  chrome:
    image: test
    shm_size: 4gb
    container_name: Chrome
    expose : 
      - "4444"
    command: >
      sh -c "
      ./shell/start-grid-standalone.sh
      "
    volumes:
      - "grid:/app:rw"
 jaeger:
    container_name: Jaeger
    image: jaegertracing/all-in-one:latest
    ports:
      - 16686:16686
      - 6831:6831/udp
    volumes:
      - Jaeger-vol:/var/lib/jaeger
volumes:
 Jaeger-vol:
 grid:

Dockerfile for image test :

FROM selenium/standalone-chrome:latest
WORKDIR /app
COPY . . 
RUN sudo apt install curl
RUN curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d
> cs
RUN chmod +x cs 
RUN ./cs setup --yes
RUN export PATH="/home/.local/share/coursier/bin"

The docker file takes reference from https://get-coursier.io/docs/cli-installation and the docker compose takes reference from https://github.com/manoj9788/tracing-selenium-grid. The content of /shell/start-grid-standalone.sh is as same as https://github.com/manoj9788/tracing-selenium-grid/blob/master/start-grid-standalone.sh

And the error I get is :

Chrome | + grep selenium-server-4.0.0-alpha-7.jar Chrome | + awk '{print $2}' Chrome | + xargs kill Chrome | kill: (9): No such process Chrome | ++ coursier fetch -p io.opentelemetry:opentelemetry-exporter-jaeger:1.0.0 io.grpc:grpc-netty:1.35.0 Chrome | ./shell/start-grid-standalone.sh: line 4: coursier: command not found Chrome | + java -Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=localhost:14250 -Dotel.resource.attributes=service.name=selenium-standalone -jar selenium-beta-4.jar --ext standalone Chrome | Error: Unable to access jarfile selenium-beta-4.jar

I actually save the location of coursier binary file as environment variable,so why I still get the error for coursier: command not found ? Hope someone could help me ,thanks!

TonyLiu
  • 1
  • 1
  • 1

1 Answers1

0

Here's what worked for me. As an example here's how the modified command in the shell script looks like:

curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > /tmp/cs
chmod +x /tmp/cs

java ${JAVA_OPTS:-$SE_JAVA_OPTS} -Dwebdriver.http.factory=jdk-http-client \
  -jar /opt/selenium/selenium-server.jar \
  --ext /opt/selenium/selenium-http-jdk-client.jar:$(/tmp/cs fetch --classpath --cache /tmp io.opentelemetry:opentelemetry-exporter-jaeger:1.19.0 io.grpc:grpc-netty:1.50.2) hub \
  --session-request-timeout ${SE_SESSION_REQUEST_TIMEOUT} \
  --session-retry-interval ${SE_SESSION_RETRY_INTERVAL} \
  --relax-checks ${SE_RELAX_CHECKS} \
  --bind-host ${SE_BIND_HOST} \
  ${HOST_CONFIG} \
  ${PORT_CONFIG} \
  ${SE_OPTS}

I have created a full fledged demo project and uploaded it to GitHub which demonstrates how to perform tracing for

  • a simple grid (the one that has just a Hub and a node)
  • a distributed grid (which has an event-bus, sessions, session-queue, router, distributer and a node)

Please take a look at the GitHub project

Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66