hobbit-project / platform

HOBBIT benchmarking platform
GNU General Public License v2.0
23 stars 9 forks source link

Question: System_finished_signal #177

Closed smirnp closed 6 years ago

smirnp commented 6 years ago

I'm running dockerized components locally (via Java SDK) where my systemAdapter should notify BenchmarkController about it's finish. Now the only way to do that is to send Docker_Container_Terminated signal (with containerID listed in BC lists). I order to run my containers without platform-controller introduced System_finished_signal for local debugs in SDK and created a listener to it in SDK's unitTests (it works).

My question is the following: may the System_finished_signal be introduced in hobbit-core or it has some security/logical issues? (E.g. probably user can send this signal before his system really finished and start to communicate with evaluation module (which starts after the system should be finished)?)

MichaelRoeder commented 6 years ago

In the documentation, we might have described the workflow using a SYSTEM_FINISHED_SIGNAL to keep the explanation simple. However, this signal is simply not existing (sorry, if this caused you some headaches :worried: ). The platform sends the information about terminated containers using the DOCKER_CONTAINER_TERMINATED message. The BC will get it and check whether the terminated container is one of its own containers.

So for your SDK, you should provide the BC with some system container ID (done by adding this ID to the START_BENCHMARK_SIGNAL that is processed here). Later, you can send the [DOCKER_CONTAINER_TERMINATED] message with an exit code attached (typically 0) to indicate the the system is terminated.

smirnp commented 6 years ago

Thank you for your responce