Skip to content

Commit f92535b

Browse files
authored
Remove unnecessary references to AWS_ACCESS_KEY_ID (#2056)
1 parent 2cccd1e commit f92535b

File tree

22 files changed

+23
-105
lines changed

22 files changed

+23
-105
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ Create `dev/config/env.sh` with the following information:
132132

133133
export AWS_ACCOUNT_ID="***" # you can find your account ID in the AWS web console; here is an example: 764403040417
134134
export AWS_REGION="***" # you can use any AWS region you'd like, e.g. "us-west-2"
135-
export AWS_ACCESS_KEY_ID="***"
136-
export AWS_SECRET_ACCESS_KEY="***"
135+
export AWS_ACCESS_KEY_ID="***" # alternatively, you can remove this to use the default credentials chain on your machine
136+
export AWS_SECRET_ACCESS_KEY="***" # alternatively, you can remove this to use the default credentials chain on your machine
137137

138138
# export NUM_BUILD_PROCS=2 # optional; can be >2 if you have enough memory
139139
```

cli/cmd/cluster.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,12 +742,8 @@ func printInfoOperatorResponse(clusterConfig clusterconfig.Config, operatorEndpo
742742
}
743743
infoResponse.ClusterConfig.Config = clusterConfig
744744

745-
fmt.Println(console.Bold("metadata:"))
746-
fmt.Println(fmt.Sprintf("aws access key id: %s", infoResponse.MaskedAWSAccessKeyID))
747-
fmt.Println(fmt.Sprintf("%s: %s", clusterconfig.APIVersionUserKey, infoResponse.ClusterConfig.APIVersion))
748-
749-
fmt.Println()
750745
fmt.Println(console.Bold("cluster config:"))
746+
fmt.Println(fmt.Sprintf("%s: %s", clusterconfig.APIVersionUserKey, infoResponse.ClusterConfig.APIVersion))
751747
fmt.Print(yamlString)
752748

753749
printInfoPricing(infoResponse, clusterConfig)

cli/types/cliconfig/config_key.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ const (
2121
DefaultEnvironmentKey = "default_environment"
2222
NameKey = "name"
2323
OperatorEndpointKey = "operator_endpoint"
24-
AWSAccessKeyIDKey = "aws_access_key_id"
25-
AWSSecretAccessKeyKey = "aws_secret_access_key"
2624
)

dev/operator_local.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)"
6464
eval $(python3 $ROOT/manager/cluster_config_env.py "$ROOT/dev/config/cluster.yaml")
6565

6666
export CORTEX_DEV_DEFAULT_IMAGE_REGISTRY="$CORTEX_DEV_DEFAULT_IMAGE_REGISTRY"
67-
export CLUSTER_AWS_ACCESS_KEY_ID="${CLUSTER_AWS_ACCESS_KEY_ID:-$AWS_ACCESS_KEY_ID}"
68-
export CLUSTER_AWS_SECRET_ACCESS_KEY="${CLUSTER_AWS_SECRET_ACCESS_KEY:-$AWS_SECRET_ACCESS_KEY}"
6967

7068
python3 $ROOT/dev/update_cli_config.py "$HOME/.cortex/cli.yaml" "${CORTEX_CLUSTER_NAME}" "http://localhost:8888"
7169

docs/clusters/management/auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AWS credentials required to authenticate cortex client requests to the operator
1616

1717
### Cluster management
1818

19-
It is recommended that your AWS credentials have AdminstratorAccess before running `cortex cluster *` commands.
19+
It is recommended that your AWS credentials have AdministratorAccess before running `cortex cluster *` commands.
2020

2121
After spinning up a cluster using `cortex cluster up`, the IAM entity user or role that created the cluster is automatically granted `system:masters` permission to the cluster's RBAC. Make sure to keep track of which IAM entity originally created the cluster.
2222

docs/clusters/management/delete.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ Prometheus volume are not automatically deleted when running `cortex cluster dow
1212
To delete them:
1313

1414
```bash
15-
# set AWS credentials
16-
export AWS_ACCESS_KEY_ID=***
17-
export AWS_SECRET_ACCESS_KEY=***
18-
1915
# identify the name of your cortex S3 bucket
2016
aws s3 ls
2117

docs/workloads/async/example.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ labels = ["setosa", "versicolor", "virginica"]
3737

3838
class PythonPredictor:
3939
def __init__(self, config):
40-
if os.environ.get("AWS_ACCESS_KEY_ID"):
41-
s3 = boto3.client("s3") # client will use your credentials if available
42-
else:
43-
s3 = boto3.client("s3", config=Config(signature_version=UNSIGNED)) # anonymous client
44-
40+
s3 = boto3.client("s3")
4541
s3.download_file(config["bucket"], config["key"], "/tmp/model.pkl")
4642
self.model = pickle.load(open("/tmp/model.pkl", "rb"))
4743

@@ -59,7 +55,7 @@ class PythonPredictor:
5955
return {"label": labels[label_id]}
6056
```
6157

62-
```
58+
```python
6359
# requirements.txt
6460

6561
boto3

docs/workloads/dependencies/images.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ For example, to use ECR, first create a repository to store your image:
7575
# We create a repository in ECR
7676

7777
export AWS_REGION="***"
78-
export AWS_ACCESS_KEY_ID="***"
79-
export AWS_SECRET_ACCESS_KEY="***"
8078
export REGISTRY_URL="***" # this will be in the format "<aws_account_id>.dkr.ecr.<aws_region>.amazonaws.com"
8179

8280
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $REGISTRY_URL

manager/install.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function cluster_up() {
3838

3939
echo -n "○ updating cluster configuration "
4040
setup_configmap
41-
setup_secrets
4241
echo ""
4342

4443
echo -n "○ configuring networking (this might take a few minutes) "
@@ -93,7 +92,6 @@ function cluster_configure() {
9392

9493
echo -n "○ updating cluster configuration "
9594
setup_configmap
96-
setup_secrets
9795
echo ""
9896

9997
# this is necessary since max_instances may have been updated
@@ -218,13 +216,6 @@ function setup_configmap() {
218216
-o yaml --dry-run=client | kubectl apply -f - >/dev/null
219217
}
220218

221-
function setup_secrets() {
222-
kubectl -n=default create secret generic 'aws-credentials' \
223-
--from-literal='AWS_ACCESS_KEY_ID'=$CLUSTER_AWS_ACCESS_KEY_ID \
224-
--from-literal='AWS_SECRET_ACCESS_KEY'=$CLUSTER_AWS_SECRET_ACCESS_KEY \
225-
-o yaml --dry-run=client | kubectl apply -f - >/dev/null
226-
}
227-
228219
function setup_prometheus() {
229220
envsubst < manifests/prometheus-operator.yaml | kubectl apply -f - >/dev/null
230221
envsubst < manifests/prometheus-statsd-exporter.yaml | kubectl apply -f - >/dev/null

pkg/operator/endpoints/info.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ package endpoints
1818

1919
import (
2020
"net/http"
21-
"os"
2221
"sort"
2322
"strings"
2423

2524
"github.com/cortexlabs/cortex/pkg/lib/aws"
2625
"github.com/cortexlabs/cortex/pkg/lib/k8s"
27-
s "github.com/cortexlabs/cortex/pkg/lib/strings"
2826
"github.com/cortexlabs/cortex/pkg/operator/config"
2927
"github.com/cortexlabs/cortex/pkg/operator/schema"
3028
"github.com/cortexlabs/cortex/pkg/types/clusterconfig"
@@ -49,10 +47,9 @@ func Info(w http.ResponseWriter, r *http.Request) {
4947
}
5048

5149
response := schema.InfoResponse{
52-
MaskedAWSAccessKeyID: s.MaskString(os.Getenv("AWS_ACCESS_KEY_ID"), 4),
53-
ClusterConfig: fullClusterConfig,
54-
NodeInfos: nodeInfos,
55-
NumPendingReplicas: numPendingReplicas,
50+
ClusterConfig: fullClusterConfig,
51+
NodeInfos: nodeInfos,
52+
NumPendingReplicas: numPendingReplicas,
5653
}
5754
respond(w, response)
5855
}

0 commit comments

Comments
 (0)