You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by of...@apache.org on 2020/02/07 14:54:51 UTC
[incubator-dlab] branch DLAB-1467 updated: Added azure auth file
while notebook configure action
This is an automated email from the ASF dual-hosted git repository.
ofuks pushed a commit to branch DLAB-1467
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-1467 by this push:
new e77d9f0 Added azure auth file while notebook configure action
e77d9f0 is described below
commit e77d9f0c62fd518228baa2959a9cee39e1284ba7
Author: Oleh Fuks <ol...@gmail.com>
AuthorDate: Fri Feb 7 16:54:34 2020 +0200
Added azure auth file while notebook configure action
---
.../response/handlers/ComputationalConfigure.java | 42 +++++++++++++---------
1 file changed, 26 insertions(+), 16 deletions(-)
diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/ComputationalConfigure.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/ComputationalConfigure.java
index adba483..b2aee18 100644
--- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/ComputationalConfigure.java
+++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/ComputationalConfigure.java
@@ -22,8 +22,13 @@ package com.epam.dlab.backendapi.core.response.handlers;
import com.epam.dlab.backendapi.ProvisioningServiceApplicationConfiguration;
import com.epam.dlab.backendapi.core.Directories;
import com.epam.dlab.backendapi.core.FileHandlerCallback;
-import com.epam.dlab.backendapi.core.commands.*;
+import com.epam.dlab.backendapi.core.commands.CommandBuilder;
+import com.epam.dlab.backendapi.core.commands.DockerAction;
+import com.epam.dlab.backendapi.core.commands.DockerCommands;
+import com.epam.dlab.backendapi.core.commands.ICommandExecutor;
+import com.epam.dlab.backendapi.core.commands.RunDockerCommand;
import com.epam.dlab.backendapi.core.response.folderlistener.FolderListenerExecutor;
+import com.epam.dlab.cloud.CloudProvider;
import com.epam.dlab.dto.aws.computational.SparkComputationalCreateAws;
import com.epam.dlab.dto.base.DataEngineType;
import com.epam.dlab.dto.base.computational.ComputationalBase;
@@ -34,6 +39,8 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
+import java.util.Objects;
+
import static com.epam.dlab.backendapi.core.commands.DockerAction.CONFIGURE;
@Slf4j
@@ -81,24 +88,27 @@ public class ComputationalConfigure implements DockerCommands {
configuration.getResourceStatusPollTimeout(),
getFileHandlerCallback(CONFIGURE, uuid, dto));
try {
+ RunDockerCommand runDockerCommand = new RunDockerCommand()
+ .withInteractive()
+ .withName(nameContainer(dto.getEdgeUserName(), CONFIGURE,
+ dto.getExploratoryName(), dto.getComputationalName()))
+ .withVolumeForRootKeys(configuration.getKeyDirectory())
+ .withVolumeForResponse(configuration.getImagesDirectory())
+ .withVolumeForLog(configuration.getDockerLogDirectory(), dataEngineType.getName())
+ .withResource(dataEngineType.getName())
+ .withRequestId(uuid)
+ .withConfKeyName(configuration.getAdminKey())
+ .withActionConfigure(getImageConfigure(dto.getApplicationName(), dataEngineType));
+ if (configuration.getCloudProvider() == CloudProvider.AZURE &&
+ Objects.nonNull(configuration.getCloudConfiguration().getAzureAuthFile()) &&
+ !configuration.getCloudConfiguration().getAzureAuthFile().isEmpty()) {
+ runDockerCommand.withVolumeFoAzureAuthFile(configuration.getCloudConfiguration().getAzureAuthFile());
+ }
+
commandExecutor.executeAsync(
dto.getEdgeUserName(),
uuid,
- commandBuilder.buildCommand(
- new RunDockerCommand()
- .withInteractive()
- .withName(nameContainer(dto.getEdgeUserName(), CONFIGURE,
- dto.getExploratoryName(), dto.getComputationalName()))
- .withVolumeForRootKeys(configuration.getKeyDirectory())
- .withVolumeForResponse(configuration.getImagesDirectory())
- .withVolumeForLog(configuration.getDockerLogDirectory(), dataEngineType.getName())
- .withResource(dataEngineType.getName())
- .withRequestId(uuid)
- .withConfKeyName(configuration.getAdminKey())
- .withActionConfigure(getImageConfigure(dto.getApplicationName(), dataEngineType)),
- dto
- )
- );
+ commandBuilder.buildCommand(runDockerCommand, dto));
} catch (Exception t) {
throw new DlabException("Could not configure computational resource cluster", t);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org