-
Notifications
You must be signed in to change notification settings - Fork 3
Building images and debugging containers
If your components demonstrate expected behavior being executed as java codes then its time to create docker images and debug your components as docker containers (the same manner as it will be done in the online platform).
The SDK offers you automatic images building and containers execution functionalities in order to make the dockerizing process less error-prone and time consuming.
See ExampleBenchmarkTest.java as an example for the described operations.
Here is the brief description of the procedure: 1. Implement dockerBuilders for your components. The only thing you should do is to check/modify project-specific information, which will be shared for all your docker images. See the DummyDockersBuilder as an example. This builder (specified for your project) will be used as an argument for all the predefined dockerizerBuilders, which you may reuse without any modifications.
-
Check that images are building successfully. Please note, what all docker-files are generating every time, then you perform image building. DockerFiles will share project-specific configuration, which you defined at previous stage, but will differ by the runner class names. The only thing you should check at the image building stage is proper packaging of your source codes into jar file (including all dependencies by Shade or other maven plugins) under the building directory folder (which is target by default). Use 'mvn package -DskipTests=true' or GUI of your IDE for code packaging (and s).
-
Check that containers are runnable and show expected behavior. To perform containers creation and running you should check that DockerizerBuilders for all of your components(defined and checked at previuos stages) are submitted the ComponentsExecutor and to the StartStopContainersReaction (the same manner as it was done for components in non-dockerized mode). The containers will be started/stopped by the order defined in BenchmarkController and internal logs from containers will be shown in console. The "useCachedImages()" and "useCachedContainer()" flags will help you to avoid image rebuilding and container removal/creation procedures for the components, which already show the expected behavior.
During the debug process you also can mix execution the dockerized components with undockerised java codes, just switching between the type of component you submit into the components executor.