[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Migrating to htcondor2 -> pypi LTS supported version?



Hello again,

I continuedÂtesting with the latest 24.11.2 version on pypi and I'm finding what seem to be bugs when using itemdata.

The example in [1] fails with htcondor2 (but succeeds with htcondor):


[khurtado@cmscon toreport]$ python3 test.py
Traceback (most recent call last):
 File "/home/khurtado/new-condor/toreport/test.py", line 27, in <module>
  result = htcondor.Schedd().submit(submit, itemdata=iter(jobAds))
 File "/home/khurtado/.local/lib/python3.9/site-packages/htcondor2/_schedd.py", line 566, in submit
  return _schedd_submit(self._addr, real._handle, count, spool)
htcondor2_impl.HTCondorException: Failed to create job ad, errmsg=Submit:-1:Parse error in _expression_:
Rank = 2 38

The problem lies onÂ

ad['Arguments'] = "1 2 3"
ad['Rank'] = '8'


Here are different scenarios with different results:

1)ÂIf only:
ad['Arguments'] = "1 2 3"

is defined, without the Rank, everything works well and the arguments are passed.

2) If ad['Rank'] is defined in the jobAds, but we add the arguments in the htcondor.Submit() object instead of the jobAd dictionary, it works as well. I.e.:

submit = htcondor.Submit(
  f"""
  ...
  arguments = 1 2 3
  ...
  """
)

3) If only ad['Rank'] is defined, things work as well.

4) Other combinations that fail are:

a)
ad['Arguments'] = "1 2 3"
ad['request_memory'] = "200"

b)Â
ad['request_memory'] = 'OriginalMemory + ExtraMemory * (WMCore_ResizeJob ? (RequestCpus-OriginalCpus) : 0)'
ad['Rank'] = '8'

In both cases above, if ad['request_memory'] is defined alone (excluding Arguments or Rank, respectively), then submission works.

Again, all the cases above work as expected with htcondor. There may be more combinations that are failing with htcondor2 that are not obvious.
Are these bugs or is this expected?

[1]
#!/usr/bin/env python3
import htcondor2 as htcondor
import classad2 as classad

# Create a job description. It _must_ set `log` to create a job event log.
logFileName = "sleep.log"
submit = htcondor.Submit(
  f"""
  executable = /bin/sleep
  transfer_executable = false

  log = {logFileName}
  """
)

jobAds = []
for name in range(2):
  name = str(name)
  ad = {}
  ad['My.MyJobName'] = classad.quote(name)
  ad['Arguments'] = '1 2 3'
  ad['Rank'] = '8'
  jobAds.append(ad)

# Submit the job description, creating the job.
result = htcondor.Schedd().submit(submit, itemdata=iter(jobAds))
clusterID = result.cluster()



On Mon, Sep 15, 2025 at 11:45âAM Kenyi Hurtado Anampa <khurtado@xxxxxx> wrote:
Hi Tim,

Thank you so much for the confirmation.Â
We will then wait for 25.0.x to be released and work against that version.

Best regards,
Kenyi

On Mon, Sep 15, 2025 at 10:24âAM Tim Theisen <tim@xxxxxxxxxxx> wrote:

Hello Kenyi,

There has been significant work done on the htcondor2 binding during the 24.x development cycle. So, it is no surprise that the 24.0.10 bindings have issues.

We have already frozen the code for the 25.0.1 release and testing is complete. It is scheduled for release next week (September 25th). I can post the python wheels for 25.0.1-beta this week. Versions 25.0.x will only receive bug fixes and a 25.0.x version will be kept on PyPI indefinitely.

I think that you should work against the 25.0 release series. Let me know if that satisfies your requirements.

...Tim

On 9/14/25 20:02, Kenyi Hurtado Anampa wrote:
Hi Tim

Thank you!Â
While trying to migrate, I run into an issueÂwhere the simplest submission example below doesn't work with htcondor 24.0.10 (string index out of range error), but works just fine with the latest 24.11.x version. Is this something expected? Is htcondor.Schedd.submit() broken in 24.0.10, does it work differently than in 24.11.x, or am IÂmissing something?Â

If e.g.: 24.11.2 is what we need to guarantee the functionalityÂwe had with the old htcondor.Schedd.submit(), how long can we expect that to last in pypi?


#!/usr/bin/env python3
import time
import htcondor2 as htcondor

# Create a job description.  It _must_ set `log` to create a job event log.
logFileName = "sleep.log"
submit = htcondor.Submit(
    f"""
    executable = /bin/sleep
    transfer_executable = false
    arguments = 20

    log = {logFileName}
    """
)

# Submit the job description, creating the job.
result = htcondor.Schedd().submit(submit, count=1)
clusterID = result.cluster()

