Skip to content

Commit 6a68963

Browse files
authored
Helm install updates, fix PR build (#39)
- Adds mandatory account_id parameter to helm charts - Fixes to documentation - Enable PR build. We can fix the failing tests in a different PR. Lets have the tests running for all PRs ### Testing Manual
1 parent 749c5cb commit 6a68963

File tree

4 files changed

+27
-19
lines changed

4 files changed

+27
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ kubectl apply -f $CHART_EXPORT_PATH/ack-$SERVICE-controller/crds
186186
Create a namespace and install the helm chart
187187
```sh
188188
export ACK_K8S_NAMESPACE=ack-system
189-
helm install -n $ACK_K8S_NAMESPACE --create-namespace $ACK_K8S_NAMESPACE --skip-crds ack-$SERVICE-controller \
189+
helm install -n $ACK_K8S_NAMESPACE --create-namespace --skip-crds ack-$SERVICE-controller \
190190
$CHART_EXPORT_PATH/ack-$SERVICE-controller
191191
```
192192

samples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Follow the instructions on our [installation page](/README.md#getting-started) t
99
Run the following commands to create a SageMaker execution IAM role which is used by SageMaker service to access AWS resources.
1010

1111
```
12-
export SAGEMAKER_EXECUTION_ROLE_NAME=ack-sagemaker-execution-role-$CLUSTER_NAME
12+
export SAGEMAKER_EXECUTION_ROLE_NAME=ack-sagemaker-execution-role
1313
1414
TRUST="{ \"Version\": \"2012-10-17\", \"Statement\": [ { \"Effect\": \"Allow\", \"Principal\": { \"Service\": \"sagemaker.amazonaws.com\" }, \"Action\": \"sts:AssumeRole\" } ] }"
1515
aws iam create-role --role-name ${SAGEMAKER_EXECUTION_ROLE_NAME} --assume-role-policy-document "$TRUST"

test/canary/scripts/install_controller_helm.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ function install_helm_chart() {
77
local oidc_role_arn="$2"
88
local region="$3"
99
local namespace="$4"
10+
local account_id=$(aws sts get-caller-identity --output text --query "Account")
1011

1112
yq w -i helm/values.yaml "serviceAccount.annotations" ""
1213
yq w -i helm/values.yaml 'serviceAccount.annotations."eks.amazonaws.com/role-arn"' "$oidc_role_arn"
1314
yq w -i helm/values.yaml "aws.region" $region
15+
yq w -i helm/values.yaml "aws.account_id" $account_id
1416

1517
kubectl create namespace $namespace
1618
kubectl apply -f helm/crds

test/e2e/service_bootstrap.py

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,29 @@ def create_data_bucket() -> str:
9090
source_bucket = s3_resource.Bucket(SAGEMAKER_SOURCE_DATA_BUCKET)
9191
destination_bucket = s3_resource.Bucket(bucket_name)
9292
temp_dir = "/tmp/ack_s3_data"
93-
# duplicate_bucket_contents(source_bucket, destination_bucket)
94-
# workaround to copy if buckets are across regions
95-
# TODO: check if there is a better way and merge to test-infra
96-
subprocess.call(["mkdir", f"{temp_dir}"])
97-
subprocess.call(
98-
[
99-
"aws",
100-
"s3",
101-
"sync",
102-
f"s3://{SAGEMAKER_SOURCE_DATA_BUCKET}",
103-
f"./{temp_dir}/",
104-
"--quiet",
105-
]
106-
)
107-
subprocess.call(
108-
["aws", "s3", "sync", f"./{temp_dir}/", f"s3://{bucket_name}", "--quiet"]
109-
)
93+
# awscli is not installed in test-infra container hence use boto3 to copy in us-west-2
94+
if region == "us-west-2":
95+
duplicate_bucket_contents(source_bucket, destination_bucket)
96+
# above method does an async copy
97+
# TODO: find a way to remove random wait
98+
time.sleep(180)
99+
else:
100+
# workaround to copy if buckets are across regions
101+
# TODO: check if there is a better way and merge to test-infra
102+
subprocess.call(["mkdir", f"{temp_dir}"])
103+
subprocess.call(
104+
[
105+
"aws",
106+
"s3",
107+
"sync",
108+
f"s3://{SAGEMAKER_SOURCE_DATA_BUCKET}",
109+
f"./{temp_dir}/",
110+
"--quiet",
111+
]
112+
)
113+
subprocess.call(
114+
["aws", "s3", "sync", f"./{temp_dir}/", f"s3://{bucket_name}", "--quiet"]
115+
)
110116

111117
logging.info(f"Synced data bucket")
112118

0 commit comments

Comments
 (0)