Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image: worker mode not starting correctly #1322

Closed
liliankasem opened this issue Apr 10, 2020 · 2 comments
Closed

Docker image: worker mode not starting correctly #1322

liliankasem opened this issue Apr 10, 2020 · 2 comments
Labels

Comments

@liliankasem
Copy link

liliankasem commented Apr 10, 2020

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
@liliankasem
Copy link
Author

liliankasem commented Apr 10, 2020

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 :)

@heyman
Copy link
Member

heyman commented Apr 13, 2020

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 :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants