class DockerContainerOperationManager {

    @Async("pauseRunExecutor")
    public void pauseRun(PipelineRun run) {
        try {
            final String containerId = kubernetesManager.getContainerIdFromKubernetesPod(run.getPodId(), 
                    run.getActualDockerImage());
            final String apiToken = authManager.issueTokenForCurrentUser().getToken();
            Assert.notNull(containerId,
                    messageHelper.getMessage(MessageConstants.ERROR_CONTAINER_ID_FOR_RUN_NOT_FOUND, run.getId()));

            final String pauseRunCommand = DockerPauseCommand.builder()
                    .runPauseScriptUrl(pauseRunScriptUrl)
                    .api(preferenceManager.getPreference(SystemPreferences.BASE_API_HOST))
                    .apiToken(apiToken)
                    .pauseDistributionUrl(commitScriptsDistributionsUrl)
                    .distributionUrl(preferenceManager.getPreference(SystemPreferences.BASE_PIPE_DISTR_URL))
                    .runId(String.valueOf(run.getId()))
                    .containerId(containerId)
                    .timeout(String.valueOf(preferenceManager.getPreference(SystemPreferences.COMMIT_TIMEOUT)))
                    .newImageName(run.getActualDockerImage())
                    .defaultTaskName(run.getTaskName())
                    .preCommitCommand(preferenceManager.getPreference(SystemPreferences.PRE_COMMIT_COMMAND_PATH))
                    .postCommitCommand(preferenceManager.getPreference(SystemPreferences.POST_COMMIT_COMMAND_PATH))
                    .build()
                    .getCommand();

            RunInstance instance = run.getInstance();
            kubernetesManager.addNodeLabel(instance.getNodeName(), KubernetesConstants.PAUSED_NODE_LABEL,
                    TaskStatus.PAUSED.name());

            run.setPodIP(null);
            run.setServiceUrl(null);
            removeUtilizationLevelTags(run);
            runManager.updateRunInfo(run);

            Process sshConnection = submitCommandViaSSH(instance.getNodeIP(), pauseRunCommand);

            //TODO: change SystemPreferences.COMMIT_TIMEOUT in according to
            // f_EPMCMBIBPC-2025_add_lastStatusUpdate_time branche
            boolean isFinished = sshConnection.waitFor(
                    preferenceManager.getPreference(SystemPreferences.PAUSE_TIMEOUT), TimeUnit.SECONDS);

            if (isFinished && sshConnection.exitValue() == COMMAND_CANNOT_EXECUTE_CODE) {
                //TODO: change in according to f_EPMCMBIBPC-2025_add_lastStatusUpdate_time branche
                run.setStatus(TaskStatus.RUNNING);
                runManager.updatePipelineStatus(run);
                kubernetesManager.removeNodeLabel(instance.getNodeName(), KubernetesConstants.PAUSED_NODE_LABEL);
                return;
            }
            Assert.state(sshConnection.exitValue() == 0,
                    messageHelper.getMessage(MessageConstants.ERROR_RUN_PIPELINES_PAUSE_FAILED, run.getId()));

            kubernetesManager.deletePod(run.getPodId());
            cloudFacade.stopInstance(instance.getCloudRegionId(), instance.getNodeId());
            kubernetesManager.deleteNode(instance.getNodeName());
            run.setStatus(TaskStatus.PAUSED);
            runManager.updatePipelineStatus(run);
        } catch (Exception e) {
            LOGGER.error(e.getMessage(), e);
            addRunLog(run, e.getMessage(), PAUSE_RUN_TASK);
            failRunAndTerminateNode(run, e);
            throw new IllegalArgumentException(PAUSE_COMMAND_DESCRIPTION, e);
        }
    }

}