Skip to content

Commit 88c6dac

Browse files
authored
Update canary dependencies and fix inference component test (#340)
Issue #, if available: Description of changes: By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent f366646 commit 88c6dac

File tree

6 files changed

+58
-42
lines changed

6 files changed

+58
-42
lines changed

test/canary/Dockerfile.canary

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,53 @@
1-
FROM public.ecr.aws/ubuntu/ubuntu:18.04
1+
FROM public.ecr.aws/ubuntu/ubuntu:22.04
22

3-
# Build time parameters
3+
# Build time parameters
44
ARG SERVICE=sagemaker
55

6+
# Python parameters
7+
ARG PYTHON=python3
8+
ARG PYTHON_VERSION=3.12.8
9+
ARG PYTHON_SHORT_VERSION=3.12
10+
# Python won’t try to write .pyc or .pyo files on the import of source modules
11+
# Force stdin, stdout and stderr to be totally unbuffered. Good for logging
12+
ENV PYTHONDONTWRITEBYTECODE=1
13+
ENV PYTHONUNBUFFERED=1
14+
ENV PYTHONIOENCODING=UTF-8
15+
616
RUN apt-get update && apt-get install -y curl \
717
wget \
818
git \
9-
python3.8 \
10-
python3-pip \
11-
python3.8-dev \
1219
vim \
1320
sudo \
1421
jq \
15-
unzip
22+
unzip \
23+
zlib1g-dev \
24+
cmake \
25+
libssl-dev
26+
27+
# Install python
28+
RUN cd /tmp/ \
29+
&& wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
30+
&& tar xzf Python-${PYTHON_VERSION}.tgz \
31+
&& cd Python-${PYTHON_VERSION} \
32+
&& ./configure --enable-optimizations --with-lto --with-computed-gotos --with-system-ffi \
33+
&& make -j "$(nproc)" \
34+
&& make altinstall \
35+
&& cd .. \
36+
&& rm -rf Python-${PYTHON_VERSION} \
37+
&& rm Python-${PYTHON_VERSION}.tgz \
38+
&& ln -s /usr/local/bin/python${PYTHON_SHORT_VERSION} /usr/local/bin/python \
39+
&& ln -s /usr/local/bin/python${PYTHON_SHORT_VERSION} /usr/local/bin/python3 \
40+
&& rm -f /root/.python_history
41+
42+
# Python Path
43+
ENV PATH="/usr/local/bin:${PATH}"
44+
45+
RUN python -m pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org
46+
RUN pip install --no-cache-dir \
47+
setuptools
1648

1749
# Install awscli
18-
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.6.3.zip" -o "awscliv2.zip" \
50+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
1951
&& unzip -qq awscliv2.zip \
2052
&& ./aws/install
2153

@@ -25,26 +57,23 @@ RUN apt-get update && apt install -y software-properties-common \
2557
&& apt update && apt install -y yq
2658

2759
# Install kubectl
28-
RUN curl -LO "https://dl.k8s.io/release/v1.24.0/bin/linux/amd64/kubectl" \
60+
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
2961
&& chmod +x ./kubectl \
3062
&& cp ./kubectl /bin
3163

3264
# Install eksctl
3365
RUN curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp && mv /tmp/eksctl /bin
3466

35-
# Install Helm
36-
RUN curl -q -L "https://get.helm.sh/helm-v3.7.0-linux-amd64.tar.gz" | tar zxf - -C /usr/local/bin/ \
67+
# Install Helm
68+
RUN curl -q -L "https://get.helm.sh/helm-v4.0.0-linux-amd64.tar.gz" | tar zxf - -C /usr/local/bin/ \
3769
&& mv /usr/local/bin/linux-amd64/helm /usr/local/bin/helm \
3870
&& rm -r /usr/local/bin/linux-amd64 \
39-
&& chmod +x /usr/local/bin/helm
71+
&& chmod +x /usr/local/bin/helm
4072

4173
ENV SERVICE_REPO_PATH=/$SERVICE-controller
4274
COPY ./test/e2e/requirements.txt requirements.txt
4375

44-
RUN ln -s /usr/bin/python3.8 /usr/bin/python \
45-
&& python -m pip install --upgrade pip
46-
4776
RUN python -m pip install -r requirements.txt
4877

4978
WORKDIR /$SERVICE_REPO_PATH
50-
CMD ["./test/canary/scripts/run_test.sh"]
79+
CMD ["./test/canary/scripts/run_test.sh"]

test/canary/canary.buildspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ phases:
1919
commands:
2020
# Run tests
2121
- docker run --name ack-canary $(env | cut -f1 -d= | sed 's/^/-e /') --mount type=bind,source="$(pwd)/",target="/${SERVICE}-controller/" ${ECR_CACHE_URI}:latest
22-
22+
2323
post_build:
2424
commands:
2525
- docker cp ack-canary:/sagemaker-controller/test/canary/integration_tests.xml /tmp/results.xml || true
2626
# Push test image to cache ECR repo
2727
- docker push ${ECR_CACHE_URI}:latest || true
28-
28+
2929
reports:
3030
IntegrationTestReport:
3131
files:
3232
- "results.xml"
33-
base-directory: "/tmp"
33+
base-directory: "/tmp"

test/canary/scripts/install_controller_helm.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ function install_helm_chart() {
88
local region="$3"
99
local namespace="$4"
1010

11-
yq w -i helm/values.yaml "serviceAccount.annotations" ""
12-
yq w -i helm/values.yaml 'serviceAccount.annotations."eks.amazonaws.com/role-arn"' "$oidc_role_arn"
13-
yq w -i helm/values.yaml "aws.region" $region
14-
yq w -i helm/values.yaml "log.level" "debug"
15-
yq w -i helm/values.yaml "log.enable_development_logging" "true"
16-
11+
yq eval ".serviceAccount.annotations = {}" -i helm/values.yaml
12+
yq eval ".serviceAccount.annotations.\"eks.amazonaws.com/role-arn\" = \"$oidc_role_arn\"" -i helm/values.yaml
13+
yq eval ".aws.region = \"$region\"" -i helm/values.yaml
14+
yq eval '.log.level = "debug"' -i helm/values.yaml
15+
yq eval '.log.enable_development_logging = true' -i helm/values.yaml
1716

1817
kubectl apply -f helm/crds
1918
helm install -n $namespace --create-namespace ack-$service-controller --skip-crds helm
20-
}
19+
}

