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
Create async monitoring service #2034
Conversation
You can run ganga as |
@mesmith75 @alexanderrichards I pushed some changes to handle graceful shutdown. Basically I added a method that cancels all remaining tasks except for the one currently running. I do that in the thread's My question is, do you think that is enough? In your experience are there any termination signals that are not handled by |
From memory GangThreadPool should handle most cases. Although I can't remember where we register the signal handler for things like SIGINT/SIGTERM and it doesn't appear to be in the |
1ad4a0a
to
094eda4
Compare
* WIP: Create initial async monitoring service * Add enable/disable functionality to aio monitoring * Add dedicated aio monitoring method to run tasks * Remove obsolete aio event loop initialization * Update test utils sleep_until_state method to use new aio service * Add thread pool executor for aio monitoring service * Attempt tutorial test run without runMonitoring method
Dummy remote backend for benchmarking
@mesmith75 You are right, right now we only ensure that the environment is set up for DIRACOS, however the Python interpreter is inherited from the main process. |
@mesmith75 @egede here is the situation:
This solution will not work due to the multiprocessing library's limitations when working with an interactive Python shell such as our case. In particular, when we need to spawn a new process with a different Python interpreter instead of forking our current process which we have been doing so far. The current DIRAC concurrency setup yields by far the best performance results due to only instantiating the DIRAC process once and running all DIRAC tasks in an internal thread pool. However, it requires complex synchronization primitives such as events and queues which can only be used with the Alternatively, I could make use of our current asyncio based monitoring service and use asyncio's internal |
I am picking up on this again. While we in the past have been forced to have different python versions for the DIRAC API and for Ganga, I do not see that as a strong constraint any longer. So we could for installations involving DIRAC, we could enforce the use of a specific python version. We could also make the Ganga version installed in /cvmfs use the python version distributed with DIRAC explicit which would solve the issue for 95% of our users. |
Although I am hesitant to start tying us to a particular python version or installation, that is not a terrible solution - the current Dirac installation uses an up-to-date python version so we wouldn't be losing out in features. The only drawback is that we lose the access to all the packages in LCG (pandas etc) that we have currently been making available on the CVMFS installation but perhaps that is a small price to pay for significantly better performance. |
@mesmith75 @egede So based on your input I will develop and submit a solution to match the Dirac version with the system version so it can be tested out. |
…ing_service PEP8 fixes for PR #2034 (new_monitoring_service) by autopep8
This PR contains a very basic initial implementation of the new asyncio based monitoring service. It currently only works for the local backend.
Also every file that I change is formatted using autopep8 so that we can hopefully format most of the files as we go on.