Locust: Docker image: worker mode not starting correctly

Created on 10 Apr 2020  ยท  2Comments  ยท  Source: locustio/locust

Describe the bug

When running the latests docker image with LOCUST_MODE set to worker, locust should start in worker mode, but it does not.

It seems to start in standalone mode and the correct LOCUST_OPTS from the docker_start.sh file are not being set.

Expected behavior

When the container runs, I should see:

Starting Locust in worker mode...
$ locust  -f /tests/locustfile.py -H ${TARGET_URL} --worker --master-host=${LOCUST_MASTER_HOST} --master-port=${LOCUST_MASTER_PORT:-5557}

Line 19 in the docker file should take effect:
https://github.com/locustio/locust/blob/master/docker_start.sh

Actual behavior

It seems to recognise that the mode was set to worker, but the options are not getting updated to run in worker mode:

Starting Locust in worker mode...
$ locust  -f /tests/locustfile.py -H http://something
[2020-04-10 06:05:33,874] moma-locust-worker-c8m79/INFO/locust.main: Starting web monitor at http://*:8089
[2020-04-10 06:05:33,874] moma-locust-worker-c8m79/INFO/locust.main: Starting Locust 0.14.5

Steps to reproduce

Run the docker image with these environment variables set

      LOCUST_MODE:         worker
      LOCUST_MASTER_HOST:  something
      TARGET_URL:          http://something
      LOCUSTFILE_PATH:     /tests/locustfile.py

Environment

  • OS: docker
  • Python version: official locust docker image (latest)
  • Locust version: 0.14.5

This docker-compose give the same issue:

x-common: &common
  image: locustio/locust
  environment: &common-env
    TARGET_URL: http://localhost:8080
    LOCUSTFILE_PATH: /tests/locustfile.py
  volumes:
    - ./tests:/tests

services:
  locust-master:
    <<: *common
    ports:
      - 8089:8089
    environment:
      <<: *common-env
      LOCUST_MODE: master

  locust-worker:
    <<: *common
    depends_on: [locust-master]
    environment:
      <<: *common-env
      LOCUST_MODE: worker
      LOCUST_MASTER_HOST: locust-master
bug

All 2 comments

Just realised it's just because the latest docker image doesn't reflect what is in master.

Switched to the master tag (instead of latest) and everything looks good to me.

Though, it would be good to know when we're getting a new docker image, would love to pin my version rather than use the master tag :)

Though, it would be good to know when we're getting a new docker image, would love to pin my version rather than use the master tag :)

Version 1.0 is not quite ready yet, but hopefully we'll be able to release a beta/release candidate pretty soon. It's hard to give a reliable ETA though since all work is done on an unpaid voluntary basis :).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gboorse picture gboorse  ยท  3Comments

meeech picture meeech  ยท  4Comments

walbx picture walbx  ยท  4Comments

sanyco92 picture sanyco92  ยท  4Comments

dolohow picture dolohow  ยท  3Comments