seleniumhq-community / docker-seleniarm

Multi-Arch (arm64/armhf/amd64) Docker images for the Selenium Grid Server
https://hub.docker.com/u/seleniarm
Other
248 stars 24 forks source link

[🐛 Bug]: Selenium Grid is not starting the node containers #10

Closed EduMelo closed 2 years ago

EduMelo commented 2 years ago

What happened?

I configured selenium grid in a kubernetes cluster via helm specs. I did the required changes based in what is required for running Selenium Grid dinnamic so I configure the config.toml as a ConfigMap (as I pasted in the command section)

I made a request and the hub received it as the log shows:

But no container was started and the requsition timeout. I already figured out how to run selenium grid in a non-dinamic way, but no success so far in a dinamic way Do anyone knows if this configuration is working?

Command used to start Selenium Grid with Docker

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "seleniumGrid.hub.fullname" . }}-configmap
data:
  config.toml: |
    [docker]
    configs = [
        "seleniarm/node-firefox:99.0", "{\"browserName\": \"firefox\"}",
        "seleniarm/node-chromium:101.0", "{\"browserName\": \"chrome\"}",
        "seleniarm/node-chromium:101.0", "{\"browserName\": \"MicrosoftEdge\"}"
        ]

    url = "http://127.0.0.1:2375"
    video-image = "selenium/video:ffmpeg-4.3.1-20220429"
---
{{- if (not .Values.isolateComponents) }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "seleniumGrid.hub.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels: &hub_labels
    app: selenium-hub
    app.kubernetes.io/name: selenium-hub
    {{- include "seleniumGrid.commonLabels" . | nindent 4 }}
    {{- with .Values.hub.labels }}
      {{- toYaml . | nindent 4 }}
    {{- end }}
    {{- with .Values.customLabels }}
      {{- toYaml . | nindent 4 }}
    {{- end }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: selenium-hub
  template:
    metadata:
      labels: *hub_labels
    {{- with .Values.hub.annotations }}
      annotations: {{- toYaml . | nindent 8 }}
    {{- end }}
    spec:
      volumes:
      - name: dockersock
        hostPath:
          path: /var/run/docker.sock
      - name: config-volume
        configMap:
          name: {{ template "seleniumGrid.hub.fullname" . }}-configmap
      containers:
        - name: selenium-hub
          {{- $imageTag := default .Values.global.seleniumGrid.imageTag .Values.hub.imageTag }}
          image: {{ printf "%s:%s" .Values.hub.imageName $imageTag }}
          imagePullPolicy: {{ .Values.hub.imagePullPolicy }}
          ports:
            - containerPort: {{ .Values.hub.port }}
              protocol: TCP
            - containerPort: {{ .Values.hub.publishPort }}
              protocol: TCP
            - containerPort: {{ .Values.hub.subscribePort }}
              protocol: TCP
          volumeMounts:
          - name: dockersock
            mountPath: /var/run/docker.sock
          - name: config-volume
            mountPath: /opt/selenium/config.toml
            subPath: config.toml
        {{- if .Values.hub.livenessProbe.enabled }}
          livenessProbe:
            httpGet:
              path: {{ .Values.hub.livenessProbe.path }}
              port: {{ .Values.hub.port }}
            initialDelaySeconds: {{ .Values.hub.livenessProbe.initialDelaySeconds }}
            periodSeconds: {{ .Values.hub.livenessProbe.periodSeconds }}
            timeoutSeconds: {{ .Values.hub.livenessProbe.timeoutSeconds }}
            successThreshold: {{ .Values.hub.livenessProbe.successThreshold }}
            failureThreshold: {{ .Values.hub.livenessProbe.failureThreshold }}
        {{- end }}
        {{- if .Values.hub.readinessProbe.enabled }}
          readinessProbe:
            httpGet:
              path: {{ .Values.hub.readinessProbe.path }}
              port: {{ .Values.hub.port }}
            initialDelaySeconds: {{ .Values.hub.readinessProbe.initialDelaySeconds }}
            periodSeconds: {{ .Values.hub.readinessProbe.periodSeconds }}
            timeoutSeconds: {{ .Values.hub.readinessProbe.timeoutSeconds }}
            successThreshold: {{ .Values.hub.readinessProbe.successThreshold }}
            failureThreshold: {{ .Values.hub.readinessProbe.failureThreshold }}
        {{- end }}
        {{- with .Values.hub.extraEnvironmentVariables }}
          env: {{- tpl (toYaml .) $ | nindent 12 }}
        {{- end }}
          envFrom:
            {{- with .Values.hub.extraEnvFrom }}
              {{- toYaml . | nindent 12 }}
            {{- end }}
        {{- with .Values.hub.resources }}
          resources: {{- toYaml . | nindent 12 }}
        {{- end }}
    {{- with .Values.hub.nodeSelector }}
      nodeSelector: {{- toYaml . | nindent 8 }}
    {{- end }}
    {{- with .Values.hub.tolerations }}
      tolerations:
        {{ toYaml . | nindent 6 }}
    {{- end }}
{{- end }}

Relevant log output

2022-05-31 03:12:22,016 INFO Included extra file "/etc/supervisor/conf.d/selenium-grid-hub.conf" during parsing
2022-05-31 03:12:22,025 INFO supervisord started with pid 8
2022-05-31 03:12:23,030 INFO spawned: 'selenium-grid-hub' with pid 9
2022-05-31 03:12:24,033 INFO success: selenium-grid-hub entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
03:12:25.138 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
03:12:25.168 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
03:12:25.758 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442, advertising as tcp://10.1.248.154:4442], XSUB binding to [binding to tcp://*:4443, advertising as tcp://10.1.248.154:4443]
03:12:26.093 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://10.1.248.154:4442 and tcp://10.1.248.154:4443
03:12:26.208 INFO [UnboundZmqEventBus.<init>] - Sockets created
03:12:27.219 INFO [UnboundZmqEventBus.<init>] - Event bus ready
03:12:52.917 INFO [Hub.execute] - Started Selenium Hub 4.1.4 (revision 535d840ee2): http://10.1.248.154:4444
03:22:05.469 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "b8b1768ce2387f95060d6a1bd52a2bd8","eventTime": 1653967325467549246,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue","http.host": "192.168.15.50:32565","http.method": "POST","http.request_content_length": "472","http.scheme": "HTTP","http.status_code": 500,"http.target": "\u002fsession","http.user_agent": "selenium\u002f3.141.59 (java unix)"}}

Operating System

Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-1060-raspi aarch64)

Docker Selenium version (tag)

4.1.4-20220429

diemol commented 2 years ago

Duplicate of https://github.com/SeleniumHQ/docker-selenium/issues/1588