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

Parsing a shortened host list (2*host1) of LSF #294

Open
htakamur opened this issue Jan 7, 2024 · 1 comment
Open

Parsing a shortened host list (2*host1) of LSF #294

htakamur opened this issue Jan 7, 2024 · 1 comment

Comments

@htakamur
Copy link

htakamur commented Jan 7, 2024

Proposed change

I want to share a brief feedback regarding working with LSF. batchspawner works fine for me with LSF; however, I noticed one thing. Usually, bjobs command returns a host list using ":" as a separator as follows:
RUN host1:host1
Meanwhile, if LSB_SHORT_HOSTLIST=1 is defined in lsf.conf, bjobs returns the list using a shorter format as follows:
RUN 2*host1
which makes a wrong URL, i.e., http://2*host1. So, to avoid this problem and accept both cases correctly, I modified the return statement in state_gethost() in LsfSpawner using re.sub() as follows:

     def state_gethost(self):
         if self.job_status:
-            return self.job_status.split(" ")[1].strip().split(":")[0]
+            return re.sub(r"^[1-9].*\*","",self.job_status.split(" ")[1].strip().split(":")[0])

Even though this change (removing the n* before the hostname) works for me, a better way may be inheriting and overriding regex(exechost_re) in the class LsfSpawner as well as TorqueSpawner. I hope this helps those with a problem regarding the host list in LSF.

Alternative options

Inheriting and overriding regex(exechost_re) in the class LsfSpawner

Who would use this feature?

LSF users

(Optional): Suggest a solution

Copy link

welcome bot commented Jan 7, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

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

No branches or pull requests

1 participant