Fix travis build (#142)

* mount clone in container

Mount the clone that travis created inside the docker container so we get the correct set of commits for this build

* Update Dockerfile

* start with docker file

* change docker run to exec

used wrong docker command in a bunch of places

* fix docker commands

* Update compile-onnx-mlir.sh

* Update .travis.yml

* save build result

* commit the built container

* copy clone rather than mount

Copy the files that travis cloned since using -v $(pwd):/onnx-mlir to mount them as a volume doesn't persist when we push the image to docker hub.

* move 'cd docker' later

* fix location for Dockerfile

* Update .travis.yml

* Update compile-onnx-mlir.sh

* fix mount directory

* conditional push of build

* remove old docker push

forgot to do this previously

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
This commit is contained in:
Kevin O'Brien 2020-05-21 10:41:00 -04:00 committed by GitHub
parent a270af5ce0
commit df18efcb48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 16 deletions

View File

@ -3,8 +3,20 @@ services:
- docker
language: cpp
dist: bionic
script:
script:
- docker build --tag onnx-mlir-build:initial ./docker
- docker run -itd --name build onnx-mlir-build:initial
- docker cp $(pwd) build:/build/onnx-mlir
- cd docker
- chmod a+x compile-onnx-mlir.sh
- docker build --tag onnx-mlir-build:initial .
- docker cp compile-onnx-mlir.sh build:/usr/bin/compile-onnx-mlir.sh
- docker exec -it build compile-onnx-mlir.sh
- docker commit build onnxmlirczar/onnx-mlir-build:latest
after_success:
- if [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_BRANCH == "master" ]; then
echo "Pushing new build to docker hub";
docker login -u onnxmlirczar -p 143f1da2-332f-45a1-8587-d6cb07c13230;
docker push onnxmlirczar/onnx-mlir-build:latest;
else
echo "Skip pushing build";
fi

View File

@ -10,9 +10,3 @@ RUN pyenv global 3.7.0
RUN pyenv rehash
ENV PATH=$PATH:/build/bin
RUN git clone --recursive https://github.com/onnx/onnx-mlir.git
COPY compile-onnx-mlir.sh bin/compile-onnx-mlir.sh
RUN compile-onnx-mlir.sh
WORKDIR /build/onnx-mlir/build
ENV LIT_OPT=v
RUN cmake --build . --target check-onnx-lit

View File

@ -1,13 +1,14 @@
#!/bin/bash
# Export environment variables pointing to LLVM-Projects
# Export environment variables pointing to LLVM-Projects.
export LLVM_PROJ_SRC=$(pwd)/llvm-project/
export LLVM_PROJ_BUILD=$(pwd)/llvm-project/build
HOME=/
PYENV_ROOT=$HOME/.pyenv
PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
eval "$(pyenv init -)"
# use python 3
pyenv shell 3.7.0
pwd
ls -al
mkdir onnx-mlir/build && cd onnx-mlir/build
cmake ..
cmake --build . --target onnx-mlir
# Run FileCheck tests:
export LIT_OPTS=-v
cmake --build . --target check-onnx-lit