Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
11fe336
revise SGE
thangckt Mar 26, 2024
8140a43
Update pbs.py
thangckt Mar 26, 2024
b893544
Update pbs.py
thangckt Mar 26, 2024
82b7262
Update pbs.py
thangckt Mar 26, 2024
01ffd14
add sge_qe_name
thangckt Mar 26, 2024
56e3afe
Update pbs.py
thangckt Mar 26, 2024
703aa49
y
thangckt Mar 26, 2024
2c3b38a
Update submission.py
thangckt Mar 26, 2024
f73e0f9
u
thangckt Mar 26, 2024
957cf4a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2024
034c9d7
Update pbs.py
thangckt Mar 26, 2024
3f07742
Update pbs.py
thangckt Mar 26, 2024
499c691
Merge branch 'PR' into master
thangckt Mar 26, 2024
76150bf
Merge pull request #1 from thangckt/master
thangckt Mar 26, 2024
ef28a1b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2024
65dca91
u
thangckt Mar 27, 2024
ffe52e1
Merge pull request #2 from thangckt/master
thangckt Mar 27, 2024
8d7b566
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 27, 2024
8c50c4f
u
thangckt Mar 27, 2024
89d2a41
Merge branch 'PR' into master
thangckt Mar 27, 2024
2093336
Merge pull request #3 from thangckt/master
thangckt Mar 27, 2024
920984d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 27, 2024
c8f5657
y
thangckt Mar 27, 2024
ef6ebeb
Merge branch 'master' of https://github.com/thangckt/dpdispatcher
thangckt Mar 27, 2024
f56fa50
Merge branch 'PR' into master
thangckt Mar 27, 2024
e06c648
Merge pull request #4 from thangckt/master
thangckt Mar 27, 2024
6d6c973
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 27, 2024
dae7909
Update pbs.py
thangckt Mar 27, 2024
4ca179c
Merge pull request #5 from thangckt/master
thangckt Mar 27, 2024
83644c3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 27, 2024
b1758d9
Create _version.py
thangckt Apr 4, 2024
62a3459
Delete dpdispatcher/_version.py
thangckt Apr 4, 2024
774b130
Merge pull request #6 from deepmodeling/master
thangckt Apr 13, 2024
2ae2e62
Update pbs.py
thangckt Apr 13, 2024
ad6b971
Merge branch 'master' of https://github.com/deepmodeling/dpdispatcher…
thangckt May 2, 2024
d02adf6
Merge pull request #8 from deepmodeling/master
thangckt May 7, 2024
3aca952
Merge pull request #9 from deepmodeling/master
thangckt May 19, 2024
9fc0f84
Merge branch 'master' into PR
thangckt May 28, 2024
95b8aa5
Merge pull request #10 from deepmodeling/master
thangckt May 28, 2024
cc7efcd
Merge pull request #11 from thangckt/master
thangckt May 28, 2024
99589d3
u
thangckt May 29, 2024
711da1d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 29, 2024
1e0c21e
Update test_lsf_script_generation.py
thangckt May 29, 2024
10cf5d3
Merge branch 'PR' of https://github.com/thangckt/dpdispatcher into PR
thangckt May 29, 2024
416a767
Merge pull request #12 from thangckt/PR
thangckt May 29, 2024
e530cf6
Update test_lsf_script_generation.py
thangckt May 29, 2024
5adce1b
Merge pull request #13 from deepmodeling/master
thangckt Jul 24, 2024
4084a31
Update pbs.py
thangckt Jul 24, 2024
9b1c566
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2024
fc690ae
change `sge_pe_name` to `pe_name`
thangckt Jul 25, 2024
cfbc5dd
Update ssh_context.py
thangckt Jul 25, 2024
81f52a3
Merge branch 'master' into master
thangckt Jul 25, 2024
7bbc485
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
37da47c
u
thangckt Jul 25, 2024
bca9728
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 25, 2024
02f1449
Merge pull request #14 from deepmodeling/master
thangckt Jul 25, 2024
c13be3b
Update SSHcontext: add execute command
thangckt Jul 27, 2024
a9fbadf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 27, 2024
fba9574
Update pbs.py
thangckt Jul 29, 2024
0d2cd71
Merge remote-tracking branch 'upstream/master' into dev
thangckt Aug 27, 2024
5f42bc8
Update dlog.py
thangckt Sep 2, 2024
bfe1615
Update dlog.py
thangckt Sep 2, 2024
1ded55e
Merge pull request #16 from deepmodeling/master
thangckt Sep 2, 2024
4033a20
Merge pull request #17 from deepmodeling/master
thangckt Sep 14, 2024
59b6139
Merge pull request #18 from deepmodeling/master
thangckt Oct 6, 2024
1f514de
Update ssh_context.py
thangckt Oct 6, 2024
be99e41
Update ssh_context.py
thangckt Oct 6, 2024
415c114
allow retry_count=0
thangckt Oct 15, 2024
ac9c1e4
Update submission.py
thangckt Oct 15, 2024
d28233d
Merge pull request #19 from deepmodeling/master
thangckt Oct 15, 2024
1f29674
Update submission.py
thangckt Oct 23, 2024
ba5147d
Update submission.py
thangckt Oct 23, 2024
7ee3919
Update submission.py
thangckt Oct 23, 2024
2fb5e81
Update submission.py
thangckt Oct 23, 2024
033443c
Update submission.py
thangckt Oct 23, 2024
f977a7a
Update submission.py
thangckt Oct 23, 2024
1787bcc
Update pbs.py
thangckt Oct 31, 2024
2e8b001
Merge pull request #20 from deepmodeling/master
thangckt Nov 4, 2024
c56ef45
Merge pull request #21 from deepmodeling/master
thangckt Dec 2, 2024
6bd72ad
Update shell.py
thangckt Dec 8, 2024
57a5991
u
thangckt Dec 9, 2024
69b4a0b
Update batch.py
thangckt Dec 9, 2024
e80b712
Update batch.py
thangckt Dec 9, 2024
2f22fe5
Merge pull request #22 from deepmodeling/master
thangckt Jan 2, 2025
4bf6a76
Update machine.py
thangckt Jan 7, 2025
170b1ef
Update machine.py
thangckt Jan 7, 2025
9db2abc
Merge pull request #23 from deepmodeling/master
thangckt Feb 7, 2025
4ad8a82
Merge pull request #24 from deepmodeling/master
thangckt Apr 30, 2025
96176dc
Merge remote-tracking branch 'upstream/master'
thangckt Aug 27, 2025
284f1f8
revise option to control number of resubmit fail jobs
thangckt Aug 27, 2025
8b04937
revise resubmit fail jobs
thangckt Aug 27, 2025
909e595
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 27, 2025
1ee843f
u
thangckt Aug 27, 2025
6b244da
u
thangckt Aug 27, 2025
4bb42d8
u
thangckt Aug 27, 2025
e897d8a
Update test_argcheck.py
thangckt Aug 27, 2025
ae8a0a3
u
thangckt Aug 29, 2025
0d6bf3d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 29, 2025
1d0d467
Update .gitignore
thangckt Aug 29, 2025
08e24a6
Merge branch 'master' of https://github.com/thangckt/dpdispatcher
thangckt Aug 29, 2025
ac7116d
u
thangckt Aug 29, 2025
558e911
Update test_class_machine_dispatch.py
thangckt Aug 29, 2025
c8b0198
u
thangckt Aug 29, 2025
2960443
Revert "u"
thangckt Aug 29, 2025
6682e06
Update test_class_machine_dispatch.py
thangckt Aug 29, 2025
26a3732
Update machine.py
thangckt Aug 29, 2025
77ce083
u
thangckt Aug 29, 2025
ecc93b2
u
thangckt Aug 29, 2025
bfe4356
Update pbs.py
thangckt Aug 29, 2025
e9d5781
Merge pull request #26 from deepmodeling/master
thangckt Oct 31, 2025
2336f62
u
thangckt Oct 31, 2025
a55256d
Merge branch 'deepmodeling:master' into main
thangckt Nov 8, 2025
b74bf7a
Update pbs.py
thangckt Nov 15, 2025
eb1a730
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 15, 2025
c49374e
Merge branch 'master' into reentry
thangckt Nov 15, 2025
41b7b37
Merge branch 'reentry'
thangckt Dec 17, 2025
976f2af
Merge branch 'deepmodeling:master' into main
thangckt Dec 17, 2025
1e9bdd9
Refactor log messages for clarity and consistency
thangckt Dec 17, 2025
37716c3
.
thangckt Dec 17, 2025
4251ca4
.
thangckt Dec 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dpdispatcher/contexts/ssh_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def _setup_ssh(self):
key = pkey_class.from_private_key_file(
key_path, self.passphrase
)
except paramiko.SSHException as e:
except paramiko.SSHException:
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
pass
if key is not None:
break
Expand All @@ -200,7 +200,7 @@ def _setup_ssh(self):
for pkey_class, filename in keyfiles:
try:
key = pkey_class.from_private_key_file(filename, self.passphrase)
except paramiko.SSHException as e:
except paramiko.SSHException:
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
pass
if key is not None:
break
Expand Down
26 changes: 12 additions & 14 deletions dpdispatcher/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,14 @@ def serialize(self, if_static=False):
def register_task(self, task):
if self.belonging_jobs:
raise RuntimeError(
"Not allowed to register tasks after generating jobs. "
f"submission hash error {self}"
f"Not allowed to register tasks after generating jobs. submission hash error {self}"
)
self.belonging_tasks.append(task)

