This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new aaa9886  [CONDA] Revamp conda recipe. (#6732)
aaa9886 is described below

commit aaa9886d83afcc59c1434a9f300115bdea61df8f
Author: Tianqi Chen <[email protected]>
AuthorDate: Fri Oct 23 20:41:10 2020 -0400

    [CONDA] Revamp conda recipe. (#6732)
    
    * [CONDA] Revamp conda recipe.
    
    - Combines two packages into a single recipe.
    - Enable windows build.
    - Better packaging hash tag (use git string).
    
    * Address comment
---
 .gitignore                                         |  2 +-
 conda/Dockerfile.template                          | 22 +-----
 conda/build_cpu.sh                                 |  4 +-
 conda/build_cuda.sh                                |  3 +-
 conda/build_win.bat                                | 18 +++++
 conda/recipe/bld.bat                               | 38 ++++++++++
 conda/{tvm-libs => recipe}/build.sh                | 44 ++++++-----
 conda/{ => recipe}/conda_build_config.yaml         |  2 +-
 conda/{ => recipe}/cross-linux.cmake               |  0
 conda/recipe/install_libtvm.bat                    | 22 ++++++
 conda/{tvm/build.sh => recipe/install_libtvm.sh}   |  5 +-
 conda/recipe/install_tvm_python.bat                | 20 +++++
 .../{tvm/build.sh => recipe/install_tvm_python.sh} |  5 +-
 conda/recipe/meta.yaml                             | 88 ++++++++++++++++++++++
 .../{render_cuda.py => render_cuda_dockerfiles.py} |  2 +-
 conda/tvm-libs/meta.yaml                           | 48 ------------
 conda/tvm/meta.yaml                                | 62 ---------------
 docker/Dockerfile.conda_cpu                        | 23 ++----
 docker/Dockerfile.conda_cuda100                    | 22 +-----
 docker/Dockerfile.conda_cuda90                     | 22 +-----
 docker/bash.sh                                     |  2 +-
 docker/build.sh                                    |  2 +-
 .../install/ubuntu_install_conda.sh                | 12 ++-
 include/tvm/parser/source_map.h                    |  2 +-
 tests/lint/add_asf_header.py                       | 20 +++++
 tests/lint/check_file_type.py                      |  1 +
 version.py                                         |  4 +-
 27 files changed, 272 insertions(+), 223 deletions(-)

diff --git a/.gitignore b/.gitignore
index 77c593c..cdcf678 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,7 +24,7 @@ var/
 *.egg-info/
 .installed.cfg
 *.egg
-
+.conda/
 # PyInstaller
 #  Usually these files are written by a python script from a template
 #  before PyInstaller builds the exe, so as to inject date/other infos into it.
diff --git a/conda/Dockerfile.template b/conda/Dockerfile.template
index 1b5dc6f..342d532 100644
--- a/conda/Dockerfile.template
+++ b/conda/Dockerfile.template
@@ -17,30 +17,16 @@
 
 FROM nvidia/cuda:{{ cuda_version }}-devel-ubuntu16.04
 
-RUN apt-get update && apt-get install -y --no-install-recommends \
-            bzip2 curl sudo binutils && \
-    rm -rf /var/lib/apt/lists/*
+RUN apt-get update --fix-missing && apt-get install -y bzip2 wget sudo 
binutils git
 
-RUN  curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v{{ 
cudnn_short_version }}/cudnn-{{ cuda_version }}-linux-x64-v{{ cudnn_version 
}}.tgz -O && \
+RUN  wget -q http://developer.download.nvidia.com/compute/redist/cudnn/v{{ 
cudnn_short_version }}/cudnn-{{ cuda_version }}-linux-x64-v{{ cudnn_version 
}}.tgz && \
     tar --no-same-owner -xzf cudnn-{{ cuda_version }}-linux-x64-v{{ 
cudnn_version }}.tgz -C /usr/local && \
     rm cudnn-{{ cuda_version }}-linux-x64-v{{ cudnn_version }}.tgz && \
     ldconfig
 
-
-RUN curl -o ~/miniconda.sh -O 
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh  && \
-     chmod +x ~/miniconda.sh && \
-     ~/miniconda.sh -b -p /opt/conda && \
-     rm ~/miniconda.sh && \
-     /opt/conda/bin/conda upgrade --all && \
-     /opt/conda/bin/conda install conda-build conda-verify && \
-     /opt/conda/bin/conda clean -ya
-
-RUN /opt/conda/bin/conda install --download-only cmake make zlib
-RUN /opt/conda/bin/conda install --download-only -c numba llvmdev=8.0.0
+COPY install/ubuntu_install_conda.sh /install/ubuntu_install_conda.sh
+RUN bash /install/ubuntu_install_conda.sh
 
 ENV PATH /opt/conda/bin:$PATH
 ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
 ENV CONDA_BLD_PATH /tmp
-
-WORKDIR /workspace
-RUN chmod -R a+w /workspace
diff --git a/conda/build_cpu.sh b/conda/build_cpu.sh
index 992b1a3..48b93b2 100755
--- a/conda/build_cpu.sh
+++ b/conda/build_cpu.sh
@@ -26,6 +26,4 @@ mkdir -p /tmp/.conda/pkgs
 touch /tmp/.conda/pkgs/urls.txt
 touch /tmp/.conda/environments.txt
 
-
-conda build --output-folder=conda/pkg -c numba conda/tvm-libs
-conda build --output-folder=conda/pkg -m conda/conda_build_config.yaml 
conda/tvm
+conda build --output-folder=conda/pkg conda/recipe
diff --git a/conda/build_cuda.sh b/conda/build_cuda.sh
index 2c9a20a..ec4a144 100755
--- a/conda/build_cuda.sh
+++ b/conda/build_cuda.sh
@@ -26,5 +26,4 @@ mkdir -p /tmp/.conda/pkgs
 touch /tmp/.conda/pkgs/urls.txt
 touch /tmp/.conda/environments.txt
 
-
-conda build --output-folder=conda/pkg --variants "{cuda: True, cuda_version: 
${CUDA_VERSION%.*}}" -c numba conda/tvm-libs
+conda build --output-folder=conda/pkg --variants "{cuda: True, cuda_version: 
${CUDA_VERSION%.*}}" conda/recipe
diff --git a/conda/build_win.bat b/conda/build_win.bat
new file mode 100644
index 0000000..59d0d07
--- /dev/null
+++ b/conda/build_win.bat
@@ -0,0 +1,18 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+::
+::   http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+conda build --output-folder=conda/pkg conda/recipe
diff --git a/conda/recipe/bld.bat b/conda/recipe/bld.bat
new file mode 100644
index 0000000..9fc0469
--- /dev/null
+++ b/conda/recipe/bld.bat
@@ -0,0 +1,38 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+::
+::   http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+echo on
+
+rd /s /q build
+mkdir build
+cd build
+
+cmake ^
+      -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
+      -DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^
+      -DUSE_LLVM=ON ^
+      -DUSE_RPC=ON ^
+      -DUSE_CPP_RPC=ON ^
+      -DUSE_SORT=ON ^
+      -DUSE_RANDOM=ON ^
+      -DUSE_GRAPH_RUNTIME_DEBUG=ON ^
+      -DINSTALL_DEV=ON ^
+      %SRC_DIR%
+
+cd ..
+:: defer build to install stage to avoid rebuild.
+:: sometimes windows msbuild is not very good at file
+:: caching and install will results in a rebuild
diff --git a/conda/tvm-libs/build.sh b/conda/recipe/build.sh
old mode 100644
new mode 100755
similarity index 63%
rename from conda/tvm-libs/build.sh
rename to conda/recipe/build.sh
index 94919c6..c9e7631
--- a/conda/tvm-libs/build.sh
+++ b/conda/recipe/build.sh
@@ -6,9 +6,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,35 +19,41 @@
 set -e
 set -u
 
+GPU_OPT=""
+TOOLCHAIN_OPT=""
+
 if [ "$target_platform" == "osx-64" ]; then
     # macOS 64 bits
-    METAL_OPT="-DUSE_METAL=ON"
-    TOOLCHAIN_OPT="-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11"
-else
-    METAL_OPT=""
-    if [ "$target_platform" == "linux-64" ]; then
-       # Linux 64 bits
-       
TOOLCHAIN_OPT="-DCMAKE_TOOLCHAIN_FILE=${RECIPE_DIR}/../cross-linux.cmake"
-    else
-       # Windows (or 32 bits, which we don't support)
-       TOOLCHAIN_OPT=""
-    fi
+    GPU_OPT="-DUSE_METAL=ON"
+elif [ "$target_platform" == "linux-64" ]; then
+    TOOLCHAIN_OPT="-DCMAKE_TOOLCHAIN_FILE=${RECIPE_DIR}/cross-linux.cmake"
 fi
 
 # When cuda is not set, we default to False
 cuda=${cuda:-False}
 
 if [ "$cuda" == "True" ]; then
-    CUDA_OPT="-DUSE_CUDA=ON -DUSE_CUBLAS=ON -DUSE_CUDNN=ON"
+    GPU_OPT="-DUSE_CUDA=ON -DUSE_CUBLAS=ON -DUSE_CUDNN=ON"
     TOOLCHAIN_OPT=""
-else
-    CUDA_OPT=""
 fi
 
+# remove touched cmake config
+rm -f config.cmake
 rm -rf build || true
 mkdir -p build
 cd build
-cmake $METAL_OPT $CUDA_OPT -DUSE_LLVM=$PREFIX/bin/llvm-config -DINSTALL_DEV=ON 
-DCMAKE_INSTALL_PREFIX="$PREFIX" $TOOLCHAIN_OPT ..
-make -j${CPU_COUNT} VERBOSE=1
-make install
+
+cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
+      -DCMAKE_BUILD_TYPE=Release \
+      -DUSE_RPC=ON \
+      -DUSE_CPP_RPC=OFF \
+      -DUSE_SORT=ON \
+      -DUSE_RANDOM=ON \
+      -DUSE_GRAPH_RUNTIME_DEBUG=ON \
+      -DUSE_LLVM=ON \
+      -DINSTALL_DEV=ON \
+      ${GPU_OPT} ${TOOLCHAIN_OPT} \
+      ${SRC_DIR}
+
+make -j${CPU_COUNT}
 cd ..
diff --git a/conda/conda_build_config.yaml 
b/conda/recipe/conda_build_config.yaml
similarity index 99%
rename from conda/conda_build_config.yaml
rename to conda/recipe/conda_build_config.yaml
index 79d6bfe..938d294 100644
--- a/conda/conda_build_config.yaml
+++ b/conda/recipe/conda_build_config.yaml
@@ -16,9 +16,9 @@
 # under the License.
 
 python:
-  - 3.5
   - 3.6
   - 3.7
+  - 3.8
 
 cuda:
   - False
diff --git a/conda/cross-linux.cmake b/conda/recipe/cross-linux.cmake
similarity index 100%
rename from conda/cross-linux.cmake
rename to conda/recipe/cross-linux.cmake
diff --git a/conda/recipe/install_libtvm.bat b/conda/recipe/install_libtvm.bat
new file mode 100644
index 0000000..f423c52
--- /dev/null
+++ b/conda/recipe/install_libtvm.bat
@@ -0,0 +1,22 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+::
+::   http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+cmake --build build --config Release --target install
+
+:: Copy files into library bin so that they can be found
+cp %LIBRARY_LIB%\tvm.dll %LIBRARY_BIN%\tvm.dll
+cp %LIBRARY_LIB%\tvm_runtime.dll %LIBRARY_BIN%\tvm_runtime.dll
diff --git a/conda/tvm/build.sh b/conda/recipe/install_libtvm.sh
old mode 100644
new mode 100755
similarity index 88%
copy from conda/tvm/build.sh
copy to conda/recipe/install_libtvm.sh
index 9bdbe0a..b236c7d
--- a/conda/tvm/build.sh
+++ b/conda/recipe/install_libtvm.sh
@@ -19,6 +19,5 @@
 set -e
 set -u
 
-cd python
-$PYTHON setup.py install --single-version-externally-managed 
--record=/tmp/record.txt
-cd ..
+cd build
+make install
diff --git a/conda/recipe/install_tvm_python.bat 
b/conda/recipe/install_tvm_python.bat
new file mode 100644
index 0000000..9618746
--- /dev/null
+++ b/conda/recipe/install_tvm_python.bat
@@ -0,0 +1,20 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+::
+::   http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+echo on
+
+cd %SRC_DIR%\python
+%PYTHON% setup.py install --single-version-externally-managed 
--record=%SRC_DIR%\record.txt
diff --git a/conda/tvm/build.sh b/conda/recipe/install_tvm_python.sh
old mode 100644
new mode 100755
similarity index 88%
copy from conda/tvm/build.sh
copy to conda/recipe/install_tvm_python.sh
index 9bdbe0a..2c721c6
--- a/conda/tvm/build.sh
+++ b/conda/recipe/install_tvm_python.sh
@@ -19,6 +19,5 @@
 set -e
 set -u
 
-cd python
-$PYTHON setup.py install --single-version-externally-managed 
--record=/tmp/record.txt
-cd ..
+cd ${SRC_DIR}/python
+${PYTHON} setup.py install --single-version-externally-managed 
--record=/tmp/record.txt
diff --git a/conda/recipe/meta.yaml b/conda/recipe/meta.yaml
new file mode 100644
index 0000000..67ba7fe
--- /dev/null
+++ b/conda/recipe/meta.yaml
@@ -0,0 +1,88 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+{% set version = '0.8.dev0' %}
+{% set pkg_name = 'tvm' %}
+{% set cuda_tag = cuda_version | replace('.', '') %} # [cuda]
+{% set pkg_name = pkg_name + '-cu' + cuda_tag %} # [cuda]
+{% set build_tag = environ.get('GIT_BUILD_STR', 'unknown') %}
+{% set build_tag = build_tag + '_h' + PKG_HASH + '_' + PKG_BUILDNUM %}
+
+package:
+  name: {{ pkg_name }}-package
+  version: {{ version }}
+
+source:
+  path: '../..'
+
+build:
+  number: 0
+  include_recipe: False
+  missing_dso_whitelist:
+    - "*libcuda.*"  # [linux]
+
+requirements:
+  build:
+    # The anaconda compilers for OS X are old an annoying
+    # so we rely on the platform ones for now
+    - {{ compiler('cxx') }} # [not osx]
+    - cmake
+    - make # [not win]
+  host:
+    - zlib
+    - llvmdev ==10.0.0
+
+outputs:
+  - name: {{ pkg_name }}-libs
+    script: install_libtvm.bat # [win]
+    script: install_libtvm.sh  # [not win]
+    string: {{ build_tag }}
+    requirements:
+      build:
+        - {{ compiler('cxx') }}
+        - cmake
+        - git
+        - make # [not win]
+      host:
+        - zlib
+        - llvmdev ==10.0.0
+        - {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, 
max_pin='x.x') }}  # [cuda]
+        - {{ pin_compatible('cudnn', lower_bound='7.6.0', max_pin='x') }}  # 
[cuda]
+      run:
+        - llvmdev ==10.0.0
+        - {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, 
max_pin='x.x') }}  # [cuda]
+        - {{ pin_compatible('cudnn', lower_bound='7.6.0', max_pin='x') }}  # 
[cuda]
+
+  - name: {{ pkg_name }}
+    script: install_tvm_python.sh  # [not win]
+    script: install_tvm_python.bat # [win]
+    string: {{ build_tag }}_py{{ PY_VER | replace('.', '')}}
+    requirements:
+      host:
+        - python
+        - setuptools
+      run:
+        - python
+        - decorator
+        - psutil
+        - {{ pin_compatible('numpy') }}
+        - {{ pin_subpackage(pkg_name + '-libs', exact=True) }}
+
+about:
+  home: https://tvm.apache.org
+  license: Apache2
+  summary: An End to End Deep Learning Compiler Stack for CPUs, GPUs and 
accelerators.
diff --git a/conda/render_cuda.py b/conda/render_cuda_dockerfiles.py
similarity index 98%
rename from conda/render_cuda.py
rename to conda/render_cuda_dockerfiles.py
index efd6169..d9d32f0 100644
--- a/conda/render_cuda.py
+++ b/conda/render_cuda_dockerfiles.py
@@ -48,7 +48,7 @@ def render_dockerfile(version):
     )
     fname = os.path.join(condadir, "../docker/Dockerfile.conda_cuda" + 
version.replace(".", ""))
     with open(fname, "w") as f:
-        f.write(txt)
+        f.write(txt + "\n")
     return fname
 
 
diff --git a/conda/tvm-libs/meta.yaml b/conda/tvm-libs/meta.yaml
deleted file mode 100644
index f151048..0000000
--- a/conda/tvm-libs/meta.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-{% set version = "0.8.dev0" %}
-
-package:
-  name: tvm-libs
-  version: {{ version }}
-
-source:
-  path: ../..
-
-build:
-  number: 0
-  string: cuda{{ cuda_version | replace('.', '') }}h{{ PKG_HASH }}_{{ 
PKG_BUILDNUM }}  # [cuda]
-
-requirements:
-  build:
-    # The anaconda compilers for OS X are old an annoying
-    # so we rely on the platform ones for now
-    - {{ compiler('cxx') }}  # [linux]
-    - cmake
-    - make
-  host:
-    - llvmdev ==8.0.0
-    - zlib  # [linux]
-  run:
-    - {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, 
max_pin='x.x') }}  # [cuda]
-    - {{ pin_compatible('cudnn', lower_bound='7.6.0', max_pin='x') }}  # [cuda]
-
-about:
-  home: https://github.com/apache/incubator-tvm
-  license: Apache2
-  summary: a low level domain specific language for compiling tensor 
computation pipelines
\ No newline at end of file
diff --git a/conda/tvm/meta.yaml b/conda/tvm/meta.yaml
deleted file mode 100644
index 9e8f947..0000000
--- a/conda/tvm/meta.yaml
+++ /dev/null
@@ -1,62 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-{% set version = "0.8.dev0" %}
-
-package:
-  name: tvm
-  version: {{ version }}
-
-source:
-  path: ../..
-
-build:
-  number: 0
-
-requirements:
-  build:
-    - {{ compiler('cxx') }}
-  host:
-    - python {{ python }}
-    - cython
-    - numpy
-    - setuptools
-    - decorator
-    - tvm-libs {{ version }}
-  run:
-    - python {{ python }}
-    - {{ pin_compatible('numpy') }}
-    - decorator
-    - tvm-libs {{ version }}
-    - psutil
-
-test:
-  imports:
-    - tvm
-  requires:
-    - pytest
-    - scipy
-  source_files:
-    - tests/python
-  commands:
-    - python -m pytest -v tests/python/integration
-
-about:
-  home: https://github.com/apache/incubator-tvm
-  license: Apache-2.0
-  license_family: Apache
-  summary: a low level domain specific language for compiling tensor 
computation pipelines
diff --git a/docker/Dockerfile.conda_cpu b/docker/Dockerfile.conda_cpu
index 4e0c35a..d2779af 100644
--- a/docker/Dockerfile.conda_cpu
+++ b/docker/Dockerfile.conda_cpu
@@ -17,25 +17,12 @@
 
 FROM ubuntu:16.04
 
-RUN apt-get update && apt-get install -y bzip2 curl sudo binutils && rm -rf 
/var/lib/apt/lists/*
+RUN apt-get update --fix-missing && apt-get install -y bzip2 wget sudo 
binutils git
 
-RUN curl -o ~/miniconda.sh -O 
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh  && \
-     chmod +x ~/miniconda.sh && \
-     ~/miniconda.sh -b -p /opt/conda && \
-     rm ~/miniconda.sh && \
-     /opt/conda/bin/conda upgrade --all && \
-     /opt/conda/bin/conda install conda-build conda-verify && \
-     /opt/conda/bin/conda clean -ya
-
-# Cache some of the packages for the builds
-RUN /opt/conda/bin/conda install --download-only cmake make zlib && \
-    /opt/conda/bin/conda install --download-only -c numba llvmdev=8.0.0 && \
-    /opt/conda/bin/conda create -n py35 --download-only pytest scipy 
numpy=1.11 cython decorator python=3.5 && \
-    /opt/conda/bin/conda create -n py36 --download-only pytest scipy 
numpy=1.11 cython decorator python=3.6 && \
-    /opt/conda/bin/conda create -n py37 --download-only pytest scipy 
numpy=1.11 cython decorator python=3.7
+COPY install/ubuntu_install_conda.sh /install/ubuntu_install_conda.sh
+RUN bash /install/ubuntu_install_conda.sh
 
 ENV PATH /opt/conda/bin:$PATH
 ENV CONDA_BLD_PATH /tmp
-
-WORKDIR /workspace
-RUN chmod -R a+w /workspace
+ENV CONDA_PKGS_DIRS /workspace/.conda/pkgs
+ENV CONDA_ENVS_DIRS /workspace/.conda/env
diff --git a/docker/Dockerfile.conda_cuda100 b/docker/Dockerfile.conda_cuda100
index d6e1cdd..7705c85 100644
--- a/docker/Dockerfile.conda_cuda100
+++ b/docker/Dockerfile.conda_cuda100
@@ -17,30 +17,16 @@
 
 FROM nvidia/cuda:10.0-devel-ubuntu16.04
 
-RUN apt-get update && apt-get install -y --no-install-recommends \
-            bzip2 curl sudo binutils && \
-    rm -rf /var/lib/apt/lists/*
+RUN apt-get update --fix-missing && apt-get install -y bzip2 wget sudo 
binutils git
 
-RUN  curl -fsSL 
http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.0/cudnn-10.0-linux-x64-v7.6.0.64.tgz
 -O && \
+RUN  wget -q 
http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.0/cudnn-10.0-linux-x64-v7.6.0.64.tgz
 && \
     tar --no-same-owner -xzf cudnn-10.0-linux-x64-v7.6.0.64.tgz -C /usr/local 
&& \
     rm cudnn-10.0-linux-x64-v7.6.0.64.tgz && \
     ldconfig
 
-
-RUN curl -o ~/miniconda.sh -O 
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh  && \
-     chmod +x ~/miniconda.sh && \
-     ~/miniconda.sh -b -p /opt/conda && \
-     rm ~/miniconda.sh && \
-     /opt/conda/bin/conda upgrade --all && \
-     /opt/conda/bin/conda install conda-build conda-verify && \
-     /opt/conda/bin/conda clean -ya
-
-RUN /opt/conda/bin/conda install --download-only cmake make zlib
-RUN /opt/conda/bin/conda install --download-only -c numba llvmdev=8.0.0
+COPY install/ubuntu_install_conda.sh /install/ubuntu_install_conda.sh
+RUN bash /install/ubuntu_install_conda.sh
 
 ENV PATH /opt/conda/bin:$PATH
 ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
 ENV CONDA_BLD_PATH /tmp
-
-WORKDIR /workspace
-RUN chmod -R a+w /workspace
\ No newline at end of file
diff --git a/docker/Dockerfile.conda_cuda90 b/docker/Dockerfile.conda_cuda90
index f55aa1b..3721674 100644
--- a/docker/Dockerfile.conda_cuda90
+++ b/docker/Dockerfile.conda_cuda90
@@ -17,30 +17,16 @@
 
 FROM nvidia/cuda:9.0-devel-ubuntu16.04
 
-RUN apt-get update && apt-get install -y --no-install-recommends \
-            bzip2 curl sudo binutils && \
-    rm -rf /var/lib/apt/lists/*
+RUN apt-get update --fix-missing && apt-get install -y bzip2 wget sudo 
binutils git
 
-RUN  curl -fsSL 
http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.0/cudnn-9.0-linux-x64-v7.6.0.64.tgz
 -O && \
+RUN  wget -q 
http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.0/cudnn-9.0-linux-x64-v7.6.0.64.tgz
 && \
     tar --no-same-owner -xzf cudnn-9.0-linux-x64-v7.6.0.64.tgz -C /usr/local 
&& \
     rm cudnn-9.0-linux-x64-v7.6.0.64.tgz && \
     ldconfig
 
-
-RUN curl -o ~/miniconda.sh -O 
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh  && \
-     chmod +x ~/miniconda.sh && \
-     ~/miniconda.sh -b -p /opt/conda && \
-     rm ~/miniconda.sh && \
-     /opt/conda/bin/conda upgrade --all && \
-     /opt/conda/bin/conda install conda-build conda-verify && \
-     /opt/conda/bin/conda clean -ya
-
-RUN /opt/conda/bin/conda install --download-only cmake make zlib
-RUN /opt/conda/bin/conda install --download-only -c numba llvmdev=8.0.0
+COPY install/ubuntu_install_conda.sh /install/ubuntu_install_conda.sh
+RUN bash /install/ubuntu_install_conda.sh
 
 ENV PATH /opt/conda/bin:$PATH
 ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
 ENV CONDA_BLD_PATH /tmp
-
-WORKDIR /workspace
-RUN chmod -R a+w /workspace
\ No newline at end of file
diff --git a/docker/bash.sh b/docker/bash.sh
index 05e4367..40c68e7 100755
--- a/docker/bash.sh
+++ b/docker/bash.sh
@@ -70,7 +70,7 @@ else
     CUDA_ENV=""
 fi
 
-if [[ "${DOCKER_IMAGE_NAME}" == *"gpu"* ]]; then
+if [[ "${DOCKER_IMAGE_NAME}" == *"gpu"* || "${DOCKER_IMAGE_NAME}" == *"cuda"* 
]]; then
     if ! type "nvidia-docker" 1> /dev/null 2> /dev/null
     then
         DOCKER_BINARY="docker"
diff --git a/docker/build.sh b/docker/build.sh
index 43f0a08..7d91458 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -91,7 +91,7 @@ if [ "$#" -lt 1 ] || [ ! -e 
"${SCRIPT_DIR}/Dockerfile.${CONTAINER_TYPE}" ]; then
 fi
 
 # Use nvidia-docker if the container is GPU.
-if [[ "${CONTAINER_TYPE}" == *"gpu"* ]]; then
+if [[ "${CONTAINER_TYPE}" == *"gpu"* || "${CONTAINER_TYPE}" == *"cuda"* ]]; 
then
     if ! type "nvidia-docker" 1> /dev/null 2> /dev/null
     then
         DOCKER_BINARY="docker"
diff --git a/conda/tvm/build.sh b/docker/install/ubuntu_install_conda.sh
old mode 100644
new mode 100755
similarity index 67%
rename from conda/tvm/build.sh
rename to docker/install/ubuntu_install_conda.sh
index 9bdbe0a..ef059ce
--- a/conda/tvm/build.sh
+++ b/docker/install/ubuntu_install_conda.sh
@@ -18,7 +18,13 @@
 
 set -e
 set -u
+set -o pipefail
 
-cd python
-$PYTHON setup.py install --single-version-externally-managed 
--record=/tmp/record.txt
-cd ..
+cd /tmp && wget -q 
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
+chmod +x Miniconda3-latest-Linux-x86_64.sh
+/tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda
+rm /tmp/Miniconda3-latest-Linux-x86_64.sh
+/opt/conda/bin/conda upgrade --all
+/opt/conda/bin/conda clean -ya
+/opt/conda/bin/conda install conda-build conda-verify
+chmod -R a+w /opt/conda/
diff --git a/include/tvm/parser/source_map.h b/include/tvm/parser/source_map.h
index 5595574..1153deb 100644
--- a/include/tvm/parser/source_map.h
+++ b/include/tvm/parser/source_map.h
@@ -101,7 +101,7 @@ class SourceMap : public ObjectRef {
   TVM_DLL SourceMap(std::initializer_list<std::pair<SourceName, Source>> 
source_map)
       : SourceMap(Map<SourceName, Source>(source_map)) {}
 
-  TVM_DLL SourceMap() : SourceMap({}) {}
+  TVM_DLL SourceMap() : SourceMap(Map<SourceName, Source>()) {}
 
   TVM_DLL static SourceMap Global();
 
diff --git a/tests/lint/add_asf_header.py b/tests/lint/add_asf_header.py
index a83373c..477ef2d 100644
--- a/tests/lint/add_asf_header.py
+++ b/tests/lint/add_asf_header.py
@@ -115,6 +115,25 @@ header_groovystyle = """
 // under the License.
 """.strip()
 
+header_cmdstyle = """
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+::
+::   http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+""".strip()
+
 FMT_MAP = {
     "sh": header_pystyle,
     "cc": header_cstyle,
@@ -141,6 +160,7 @@ FMT_MAP = {
     "plist": header_mdstyle,
     "xcworkspacedata": header_mdstyle,
     "html": header_mdstyle,
+    "bat": header_cmdstyle,
 }
 
 
diff --git a/tests/lint/check_file_type.py b/tests/lint/check_file_type.py
index 8a90bb3..7d3e95d 100644
--- a/tests/lint/check_file_type.py
+++ b/tests/lint/check_file_type.py
@@ -44,6 +44,7 @@ ALLOW_EXTENSION = {
     "pyd",
     "pyx",
     "cu",
+    "bat",
     # relay text format
     "rly",
     # configurations
diff --git a/version.py b/version.py
index 6554343..0338d13 100644
--- a/version.py
+++ b/version.py
@@ -75,10 +75,10 @@ def main():
         __version__,
     )
     # conda
-    for path in ["tvm", "tvm-libs"]:
+    for path in ["recipe"]:
         update(
             os.path.join(proj_root, "conda", path, "meta.yaml"),
-            '(?<=version = ")[.0-9a-z]+',
+            "(?<=version = ')[.0-9a-z]+",
             __version__,
         )
 

Reply via email to