onnxruntime/dockerfiles/Dockerfile.source

20 lines
1.4 KiB
Text
Raw Normal View History

# --------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------
# Dockerfile to run ONNXRuntime with source build for CPU
Cherry picking for Rel-1.6 (#6006) * Update onnx (#5720) * update onnx * update docker image for testing (cherry picked from commit 705d09316705f7431de7c6ed8151f8f6bbfe388c) * cherry pick PR 5720 * C#: Add CreateFromMemory to FixedBufferOnnxValue to allow bind user buffers and pass custom binary compatible types (#5886) Add CreateFromMemory to FixedBufferOnnxValue so users can bind their own custom binary compatible buffers to feed/fetch data. (cherry picked from commit c2d610066a460bc62bb030e4b6907f82c6617caa) * [Java] Initial Apple Silicon support (#5891) * Rearranging checks in onnxruntime_mlas.cmake to pickup Apple Silicon. On an M1 Macbook Pro clang reports: $ clang -dumpmachine arm64-apple-darwin20.1.0 So the regex check needs to look for "arm64" first, as otherwise it matches 32-bit ARM and you get NEON compilation failures. * Adding Java side library loading support for Apple Silicon (and other aarch64 architectures). * Adding Qgemm fix from @tracysh * Fixes the java packaging on Windows. * Missed a check in the java platform detector. (cherry picked from commit 8b83c51a35ea1673fb0af060ae59b3330cfd5628) * Add OpenVINO EP shared lib to Py Wheel (#5920) * Add OpenVINO EP shared lib to Py Wheel Include the libonnxruntime_providers_openvino.so/.dll to the wheel * Follow libs.extend pattern as other EPs (cherry picked from commit 40926867c31c4a0118dd0a60b9e2dadefee6f237) * Make NNAPI EP reject nodes with no-shape inputs (#5927) (cherry picked from commit 87368655e23c61863d39d0eddb4a8d24612c0ba1) * Sahar/fix documentation shared lib (#5926) * Update OpenVINO-ExecutionProvider.Md update openvino-executionprovider.md for shared library * Update Build.md updated --build_shared_lib flag for building openvino shared provider lib * Update Dockerfile.openvino building for shared library with the new changes for openvino shared lib * Revert "Update Build.md" This reverts commit c9cf5fee76be7fdc10cadf07259f1d4ed5b45b93. * Revert "Update Dockerfile.openvino " This reverts commit e1624e4f93a4cfb425b6f21d7fb71b299a146740. * Update OpenVINO-ExecutionProvider.md fix documentation to the shared library Co-authored-by: sfatimar <sahar.fatima@intel/com> (cherry picked from commit 8168c919782a080490482f37100acdee94c2f9d2) * Update dockerfiles (#5929) 1. Remove conda from the images. Because conda contains a file named /opt/miniconda/lib/libcrypto.so.1.0.0 which can't pass our security scan. Also, it will be easier for us to manage the third party usage registrations. 2. Remove openssh from the images. Because the official openssh package provided by Ubuntu can't pass our security scan. 3. Reduce the image size to 1/3 by using stages. Also, because it contains less packages, it will be less often needed to update. 4. Put the LICENSE-IMAGE.txt file in right place. It is missed in current images. You can see it was added to a temp folder "/code" but it got deleted afterwards. 5. Update the CPU docker image's base image to Ubuntu 18.04. The GPU one is already 18.04. It's better to keep them the same. 6. Remove the build arg ONNXRUNTIME_REPO/ONNXRUNTIME_BRANCH. Instead, the new one always uses the local source. I feel it can reduce confusion. (cherry picked from commit 1dbabb23626368dddac2a79e3df4852f8ea52cdb) * Add Longformer Attention Cuda Op(#5932) Limitation: Global tokens must be at the beginning of sequence. (cherry picked from commit 31a6be3d675d09fbe053e03d668695be1bd5fd89) * Bug fix for MaskRCNN and FasterRCNN (#5935) Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> (cherry picked from commit e39e82b43a3f1b632f8d54d5e9873c6d123826b9) * Fix publishing pipelines. (#5942) Fix publishing pipelines. (cherry picked from commit c4b55d29fe54605b582f373e9997642ff78f1aba) * Fix Python Linux GPU package name (#5943) Fix Python Linux GPU package name. I accidentally added "noopenmp" to it. (cherry picked from commit 5fdd9f0fd26c8038aef8977af9ad554a5b8aa978) * Update BUILD.md with shared provider information (#5944) * Update build instructions to include information about shared providers (cherry picked from commit 27513d1fd796dbb623e50a9caed243ac9ae600ef) * [OpenVINO]Fix memory leak in `IsDebugEnabled()` under Windows (#5948) * w * w Co-authored-by: modav <modav@microsoft.com> (cherry picked from commit e207589631a41d618f3e87c66de6b2f7e49ef52d) * Add support for Python 3.8+ on Windows when CUDA is enabled (#5956) (cherry picked from commit 015fbb3dbb8547294171990e1104cdf101be4a7d) * Support the cross compiling for Apple Silicon (#5974) * support macos_arm64 cross compiling * update the build docs * update as commented. * Update BUILD.md (cherry picked from commit 2ec211ea7b28bc7d1831c57ec345fecbea917609) * Update docker files to put 'unattended-upgrades' in a right place(#5983) (cherry picked from commit 3323fb608278108b7ebd98c74b5716779e84056e) * Enable the xcode build for Apple Silicon (arm64 MacOS) (#5924) * fix the build script for macos/xcode * add the version check * correct the osx-arch configuration * typo (cherry picked from commit 1852ade75dc57ad37834a92f57277819c2b142e3) * Add python 3.9 support (#5874) 1. Add python 3.9 support(except Linux ARM) 2. Add Windows GPU python 3.8 to our packaging pipeline. * Revert some pipeline changes in #5874 Co-authored-by: Ashwini Khade <askhade@microsoft.com> Co-authored-by: Du Li <duli@OrtTrainingDev0.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net> Co-authored-by: Dmitri Smirnov <yuslepukhin@users.noreply.github.com> Co-authored-by: Adam Pocock <craigacp@gmail.com> Co-authored-by: S. Manohar Karlapalem <manohar.karlapalem@intel.com> Co-authored-by: Guoyu Wang <62914304+gwang-msft@users.noreply.github.com> Co-authored-by: sfatimar <64512376+sfatimar@users.noreply.github.com> Co-authored-by: Changming Sun <chasun@microsoft.com> Co-authored-by: Tianlei Wu <tlwu@microsoft.com> Co-authored-by: Maajid khan <n.maajidkhan@gmail.com> Co-authored-by: Ryan Hill <38674843+RyanUnderhill@users.noreply.github.com> Co-authored-by: Moshe David <mosdav165@gmail.com> Co-authored-by: Ivan Stojiljkovic <17503404+ivanst0@users.noreply.github.com> Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
2020-12-02 21:45:20 +00:00
FROM ubuntu:18.04
MAINTAINER Changming Sun "chasun@microsoft.com"
ADD . /code
Cherry picking for Rel-1.6 (#6006) * Update onnx (#5720) * update onnx * update docker image for testing (cherry picked from commit 705d09316705f7431de7c6ed8151f8f6bbfe388c) * cherry pick PR 5720 * C#: Add CreateFromMemory to FixedBufferOnnxValue to allow bind user buffers and pass custom binary compatible types (#5886) Add CreateFromMemory to FixedBufferOnnxValue so users can bind their own custom binary compatible buffers to feed/fetch data. (cherry picked from commit c2d610066a460bc62bb030e4b6907f82c6617caa) * [Java] Initial Apple Silicon support (#5891) * Rearranging checks in onnxruntime_mlas.cmake to pickup Apple Silicon. On an M1 Macbook Pro clang reports: $ clang -dumpmachine arm64-apple-darwin20.1.0 So the regex check needs to look for "arm64" first, as otherwise it matches 32-bit ARM and you get NEON compilation failures. * Adding Java side library loading support for Apple Silicon (and other aarch64 architectures). * Adding Qgemm fix from @tracysh * Fixes the java packaging on Windows. * Missed a check in the java platform detector. (cherry picked from commit 8b83c51a35ea1673fb0af060ae59b3330cfd5628) * Add OpenVINO EP shared lib to Py Wheel (#5920) * Add OpenVINO EP shared lib to Py Wheel Include the libonnxruntime_providers_openvino.so/.dll to the wheel * Follow libs.extend pattern as other EPs (cherry picked from commit 40926867c31c4a0118dd0a60b9e2dadefee6f237) * Make NNAPI EP reject nodes with no-shape inputs (#5927) (cherry picked from commit 87368655e23c61863d39d0eddb4a8d24612c0ba1) * Sahar/fix documentation shared lib (#5926) * Update OpenVINO-ExecutionProvider.Md update openvino-executionprovider.md for shared library * Update Build.md updated --build_shared_lib flag for building openvino shared provider lib * Update Dockerfile.openvino building for shared library with the new changes for openvino shared lib * Revert "Update Build.md" This reverts commit c9cf5fee76be7fdc10cadf07259f1d4ed5b45b93. * Revert "Update Dockerfile.openvino " This reverts commit e1624e4f93a4cfb425b6f21d7fb71b299a146740. * Update OpenVINO-ExecutionProvider.md fix documentation to the shared library Co-authored-by: sfatimar <sahar.fatima@intel/com> (cherry picked from commit 8168c919782a080490482f37100acdee94c2f9d2) * Update dockerfiles (#5929) 1. Remove conda from the images. Because conda contains a file named /opt/miniconda/lib/libcrypto.so.1.0.0 which can't pass our security scan. Also, it will be easier for us to manage the third party usage registrations. 2. Remove openssh from the images. Because the official openssh package provided by Ubuntu can't pass our security scan. 3. Reduce the image size to 1/3 by using stages. Also, because it contains less packages, it will be less often needed to update. 4. Put the LICENSE-IMAGE.txt file in right place. It is missed in current images. You can see it was added to a temp folder "/code" but it got deleted afterwards. 5. Update the CPU docker image's base image to Ubuntu 18.04. The GPU one is already 18.04. It's better to keep them the same. 6. Remove the build arg ONNXRUNTIME_REPO/ONNXRUNTIME_BRANCH. Instead, the new one always uses the local source. I feel it can reduce confusion. (cherry picked from commit 1dbabb23626368dddac2a79e3df4852f8ea52cdb) * Add Longformer Attention Cuda Op(#5932) Limitation: Global tokens must be at the beginning of sequence. (cherry picked from commit 31a6be3d675d09fbe053e03d668695be1bd5fd89) * Bug fix for MaskRCNN and FasterRCNN (#5935) Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> (cherry picked from commit e39e82b43a3f1b632f8d54d5e9873c6d123826b9) * Fix publishing pipelines. (#5942) Fix publishing pipelines. (cherry picked from commit c4b55d29fe54605b582f373e9997642ff78f1aba) * Fix Python Linux GPU package name (#5943) Fix Python Linux GPU package name. I accidentally added "noopenmp" to it. (cherry picked from commit 5fdd9f0fd26c8038aef8977af9ad554a5b8aa978) * Update BUILD.md with shared provider information (#5944) * Update build instructions to include information about shared providers (cherry picked from commit 27513d1fd796dbb623e50a9caed243ac9ae600ef) * [OpenVINO]Fix memory leak in `IsDebugEnabled()` under Windows (#5948) * w * w Co-authored-by: modav <modav@microsoft.com> (cherry picked from commit e207589631a41d618f3e87c66de6b2f7e49ef52d) * Add support for Python 3.8+ on Windows when CUDA is enabled (#5956) (cherry picked from commit 015fbb3dbb8547294171990e1104cdf101be4a7d) * Support the cross compiling for Apple Silicon (#5974) * support macos_arm64 cross compiling * update the build docs * update as commented. * Update BUILD.md (cherry picked from commit 2ec211ea7b28bc7d1831c57ec345fecbea917609) * Update docker files to put 'unattended-upgrades' in a right place(#5983) (cherry picked from commit 3323fb608278108b7ebd98c74b5716779e84056e) * Enable the xcode build for Apple Silicon (arm64 MacOS) (#5924) * fix the build script for macos/xcode * add the version check * correct the osx-arch configuration * typo (cherry picked from commit 1852ade75dc57ad37834a92f57277819c2b142e3) * Add python 3.9 support (#5874) 1. Add python 3.9 support(except Linux ARM) 2. Add Windows GPU python 3.8 to our packaging pipeline. * Revert some pipeline changes in #5874 Co-authored-by: Ashwini Khade <askhade@microsoft.com> Co-authored-by: Du Li <duli@OrtTrainingDev0.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net> Co-authored-by: Dmitri Smirnov <yuslepukhin@users.noreply.github.com> Co-authored-by: Adam Pocock <craigacp@gmail.com> Co-authored-by: S. Manohar Karlapalem <manohar.karlapalem@intel.com> Co-authored-by: Guoyu Wang <62914304+gwang-msft@users.noreply.github.com> Co-authored-by: sfatimar <64512376+sfatimar@users.noreply.github.com> Co-authored-by: Changming Sun <chasun@microsoft.com> Co-authored-by: Tianlei Wu <tlwu@microsoft.com> Co-authored-by: Maajid khan <n.maajidkhan@gmail.com> Co-authored-by: Ryan Hill <38674843+RyanUnderhill@users.noreply.github.com> Co-authored-by: Moshe David <mosdav165@gmail.com> Co-authored-by: Ivan Stojiljkovic <17503404+ivanst0@users.noreply.github.com> Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
2020-12-02 21:45:20 +00:00
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends python3-dev ca-certificates g++ python3-numpy gcc make git python3-setuptools python3-wheel python3-pip aria2 && aria2c -q -d /tmp -o cmake-3.18.2-Linux-x86_64.tar.gz https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.tar.gz && tar -zxf /tmp/cmake-3.18.2-Linux-x86_64.tar.gz --strip=1 -C /usr
# Prepare onnxruntime repository & build onnxruntime
Cherry picking for Rel-1.6 (#6006) * Update onnx (#5720) * update onnx * update docker image for testing (cherry picked from commit 705d09316705f7431de7c6ed8151f8f6bbfe388c) * cherry pick PR 5720 * C#: Add CreateFromMemory to FixedBufferOnnxValue to allow bind user buffers and pass custom binary compatible types (#5886) Add CreateFromMemory to FixedBufferOnnxValue so users can bind their own custom binary compatible buffers to feed/fetch data. (cherry picked from commit c2d610066a460bc62bb030e4b6907f82c6617caa) * [Java] Initial Apple Silicon support (#5891) * Rearranging checks in onnxruntime_mlas.cmake to pickup Apple Silicon. On an M1 Macbook Pro clang reports: $ clang -dumpmachine arm64-apple-darwin20.1.0 So the regex check needs to look for "arm64" first, as otherwise it matches 32-bit ARM and you get NEON compilation failures. * Adding Java side library loading support for Apple Silicon (and other aarch64 architectures). * Adding Qgemm fix from @tracysh * Fixes the java packaging on Windows. * Missed a check in the java platform detector. (cherry picked from commit 8b83c51a35ea1673fb0af060ae59b3330cfd5628) * Add OpenVINO EP shared lib to Py Wheel (#5920) * Add OpenVINO EP shared lib to Py Wheel Include the libonnxruntime_providers_openvino.so/.dll to the wheel * Follow libs.extend pattern as other EPs (cherry picked from commit 40926867c31c4a0118dd0a60b9e2dadefee6f237) * Make NNAPI EP reject nodes with no-shape inputs (#5927) (cherry picked from commit 87368655e23c61863d39d0eddb4a8d24612c0ba1) * Sahar/fix documentation shared lib (#5926) * Update OpenVINO-ExecutionProvider.Md update openvino-executionprovider.md for shared library * Update Build.md updated --build_shared_lib flag for building openvino shared provider lib * Update Dockerfile.openvino building for shared library with the new changes for openvino shared lib * Revert "Update Build.md" This reverts commit c9cf5fee76be7fdc10cadf07259f1d4ed5b45b93. * Revert "Update Dockerfile.openvino " This reverts commit e1624e4f93a4cfb425b6f21d7fb71b299a146740. * Update OpenVINO-ExecutionProvider.md fix documentation to the shared library Co-authored-by: sfatimar <sahar.fatima@intel/com> (cherry picked from commit 8168c919782a080490482f37100acdee94c2f9d2) * Update dockerfiles (#5929) 1. Remove conda from the images. Because conda contains a file named /opt/miniconda/lib/libcrypto.so.1.0.0 which can't pass our security scan. Also, it will be easier for us to manage the third party usage registrations. 2. Remove openssh from the images. Because the official openssh package provided by Ubuntu can't pass our security scan. 3. Reduce the image size to 1/3 by using stages. Also, because it contains less packages, it will be less often needed to update. 4. Put the LICENSE-IMAGE.txt file in right place. It is missed in current images. You can see it was added to a temp folder "/code" but it got deleted afterwards. 5. Update the CPU docker image's base image to Ubuntu 18.04. The GPU one is already 18.04. It's better to keep them the same. 6. Remove the build arg ONNXRUNTIME_REPO/ONNXRUNTIME_BRANCH. Instead, the new one always uses the local source. I feel it can reduce confusion. (cherry picked from commit 1dbabb23626368dddac2a79e3df4852f8ea52cdb) * Add Longformer Attention Cuda Op(#5932) Limitation: Global tokens must be at the beginning of sequence. (cherry picked from commit 31a6be3d675d09fbe053e03d668695be1bd5fd89) * Bug fix for MaskRCNN and FasterRCNN (#5935) Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com> (cherry picked from commit e39e82b43a3f1b632f8d54d5e9873c6d123826b9) * Fix publishing pipelines. (#5942) Fix publishing pipelines. (cherry picked from commit c4b55d29fe54605b582f373e9997642ff78f1aba) * Fix Python Linux GPU package name (#5943) Fix Python Linux GPU package name. I accidentally added "noopenmp" to it. (cherry picked from commit 5fdd9f0fd26c8038aef8977af9ad554a5b8aa978) * Update BUILD.md with shared provider information (#5944) * Update build instructions to include information about shared providers (cherry picked from commit 27513d1fd796dbb623e50a9caed243ac9ae600ef) * [OpenVINO]Fix memory leak in `IsDebugEnabled()` under Windows (#5948) * w * w Co-authored-by: modav <modav@microsoft.com> (cherry picked from commit e207589631a41d618f3e87c66de6b2f7e49ef52d) * Add support for Python 3.8+ on Windows when CUDA is enabled (#5956) (cherry picked from commit 015fbb3dbb8547294171990e1104cdf101be4a7d) * Support the cross compiling for Apple Silicon (#5974) * support macos_arm64 cross compiling * update the build docs * update as commented. * Update BUILD.md (cherry picked from commit 2ec211ea7b28bc7d1831c57ec345fecbea917609) * Update docker files to put 'unattended-upgrades' in a right place(#5983) (cherry picked from commit 3323fb608278108b7ebd98c74b5716779e84056e) * Enable the xcode build for Apple Silicon (arm64 MacOS) (#5924) * fix the build script for macos/xcode * add the version check * correct the osx-arch configuration * typo (cherry picked from commit 1852ade75dc57ad37834a92f57277819c2b142e3) * Add python 3.9 support (#5874) 1. Add python 3.9 support(except Linux ARM) 2. Add Windows GPU python 3.8 to our packaging pipeline. * Revert some pipeline changes in #5874 Co-authored-by: Ashwini Khade <askhade@microsoft.com> Co-authored-by: Du Li <duli@OrtTrainingDev0.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net> Co-authored-by: Dmitri Smirnov <yuslepukhin@users.noreply.github.com> Co-authored-by: Adam Pocock <craigacp@gmail.com> Co-authored-by: S. Manohar Karlapalem <manohar.karlapalem@intel.com> Co-authored-by: Guoyu Wang <62914304+gwang-msft@users.noreply.github.com> Co-authored-by: sfatimar <64512376+sfatimar@users.noreply.github.com> Co-authored-by: Changming Sun <chasun@microsoft.com> Co-authored-by: Tianlei Wu <tlwu@microsoft.com> Co-authored-by: Maajid khan <n.maajidkhan@gmail.com> Co-authored-by: Ryan Hill <38674843+RyanUnderhill@users.noreply.github.com> Co-authored-by: Moshe David <mosdav165@gmail.com> Co-authored-by: Ivan Stojiljkovic <17503404+ivanst0@users.noreply.github.com> Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
2020-12-02 21:45:20 +00:00
RUN cd /code && /bin/bash ./build.sh --skip_submodule_sync --use_openmp --config Release --build_wheel --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER)
FROM ubuntu:18.04
COPY --from=0 /code/build/Linux/Release/dist /root
COPY --from=0 /code/dockerfiles/LICENSE-IMAGE.txt /code/LICENSE-IMAGE.txt
RUN apt-get update && apt-get install -y --no-install-recommends libstdc++6 libgomp1 ca-certificates python3-setuptools python3-wheel python3-pip unattended-upgrades && unattended-upgrade && python3 -m pip install /root/*.whl && rm -rf /root/*.whl