From 0bbb5eb82969a2de02ce69f6fbae621d87e17729 Mon Sep 17 00:00:00 2001 From: sugnani123 <91664490+sugnani123@users.noreply.github.com> Date: Tue, 6 Dec 2022 16:07:01 +0530 Subject: [PATCH 1/2] Update PoolAndResourceFile.java --- .../src/main/java/PoolAndResourceFile.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java b/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java index 7fb9f284..771b97c2 100644 --- a/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java +++ b/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java @@ -16,13 +16,14 @@ public class PoolAndResourceFile { // Get Batch and storage account information from environment - static String BATCH_ACCOUNT = System.getenv("AZURE_BATCH_ACCOUNT"); - static String BATCH_ACCESS_KEY = System.getenv("AZURE_BATCH_ACCESS_KEY"); - static String BATCH_URI = System.getenv("AZURE_BATCH_ENDPOINT"); - static String STORAGE_ACCOUNT_NAME = System.getenv("STORAGE_ACCOUNT_NAME"); - static String STORAGE_ACCOUNT_KEY = System.getenv("STORAGE_ACCOUNT_KEY"); + static String BATCH_ACCOUNT = "metlife"; //System.getenv("AZURE_BATCH_ACCOUNT") + static String BATCH_ACCESS_KEY = "a7+xnp0ECqN28DXqv2VmoapYQolTF0c7CriBMzxabgma4vfiha+Uffp0fbEGF1qVxdZ/tU4t9Wu6+ABa+eeYkQ=="; //System.getenv("AZURE_BATCH_ACCESS_KEY"); + static String BATCH_URI = "metlife.eastus.batch.azure.com"; //System.getenv("AZURE_BATCH_ENDPOINT"); + static String STORAGE_ACCOUNT_NAME = "metlifepoc"; //System.getenv("STORAGE_ACCOUNT_NAME"); + static String STORAGE_ACCOUNT_KEY = "SxJZ9lzgO+O+pzPX0zqA89xhKpUQ3OLvDMHOyxSO3V0PwE2sUN+LEcESJPjtBma3989DGJlDIIKT+ASt/o80tw=="; //System.getenv("STORAGE_ACCOUNT_KEY"); static String STORAGE_CONTAINER_NAME = "poolandresourcefile"; + // How many tasks to run across how many nodes static int TASK_COUNT = 5; static int NODE_COUNT = 1; From 5cab939428528a96b1e77e6fa935c31007796ac1 Mon Sep 17 00:00:00 2001 From: sugnani123 <91664490+sugnani123@users.noreply.github.com> Date: Tue, 6 Dec 2022 16:17:51 +0530 Subject: [PATCH 2/2] Update PoolAndResourceFile.java --- .../src/main/java/PoolAndResourceFile.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java b/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java index 771b97c2..6d5890f0 100644 --- a/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java +++ b/Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java @@ -112,9 +112,9 @@ public static void main(String[] argv) throws Exception { private static CloudPool createPoolIfNotExists(BatchClient client, String poolId) throws BatchErrorException, IllegalArgumentException, IOException, InterruptedException, TimeoutException { // Create a pool with 1 A1 VM - String osPublisher = "OpenLogic"; - String osOffer = "CentOS"; - String poolVMSize = "STANDARD_A1"; + String osPublisher = "canonical"; + String osOffer = "ubuntuserver"; + String poolVMSize = "standard_a1_v2"; int poolVMCount = 1; Duration poolSteadyTimeout = Duration.ofMinutes(5); Duration vmReadyTimeout = Duration.ofMinutes(20); @@ -339,17 +339,17 @@ private static void waitForTasksToComplete(BatchClient client, String jobId, Dur throw new TimeoutException("Task did not complete within the specified timeout"); } - private static void printBatchException(BatchErrorException err) { - System.out.printf("BatchError %s%n", err.toString()); - if (err.body() != null) { - System.out.printf("BatchError code = %s, message = %s%n", err.body().code(), - err.body().message().value()); - if (err.body().values() != null) { - for (BatchErrorDetail detail : err.body().values()) { - System.out.printf("Detail %s=%s%n", detail.key(), detail.value()); - } - } - } - } +// private static void printBatchException(BatchErrorException err) { +// System.out.printf("BatchError %s%n", err.toString()); +// if (err.body() != null) { +// System.out.printf("BatchError code = %s, message = %s%n", err.body().code(), +// err.body().message().value()); +// if (err.body().values() != null) { +// for (BatchErrorDetail detail : err.body().values()) { +// System.out.printf("Detail %s=%s%n", detail.key(), detail.value()); +// } +// } +// } +// } }