-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from PanDAWMS/next
3.7.1.50
- Loading branch information
Showing
148 changed files
with
8,584 additions
and
6,477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.7.0.36 | ||
3.7.1.50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,10 @@ | |
# Authors: | ||
# - Mario Lassnig, [email protected], 2016-17 | ||
# - Daniel Drizhuk, [email protected], 2017 | ||
# - Paul Nilsson, [email protected], 2017-23 | ||
# - Paul Nilsson, [email protected], 2017-24 | ||
|
||
"""This is the entry point for the PanDA Pilot, executed with 'python3 pilot.py <args>'.""" | ||
|
||
from __future__ import print_function # Python 2 (2to3 complains about this) | ||
from __future__ import absolute_import | ||
|
||
import argparse | ||
import logging | ||
import os | ||
|
@@ -44,6 +41,7 @@ | |
from pilot.util.auxiliary import ( | ||
pilot_version_banner, | ||
shell_exit_code, | ||
convert_signal_to_exit_code | ||
) | ||
from pilot.util.constants import ( | ||
get_pilot_version, | ||
|
@@ -63,13 +61,15 @@ | |
is_harvester_mode, | ||
kill_worker, | ||
) | ||
from pilot.util.heartbeat import update_pilot_heartbeat | ||
from pilot.util.https import ( | ||
get_panda_server, | ||
https_setup, | ||
send_update, | ||
) | ||
from pilot.util.processgroups import find_defunct_subprocesses | ||
from pilot.util.loggingsupport import establish_logging | ||
from pilot.util.networking import dump_ipv6_info | ||
from pilot.util.processgroups import find_defunct_subprocesses | ||
from pilot.util.timing import add_to_pilot_timing | ||
|
||
errors = ErrorCodes() | ||
|
@@ -84,8 +84,9 @@ def main() -> int: | |
# get the logger | ||
logger = logging.getLogger(__name__) | ||
|
||
# print the pilot version | ||
# print the pilot version and other information | ||
pilot_version_banner() | ||
dump_ipv6_info() | ||
|
||
# define threading events | ||
args.graceful_stop = threading.Event() | ||
|
@@ -154,6 +155,9 @@ def main() -> int: | |
f"pilot.workflow.{args.workflow}", globals(), locals(), [args.workflow], 0 | ||
) | ||
|
||
# update the pilot heartbeat file | ||
update_pilot_heartbeat(time.time()) | ||
|
||
# execute workflow | ||
try: | ||
exitcode = workflow.run(args) | ||
|
@@ -700,6 +704,19 @@ def wrap_up() -> int: | |
if args.harvester: | ||
kill_worker() | ||
|
||
exitcode, shellexitcode = get_proper_exit_code() | ||
logging.info(f"pilot has finished (exit code={exitcode}, shell exit code={shellexitcode})") | ||
logging.shutdown() | ||
|
||
return shellexitcode | ||
|
||
|
||
def get_proper_exit_code() -> (int, int): | ||
""" | ||
Return the proper exit code. | ||
:return: exit code (int), shell exit code (int). | ||
""" | ||
try: | ||
exitcode = trace.pilot["error_code"] | ||
except KeyError: | ||
|
@@ -734,11 +751,11 @@ def wrap_up() -> int: | |
logging.warning(f"failed to convert exit code to int: {exitcode}, {exc}") | ||
exitcode = 1008 | ||
|
||
if exitcode == 0 and args.signal: | ||
exitcode = convert_signal_to_exit_code(args.signal) | ||
sec = shell_exit_code(exitcode) | ||
logging.info(f"pilot has finished (exit code={exitcode}, shell exit code={sec})") | ||
logging.shutdown() | ||
|
||
return sec | ||
return exitcode, sec | ||
|
||
|
||
def get_pilot_source_dir() -> str: | ||
|
@@ -837,7 +854,8 @@ def list_zombies(): | |
if __name__ == "__main__": | ||
# get the args from the arg parser | ||
args = get_args() | ||
args.last_heartbeat = time.time() | ||
args.last_heartbeat = time.time() # keep track of server heartbeats | ||
args.pilot_heartbeat = time.time() # keep track of pilot heartbeats | ||
|
||
# Define and set the main harvester control boolean | ||
args.harvester = is_harvester_mode(args) | ||
|
Oops, something went wrong.