From d9b4d1a55af288ebff303023329f797e256cd693 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sun, 19 Jan 2020 13:59:21 -0500 Subject: [PATCH] better support for debugging node installation --- .../bubble/server/BubbleConfiguration.java | 3 +++ .../service/cloud/StandardNetworkService.java | 18 ++++++++++++++++-- bubble-server/src/main/resources/logback.xml | 7 ++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java b/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java index 2e401688..ab8532bd 100644 --- a/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java +++ b/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java @@ -65,6 +65,9 @@ public class BubbleConfiguration extends PgRestServerConfiguration public static final String SPRING_DB_FILTER = "classpath:/spring-db-filter.xml"; + public static final String ENV_DEBUG_NODE_INSTALL = "BUBBLE_DEBUG_NODE_INSTALL"; + public static final File DEBUG_NODE_INSTALL_FILE = new File(HOME_DIR, ".debug_node_install"); + public static final String TAG_SAGE_LAUNCHER = "sageLauncher"; public static final String TAG_NETWORK_UUID = "networkUuid"; public static final String TAG_PAYMENTS_ENABLED = "paymentsEnabled"; diff --git a/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java b/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java index ab46db19..e93c66ff 100644 --- a/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java +++ b/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java @@ -47,10 +47,11 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; -import static bubble.ApiConstants.getRemoteHost; -import static bubble.ApiConstants.newNodeHostname; +import static bubble.ApiConstants.*; import static bubble.dao.bill.AccountPlanDAO.PURCHASE_DELAY; import static bubble.model.cloud.BubbleNode.TAG_ERROR; +import static bubble.server.BubbleConfiguration.DEBUG_NODE_INSTALL_FILE; +import static bubble.server.BubbleConfiguration.ENV_DEBUG_NODE_INSTALL; import static bubble.service.boot.StandardSelfNodeService.*; import static bubble.service.cloud.NodeProgressMeter.getProgressMeterKey; import static bubble.service.cloud.NodeProgressMeter.getProgressMeterPrefix; @@ -328,6 +329,8 @@ public class StandardNetworkService implements NetworkService { boolean setupOk = false; final String nodeUser = node.getUser(); final String script = getAnsibleSetupScript(automation, sshArgs, nodeUser, sshTarget); + waitForDebugger(); + log.info("newNode: running script:\n"+script); for (int i=0; i - + - + - + +