test/canary/scripts/run_test.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# cleanup on EXIT regardles of error
3+
# cleanup on EXIT regardles of error
44

55
# Inputs to this file as environment variables
66
# SERVICE
@@ -12,7 +12,7 @@
1212

1313
set -euo pipefail
1414
export NAMESPACE=${NAMESPACE:-"ack-system"}
15-
export AWS_DEFAULT_REGION=$SERVICE_REGION
15+
export AWS_DEFAULT_REGION=$SERVICE_REGION
1616
export E2E_DIR=$SERVICE_REPO_PATH/test/e2e/
1717
SCRIPTS_DIR=${SERVICE_REPO_PATH}/test/canary/scripts
1818

@@ -47,7 +47,6 @@ function cleanup {
4747
kubectl delete modelbiasjobdefinitions --all
4848
kubectl delete modelexplainabilityjobdefinitions --all
4949
kubectl delete modelqualityjobdefinitions --all
50-
kubectl delete adoptedresources --all
5150
kubectl delete featuregroups --all
5251
kubectl delete modelpackages --all
5352
kubectl delete modelpackagegroups --all
@@ -65,7 +64,7 @@ function cleanup {
6564
kubectl delete namespace $NAMESPACE
6665

6766
cd $E2E_DIR
68-
export PYTHONPATH=..
67+
export PYTHONPATH=..
6968
python service_cleanup.py
7069

7170
}

test/e2e/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
acktest @ git+https://github.com/aws-controllers-k8s/test-infra.git@c91073f388b3b42192aac300762fca2542fa39f0
1+
acktest @ git+https://github.com/aws-controllers-k8s/test-infra.git@b9fd0d31598f7cc9e2952d9513501c6c2464b059
22
pytest==8.0.2
3-
black==20.8b1
3+
black>=24.3.0
44
flaky==3.7.0

test/e2e/tests/test_inference_component.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,6 @@ def update_inference_component_failed_test(self, inference_component, faulty_mod
248248
resource = k8s.wait_resource_consumed_by_controller(reference)
249249
assert resource is not None
250250

251-
# inference component transitions Updating -> InService state
252-
assert_inference_component_status_in_sync(
253-
reference.name,
254-
reference,
255-
cfg.INFERENCE_COMPONENT_STATUS_UPDATING,
256-
)
257-
258-
assert k8s.wait_on_condition(
259-
reference, ack_condition.CONDITION_TYPE_RESOURCE_SYNCED, "False"
260-
)
261-
assert k8s.get_resource_condition(reference, ack_condition.CONDITION_TYPE_TERMINAL) is None
262251
resource = k8s.get_resource(reference)
263252

264253
assert_inference_component_status_in_sync(

0 commit comments

Comments
 (0)