Permalink
Browse files

Merged in the fix for Enhancement 7055, see the URL in this commit ms…

…g for information.

Added --print-ctx-status option to the cloud client.

This help output best explains what it does and how to use it:

http://github.com/nimbusproject/nimbus/blob/master/service/client/java/source/src/org/globus/workspace/client/client-help-mode-ctxprintstatus.txt

Squashed commit of the following:
=================================

commit 41795dc6822fa97ad8e26594461f98497432e278
Author: Tim Freeman <tim@timfreeman.org>
Date:   Wed Jun 16 13:33:28 2010 -0500

    Detailed help messages for the new --print-ctx-status option

commit e06e19f4591e9141b0afcd16148602126ec6a8ee
Author: Tim Freeman <tim@timfreeman.org>
Date:   Tue Jun 15 17:10:17 2010 -0500

    --print-pending is gone, replaced by --print-ctx-status which will print out every node, see rest of commit msg

    Usage:

    $ ./bin/cloud-client.sh --print-ctx-status --handle cluster-002
    118.135.125.1     [CTX_CHECKED_IN_PENDING]
    118.135.125.17    [CTX_CHECKED_IN_PENDING]
    118.135.125.28    [CTX_NOT_CHECKED_IN]

    There are two fields, you can use awk to isolate:

    $ ./bin/cloud-client.sh --print-ctx-status --handle cluster-002 | awk '{print $2}'

    Exit code will be zero only when all are OK.  Otherwise will be 6
    unless there is an issue with input or it failed to query, etc.,
    then it will be some other non-zero code.

commit 8998b96472bd83aeb7b74f3e9187b6d68746d4ea
Author: Tim Freeman <tim@timfreeman.org>
Date:   Tue Jun 15 15:53:07 2010 -0500

    Continuing to rename the option from --print-pending to --print-ctx-status.  The functionality will change in next commit, I swear.

commit 0fcc08a358e84a14998c44a687b70be18063cf9a
Author: Tim Freeman <tim@timfreeman.org>
Date:   Tue Jun 15 15:44:12 2010 -0500

    Renamed the option from --print-pending to --print-ctx-status.  The functionality will change in next commit.

commit ee25ab3d9ec1074dc215aa8bfac0d1347cf03525
Author: Tim Freeman <tim@timfreeman.org>
Date:   Mon Jun 14 21:15:30 2010 -0500

    Added --print-pending to cloud client.  See the rest of this commit message for information.

    Print IP addresses of nodes that were launched but have not registered with the broker as OK
    or ERR.  Returns 0 if all OK, returns 6 if it found such nodes, returns other non-zero if
    there is an issue.

    Invoke:

        ./bin/cloud-client.sh --print-pending --handle cluster-001

    Help:

        ./bin/cloud-client.sh --extrahelp

    Underlying implementation is an unadvertised option because it only really works from
    a cloud-client launch.  Here is the help information:

        sh ./lib/workspace.sh --ctx-pending -h

    Sample invocations:
    -----------------------------------------------------------------------------
    $ ./bin/cloud-client.sh --print-pending --handle error
    Problem: History directory does not exist: [etc]
    See help (-h).
    $ echo $?
    1
    -----------------------------------------------------------------------------
    $ ./bin/cloud-client.sh --print-pending --handle cluster-001
    128.135.125.21
    128.135.125.22
    128.135.125.24
    $ echo $?
    6
    -----------------------------------------------------------------------------
    $ ./bin/cloud-client.sh --print-pending --handle cluster-001
    Context broker reports that all nodes for 'cluster-001' have contextualized.
    $ echo $?
    0
    -----------------------------------------------------------------------------
  • Loading branch information...
