Quickstart Guide#
cuopt_cli is built as part of the libcuopt package. Choose your install method below; the selector is pre-set for the CLI (it uses the same libcuopt install). Copy the command and run it in your environment. See Installation for all interfaces and options.
Installation#
To see all available options and their descriptions:
cuopt_cli --help
This will display the complete list of command-line arguments and their usage:
1usage: cuopt_cli [-h] [-t TYPE] [-ss SOLVER_SETTINGS] [-s SAK]
2 [-c CREDENTIALS] [-cn CONFIG] [-f FUNC] [-i FVID] [-g]
3 [-l {critical,error,warning,info,debug}] [-p POLL_TIMEOUT]
4 [-pi POLL_INTERVAL] [-nc] [-nv] [-ov] [-e EXEC_TIMEOUT] [-v]
5 [file ...]
6
7Solve a cuOpt problem using a managed service client.
8
9positional arguments:
10 file Name of a file or JSON string containing a cuOpt
11 problem, required if -g is not specified. For VRP and
12 MILP a single problem file is expected. For LP
13 multiple problem input files can be passed for batch
14 mode.
15
16options:
17 -h, --help show this help message and exit
18 -t TYPE, --type TYPE The type of problem to solve. Supported options are
19 VRP and LP. If the type is not supplied, problem
20 defaults to VRP
21 -ss SOLVER_SETTINGS, --solver-settings SOLVER_SETTINGS
22 Filename or JSON string containing solver settings for
23 LP problem type
24 -s SAK, --sak SAK File containing sak value in JSON. If this file is not
25 supplied, the environment variable CUOPT_CLIENT_SAK
26 will be used. Only one of the two authetication
27 methods (SAK or CLIENT ID & SECRET) can be used.
28 -c CREDENTIALS, --credentials CREDENTIALS
29 Note: This is deprecated, use -s option for SAK.File
30 containing client_id and secret values in JSON. If
31 this file is not supplied, the environment variables
32 CUOPT_CLIENT_SAK or pair ofCUOPT_CLIENT_ID and
33 CUOPT_CLIENT_SECRET will be used.Only one of the two
34 authetication methods(SAK or CLIENT ID & SECRET) can
35 be used.In case both are provided, SAK takes
36 precedence.
37 -cn CONFIG, --config CONFIG
38 Config file for setting client defaults in JSON. The
39 format is {"defaults": {"function_name": "",
40 "function_id": "", "function_version_id": ""}}. None
41 are required, and function_id takes precedence over
42 function_name. If set, function_version_id must be a
43 valid version of the function identified by name or id
44 -f FUNC, --func FUNC name or id of the cuOpt cloud function to call. If no
45 name or id is specified and all available functions
46 have the same name then that name will be used. The
47 latest version of the specified function will be
48 called if the -i option is not set.
49 -i FVID, --fvid FVID The id of a specific version of the specified function
50 to call. This should only be used when multiple
51 versions of the same function are available and a
52 version other than the latest is desired. By default,
53 the latest version will be called.
54 -g, --get-functions Print a list of available cuOpt functions and exit.
55 Refreshes the version cache.
56 -l {critical,error,warning,info,debug}, --log-level {critical,error,warning,info,debug}
57 Log level
58 -p POLL_TIMEOUT, --poll-timeout POLL_TIMEOUT
59 Number of seconds to poll for a result before timing
60 out. Default is to never timeout.
61 -pi POLL_INTERVAL, --poll-interval POLL_INTERVAL
62 The duration in seconds of each polling attempt.
63 Mininum is 5. Default is 60.
64 -nc, --no-compress Disable zlib compression for uncompressed data files
65 larger than 250kb. For most cases zlib compression
66 will improve cuOpt download speed and should be left
67 enabled.This flag may be used to preserve backward
68 compatibility with older cuOpt versions that do not
69 support zlib compression.
70 -nv, --no-version-string
71 Do not send the client version to the server. This
72 flag may be used to preserve backward compatibility
73 with older cuOpt versions that do not support the
74 version string.
75 -ov, --only-validation
76 If set, only validates input and doesn't add to
77 billing.
78 -e EXEC_TIMEOUT, --exec-timeout EXEC_TIMEOUT
79 http timeout when invoking a function. The server may
80 wait up to 5 minutes before returning a pending-
81 evalution result on long jobs. Most likely this does
82 not need to be modified (defaults to 300)
83 -v, --version Print client version and exit.
Please refer to Convex Optimization Settings and MIP Settings for more details on default values and other options.