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

Not able to override default settings #35

Closed
noqcks opened this issue Jul 13, 2018 · 3 comments
Closed

Not able to override default settings #35

noqcks opened this issue Jul 13, 2018 · 3 comments

Comments

@noqcks
Copy link

noqcks commented Jul 13, 2018

We're trying to alter the setting JOB_MAX_INSTANCES, but not having any luck.

Dockerfile

FROM python:2-alpine3.7

RUN apk update && apk add git postgresql-dev gcc python-dev musl-dev

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

ENV NDSCHEDULER_SETTINGS_MODULE=settings

ADD . .

CMD ["python", "scheduler.py"]

settings.py

JOB_MAX_INSTANCES = 10

scheduler.py

"""Run the scheduler process."""
from ndscheduler.server import server

class Tassadar(server.SchedulerServer):
  pass

if __name__ == "__main__":
    Tassadar.run()

And we boot up the container and try to run more than 3 instances:

ndscheduler.core.scheduler_manager - WARNING - Execution of job "REDACTED (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='0'], next run at: 2018-07-13 04:00:00 UTC)" skipped: maximum number of running instances reached (3)

Any ideas? I would expect it to not limit out at 3 any more, but rather 10.

Thanks!

@noqcks noqcks changed the title Settings overriding defaults Not able to override default settings Jul 13, 2018
@kartick
Copy link

kartick commented Aug 21, 2018

Hi,

Are you sure your settings.py is being read?

We run NDS via supervisor, and config looks like this:

[program:scheduler]
directory=/scheduler
command=python scheduler/scheduler.py
environment=PYTHONPATH="scheduler:${PYTHONPATH}",NDSCHEDULER_SETTINGS_MODULE=settings,SCHEDULER_DATA_ROOT=/scheduler/data
autostart=true
autorestart=true
startretries=5
exitcodes=0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Our custom settings.py is in the /scheduler directory and it is sucked in using the NDSCHEDULER_SETTINGS_MODULE environment variable.

@sabw8217
Copy link
Contributor

@noqcks can you share the rest of the logs you see on startup? As @kartick is suggesting, the likely problem is that your settings file is not being loaded at all because it is not on sys.path.

@noqcks
Copy link
Author

noqcks commented Aug 30, 2018

Ahhh that was it.

@noqcks noqcks closed this as completed Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants