47 #define GRID_APP_NAME "grid_cli"
49 #define LOGIN_TOKEN_ENV "GRID_CLI_LOGIN_TOKEN"
50 #define DEFAULT_APP_UID GRID_APP_NAME
52 #define LOGIN_TOKEN_APP_UID_FIELD "app"
53 #define LOGIN_TOKEN_AUTH_FIELD "cn"
54 #define LOGIN_TOKEN_USER_FIELD "u"
55 #define LOGIN_TOKEN_HOST_FIELD "h"
56 #define LOGIN_TOKEN_NETCACHE_FIELD "nc"
57 #define LOGIN_TOKEN_ICACHE_NAME_FIELD "ic"
58 #define LOGIN_TOKEN_ENABLE_MIRRORING "mm"
59 #define LOGIN_TOKEN_NETSCHEDULE_FIELD "ns"
60 #define LOGIN_TOKEN_QUEUE_FIELD "q"
61 #define LOGIN_TOKEN_SESSION_PID_FIELD "pid"
62 #define LOGIN_TOKEN_SESSION_TIMESTAMP_FIELD "ts"
63 #define LOGIN_TOKEN_SESSION_UID_FIELD "uid"
64 #define LOGIN_TOKEN_ALLOW_XSITE_CONN "xs"
65 #define LOGIN_TOKEN_NO_CONN_RETRIES "r0"
66 #define LOGIN_TOKEN_FILETRACK_SITE "fts"
67 #define LOGIN_TOKEN_FILETRACK_TOKEN "ftt"
69 #define LOGIN_TOKEN_OPTION "login-token"
70 #define NETCACHE_OPTION "netcache"
71 #define CACHE_OPTION "cache"
72 #define TRY_ALL_SERVERS_OPTION "try-all-servers"
73 #define NETSTORAGE_OPTION "netstorage"
74 #define OBJECT_KEY_OPTION "object-key"
75 #define USER_KEY_OPTION "user-key"
76 #define NAMESPACE_OPTION "namespace"
77 #define PERSISTENT_OPTION "persistent"
78 #define FAST_STORAGE_OPTION "fast-storage"
79 #define MOVABLE_OPTION "movable"
80 #define CACHEABLE_OPTION "cacheable"
81 #define NETSCHEDULE_OPTION "netschedule"
82 #define WORKER_NODE_OPTION "worker-node"
83 #define INPUT_OPTION "input"
84 #define INPUT_FILE_OPTION "input-file"
85 #define REMOTE_APP_ARGS_OPTION "remote-app-args"
86 #define OUTPUT_FILE_OPTION "output-file"
87 #define QUEUE_OPTION "queue"
88 #define BATCH_OPTION "batch"
89 #define AFFINITY_OPTION "affinity"
90 #define CLAIM_NEW_AFFINITIES_OPTION "claim-new-affinities"
91 #define ANY_AFFINITY_OPTION "any-affinity"
92 #define JOB_OUTPUT_OPTION "job-output"
93 #define JOB_OUTPUT_BLOB_OPTION "job-output-blob"
94 #define LIMIT_OPTION "limit"
95 #define TIMEOUT_OPTION "timeout"
96 #define RELIABLE_READ_OPTION "reliable-read"
97 #define CONFIRM_READ_OPTION "confirm-read"
98 #define ROLLBACK_READ_OPTION "rollback-read"
99 #define FAIL_READ_OPTION "fail-read"
100 #define JOB_ID_OPTION "job-id"
101 #define BRIEF_OPTION "brief"
102 #define WAIT_FOR_JOB_STATUS_OPTION "wait-for-job-status"
103 #define WAIT_FOR_JOB_EVENT_AFTER_OPTION "wait-for-job-event-after"
104 #define JOB_GROUP_OPTION "job-group"
105 #define WAIT_TIMEOUT_OPTION "wait-timeout"
106 #define FAIL_JOB_OPTION "fail-job"
107 #define ALL_QUEUES_OPTION "all-queues"
108 #define QUEUE_CLASSES_OPTION "queue-classes"
109 #define QUEUE_CLASS_OPTION "queue-class"
110 #define QUEUE_ARG "QUEUE"
111 #define SWITCH_ARG "SWITCH"
112 #define PULLBACK_OPTION "pullback"
113 #define WAIT_FOR_JOB_COMPLETION_OPTION "wait-for-job-completion"
114 #define NOW_OPTION "now"
115 #define DIE_OPTION "die"
116 #define DRAIN_OPTION "drain"
117 #define JOB_INPUT_DIR_OPTION "job-input-dir"
118 #define JOB_OUTPUT_DIR_OPTION "job-output-dir"
119 #define PROTOCOL_DUMP_OPTION "protocol-dump"
120 #define PASSWORD_OPTION "password"
121 #define OFFSET_OPTION "offset"
122 #define SIZE_OPTION "length"
123 #define FT_TOKEN_OPTION "ft-token"
124 #define DIRECT_MODE_OPTION "direct"
125 #define CLIENT_SESSION_OPTION "client-session"
127 #define ATTR_VALUE_ARG "ATTR_VALUE"
129 #define LOGIN_COMMAND "login"
130 #define JOBINFO_COMMAND "jobinfo"
131 #define READJOB_COMMAND "readjob"
132 #define WATCHJOB_COMMAND "watchjob"
133 #define QUEUEINFO_COMMAND "queueinfo"
134 #define SUSPEND_COMMAND "suspend"
136 #define HUMAN_READABLE_OUTPUT_FORMAT "human-readable"
137 #define RAW_OUTPUT_FORMAT "raw"
138 #define JSON_OUTPUT_FORMAT "json"
140 #define NETSCHEDULE_CHECK_QUEUE "netschedule_check_queue"
142 #ifndef NCBI_OS_MSWIN
143 #define IO_BUFFER_SIZE (512 * 1024)
145 #define IO_BUFFER_SIZE (16 * 1024)
157 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT
283 #define OPTION_ACCEPTED 1
285 #define OPTION_EXPLICITLY_SET 4
286 #define OPTION_N(number) (1 << number)
297 static void PrintLine(
const string& line);
364 bool AddPart(
const string& part);
365 void Parse(
bool icache_mode,
bool require_version);
545 void SetUp_NetCacheCmd(
bool icache_mode,
bool require_version =
true,
bool require_service =
true);
556 const string& job_key,
557 const string& server_host);
560 size_t max_embedded_input_size,
565 size_t max_embedded_input_size,
Pool of recycled CCompoundID objects.
static bool OnWarning(bool worker_node_admin, const string &warn_msg, CNetServer server)
int DumpJobInputOutput(const string &data_or_blob_id)
CCompoundIDPool m_CompoundIDPool
bool IsOptionSet(int option) const
unique_ptr< CGridClient > m_GridClient
void SetUp_NetScheduleCmd(EAPIClass api_class, EAdminCmdSeverity cmd_severity=eReadOnlyAdminCmd, bool require_queue=true)
bool IsOptionAccepted(EOption option) const
int IsOptionExplicitlySet(int option, int mask) const
struct CGridCommandLineInterfaceApp::SOptions m_Opts
void PrepareRemoteAppJobInput(size_t max_embedded_input_size, const string &args, CNcbiIstream &remote_app_stdin, CNcbiOstream &job_input_ostream)
int PrintNetScheduleStats()
void MarkOptionAsExplicitlySet(int option)
CNetICacheClient m_NetICacheClient
CNetScheduleSubmitter m_NetScheduleSubmitter
void JobInfo_PrintStatus(CNetScheduleAPI::EJobStatus status)
CNetScheduleAdmin m_NetScheduleAdmin
int ShutdownNetStorageServer()
bool IsOptionAcceptedAndSetImplicitly(EOption option) const
int ReconfigureNetStorageServer()
void MarkOptionAsAccepted(int option)
void PrintNetScheduleStats_Generic(ENetScheduleStatTopic topic)
bool ParseLoginToken(const string &token)
CNetScheduleAPIExt m_NetScheduleAPI
int IsOptionAccepted(EOption option, int mask) const
CNetStorageAdmin m_NetStorageAdmin
void MarkOptionAsSet(int option)
CGridCommandLineInterfaceApp(int argc, const char *argv[])
@ eAdminCmdWithSideEffects
void PrintServerAddress(CNetServer server)
void PrintJobStatusNotification(CNetScheduleNotificationHandler &submit_job_handler, const string &job_key, const string &server_host)
enum CGridCommandLineInterfaceApp::EAPIClass m_APIClass
int Automation_PipeServer()
void NetStorage_PrintServerReply(CJsonNode &server_reply)
int PrintNetStorageServerConfig()
void NetSchedule_SuspendResume(bool suspend)
int PrintJobAttrsAndDumpInput(const CNetScheduleJob &job)
static void PrintLine(const string &line)
bool IsOptionExplicitlySet(int option) const
void x_LoadJobInput(size_t max_embedded_input_size, CNcbiOstream &job_input_ostream)
CNetScheduleExecutor m_NetScheduleExecutor
void CheckNetStorageOptions() const
int NetScheduleSanityCheck()
CNetStorageByKey m_NetStorageByKey
bool IsOptionAcceptedButNotSet(EOption option) const
void CheckJobInputStream(CNcbiOstream &job_input_ostream)
void SetUp_AdminCmd(EAdminCmdSeverity cmd_severity)
int Cmd_NetStorageObjectInfo()
void SetUp_NetStorageCmd(EAPIClass api_class, EAdminCmdSeverity cmd_severity=eReadOnlyAdminCmd)
void SetUp_NetCacheAdminCmd(EAdminCmdSeverity cmd_severity)
CNetCacheAdmin m_NetCacheAdmin
int IsOptionSet(int option, int mask) const
int NetCacheSanityCheck()
CNetStorageObject GetNetStorageObject()
int PrintNetStorageServerInfo()
CNetCacheAPI m_NetCacheAPI
int Automation_DebugConsole()
virtual int Run()
Run the application.
CNetScheduleAPI::EJobStatus StringToJobStatus(const char *status_str)
static void PrintBlobMeta(const CNetCacheKey &key)
int Cmd_RemoveNetStorageObject()
Client API for NetCache server.
Client to NetCache server (implements ICache interface)
Smart pointer to a part of the NetSchedule API that does job retrieval and processing on the worker n...
Smart pointer to the job submission part of the NetSchedule API.
Network BLOB storage API – with access by user-defined keys.
Basic network-based data object I/O.
Network BLOB storage API.
Declarations of CCompoundIDPool, CCompoundID, and CCompoundIDField.
@ eExtendedOptionDelimiter
@ eUsePreferredAffinities
#define OPTION_EXPLICITLY_SET
NetSchedule Framework specs.
EJobStatus
Job status codes.
unsigned TNetStorageFlags
Bitwise OR of ENetStorageFlags.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
enum ENcbiSwitch ESwitch
Aux.
const struct ncbi::grid::netcache::search::fields::KEY key
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
bool AddPart(const string &part)
void Parse(bool icache_mode, bool require_version)
string aggregation_interval
time_t extend_lifetime_by
struct CGridCommandLineInterfaceApp::SOptions::SNCID ncid
TNetStorageFlags netstorage_flags
char option_flags[eNumberOfOptions]
EOutputFormat output_format
Meaningful information encoded in the NetCache key.