The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 802 - File: showthread.php PHP 7.2.19-0ubuntu0.18.04.2 (Linux)
File Line Function
/showthread.php 802 errorHandler->error



Current time: 09-16-2019, 10:39 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running wpt server and agent with docker-compose
02-12-2019, 09:11 AM
Post: #1
Running wpt server and agent with docker-compose
Hi,

I'm trying to setup a server and an agent using docker and docker-compose, both running on the same machine (my laptop). No matter how I set the compose file I cannot get the agent to show up in the Test Location combo. This is my locations.ini:

Quote:root@8a37986239aa:/var/www/html# cat settings/locations.ini
[locations]
1=Test_loc
default=Test_loc

[Test_loc]
1=Test
label="Test Location"
;group=Desktop

[Test]
browser=Chrome
label="Test Location"

When starting the containers with this docker-compose.yml file, mapping server's container port to a host port and exposing the agent's port:

Code:
version: "2.2"
services:
  wpt_server:
    #The Dockerfile just adds location.ini and server.ini
    build: .
    image: webpagetest/server:custom
    volumes:
      - ./volumes/wpt_data/dat:/var/www/html/dat
      - ./volumes/wpt_data/results:/var/www/html/results
      - ./volumes/wpt_data/logs:/var/www/html/logs
    ports:
      - 4000:80
  wpt_agent:
    image: webpagetest/agent:latest
    init: true
    environment:
      SERVER_URL: http://wpt_server/work/
      LOCATION: Test
      EXTRA_ARGS: "-m debug --checknet yes --log /debug.log -vvvv"
      NAME: "Docker Test"
    depends_on:
      - wpt_server
    cap_add:
      - NET_ADMIN


I get this error:

Code:
wpt_agent_1   | 03:22:06.880 - Resetting dropped connection: wpt_server
wpt_agent_1   | 03:22:06.881 - http://wpt_server:80 "GET /work/getwork.php?f=json&shards=1&reboot=1&location=Test&pc=Docker&version=18.10&screenwidth=1920&screenheight=1200&freedisk=0.760&upminutes=8866 HTTP/1.1" 400 422

And when also mapping agent port and using http://localhost:4000 instead of http://wpt_server for SERVER_URL:

Code:
version: "2.2"
services:
  wpt_server:
    build: .
    image: webpagetest/server:latest
    volumes:
      - ./volumes/wpt_data/dat:/var/www/html/dat
      - ./volumes/wpt_data/results:/var/www/html/results
      - ./volumes/wpt_data/logs:/var/www/html/logs
    ports:
      - 4000:80
  wpt_agent:
    image: webpagetest/agent:test
    init: true
    environment:
      SERVER_URL: http://localhost:4000/work/
      LOCATION: Test
      EXTRA_ARGS: "-m debug --checknet yes --log /debug.log -vvvv"
      NAME: "Docker Test"
    depends_on:
      - wpt_server
    cap_add:
      - NET_ADMIN
    ports:
      - 4001:80

From the agent side everything seems fine, I see on the the agent logs these messages that seems to mean that everything is working ok but not getting any work from the server ?

Code:
wpt_agent_1   | 04:21:00.931 - Checking for work: http://localhost:4000/work/getwork.php?f=json&shards=1&reboot=1&location=Test&pc=Docker&version=18.10&screenwidth=1920&screenheight=1200&freedisk=0.759&upminutes=8925
wpt_agent_1   | 04:21:00.933 - Starting new HTTP connection (1651): localhost:4000
wpt_agent_1   | 04:21:00.934 - Get Work Error: None
wpt_agent_1   | sudo: reboot: command not found

But still the agent does not show up on the Test Location combo and no errors on the server logs, I'm really clueless with what I'm missing. Any ideas ??

Thanks in advance.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Running wpt server and agent with docker-compose - jbaptiste - 02-12-2019 09:11 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)