You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/miscellaneous/environments.md
+36-16Lines changed: 36 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,15 @@ _WARNING: you are on the master branch, please refer to the docs on the branch t
4
4
5
5
The `cortex` CLI can be used to deploy models locally and/or to any number of clusters. Environments are used to select which cluster to use for a `cortex` command. An environment contains the information required to connect to a cluster (e.g. AWS credentials and Cortex operator URL).
6
6
7
-
By default, the CLI ships with a single environment named `local`. This is the default environment for all Cortex commands (other than `cortex cluster` commands), which means that APIs will be deployed locally by default.
8
-
9
-
Some cortex commands (i.e. `cortex cluster` commands) only apply to cluster environments. Unless otherwise specified by the `-e`/`--env` flag, `cortex cluster` commands create/use an environment named `aws`. For example `cortex cluster up` will configure the `aws` environment to connect to your new cluster. You may interact with this cluster by appending `--env aws` to your `cortex` commands.
7
+
## Example: `aws` only
10
8
11
-
If you accidentally delete or overwrite one of your cluster environments, running `cortex cluster info --env ENV_NAME` will automatically update the specified environment to interact with the cluster.
12
-
13
-
You can list your environments with `cortex env list`, change the default environment with `cortex env default`, delete an environment with `cortex env delete`, and create/update an environment with `cortex env configure`.
9
+
```bash
10
+
cortex cluster up # configures the aws env; same as `cortex cluster up --env aws`
11
+
cortex env default aws # sets aws as the default env
12
+
cortex deploy # uses aws env; same as `cortex deploy --env aws`
13
+
cortex logs my-api # uses aws env; same as `cortex logs my-api --env aws`
14
+
cortex delete my-api # uses aws env; same as `cortex delete my-api --env aws`
15
+
```
14
16
15
17
## Example: `local` only
16
18
@@ -37,16 +39,6 @@ cortex deploy # uses aws env; same as `cortex deploy --env aws`
37
39
cortex deploy --env local
38
40
```
39
41
40
-
## Example: only `aws`
41
-
42
-
```bash
43
-
cortex cluster up # configures the aws env; same as `cortex cluster up --env aws`
44
-
cortex env default aws # sets aws as the default env
45
-
cortex deploy # uses aws env; same as `cortex deploy --env aws`
46
-
cortex logs my-api # uses aws env; same as `cortex logs my-api --env aws`
47
-
cortex delete my-api # uses aws env; same as `cortex delete my-api --env aws`
48
-
```
49
-
50
42
## Example: multiple clusters
51
43
52
44
```bash
@@ -76,3 +68,31 @@ cortex deploy --env cluster2
76
68
cortex logs my-api --env cluster2
77
69
cortex delete my-api --env cluster2
78
70
```
71
+
72
+
## Example: configure `cortex` CLI to connect to an existing cluster
73
+
74
+
If you are installing the `cortex` CLI on a new computer, you can configure it to access an existing Cortex cluster.
75
+
76
+
If you have access to the cluster configuration file which you used to create your cluster, running `cortex cluster info` on your new machine will automatically configure your CLI:
77
+
78
+
```bash
79
+
# configure the aws environment to connect to the cluster specified in cluster.yaml
80
+
cortex cluster info --config cluster.yaml --env aws
81
+
```
82
+
83
+
If for some reason this doesn't work, or you don't have access to your cluster configuration file, you can configure the CLI manually:
84
+
85
+
```bash
86
+
# this will prompt for the necessary configuration
87
+
cortex env configure
88
+
```
89
+
90
+
## Environments overview
91
+
92
+
By default, the CLI ships with a single environment named `local`. This is the default environment for all Cortex commands (other than `cortex cluster` commands), which means that APIs will be deployed locally by default.
93
+
94
+
Some cortex commands (i.e. `cortex cluster` commands) only apply to cluster environments. Unless otherwise specified by the `-e`/`--env` flag, `cortex cluster` commands create/use an environment named `aws`. For example `cortex cluster up` will configure the `aws` environment to connect to your new cluster. You may interact with this cluster by appending `--env aws` to your `cortex` commands.
95
+
96
+
If you accidentally delete or overwrite one of your cluster environments, running `cortex cluster info --env ENV_NAME` will automatically update the specified environment to interact with the cluster.
97
+
98
+
You can list your environments with `cortex env list`, change the default environment with `cortex env default`, delete an environment with `cortex env delete`, and create/update an environment with `cortex env configure`.
0 commit comments