def register_task_list(self, task_list):
if self.belonging_jobs:
raise RuntimeError(
"Not allowed to register tasks after generating jobs. "
f"submission hash error {self}"
f"Not allowed to register tasks after generating jobs. submission hash error {self}"
)
self.belonging_tasks.extend(task_list)

Expand Down Expand Up @@ -219,9 +217,9 @@ def run_submission(
self.try_recover_from_json()
self.update_submission_state()
if self.check_all_finished():
dlog.info("info:check_all_finished: True")
dlog.info("check_all_finished: True")
else:
dlog.info("info:check_all_finished: False")
dlog.info("check_all_finished: False")
self.upload_jobs()
if dry_run is True:
dlog.info(f"submission succeeded: {self.submission_hash}")
Expand Down Expand Up @@ -342,7 +340,7 @@ def update_submission_state(self):
continue
job.get_job_state()
dlog.debug(
f"debug:update_submission_state: job: {job.job_hash}, {job.job_id}, {job.job_state}"
f"update_submission_state: job: {job.job_hash}, {job.job_id}, {job.job_state}"
)

def handle_unexpected_submission_state(self):
Expand Down Expand Up @@ -818,7 +816,7 @@ def get_job_state(self):
this method will not submit or resubmit the jobs if the job is unsubmitted.
"""
dlog.debug(
f"debug:query database; self.job_hash:{self.job_hash}; self.job_id:{self.job_id}"
f"query database; self.job_hash:{self.job_hash}; self.job_id:{self.job_id}"
)
assert self.machine is not None
job_state = self.machine.check_status(self)
Expand All @@ -838,7 +836,7 @@ def handle_unexpected_job_state(self):
if job_state == JobStatus.terminated:
self.fail_count += 1
dlog.info(
f"job: {self.job_hash} {self.job_id} terminated; "
f"job {self.job_hash} {self.job_id} terminated; "
f"fail_cout is {self.fail_count}; resubmitting job"
)
retry_count = 3
Expand All @@ -848,32 +846,32 @@ def handle_unexpected_job_state(self):
if (self.fail_count) > 0 and (self.fail_count % retry_count == 0):
last_error_message = self.get_last_error_message()
err_msg = (
f"job:{self.job_hash} {self.job_id} failed {self.fail_count} times."
f"job {self.job_hash} {self.job_id} failed {self.fail_count} times."
)
if last_error_message is not None:
err_msg += f"\nPossible remote error message: {last_error_message}"
raise RuntimeError(err_msg)
self.submit_job()
if self.job_state != JobStatus.unsubmitted:
dlog.info(
f"job:{self.job_hash} re-submit after terminated; new job_id is {self.job_id}"
f"job {self.job_hash} re-submit after terminated; new job_id is {self.job_id}"
)
time.sleep(0.2)
self.get_job_state()
dlog.info(
f"job:{self.job_hash} job_id:{self.job_id} after re-submitting; the state now is {repr(self.job_state)}"
f"job {self.job_hash} job_id:{self.job_id} after re-submitting; the state now is {repr(self.job_state)}"
)
Comment on lines +862 to 863
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Standardize job_id formatting and apply Ruff suggestion.

Line 862 uses job_id:{id} format while lines 857 and 874 use job_id is {id}. For consistency and readability, standardize to "job_id is" format. Additionally, Ruff correctly suggests using the explicit conversion flag !r instead of repr().

Apply this diff to standardize the format and fix the f-string:

-                    f"job {self.job_hash} job_id:{self.job_id} after re-submitting; the state now is {repr(self.job_state)}"
+                    f"job {self.job_hash} job_id is {self.job_id} after re-submitting; the state now is {self.job_state!r}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
f"job {self.job_hash} job_id:{self.job_id} after re-submitting; the state now is {repr(self.job_state)}"
)
f"job {self.job_hash} job_id is {self.job_id} after re-submitting; the state now is {self.job_state!r}"
)
🧰 Tools
🪛 Ruff (0.14.8)

862-862: Use explicit conversion flag

Replace with conversion flag

(RUF010)

🤖 Prompt for AI Agents
In dpdispatcher/submission.py around lines 862-863, standardize the f-string to
use "job_id is" and apply Ruff's suggestion to use the !r conversion flag:
replace the current f-string that uses "job_id:{self.job_id}" and
repr(self.job_state) with one that uses "job_id is {self.job_id!r}" and
"{self.job_state!r}" so the message format matches surrounding lines and uses
explicit representation conversion.

self.handle_unexpected_job_state()
if self.resources.wait_time != 0:
time.sleep(self.resources.wait_time)

if job_state == JobStatus.unsubmitted:
dlog.debug(f"job: {self.job_hash} unsubmitted; submit it")
dlog.debug(f"job {self.job_hash} unsubmitted; submit it")
# if self.fail_count > 3:
# raise RuntimeError("job:job {job} failed 3 times".format(job=self))
self.submit_job()
if self.job_state != JobStatus.unsubmitted:
dlog.info(f"job: {self.job_hash} submit; job_id is {self.job_id}")
dlog.info(f"job {self.job_hash} was submitted; job_id is {self.job_id}")
if self.resources.wait_time != 0:
time.sleep(self.resources.wait_time)
# self.get_job_state()
Expand Down
6 changes: 3 additions & 3 deletions dpdispatcher/utils/dpcloudserver/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ def _get_oss_bucket(self, endpoint, bucket_name):
# res = get("/tools/sts_token", {})
res = self.get("/data/get_sts_token", {})
# print('debug>>>>>>>>>>>>>', res)
dlog.debug(f"debug: _get_oss_bucket: res:{res}")
dlog.debug(f"_get_oss_bucket: res:{res}")
auth = oss2.StsAuth( # type: ignore[reportPossiblyUnboundVariable]
res["AccessKeyId"], res["AccessKeySecret"], res["SecurityToken"]
)
return oss2.Bucket(auth, endpoint, bucket_name) # type: ignore[reportPossiblyUnboundVariable]

def download(self, oss_file, save_file, endpoint, bucket_name):
bucket = self._get_oss_bucket(endpoint, bucket_name)
dlog.debug(f"debug: download: oss_file:{oss_file}; save_file:{save_file}")
dlog.debug(f"download: oss_file:{oss_file}; save_file:{save_file}")
bucket.get_object_to_file(oss_file, save_file)
return save_file

Expand Down Expand Up @@ -180,7 +180,7 @@ def download_from_url(self, url, save_file):

def upload(self, oss_task_zip, zip_task_file, endpoint, bucket_name):
dlog.debug(
f"debug: upload: oss_task_zip:{oss_task_zip}; zip_task_file:{zip_task_file}"
f"upload: oss_task_zip:{oss_task_zip}; zip_task_file:{zip_task_file}"
)
bucket = self._get_oss_bucket(endpoint, bucket_name)
total_size = os.path.getsize(zip_task_file)
Expand Down
Loading