Skip to content

Commit 8600e2a

Browse files
authored
Merge pull request #132 from aws/aarch64_test
Adding multi arch buildspec for Codebuild setup
2 parents 5d57731 + 19dfdcb commit 8600e2a

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed

ci/buildspec_arm.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
FRAMEWORK_VERSION: "1.0-1"
6+
7+
phases:
8+
install:
9+
runtime-versions:
10+
docker: 19
11+
python: 3.8
12+
pre_build:
13+
commands:
14+
- echo Logging in to Amazon ECR...
15+
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
16+
- echo Installing dependencies...
17+
- curl -LO https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Linux-aarch64.sh
18+
- bash Miniconda3-py38_4.12.0-Linux-aarch64.sh -bfp /miniconda3
19+
- export PATH=/miniconda3/bin:${PATH}
20+
- conda install python=3.8
21+
- conda update -y conda
22+
- python3 -m pip install pip==20.1 # The new pip denpendency resolver in 20.2+ can't resolve 1.0-1 and 0.90 dependencies
23+
- python3 -m pip install .[test]
24+
build:
25+
commands:
26+
- echo Build started on `date`
27+
- echo Building the Docker image...
28+
- docker login -u $dockerhub_username -p $dockerhub_password
29+
- docker build -t sklearn-base:$FRAMEWORK_VERSION-cpu-py3-arm64 -f docker/$FRAMEWORK_VERSION/base/Dockerfile_arm.cpu .
30+
- pip install wheel setuptools
31+
- python setup.py bdist_wheel
32+
- docker build -t preprod-sklearn:$FRAMEWORK_VERSION-cpu-py3-arm64 -f docker/$FRAMEWORK_VERSION/final/Dockerfile_arm.cpu .
33+
- echo Running tox...
34+
- printf "FROM preprod-sklearn:$FRAMEWORK_VERSION-cpu-py3-arm64\nADD . /app\nWORKDIR /app\nRUN python3 -m pip install .[test]" > Dockerfile_arm.test
35+
- docker build -t test-sklearn -f Dockerfile_arm.test .
36+
- docker run --rm -t test-sklearn sh -c 'tox -e ALL'
37+
- echo Running container tests...
38+
- pytest test/integration --docker-base-name preprod-sklearn --tag $FRAMEWORK_VERSION-cpu-py3-arm64 --py-version 3 --framework-version $FRAMEWORK_VERSION
39+
- docker tag preprod-sklearn:$FRAMEWORK_VERSION-cpu-py3-arm64 515193369038.dkr.ecr.us-west-2.amazonaws.com/sagemaker-scikit-learn:$FRAMEWORK_VERSION-cpu-py3-arm64
40+
post_build:
41+
commands:
42+
- echo Build completed on `date`
43+
- echo Pushing the Docker image...
44+
- docker push 515193369038.dkr.ecr.us-west-2.amazonaws.com/sagemaker-scikit-learn:$FRAMEWORK_VERSION-cpu-py3-arm64

docker/1.0-1/final/Dockerfile_aarm64.cpu renamed to docker/1.0-1/final/Dockerfile_arm.cpu

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM sklearn-base:1.0-1-arm64-cpu-py3
1+
FROM sklearn-base:1.0-1-arm-cpu-py3
22
ENV SAGEMAKER_SKLEARN_VERSION 1.0-1
33

44
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true

test-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ python-dateutil==2.8.1
1212
PyYAML
1313
requests>=2.23.0
1414
sagemaker>=1.3.0,<2
15-
tox
15+
tox

test/resources/module/user_code.tar.gz

100755100644
File mode changed.

0 commit comments

Comments
 (0)