2020-05-18 22:24:05 +08:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
language: cpp
|
2020-08-18 17:55:14 +08:00
|
|
|
os:
|
|
|
|
- linux
|
2020-05-18 22:24:05 +08:00
|
|
|
dist: bionic
|
2020-05-30 05:22:13 +08:00
|
|
|
arch:
|
|
|
|
- s390x
|
|
|
|
- ppc64le
|
|
|
|
- amd64
|
2020-08-18 08:59:50 +08:00
|
|
|
env:
|
|
|
|
- NIGHTLY=true
|
|
|
|
- NIGHTLY=false
|
2020-09-09 23:12:01 +08:00
|
|
|
# Do not test branch update unless it's mater.
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
stages:
|
|
|
|
- name: prereq-init
|
|
|
|
- name: prereq-0
|
|
|
|
- name: prereq-1
|
|
|
|
- name: prereq-2
|
|
|
|
- name: prereq-final
|
|
|
|
- name: test
|
2020-05-30 05:22:13 +08:00
|
|
|
script:
|
2020-08-18 08:59:50 +08:00
|
|
|
- export CPU_ARCH=$TRAVIS_CPU_ARCH
|
|
|
|
- if [ "$CPU_ARCH" == "amd64" ] ; then
|
|
|
|
export CPU_ARCH="x86";
|
|
|
|
fi
|
|
|
|
- echo "CPU Architecture is " $CPU_ARCH
|
2020-05-30 05:22:13 +08:00
|
|
|
- echo "commit is " $TRAVIS_COMMIT
|
|
|
|
- df -h
|
2020-08-18 08:59:50 +08:00
|
|
|
- if [ "$NIGHTLY" = true ] ; then
|
|
|
|
echo "Using nightly llvm-mlir image, build may fail.";
|
|
|
|
docker build --tag onnx-mlir-build:initial --build-arg BASE="onnxmlirczar/onnx-mlir-llvmimage:${CPU_ARCH}-nightly" -f ./docker/$CPU_ARCH.Dockerfile ./docker;
|
|
|
|
else
|
|
|
|
echo "Using latest compatible llvm-mlir image, build should not fail.";
|
|
|
|
docker build --tag onnx-mlir-build:initial --build-arg BASE="onnxmlirczar/onnx-mlir-llvmimage:$CPU_ARCH" -f ./docker/$CPU_ARCH.Dockerfile ./docker;
|
|
|
|
fi
|
2020-05-21 22:41:00 +08:00
|
|
|
- docker run -itd --name build onnx-mlir-build:initial
|
2020-05-30 05:22:13 +08:00
|
|
|
- echo "docker is running now"
|
|
|
|
- df -h
|
2020-05-21 22:41:00 +08:00
|
|
|
- docker cp $(pwd) build:/build/onnx-mlir
|
2020-05-18 22:24:05 +08:00
|
|
|
- cd docker
|
2020-08-18 20:41:19 +08:00
|
|
|
- chmod a+x compile-onnx-mlir.sh test-onnx-mlir.sh
|
2020-05-21 22:41:00 +08:00
|
|
|
- docker cp compile-onnx-mlir.sh build:/usr/bin/compile-onnx-mlir.sh
|
2020-08-18 20:41:19 +08:00
|
|
|
- docker cp test-onnx-mlir.sh build:/usr/bin/test-onnx-mlir.sh
|
2020-05-30 05:22:13 +08:00
|
|
|
- echo "about to execute build inside docker"
|
|
|
|
- docker exec build df -h
|
|
|
|
- docker exec build compile-onnx-mlir.sh
|
2020-08-18 20:41:19 +08:00
|
|
|
- docker exec build test-onnx-mlir.sh
|
2020-08-18 08:59:50 +08:00
|
|
|
- docker commit build onnxmlirczar/onnx-mlir-build:$CPU_ARCH
|
2020-09-20 21:12:49 +08:00
|
|
|
|
2020-09-09 23:12:01 +08:00
|
|
|
jobs:
|
2020-09-20 21:12:49 +08:00
|
|
|
fast_finish: true
|
2020-09-09 23:12:01 +08:00
|
|
|
allow_failures:
|
|
|
|
- env: NIGHTLY=true
|
2020-09-20 21:12:49 +08:00
|
|
|
- arch: ppc64le
|
2020-09-09 23:12:01 +08:00
|
|
|
include:
|
|
|
|
##########################################################################################
|
|
|
|
#
|
|
|
|
# Incrementally build s390 prereq docker images through 5 time-constrained steps.
|
|
|
|
#
|
|
|
|
##########################################################################################
|
|
|
|
- stage: prereq-init
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- s390x
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:s390x -f docker/prereq.s390x.Dockerfile --build-arg BASE_IMAGE="ubuntu:focal" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:s390x
|
|
|
|
- stage: prereq-0
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- s390x
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:s390x -f docker/prereq.s390x.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:s390x" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:s390x
|
|
|
|
- stage: prereq-1
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- s390x
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:s390x -f docker/prereq.s390x.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:s390x" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:s390x
|
|
|
|
- stage: prereq-2
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- s390x
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:s390x -f docker/prereq.s390x.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:s390x" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:s390x
|
|
|
|
- stage: prereq-final
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- s390x
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage:s390x -f docker/prereq.s390x.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:s390x" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage:s390x
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
#
|
|
|
|
# Incrementally build ppc64le prereq docker images through 5 time-constrained steps.
|
|
|
|
#
|
|
|
|
##########################################################################################
|
|
|
|
- stage: prereq-init
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- ppc64le
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le -f docker/prereq.ppc64le.Dockerfile --build-arg BASE_IMAGE="ubuntu:bionic" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le
|
|
|
|
- stage: prereq-0
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- ppc64le
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le -f docker/prereq.ppc64le.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le
|
|
|
|
- stage: prereq-1
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- ppc64le
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le -f docker/prereq.ppc64le.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le
|
|
|
|
- stage: prereq-2
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- ppc64le
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le -f docker/prereq.ppc64le.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le
|
|
|
|
- stage: prereq-final
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- ppc64le
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage:ppc64le -f docker/prereq.ppc64le.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:ppc64le" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage:ppc64le
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
#
|
|
|
|
# Incrementally build amd64 prereq docker images through 5 time-constrained steps.
|
|
|
|
#
|
|
|
|
##########################################################################################
|
|
|
|
- stage: prereq-init
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- amd64
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:x86 -f docker/prereq.amd64.Dockerfile --build-arg BASE_IMAGE="ubuntu:focal" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:x86
|
|
|
|
- stage: prereq-0
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- amd64
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:x86 -f docker/prereq.amd64.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:x86" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:x86
|
|
|
|
- stage: prereq-1
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- amd64
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:x86 -f docker/prereq.amd64.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:x86" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:x86
|
|
|
|
- stage: prereq-2
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- amd64
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage-partial:x86 -f docker/prereq.amd64.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:x86" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage-partial:x86
|
|
|
|
- stage: prereq-final
|
|
|
|
if: commit_message = "Rebuild prereq docker."
|
|
|
|
arch:
|
|
|
|
- amd64
|
|
|
|
script:
|
|
|
|
- docker build -t onnxmlirczar/onnx-mlir-llvmimage:x86 -f docker/prereq.amd64.Dockerfile --build-arg BASE_IMAGE="onnxmlirczar/onnx-mlir-llvmimage-partial:x86" ./utils
|
|
|
|
- docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"
|
|
|
|
- docker push onnxmlirczar/onnx-mlir-llvmimage:x86
|
|
|
|
after_success:
|
2020-08-18 08:59:50 +08:00
|
|
|
- if [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_BRANCH == "master" ] && [ $NIGHTLY == false ]; then
|
2020-05-21 22:41:00 +08:00
|
|
|
echo "Pushing new build to docker hub";
|
2020-07-25 01:31:43 +08:00
|
|
|
docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN";
|
2020-08-18 08:59:50 +08:00
|
|
|
docker push onnxmlirczar/onnx-mlir-build:$CPU_ARCH;
|
2020-09-09 23:12:01 +08:00
|
|
|
else
|
|
|
|
echo "Skip pushing build";
|
2020-05-21 22:41:00 +08:00
|
|
|
fi
|