-
Notifications
You must be signed in to change notification settings - Fork 2
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
Async #13
Conversation
Hey, great to see this being implemented! Looks good on the whole, but I have a few remarks about the schema:
|
@LourensVeen you are right about the async function should never return Also, |
The reason I was thinking it would be defined globally is that it carries a particular meaning, namely "this is an asynchronous service, you should call the specified callback again to get the result". The workflow engine needs to be able to distinguish between synchronous and asynchronous calls, and the idea is that it can do so by the return type. If it's a Future, it's asynchronous, otherwise it's synchronous and whatever comes out is the result. If the workflow engine can distinguish this by itself, then the user doesn't have to think about it. They just specify the step, and the engine takes care of the rest. It's much more user-friendly. For the same reason, I don't think that the user should have to worry about docker container ids and port names. The user is busy thinking about proteins and ligands and binding sites! They shouldn't have to know that there's a Cerise running in a Docker that connects to a cluster. All they should have to know is that they put a protein-with-ligand-md step in their workflow which will produce the energies as its output. Everything else is overhead that we should try to minimise. Also, what happens if the user specifies a container name and port number that's in use by another user. Will they be able to steal the other user's core hours? |
@felipeZ @LourensVeen Great to see this materialize so quickly. As Lourens mentioned, I would try to keep the Future response as generic as possible and indeed have it be part of common_resources. It makes developing the workflow manager easier and more consistent and in the end it makes the life of the user easier. That makes me wonder how many of the current parameters in the schema are lie_md specific and if they could be derived from the |
I agree with both of you I would return a Future object with only the |
And probably the URI of the endpoint needed to check progress and retrieve results. |
Following the recommendation of both @LourensVeen and @marcvdijk the functions the function We only need to store the The synchronous functions |
Create an asynchronous interface to call an
lieMD
simulation, see #11API
There are 3 new functions that support the async call:
How does it work?
Both the
run_async_ligand_solvent_md
andrun_async_ligand_protein_md
take the same input that they blocking counterparts:run_ligand_solvent_md
andrun_ligand_protein_md
, respectively. These async functions submit a job using cerise and return inmediately.These functions return the a dictionary specified here. The dict returned by these functions can be used together with the
query_liemd_results
function to retrieve the output. When this last function is invoked, it checks for the status of the job using thejob_name
,username
and other meta-data information provided by eitherrun_async_ligand_solvent_md
andrun_async_ligand_protein_md
.If the job is still running an empty dictionary is return together with the status. Otherwise if the job has finished successfully a
results
dictionary is return. In case of failure the status and an empty dictionary are returned.See the example