Skip to content

Commit 38b038b

Browse files
authored
Remove support for local provider (#1755)
1 parent 1fed73f commit 38b038b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+488
-3724
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,19 +274,12 @@ If you want to switch back to the in-cluster operator:
274274
1. `<ctrl+c>` to stop your local operator
275275
2. `make operator-start-aws` to restart the operator in your cluster
276276

277-
If you only want to test Cortex's local environment, here is the common workflow:
278-
279-
1. `make cli-watch` (builds the CLI and re-builds it when files are changed)
280-
2. Make your changes
281-
3. `make images-dev-local` (only necessary if API images or the manager are modified)
282-
4. Test your changes e.g. via `cortex deploy` (and repeat steps 2 and 3 as necessary)
283-
284277
### Dev workflow optimizations
285278

286279
If you are only modifying the CLI, `make cli-watch` will build the CLI and re-build it when files are changed. When doing this, you can leave the operator running in the cluster instead of running it locally.
287280

288281
If you are only modifying the operator, `make operator-local-aws` will build and start the operator locally, and build/restart it when files are changed.
289282

290-
If you are modifying code in the API images (i.e. any of the Python serving code), `make images-dev-aws` may build more images than you need during testing. For example, if you are only testing using the `python-predictor-cpu` image, you can run `./dev/registry.sh update-single python-predictor-cpu --provider aws` (or use `--provider local` if testing locally).
283+
If you are modifying code in the API images (i.e. any of the Python serving code), `make images-dev-aws` may build more images than you need during testing. For example, if you are only testing using the `python-predictor-cpu` image, you can run `./dev/registry.sh update-single python-predictor-cpu --provider aws`.
291284

292285
See `Makefile` for additional dev commands.

Makefile

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -91,33 +91,33 @@ cluster-up-gcp-y:
9191
@$(MAKE) kubectl-gcp
9292

9393
cluster-down-aws:
94-
@$(MAKE) images-manager-local
94+
@$(MAKE) images-manager-skip-push
9595
@$(MAKE) cli
9696
@kill $(shell pgrep -f rerun) >/dev/null 2>&1 || true
9797
@./bin/cortex cluster down --config=./dev/config/cluster-aws.yaml --aws-key="$$AWS_ACCESS_KEY_ID" --aws-secret=$$AWS_SECRET_ACCESS_KEY
9898
cluster-down-gcp:
99-
@$(MAKE) images-manager-local
99+
@$(MAKE) images-manager-skip-push
100100
@$(MAKE) cli
101101
@kill $(shell pgrep -f rerun) >/dev/null 2>&1 || true
102102
@./bin/cortex cluster-gcp down --config=./dev/config/cluster-gcp.yaml
103103

104104
cluster-down-aws-y:
105-
@$(MAKE) images-manager-local
105+
@$(MAKE) images-manager-skip-push
106106
@$(MAKE) cli
107107
@kill $(shell pgrep -f rerun) >/dev/null 2>&1 || true
108108
@./bin/cortex cluster down --config=./dev/config/cluster-aws.yaml --aws-key="$$AWS_ACCESS_KEY_ID" --aws-secret="$$AWS_SECRET_ACCESS_KEY" --yes
109109
cluster-down-gcp-y:
110-
@$(MAKE) images-manager-local
110+
@$(MAKE) images-manager-skip-push
111111
@$(MAKE) cli
112112
@kill $(shell pgrep -f rerun) >/dev/null 2>&1 || true
113113
@./bin/cortex cluster-gcp down --config=./dev/config/cluster-gcp.yaml --yes
114114

115115
cluster-info-aws:
116-
@$(MAKE) images-manager-local
116+
@$(MAKE) images-manager-skip-push
117117
@$(MAKE) cli
118118
@eval $$(python3 ./manager/cluster_config_env.py ./dev/config/cluster-aws.yaml) && ./bin/cortex cluster info --config=./dev/config/cluster-aws.yaml --configure-env="$$CORTEX_CLUSTER_NAME-aws" --aws-key="$$AWS_ACCESS_KEY_ID" --aws-secret="$$AWS_SECRET_ACCESS_KEY" --yes
119119
cluster-info-gcp:
120-
@$(MAKE) images-manager-local
120+
@$(MAKE) images-manager-skip-push
121121
@$(MAKE) cli
122122
@eval $$(python3 ./manager/cluster_config_env.py ./dev/config/cluster-gcp.yaml) && ./bin/cortex cluster-gcp info --config=./dev/config/cluster-gcp.yaml --configure-env="$$CORTEX_CLUSTER_NAME-gcp" --yes
123123

@@ -181,49 +181,47 @@ operator-update-gcp:
181181

182182
# Docker images
183183

184+
images-all-skip-push:
185+
@./dev/registry.sh update all
184186
images-all-aws:
185187
@./dev/registry.sh update all -p aws
186188
images-all-gcp:
187189
@./dev/registry.sh update all -p gcp
188-
images-all-local:
189-
@./dev/registry.sh update all -p local
190+
images-all-slim-skip-push:
191+
@./dev/registry.sh update all --include-slim
190192
images-all-slim-aws:
191193
@./dev/registry.sh update all -p aws --include-slim
192194
images-all-slim-gcp:
193195
@./dev/registry.sh update all -p gcp --include-slim
194-
images-all-slim-local:
195-
@./dev/registry.sh update all -p local --include-slim
196196

197+
images-dev-skip-push:
198+
@./dev/registry.sh update dev
197199
images-dev-aws:
198200
@./dev/registry.sh update dev -p aws
199201
images-dev-gcp:
200202
@./dev/registry.sh update dev -p gcp
201-
images-dev-local:
202-
@./dev/registry.sh update dev -p local
203+
images-dev-slim-skip-push:
204+
@./dev/registry.sh update dev --include-slim
203205
images-dev-slim-aws:
204206
@./dev/registry.sh update dev -p aws --include-slim
205207
images-dev-slim-gcp:
206208
@./dev/registry.sh update dev -p gcp --include-slim
207-
images-dev-slim-local:
208-
@./dev/registry.sh update dev -p local --include-slim
209209

210+
images-api-skip-push:
211+
@./dev/registry.sh update api
210212
images-api-aws:
211213
@./dev/registry.sh update api -p aws
212214
images-api-gcp:
213215
@./dev/registry.sh update api -p gcp
214-
images-api-local:
215-
@./dev/registry.sh update api -p local
216+
images-api-slim-skip-push:
217+
@./dev/registry.sh update api --include-slim
216218
images-api-slim-aws:
217219
@./dev/registry.sh update api -p aws --include-slim
218220
images-api-slim-gcp:
219221
@./dev/registry.sh update api -p gcp --include-slim
220-
images-api-slim-local:
221-
@./dev/registry.sh update api -p local --include-slim
222222

223-
images-manager-local:
224-
@./dev/registry.sh update-single manager -p local
225-
images-iris-local:
226-
@./dev/registry.sh update-single python-predictor-cpu -p local
223+
images-manager-skip-push:
224+
@./dev/registry.sh update-single manager
227225
images-iris-aws:
228226
@./dev/registry.sh update-single python-predictor-cpu -p aws
229227
images-iris-gcp:
@@ -234,8 +232,6 @@ registry-create-aws:
234232

235233
registry-clean-aws:
236234
@./dev/registry.sh clean -p aws
237-
registry-clean-local:
238-
@./dev/registry.sh clean -p local
239235

240236
# Misc
241237

build/images.sh

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,69 +19,57 @@
1919

2020
set -euo pipefail
2121

22-
api_images_local=(
22+
api_images_cluster=(
2323
"python-predictor-cpu"
2424
"python-predictor-gpu"
2525
"tensorflow-predictor"
2626
"onnx-predictor-cpu"
2727
"onnx-predictor-gpu"
2828
)
29-
api_images_cluster=(
30-
# includes api_images_local
31-
)
3229
api_images_aws=(
33-
# includes api_images_local and api_images_cluster
30+
# includes api_images_cluster
3431
"python-predictor-inf"
3532
)
3633
api_images_gcp=(
37-
# includes api_images_local and api_images_cluster
34+
# includes api_images_cluster
3835
)
3936

40-
api_slim_images_local=(
37+
api_slim_images_cluster=(
4138
"python-predictor-cpu-slim"
4239
"python-predictor-gpu-slim"
4340
"tensorflow-predictor-slim"
4441
"onnx-predictor-cpu-slim"
4542
"onnx-predictor-gpu-slim"
4643
)
47-
api_slim_images_cluster=(
48-
# includes api_slim_images_local
49-
)
5044
api_slim_images_aws=(
51-
# includes api_slim_images_local and api_slim_images_cluster
45+
# includes api_slim_images_cluster
5246
"python-predictor-inf-slim"
5347
)
5448
api_slim_images_gcp=(
55-
# includes api_slim_images_local and api_slim_images_cluster
49+
# includes api_slim_images_cluster
5650
)
5751

58-
dev_images_local=(
59-
"downloader"
60-
)
6152
dev_images_cluster=(
62-
# includes dev_images_local
53+
"downloader"
6354
"manager"
6455
)
6556
dev_images_aws=(
66-
# includes dev_images_local and dev_images_cluster
57+
# includes dev_images_cluster
6758
"request-monitor"
6859
)
6960
dev_images_gcp=(
70-
# includes dev_images_local and dev_images_cluster
61+
# includes dev_images_cluster
7162
)
7263

73-
non_dev_images_local=(
64+
non_dev_images_cluster=(
7465
"tensorflow-serving-cpu"
7566
"tensorflow-serving-gpu"
76-
)
77-
non_dev_images_cluster=(
78-
# includes non_dev_images_local
7967
"operator"
8068
"istio-proxy"
8169
"istio-pilot"
8270
)
8371
non_dev_images_aws=(
84-
# includes non_dev_images_local and non_dev_images_cluster
72+
# includes non_dev_images_cluster
8573
"tensorflow-serving-inf"
8674
"cluster-autoscaler"
8775
"metrics-server"
@@ -92,55 +80,43 @@ non_dev_images_aws=(
9280
"statsd"
9381
)
9482
non_dev_images_gcp=(
95-
# includes non_dev_images_local and non_dev_images_cluster
83+
# includes non_dev_images_cluster
9684
"google-pause"
9785
)
9886

9987
all_images=(
100-
"${api_images_local[@]}"
10188
"${api_images_cluster[@]}"
10289
"${api_images_aws[@]}"
10390
"${api_images_gcp[@]}"
104-
"${api_slim_images_local[@]}"
10591
"${api_slim_images_cluster[@]}"
10692
"${api_slim_images_aws[@]}"
10793
"${api_slim_images_gcp[@]}"
108-
"${dev_images_local[@]}"
10994
"${dev_images_cluster[@]}"
11095
"${dev_images_aws[@]}"
11196
"${dev_images_gcp[@]}"
112-
"${non_dev_images_local[@]}"
11397
"${non_dev_images_cluster[@]}"
11498
"${non_dev_images_aws[@]}"
11599
"${non_dev_images_gcp[@]}"
116100
)
117101

118102
aws_images=(
119-
"${api_images_local[@]}"
120103
"${api_images_cluster[@]}"
121104
"${api_images_aws[@]}"
122-
"${api_slim_images_local[@]}"
123105
"${api_slim_images_cluster[@]}"
124106
"${api_slim_images_aws[@]}"
125-
"${dev_images_local[@]}"
126107
"${dev_images_cluster[@]}"
127108
"${dev_images_aws[@]}"
128-
"${non_dev_images_local[@]}"
129109
"${non_dev_images_cluster[@]}"
130110
"${non_dev_images_aws[@]}"
131111
)
132112

133113
gcp_images=(
134-
"${api_images_local[@]}"
135114
"${api_images_cluster[@]}"
136115
"${api_images_gcp[@]}"
137-
"${api_slim_images_local[@]}"
138116
"${api_slim_images_cluster[@]}"
139117
"${api_slim_images_gcp[@]}"
140-
"${dev_images_local[@]}"
141118
"${dev_images_cluster[@]}"
142119
"${dev_images_gcp[@]}"
143-
"${non_dev_images_local[@]}"
144120
"${non_dev_images_cluster[@]}"
145121
"${non_dev_images_gcp[@]}"
146122
)

cli/cmd/cluster.go

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ func clusterInit() {
7070
addClusterConfigFlag(_clusterUpCmd)
7171
addAWSCredentialsFlags(_clusterUpCmd)
7272
addClusterAWSCredentialsFlags(_clusterUpCmd)
73-
defaultEnv := getDefaultEnv(_clusterCommandType)
74-
_clusterUpCmd.Flags().StringVarP(&_flagClusterUpEnv, "configure-env", "e", defaultEnv, "name of environment to configure")
73+
_clusterUpCmd.Flags().StringVarP(&_flagClusterUpEnv, "configure-env", "e", "aws", "name of environment to configure")
7574
_clusterUpCmd.Flags().BoolVarP(&_flagClusterDisallowPrompt, "yes", "y", false, "skip prompts")
7675
_clusterCmd.AddCommand(_clusterUpCmd)
7776

@@ -144,10 +143,6 @@ var _clusterUpCmd = &cobra.Command{
144143
Run: func(cmd *cobra.Command, args []string) {
145144
telemetry.EventNotify("cli.cluster.up", map[string]interface{}{"provider": types.AWSProviderType})
146145

147-
if _flagClusterUpEnv == "local" {
148-
exit.Error(ErrorLocalEnvironmentCantUseClusterProvider(types.AWSProviderType))
149-
}
150-
151146
envExists, err := isEnvConfigured(_flagClusterUpEnv)
152147
if err != nil {
153148
exit.Error(err)
@@ -322,10 +317,6 @@ var _clusterConfigureCmd = &cobra.Command{
322317
Run: func(cmd *cobra.Command, args []string) {
323318
telemetry.Event("cli.cluster.configure", map[string]interface{}{"provider": types.AWSProviderType})
324319

325-
if _flagClusterConfigureEnv == "local" {
326-
exit.Error(ErrorLocalEnvironmentCantUseClusterProvider(types.AWSProviderType))
327-
}
328-
329320
if _, err := docker.GetDockerClient(); err != nil {
330321
exit.Error(err)
331322
}
@@ -403,10 +394,6 @@ var _clusterInfoCmd = &cobra.Command{
403394
Run: func(cmd *cobra.Command, args []string) {
404395
telemetry.Event("cli.cluster.info", map[string]interface{}{"provider": types.AWSProviderType})
405396

406-
if _flagClusterInfoEnv == "local" {
407-
exit.Error(ErrorLocalEnvironmentCantUseClusterProvider(types.AWSProviderType))
408-
}
409-
410397
if _, err := docker.GetDockerClient(); err != nil {
411398
exit.Error(err)
412399
}
@@ -532,11 +519,20 @@ var _clusterDownCmd = &cobra.Command{
532519
envNames, isDefaultEnv, _ := getEnvNamesByOperatorEndpoint(*loadBalancer.DNSName)
533520
if len(envNames) > 0 {
534521
for _, envName := range envNames {
535-
removeEnvFromCLIConfig(envName)
522+
err := removeEnvFromCLIConfig(envName)
523+
if err != nil {
524+
exit.Error(err)
525+
}
536526
}
537527
fmt.Printf("✓ deleted the %s environment configuration%s\n", s.StrsAnd(envNames), s.SIfPlural(len(envNames)))
538528
if isDefaultEnv {
539-
fmt.Println("✓ set the default environment to local")
529+
newDefaultEnv, err := getDefaultEnv()
530+
if err != nil {
531+
exit.Error(err)
532+
}
533+
if newDefaultEnv != nil {
534+
fmt.Println(fmt.Sprintf("✓ set the default environment to %s", *newDefaultEnv))
535+
}
540536
}
541537
}
542538
}

0 commit comments

Comments
 (0)