accli 2.1.2__tar.gz → 2.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {accli-2.1.2 → accli-2.1.3}/PKG-INFO +1 -1
  2. {accli-2.1.2 → accli-2.1.3}/accli/_version.py +1 -1
  3. {accli-2.1.2 → accli-2.1.3}/accli/cli.py +37 -10
  4. {accli-2.1.2 → accli-2.1.3}/accli/setup-nfs.ps1 +11 -5
  5. {accli-2.1.2 → accli-2.1.3}/accli.egg-info/PKG-INFO +1 -1
  6. {accli-2.1.2 → accli-2.1.3}/LICENSE +0 -0
  7. {accli-2.1.2 → accli-2.1.3}/README.md +0 -0
  8. {accli-2.1.2 → accli-2.1.3}/accli/AcceleratorJobProjectService.py +0 -0
  9. {accli-2.1.2 → accli-2.1.3}/accli/AcceleratorTaskDispatcher.py +0 -0
  10. {accli-2.1.2 → accli-2.1.3}/accli/AcceleratorTerminalCliProjectService.py +0 -0
  11. {accli-2.1.2 → accli-2.1.3}/accli/CsvRegionalTimeseriesValidator.py +0 -0
  12. {accli-2.1.2 → accli-2.1.3}/accli/__init__.py +0 -0
  13. {accli-2.1.2 → accli-2.1.3}/accli/__main__.py +0 -0
  14. {accli-2.1.2 → accli-2.1.3}/accli/cleanup-nfs.ps1 +0 -0
  15. {accli-2.1.2 → accli-2.1.3}/accli/common.py +0 -0
  16. {accli-2.1.2 → accli-2.1.3}/accli/gui.py +0 -0
  17. {accli-2.1.2 → accli-2.1.3}/accli/job_views.py +0 -0
  18. {accli-2.1.2 → accli-2.1.3}/accli/log_timeline.py +0 -0
  19. {accli-2.1.2 → accli-2.1.3}/accli/mount_downloader.py +0 -0
  20. {accli-2.1.2 → accli-2.1.3}/accli/nfs_watcher.py +0 -0
  21. {accli-2.1.2 → accli-2.1.3}/accli/refresh_explorer.ps1 +0 -0
  22. {accli-2.1.2 → accli-2.1.3}/accli/token.py +0 -0
  23. {accli-2.1.2 → accli-2.1.3}/accli/version_checker.py +0 -0
  24. {accli-2.1.2 → accli-2.1.3}/accli.egg-info/SOURCES.txt +0 -0
  25. {accli-2.1.2 → accli-2.1.3}/accli.egg-info/dependency_links.txt +0 -0
  26. {accli-2.1.2 → accli-2.1.3}/accli.egg-info/entry_points.txt +0 -0
  27. {accli-2.1.2 → accli-2.1.3}/accli.egg-info/requires.txt +0 -0
  28. {accli-2.1.2 → accli-2.1.3}/accli.egg-info/top_level.txt +0 -0
  29. {accli-2.1.2 → accli-2.1.3}/pyproject.toml +0 -0
  30. {accli-2.1.2 → accli-2.1.3}/setup.cfg +0 -0
  31. {accli-2.1.2 → accli-2.1.3}/tests/test_jobs_commands.py +0 -0
  32. {accli-2.1.2 → accli-2.1.3}/tests/test_log_timeline.py +0 -0
  33. {accli-2.1.2 → accli-2.1.3}/tests/test_logs_command.py +0 -0
  34. {accli-2.1.2 → accli-2.1.3}/tests/test_mount_lifecycle.py +0 -0
  35. {accli-2.1.2 → accli-2.1.3}/tests/test_update_check.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: accli
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: IIASA Accelerator Client
5
5
  Author-email: Wrufesh S <wrufesh@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -1,3 +1,3 @@
1
1
  # Please strictly put double quote to use this info for git tag
2
2
  # Read a developer guide for git tag command with regex
