/
buildspec_tensorflow_2_5.yml
60 lines (56 loc) · 3.16 KB
/
buildspec_tensorflow_2_5.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Build Spec for AWS CodeBuild CI TF 2.5.0 CPU and GPU Containers
# Target Containers:
# CPU Container: 763104351884.dkr.ecr.us-east-1.amazonaws.com/tensorflow-training:2.5.0-cpu-py37-ubuntu18.04
# GPU Container: 763104351884.dkr.ecr.us-east-1.amazonaws.com/tensorflow-training:2.5.0-gpu-py37-cu112-ubuntu18.04
version: 0.2
env:
variables:
run_pytest_pytorch: "disable"
run_pytest_mxnet: "disable"
run_pytest_tensorflow: "disable"
run_pytest_tensorflow2: "enable"
run_pytest_xgboost: "disable"
run_pytest_profiler: "enable"
run_integration_pytest_pytorch: "disable"
run_integration_pytest_mxnet: "disable"
run_integration_pytest_tensorflow: "disable"
run_integration_pytest_tensorflow2: "enable"
run_integration_pytest_xgboost: "disable"
# below needs to be enabled
zero_code_change_test: "enable"
# set code coverage flag
code_coverage_smdebug: "true"
build_type: "pr" # must be one of pr, nightly or release
phases:
install:
commands:
- . config/change_branch.sh
- su && apt-get update
- apt-get install sudo -qq -o=Dpkg::Use-Pty=0 # silence output: https://askubuntu.com/a/668859/724247
- sudo apt-get update -qq -o=Dpkg::Use-Pty=0
- sudo apt-get install unzip -qq -o=Dpkg::Use-Pty=0
- pip install --upgrade pip==22.0.3
- pip install -q matplotlib==3.3.1 seaborn==0.10.1 nbconvert==5.6.1 papermill==2.3.4 flaky==3.7.0 beautifulsoup4==4.8.2 jupyter==1.0.0 scipy==1.5.2 scikit-learn==0.23.2 bokeh==2.2.3 simplejson==3.17.2 transformers==4.2.1 tensorflow_datasets==4.0.1
- pip install -q pytest wheel pytest-html pre-commit awscli pytest-cov
pre_build:
commands:
- cd $CODEBUILD_SRC_DIR
build:
commands:
- cd $CODEBUILD_SRC_DIR && python setup.py bdist_wheel --universal
# We do not need to force install smdebug-rules. The container used for PR builds do not have smdebug rules binary.
# Force installing rules binary attempts to re-install ipython-genutils which fails on PyTorch Ubuntu 16.04 containers.
- cd $RULES_CODEBUILD_SRC_DIR && python setup.py bdist_wheel --universal
- cd $CODEBUILD_SRC_DIR && pip install --force-reinstall dist/*.whl && cd ..
- cd $CODEBUILD_SRC_DIR && chmod +x config/tests.sh && PYTHONPATH=. && ./config/tests.sh && mkdir -p upload/$CURRENT_COMMIT_PATH/wheels && cp ./dist/*.whl upload/$CURRENT_COMMIT_PATH/wheels && cd ..
- pip show smdebug
- echo 'Uploading Coverage to CodeCov'
- bash $CODEBUILD_SRC_DIR/config/codecov.sh
- if [ "$build_type" != "pr" ]; then cd $RULES_CODEBUILD_SRC_DIR && chmod +x config/tests.sh && PYTHONPATH=. && mkdir -p upload/$CURRENT_COMMIT_PATH/wheels && ./config/tests.sh && cp ./dist/*.whl upload/$CURRENT_COMMIT_PATH/wheels && cd ..; fi
post_build:
commands:
- . $CODEBUILD_SRC_DIR/config/upload_on_end.sh
- rm -rf $CODEBUILD_SRC_DIR/upload/$CURRENT_COMMIT_PATH
- rm -rf $RULES_CODEBUILD_SRC_DIR/upload/$CURRENT_COMMIT_PATH
- if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 0 ]; then echo "ERROR BUILD FAILED " && exit 1 ; fi
- if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 1 ]; then echo "INFO BUILD SUCCEEDED !!! " ; fi