1 parent 39ef693 commit c15d710202709f6b05d132abb2dfaff149cdb4d5 @timf timf committed Jun 16, 2010
@@ -41,6 +41,7 @@
public boolean mode_monitorEnsemble;
public boolean mode_monitorContext;
public boolean mode_noMoreContextInjections;
+ public boolean mode_ctxPrintStatus;
public boolean mode_injectContextData;
public boolean mode_createContext;
public boolean mode_createInjectableContext;
@@ -195,6 +196,11 @@ private void intakeActions(CommandLine line) {
this.gotCmdLine(Opts.CTX_NO_MORE_INJECTIONS_OPT_STRING, "enabled");
}
+ if (line.hasOption(Opts.CTX_PRINT_STATUS_OPT_STRING)) {
+ this.mode_ctxPrintStatus = true;
+ this.gotCmdLine(Opts.CTX_PRINT_STATUS_OPT_STRING, "enabled");
+ }
+
if (line.hasOption(Opts.IMPERSONATE_CTX_AGENT_OPT_STRING)) {
this.mode_impersonateContextAgent = true;
this.gotCmdLine(Opts.IMPERSONATE_CTX_AGENT_OPT_STRING, "enabled");
@@ -89,6 +89,8 @@ public String getModeHelpString(AllArguments args) throws IOException {
filename = "client-help-mode-ctxdata.txt";
} else if (args.mode_start) {
filename = "client-help-mode-shared1.txt";
+ } else if (args.mode_ctxPrintStatus) {
+ filename = "client-help-mode-ctxprintstatus.txt";
} else {
return null;
}
@@ -239,6 +239,10 @@
public final Option CTX_CREATE_OPT =
OptionBuilder.withLongOpt(CTX_CREATE_OPT_STRING).create();
+ public static final String CTX_PRINT_STATUS_OPT_STRING = "ctx-print-status";
+ public final Option CTX_PRINT_STATUS_OPT =
+ OptionBuilder.withLongOpt(CTX_PRINT_STATUS_OPT_STRING).create();
+
public static final String CTX_CREATE_INJECTABLE_OPT_STRING =
"ctx-create-injectable";
public final Option CTX_CREATE_INJECTABLE_OPT =
@@ -341,6 +345,7 @@
this.ENSEMBLE_MONITOR_OPT,
this.CTX_NO_MORE_INJECTIONS_OPT,
this.CTX_CREATE_OPT,
+ this.CTX_PRINT_STATUS_OPT,
this.CTX_CREATE_INJECTABLE_OPT,
this.CTX_CONTACT_PATH_OPT,
this.CTX_DATA_OPT,
@@ -23,6 +23,9 @@
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;
import org.globus.axis.gsi.GSIConstants;
+import org.globus.workspace.client.modes.ContextDataInject;
+import org.globus.workspace.client.modes.ContextMonitor;
+import org.globus.workspace.client.modes.ContextPrintStatus;
import org.globus.workspace.client.modes.Destroy;
import org.globus.workspace.client.modes.FactoryQuery;
import org.globus.workspace.client.modes.InstanceQuery;
@@ -36,8 +39,6 @@
import org.globus.workspace.client.modes.ShutdownSave;
import org.globus.workspace.client.modes.EnsembleDone;
import org.globus.workspace.client.modes.EnsembleMonitor;
-import org.globus.workspace.client.modes.ContextDataInject;
-import org.globus.workspace.client.modes.ContextMonitor;
import org.globus.workspace.client.modes.ContextNoMoreInjections;
import org.globus.workspace.client.modes.ContextCreate;
import org.globus.workspace.client.modes.ContextCreate_Injectable;
@@ -435,6 +436,8 @@ private void chooseMode() throws ParameterProblem {
this.setMode(new ContextCreate_Injectable(this.pr, this.cliArgs, this));
} else if (this.cliArgs.mode_impersonateContextAgent) {
this.setMode(new ContextAgentImpersonate(this.pr, this.cliArgs, this));
+ } else if (this.cliArgs.mode_ctxPrintStatus) {
+ this.setMode(new ContextPrintStatus(this.pr, this.cliArgs, this));
}
if (this.mode == null) {
@@ -0,0 +1,74 @@
+
+Definition:
+==========
+
+Print IP addresses and contextualization status of cluster nodes that
+were launched.
+
+Unadvertised option for the "workspace.sh" program, it works best with
+Nimbus clusters launched with the cloud-client and it is usually only
+invoked programatically via the cloud-client's --print-ctx-status option.
+
+Sample output (fields can be split by awk):
+
+118.135.125.1 [CTX_CHECKED_IN_PENDING]
+118.135.125.17 [CTX_CHECKED_IN_PENDING]
+118.135.125.28 [CTX_NOT_CHECKED_IN]
+
+This will only exit successfully if all context members have moved to
+'OK'. Otherwise, it will exit with an error code 6 after printing all
+of the IP addresses, one per line, of VMs in the cluster launch and
+their contextualization status.
+
+NOTE: If there is another problem (for example, there is an issue with
+a given parameter issue), the client will exit with an error code
+different than 0 or 6.
+
+
+[CTX_SUCCESS]
+=============
+
+This means that the node with that IP address has reported "OK" to the
+context broker, it has gotten all of the information necessary and has
+run the on-VM contextualization scripts to set everything up and become
+"operational."
+
+
+[CTX_ERROR]
+===========
+
+The VM has successfully established communications with the context
+broker but there was an issue during contextualization so it reported
+an error to the context broker. If you launched with the cloud-client,
+there will normally be a "reports" directory in the history directory
+with the error messages written out to files.
+
+
+[CTX_CHECKED_IN_PENDING]
+========================
+
+The VM has successfully established communications with the context
+broker but it is still waiting for a "complete" response with all
+of the information it needs from other VMs. It is normally the
+case that this state will happen while VMs are booting up, some
+have not even initially contacted the broker yet.
+
+
+[CTX_NOT_CHECKED_IN]
+====================
+
+This VM has not established any communication channel with the
+context broker. It could have never launched, be booting up, or
+have failed to communicate with the broker at all due to a network
+or configuration issue.
+
+
+If using directly via lib/workspace.sh (which would be odd):
+===========================================================
+
+--eprFile (-e) <file> EPR of the context to query.
+
+--epr-ip-dir <dir> The directory to the ip/id recordings
+ directory that were written at launch
+ time.
+
Oops, something went wrong.

0 comments on commit c15d710

Please sign in to comment.