3
- VERSION = "v2.1.2"
3
+ VERSION = "v2.1.3"
@@ -1093,6 +1093,14 @@ def map_windows_network_drive(mount_point_abs, max_attempts: int) -> tuple[bool,
1093
1093
  for attempt in range(1, max_attempts + 1):
1094
1094
  cleanup_stuck_windows_mount_processes()
1095
1095
 
1096
+ # Ensure any prior accli-umount-nfs task has finished and NfsClnt is RUNNING (prevents Network Error - 1222)
1097
+ for _ in range(10):
1098
+ umount_check = subprocess.run(["schtasks", "/query", "/tn", "accli-umount-nfs"], capture_output=True, text=True, errors="replace")
1099
+ clnt_check = subprocess.run(["sc.exe", "query", "NfsClnt"], capture_output=True, text=True, errors="replace")
1100
+ if (not umount_check.stdout or "Running" not in umount_check.stdout) and (clnt_check.stdout and "RUNNING" in clnt_check.stdout):
1101
+ break
1102
+ time.sleep(0.5)
1103
+
1096
1104
  # If daemon died before or between attempts, revive it
1097
1105
  if not is_nfs_daemon_running():
1098
1106
  subprocess.run(["schtasks", "/run", "/tn", "accli-mount-nfs"], capture_output=True)
@@ -1234,21 +1242,38 @@ def enable_windows_nfs_features():
1234
1242
  reg_ok = reg_ok and anon_ok and cache_ok
1235
1243
 
1236
1244
  if nfs_ok and reg_ok and task_ok:
1237
- # Ensure run-umount-helper.ps1 includes the NfsRdr/NfsClnt kernel cache flush
1245
+ # Ensure run-umount-helper.ps1 includes fast nfsclnt termination and NfsRdr/NfsClnt kernel cache flush
1238
1246
  try:
1239
1247
  umount_helper = Path("C:/ProgramData/accli/run-umount-helper.ps1")
1240
1248
  if umount_helper.is_file():
1241
1249
  content = umount_helper.read_text(encoding="utf-8", errors="ignore")
1242
- if "Stop-Service -Name \"NfsRdr\"" not in content:
1250
+ if 'Stop-Process -Name "nfsclnt"' not in content:
1243
1251
  umount_helper.write_text(
1244
- content.rstrip()
1245
- + "\n\n# Synchronously stop NfsClnt & NfsRdr, then start NfsRdr & NfsClnt to flush stale kernel V_NET_ROOT cache\n"
1246
- + "try {\n"
1247
- + " Stop-Service -Name \"NfsClnt\" -Force -ErrorAction SilentlyContinue\n"
1248
- + " Stop-Service -Name \"NfsRdr\" -Force -ErrorAction SilentlyContinue\n"
1249
- + " Start-Service -Name \"NfsRdr\" -ErrorAction SilentlyContinue\n"
1250
- + " Start-Service -Name \"NfsClnt\" -ErrorAction SilentlyContinue\n"
1251
- + "} catch {}\n",
1252
+ 'try {\n'
1253
+ ' if (Get-Command Stop-ScheduledTask -ErrorAction SilentlyContinue) {\n'
1254
+ ' Stop-ScheduledTask -TaskName "accli-mount-nfs" -ErrorAction SilentlyContinue | Out-Null\n'
1255
+ ' } else {\n'
1256
+ ' schtasks /end /tn "accli-mount-nfs" 2> $null | Out-Null\n'
1257
+ ' }\n'
1258
+ '} catch {}\n\n'
1259
+ 'try {\n'
1260
+ ' Get-CimInstance Win32_Process -Filter "name=\'hf-mount-nfs.exe\'" | ForEach-Object {\n'
1261
+ ' Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue | Out-Null\n'
1262
+ ' }\n'
1263
+ '} catch {}\n\n'
1264
+ '# Force-kill nfsclnt.exe so NfsClnt never hangs in STOP_PENDING, then cycle NfsRdr & NfsClnt to flush stale kernel V_NET_ROOT cache\n'
1265
+ 'try {\n'
1266
+ ' Stop-Process -Name "nfsclnt" -Force -ErrorAction SilentlyContinue | Out-Null\n'
1267
+ ' Stop-Service -Name "NfsClnt" -Force -ErrorAction SilentlyContinue | Out-Null\n'
1268
+ ' Stop-Service -Name "NfsRdr" -Force -ErrorAction SilentlyContinue | Out-Null\n'
1269
+ ' Start-Service -Name "NfsRdr" -ErrorAction SilentlyContinue | Out-Null\n'
1270
+ ' for ($i = 0; $i -lt 5; $i++) {\n'
1271
+ ' $svc = Get-Service -Name "NfsClnt" -ErrorAction SilentlyContinue\n'
1272
+ ' if ($svc -and $svc.Status -eq \'Running\') { break }\n'
1273
+ ' Start-Service -Name "NfsClnt" -ErrorAction SilentlyContinue | Out-Null\n'
1274
+ ' Start-Sleep -Milliseconds 500\n'
1275
+ ' }\n'
1276
+ '} catch {}\n',
1252
1277
  encoding="utf-8",
1253
1278
  )
1254
1279
  except Exception:
@@ -1582,6 +1607,8 @@ def mount_start(
1582
1607
  print(f"[bold red][ERROR] NFS daemon started, but failed to map drive {mount_point_abs} in user session.[/bold red]")
1583
1608
  if err_msg:
1584
1609
  print(f"[red]{err_msg}[/red]")
1610
+ # Clean up the spawned daemon so a failed mount does not leave a zombie daemon running
1611
+ subprocess.run(["schtasks", "/run", "/tn", "accli-umount-nfs"], capture_output=True)
1585
1612
  print("[yellow]Tip: Make sure Windows NFS client feature was fully enabled and the PC was restarted.[/yellow]")
1586
1613
  raise typer.Exit(1)
1587
1614
  else:
@@ -222,12 +222,18 @@ try {
222
222
  }
223
223
  } catch {}
224
224
 
225
- # Synchronously stop NfsClnt & NfsRdr, then start NfsRdr & NfsClnt to flush stale kernel V_NET_ROOT cache
225
+ # Force-kill nfsclnt.exe so NfsClnt never hangs in STOP_PENDING, then cycle NfsRdr & NfsClnt to flush stale kernel V_NET_ROOT cache
226
226
  try {
227
- Stop-Service -Name "NfsClnt" -Force -ErrorAction SilentlyContinue
228
- Stop-Service -Name "NfsRdr" -Force -ErrorAction SilentlyContinue
229
- Start-Service -Name "NfsRdr" -ErrorAction SilentlyContinue
230
- Start-Service -Name "NfsClnt" -ErrorAction SilentlyContinue
227
+ Stop-Process -Name "nfsclnt" -Force -ErrorAction SilentlyContinue | Out-Null
228
+ Stop-Service -Name "NfsClnt" -Force -ErrorAction SilentlyContinue | Out-Null
229
+ Stop-Service -Name "NfsRdr" -Force -ErrorAction SilentlyContinue | Out-Null
230
+ Start-Service -Name "NfsRdr" -ErrorAction SilentlyContinue | Out-Null
231
+ for ($i = 0; $i -lt 5; $i++) {
232
+ $svc = Get-Service -Name "NfsClnt" -ErrorAction SilentlyContinue
233
+ if ($svc -and $svc.Status -eq 'Running') { break }
234
+ Start-Service -Name "NfsClnt" -ErrorAction SilentlyContinue | Out-Null
235
+ Start-Sleep -Milliseconds 500
236
+ }
231
237
  } catch {}
232
238
  '@
233
239
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: accli
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: IIASA Accelerator Client
5
5
  Author-email: Wrufesh S <wrufesh@gmail.com>
6
6
  License: The MIT License (MIT)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes