I am developing a django-based web platform which allows user to submit jobs to high-throughput computing nodes. I have set it up on linux Centos 7 under the username “cloudcopasi”.
I have tried submitting a job to HTC node using command-line interface (without django) and it works fine. It simply does not work while submitting the job through django-based web interface.
Whenever I try to submit a job from the django-based web-interface, I see the following error message (in HTC log):
setting owner to "cloudcopasi" when active owner is "condor_pool".
Well, I have a model in database which is defined as below:
condor_pool = models.ForeignKey(CondorPool, null=True, blank=True, on_delete = models.CASCADE)
user = models.ForeignKey(User, on_delete = models.CASCADE)
I think that the problem is somewhere here which is not letting the current logged in user (cloudcopasi) to set as an owner instead of “condor_pool”.
Can anyone please help me fix this issue? How to automatically set the owner to current user (on linux) which might help in fixing this problem?
I wouldn’t be looking at the models as much as I’d be looking at the actual API being used to submit the job. I’m not familiar with that API, so I can’t provide any specifics, but I’d be starting with the actual submit process.
Also, when you’re posting code here, please enclose it between lines consisting of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This will allows the forum software to keep your code formatted properly.
Thanks for reply. First, I have just updated my post to embed code as you suggested.
I have already figured out the submission process (the shell script) which when I run, using command-line, works fine. However, the same script when I run from the django-based web interface, it does not. And the problem is the “owner” I have already specified above.
What information should I provide about the API which would be helpful to find out and fix the problem?
Thanks for your due response.
I’d look for whatever parameter is supplied to the HTC API to identify who the owner is. It could be a set of credentials, it could be an API-key of some sort, it could be a username - but somewhere along the line something is sending the owner.
It’s possible that the user name being sent is the username for the UID of the process submitting the request - are you running your server under an ID named “condor_pool”? (Keep in mind that Django is always running as the UID under which the process is started and not the UID of the person logged on through the application being run. So if you’re starting an external process from within a Django project, it’s going to be run as the user under which Django is running.)
Server is running under the user id named “cloudcopasi”, and django is trying to submit a job under UID “condor_pool” which I am trying to determine where has that been declared in django code. I saw once initiation of “condor_pool” in the models.py file (as I mentioned in my original question) and I had been thinking around how to give django authority to submit a job as “cloudcopasi”.
So if you’re starting an external process from within a Django project, it’s going to be run as the user under which Django is running.)
How can I determine under which user Django is running? Sorry, that may be a naive question but I am not an expert in this domain and I have actually been debugging someone else code which is driving me crazy.
The code repository can be accessed here.
How are you running Django? That’s how/where you would check to find out. For example, if you’re running under uwsgi, look for your uwsgi.ini file. But regardless of the method, that is determined outside of Django or your application. It wouldn’t have anything to do with your code base.
Also, keep in mind the possibility that the UID being used may also be external to your code. There might be some other configuration files or environment variables involved. Again, I can only encourage you to find the API documentation for whatever service you’re using to try and find how it’s determining that information.
I am running django with wsgi interface and I have already looked into. I will also check other configuration files. I have been looking around APIs which submits job to HTC and there are some environment variables set. I have tried to debug and made a comparison between environment variables when the submission process is executed from command-line interface and web-interface. But it did not help!
I will explore the interface APIs further and will update if I come across anything.
Thanks a lot!