$ python3 test.py
Traceback (most recent call last):
  File "/home/khurtado/test.py", line 19, in <module>
    result = htcondor.Schedd().submit(submit, count=1)
  File "/home/khurtado/.local/lib/python3.9/site-packages/htcondor2/_schedd.py", line 434, in submit
    if first_from == 0 or queue_args[first_from - 1] == " ":
IndexError: string index out of range

$ pip3 install htcondor --user -U
Requirement already satisfied: htcondor in ./.local/lib/python3.9/site-packages (24.0.10)
Collecting htcondor
  Using cached htcondor-24.11.2-cp39-cp39-manylinux_2_28_x86_64.whl (62.4 MB)
Installing collected packages: htcondor
  Attempting uninstall: htcondor
    Found existing installation: htcondor 24.0.10
    Uninstalling htcondor-24.0.10:
      Successfully uninstalled htcondor-24.0.10
Successfully installed htcondor-24.11.2
[khurtado@cmscon ~]$ python3 test.py
[khurtado@cmscon ~]$ condor_q


-- Schedd: cmscon.hep.wisc.edu : <128.104.227.79:9618?... @ 09/12/25 15:51:49

654931.0   khurtado        9/12 15:51   0+00:00:00 I  0    0.0 sleep 20


On Tue, Sep 9, 2025 at 11:36âAM Tim Theisen <tim@xxxxxxxxxxx> wrote:

We already keep the latest patch release for each LTS series for as long as possible. In PyPI right now:

23.0.28Â Aug 21, 2025
10.0.9ÂÂÂ Sep 28, 2023
9.0.17ÂÂÂ Sep 29, 2022
8.8.15 Aug  3, 2021

The last patch for HTCondor 24.0 will appear sometime next year and that will be retained indefinitely.

So, yes, any 24.0.x fits the definition of a compatible release.

...Tim

On 9/9/25 07:25, Alan Malta Rodrigues wrote:
Hi Tim,

Do you think it would be feasible to keep the latest patch release available in PyPi for a certain period of time (maybe for 3-4 years)?
Or do you think that the python bindings will hardly be compatible with HTCondor daemons running in newer versions?

My understanding from the compatible release operator [1] is that, as long as there is a 24.0.x release in PyPi, we would be able to satisfy the htcondor version when building our application.

Best regards,
Alan.

[1]

On Mon, Sep 8, 2025 at 8:37âPM Kenyi Hurtado Anampa <khurtado@xxxxxx> wrote:
Thank you for your responses.

We specify a single version, because we usually perform validation tests before moving to a different version. We are currently using 24.0.10.


Best regards,
Kenyi

On Mon, Sep 8, 2025 at 2:14âPM Tim Theisen <tim@xxxxxxxxxxx> wrote:
I don't have a really good answer for you. Due to limited space on PyPI,
we have to remove older versions to make room for new versions.

However, our LTS version interface remains stable during the lifetime of
the series. The only thing that would have a stable version number for
the 24.0.x series, would be to have a 24.0 version and used -post1
-post2 suffixes.

Could you specify a range in your requirement? htcondor>=24.0.0,<=24.0.999

...Tim

On 9/2/25 10:21, Kenyi Hurtado Anampa via HTCondor-users wrote:
> Hello,
>
> In CMS, we are planning to freeze the current production WM system and
> we are looking to migrate from htcondor to htcondor2 python bindings
> before that.
>
> Our schedds currently have HTCondor 24.0.6, and we submit via python,
> using the htcondor python bindings from pypi.
>
> Is there a particular version from pypi that is recommended for this
> case? We would like to make sure we pick a version that staysÂlong
> term in pypi. We had seen at least one version disappearing from pypi
> in the past, so we just want to double check before e.g. just choosing
> the latest one available.
>
> Best regards,
> Kenyi
>
> _______________________________________________
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
>
> The archives can be found at: https://www-auth.cs.wisc.edu/lists/htcondor-users/

--
Tim Theisen (he, him, his)
Release Manager
Center for High Throughput Computing
Department of Computer Sciences
University of Wisconsin - Madison
4261 Computer Sciences and Statistics
1210 W Dayton St
Madison, WI 53706-1685
+1 608 265 5736

-- 
Tim Theisen (he, him, his)
Release Manager
Center for High Throughput Computing
Department of Computer Sciences
University of Wisconsin - Madison
4261 Computer Sciences and Statistics
1210 W Dayton St
Madison, WI 53706-1685
+1 608 265 5736
-- 
Tim Theisen (he, him, his)
Release Manager
Center for High Throughput Computing
Department of Computer Sciences
University of Wisconsin - Madison
4261 Computer Sciences and Statistics
1210 W Dayton St
Madison, WI 53706-1685
+1 608 265 5736