From 30a9070c8d3ff528472117fd07264b0edd88f985 Mon Sep 17 00:00:00 2001 From: Kevin O'Brien Date: Mon, 18 May 2020 10:24:05 -0400 Subject: [PATCH] Add TravisCI build using docker (#130) * Create befor_install.sh * Create install_deps.sh * Create build_onnx_mlir.sh * Create .travis.yml * Update .travis.yml * Delete befor_install.sh * Create before_install.sh * Create .travis.yml * Update before_install.sh * Delete .travis.yml * Update install_deps.sh * Update build_onnx_mlir.sh * Update build_onnx_mlir.sh * Update .travis.yml * Update before_install.sh * Update .travis.yml * Create install_LLVM.sh * Create compile_LLVM.sh * Create compile_ONNX-MLIR.sh * Create test_ONNX-MLIR.sh * try to start travis * fix indentation in .travis.yml * add debug code to second job * Update .travis.yml * Update .travis.yml * add workspaces to travis script * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update compile_LLVM.sh * Update compile_LLVM.sh * Update .travis.yml * Update install_LLVM.sh * Update compile_LLVM.sh * Update .travis.yml * Create Dockerfile * Create compile-onnx-mlir.sh * Update .travis.yml * Delete before_install.sh * Delete build_onnx_mlir.sh * Delete compile_LLVM.sh * Delete install_LLVM.sh * Delete install_deps.sh * Delete test_ONNX-MLIR.sh * Delete compile_ONNX-MLIR.sh Co-authored-by: Gheorghe-Teodor Bercea --- .travis.yml | 10 ++++++++++ docker/Dockerfile | 17 +++++++++++++++++ docker/compile-onnx-mlir.sh | 13 +++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 .travis.yml create mode 100644 docker/Dockerfile create mode 100644 docker/compile-onnx-mlir.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fff1313 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +sudo: required +services: + - docker +language: cpp +dist: bionic +script: + - cd docker + - chmod a+x compile-onnx-mlir.sh + - docker build --tag onnx-mlir-build:initial . + diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..aa0ec97 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,17 @@ +FROM caoimhinuibrian/onnx-mlir-llvmimage:initial + +WORKDIR /build +ENV HOME=/build +ENV PYENV_ROOT=$HOME/.pyenv +ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH +RUN pyenv global 3.7.0 +RUN pyenv rehash + +RUN mkdir bin +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 diff --git a/docker/compile-onnx-mlir.sh b/docker/compile-onnx-mlir.sh new file mode 100644 index 0000000..c847e09 --- /dev/null +++ b/docker/compile-onnx-mlir.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# 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 +mkdir onnx-mlir/build && cd onnx-mlir/build +cmake .. +cmake --build . --target onnx-mlir