Skip to content
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 containers in parallel when possible #546

Open
denkv opened this issue Jun 29, 2023 · 0 comments
Open

Create containers in parallel when possible #546

denkv opened this issue Jun 29, 2023 · 0 comments

Comments

@denkv
Copy link
Collaborator

denkv commented Jun 29, 2023

User story

To make things faster, containers should not be created one by one and created in parallel when possible.

Possible opportunities:

  • LOGGER.info("Creating benchmark controller " + benchmark.mainImage);
    String containerId = controller.containerManager.startContainer(benchmark.mainImage,
    Constants.CONTAINER_TYPE_BENCHMARK, experimentStatus.getRootContainer(),
    new String[] { Constants.RABBIT_MQ_HOST_NAME_KEY + "=" + experimentStatus.getRabbitMQContainer(),
    Constants.HOBBIT_SESSION_ID_KEY + "=" + config.id,
    Constants.HOBBIT_EXPERIMENT_URI_KEY + "=" + experimentStatus.experimentUri,
    Constants.BENCHMARK_PARAMETERS_MODEL_KEY + "=" + config.serializedBenchParams,
    Constants.SYSTEM_URI_KEY + "=" + config.systemUri },
    null, null, config.id);
    if (containerId == null) {
    experimentStatus.addError(HobbitErrors.BenchmarkCreationError);
    throw new Exception("Couldn't create benchmark controller " + config.benchmarkUri);
    }
    if (experimentStatus.getRootContainer() == null) {
    experimentStatus.setRootContainer(containerId);
    }
    experimentStatus.setBenchmarkContainer(containerId);
    LOGGER.info("Creating system " + system.mainImage);
    String serializedSystemParams = getSerializedSystemParams(config, benchmark, system);
    containerId = controller.containerManager.startContainer(system.mainImage,
    Constants.CONTAINER_TYPE_SYSTEM, experimentStatus.getRootContainer(),
    new String[] { Constants.RABBIT_MQ_HOST_NAME_KEY + "=" + experimentStatus.getRabbitMQContainer(),
    Constants.HOBBIT_SESSION_ID_KEY + "=" + config.id,
    Constants.SYSTEM_PARAMETERS_MODEL_KEY + "=" + serializedSystemParams },
    null, null, config.id);
    if (containerId == null) {
    LOGGER.error("Couldn't start the system. Trying to cancel the benchmark.");
    forceBenchmarkTerminate_unsecured(HobbitErrors.SystemCreationError);
    throw new Exception("Couldn't start the system " + config.systemUri);
    } else {
    experimentStatus.setSystemContainer(containerId);
    }
    LOGGER.info("Finished starting of new experiment.");
  • for (String image : usedImages) {
    experimentStatus.addImage(image);
    controller.containerManager.pullImage(image);
    }

Solution

We already have API for that and it was tested with ORCA:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant