Issues Setting Params / luigi.Config, example using port

201 views
Skip to first unread message

pete....@gmail.com

unread,
Sep 7, 2017, 1:47:33 PM9/7/17
to Luigi
I'm trying to migrate cron jobs over to Luigi at my firm. I'm not a dev but I do scripting. I want to convince others to use Luigi but I'm struggling implementing it on my own.

I'd like to implement one of two solutions, either will work:

1. creating a luigi.cfg/client.cfg file
OR
2.. creating params within "class ClassName(luigi.Config):"

With solution #1, creating a .cfg file and setting the .cfg file as LUIGI_CONFIG_PATH, I see that it works to some degree:

[pete.west@chi-ldvd085 pipes]$ pwd
/home/pete.west/pipes
[pete.west@chi-ldvd085 pipes]$ ls
1 client.cfg logging.cfg testing.py
[pete.west@chi-ldvd085 pipes]$ cat client.cfg
[core]
default_scheduler_port=8085
logging_conf_file=/home/pete.west/pipes/logging.cfg

[pete.west@chi-ldvd085 pipes]$ export LUIGI_CONFIG_PATH=/home/pete.west/pipes/client.cfg
[pete.west@chi-ldvd085 pipes]$ python
Python 2.7.13 (default, Jun 26 2017, 10:20:05)
[GCC 7.1.1 20170622 (Red Hat 7.1.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import luigi
>>> luigi.configuration.get_config().get('core', 'default_scheduler_port')
'8085'
>>> exit()

But when I run the luigid command...

[pete.west@chi-ldvd085 pipes]$ luigid
Configuring logging from file: /home/pete.west/pipes/logging.cfg

... the webserver that launches is the default:

http://chi-ldvd085:8082/static/visualiser/index.html


Can someone please assist and inform me why 8085 isn't being used as the port and how I can get 8085 to work as the port?

Thank you kindly! I'd also like to note that I've reviewed some other great posts on this discussion page:
- https://groups.google.com/forum/#!topic/luigi-user/rL1H_VCAH0w
- https://groups.google.com/forum/#!searchin/luigi-user/config|sort:relevance/luigi-user/Y95vbKWPV_U/WvheSYfSQzgJ
These have been very helpful, but I still haven't achieved the desired solution.

Brad Maggard

unread,
Sep 18, 2017, 1:20:44 PM9/18/17
to Luigi
In cmdline.py, the api_port argument to luigi.server.run is only ever set from opts.port, meaning that luigid port can only be set from the command line: the configuration file is not used.

This is true for everything but the logging configuration and does not appear to be in conformance with the documentation.

Please let me know whether you are going to submit an issue.  I (casually) searched, but did not find any:

Peter West

unread,
Sep 18, 2017, 3:34:56 PM9/18/17
to Luigi
I created an issue:  https://github.com/spotify/luigi/issues/2235

Thank you for your response! 
Reply all
Reply to author
Forward
0 new messages