From d95720b890196c5a0bdbc69eda3ced6a3ac5594f Mon Sep 17 00:00:00 2001 From: Mizux Seiha Date: Tue, 21 Sep 2021 12:26:38 +0200 Subject: [PATCH 1/7] python: Add vrp_nodes_indices --- makefiles/Makefile.python.mk | 1 + .../samples/vrp_nodes_indices.py | 100 ++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100755 ortools/constraint_solver/samples/vrp_nodes_indices.py diff --git a/makefiles/Makefile.python.mk b/makefiles/Makefile.python.mk index a19f41fbe6..48e9fd6b3c 100644 --- a/makefiles/Makefile.python.mk +++ b/makefiles/Makefile.python.mk @@ -605,6 +605,7 @@ test_python_constraint_solver_samples: \ rpy_vrp_drop_nodes \ rpy_vrp_global_span \ rpy_vrp_initial_routes \ + rpy_vrp_nodes_indices \ rpy_vrp_pickup_delivery \ rpy_vrp_pickup_delivery_fifo \ rpy_vrp_pickup_delivery_lifo \ diff --git a/ortools/constraint_solver/samples/vrp_nodes_indices.py b/ortools/constraint_solver/samples/vrp_nodes_indices.py new file mode 100755 index 0000000000..3867875057 --- /dev/null +++ b/ortools/constraint_solver/samples/vrp_nodes_indices.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python3 +# Copyright 2010-2021 Google LLC +# Licensed 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. +# [START program] +"""Sample to better understand Node/Index relation. + +This script generate few markdown tables to better understand +the relation between nodes and indices. + +Things to notice: +* Since we have two duplicates (node 5 and node 4) solver need 2 extra indices to have an unique index for each vehicle start/stop and locations. +* Solver needs to "create" an index for a vehicle 1 start since solver need an unique start index per vehicle. +* All end nodes are moved to the end of the index list aka [15, 16, 17, 18]. +* routing.Size() return the number of node which are not end nodes (here 15 aka [0-14]) +note: using the two properties above, we know that any index in range(routing.Size()) is not a vehicle end node. + +* Since end nodes are moved to the end, their respective "empty" node index are +reused so all locations indices are "shifted" +e.g. node 9 is mapped to index 6 +* Same for start nodes which are moved to "empty" space +e.g. start node 7 mapped to index 4 + +Takeaway: +* Allways use routing.Start(), routing.End(), manager.IndexToNode() or manager.NodeToIndex(). +* Location node is not necessarily equal to its index. +* To loop through ALL indices use manager.GetNumberOfIndices() (Python) or manager::num_indices() (C++) +""" + +from ortools.constraint_solver import routing_enums_pb2 +from ortools.constraint_solver import pywrapcp + + +def main(): + """Entry point of the program.""" + locations = 17 + starts = [5, 5, 7, 8] + ends = [1, 2, 4, 4] + vehicles = len(starts) + assert len(starts) == len(ends) + + manager = pywrapcp.RoutingIndexManager(locations, vehicles, starts, ends) + routing = pywrapcp.RoutingModel(manager) + + print('Starts/Ends:') + header = '| |' + separator = '|---|' + v_starts = '| start |' + v_ends = '| end |' + for v in range(manager.GetNumberOfVehicles()): + header += f' vehicle {v} |' + separator += '---|' + v_starts += f' {starts[v]} |' + v_ends += f' {ends[v]} |' + print(header) + print(separator) + print(v_starts) + print(v_ends) + + print('\nNodes:') + print('| locations | manager.GetNumberOfNodes | manager.GetNumberOfIndices | routing.nodes | routing.Size |') + print('|---|---|---|---|---|') + print(f'| {locations} | {manager.GetNumberOfNodes()} | {manager.GetNumberOfIndices()} | {routing.nodes()} | {routing.Size()} |') + + print('\nLocations:') + print('| node | index | routing.IsStart | routing.IsEnd |') + print('|---|---|---|---|') + for node in range(manager.GetNumberOfNodes()): + if node in starts or node in ends: + continue + index = manager.NodeToIndex(node) + print( + f'| {node} | {index} | {routing.IsStart(index)} | {routing.IsEnd(index)} |' + ) + + print('\nStart/End:') + print('| vehicle | Start/end | node | index | routing.IsStart | routing.IsEnd |') + print('|---|---|---|---|---|---|') + for v in range(manager.GetNumberOfVehicles()): + start_index = routing.Start(v) + start_node = manager.IndexToNode(start_index) + print(f'| {v} | start | {start_node} | {start_index} | {routing.IsStart(start_index)} | {routing.IsEnd(start_index)} |') + for v in range(manager.GetNumberOfVehicles()): + end_index = routing.End(v) + end_node = manager.IndexToNode(end_index) + print(f'| {v} | end | {end_node} | {end_index} | {routing.IsStart(end_index)} | {routing.IsEnd(end_index)} |') + + +if __name__ == '__main__': + main() +# [END program] From ae6f0e8431a3d1432de79e764982df50ec724986 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 21 Sep 2021 12:50:22 +0200 Subject: [PATCH 2/7] try github actions without dotnet setup --- .github/workflows/make_linux_dotnet.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/make_linux_dotnet.yml b/.github/workflows/make_linux_dotnet.yml index 0b0a54bc54..05b169f831 100644 --- a/.github/workflows/make_linux_dotnet.yml +++ b/.github/workflows/make_linux_dotnet.yml @@ -6,10 +6,6 @@ jobs: # Building using the github runner environement directly. make: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - dotnet-version: ['3.1.x', '5.0.x'] steps: - uses: actions/checkout@v2 - name: Check make @@ -18,10 +14,6 @@ jobs: run: sudo apt install -y swig - name: Check swig run: swig -version - - name: Setup dotnet ${{ matrix.dotnet-version }} - uses: ./ - with: - dotnet-version: ${{ matrix.dotnet-version }} - name: Check dotnet run: dotnet --info - name: Build third party From 279144fa019535bec6237d37566d00e8fc40ccbc Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 21 Sep 2021 12:53:39 +0200 Subject: [PATCH 3/7] bump absl version in setup.py --- tools/setup.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/setup.py.in b/tools/setup.py.in index b7596b6034..fb9d7a0ec6 100644 --- a/tools/setup.py.in +++ b/tools/setup.py.in @@ -43,7 +43,7 @@ setup( packages=find_packages(), install_requires=[ 'protobuf >= 3.18.0', - 'absl-py >= 0.11', + 'absl-py >= 0.13', ], package_data={ 'ortools.init' : ['_pywrapinit.dll', '*.pyi'], From 7f1e83ef666a48e8ee6a3c082b02f013b9debf8b Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 21 Sep 2021 13:10:01 +0200 Subject: [PATCH 4/7] remove cmake linux code --- .github/workflows/cmake_linux_dotnet.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/cmake_linux_dotnet.yml b/.github/workflows/cmake_linux_dotnet.yml index 1a2d9a5761..40e6932d3b 100644 --- a/.github/workflows/cmake_linux_dotnet.yml +++ b/.github/workflows/cmake_linux_dotnet.yml @@ -6,10 +6,6 @@ jobs: # Building using the github runner environement directly. cmake: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - dotnet-version: ['3.1.x', '5.0.x'] steps: - uses: actions/checkout@v2 - name: Check cmake @@ -18,10 +14,6 @@ jobs: run: sudo apt install -y swig - name: Check swig run: swig -version - - name: Setup dotnet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - name: Check dotnet run: dotnet --info - name: Configure From 0d8b878caf6b91993e725fa288e0023706c01b7e Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 21 Sep 2021 13:21:26 +0200 Subject: [PATCH 5/7] bump fsproj examples to coreapp 3.1 --- examples/contrib/SimpleProgramFSharp.fsproj | 2 +- examples/contrib/fsProgram.fsproj | 2 +- examples/contrib/fsdiet.fsproj | 2 +- examples/contrib/fsequality-inequality.fsproj | 2 +- examples/contrib/fsequality.fsproj | 2 +- examples/contrib/fsinteger-linear-program.fsproj | 2 +- examples/contrib/fsintegerprogramming.fsproj | 2 +- examples/contrib/fsknapsack.fsproj | 2 +- examples/contrib/fslinearprogramming.fsproj | 2 +- examples/contrib/fsnetwork-max-flow-lpSolve.fsproj | 2 +- examples/contrib/fsnetwork-max-flow.fsproj | 2 +- examples/contrib/fsnetwork-min-cost-flow.fsproj | 2 +- examples/contrib/fsrabbit-pheasant.fsproj | 2 +- examples/contrib/fsvolsay.fsproj | 2 +- examples/contrib/fsvolsay3-lpSolve.fsproj | 2 +- examples/contrib/fsvolsay3.fsproj | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/contrib/SimpleProgramFSharp.fsproj b/examples/contrib/SimpleProgramFSharp.fsproj index e38a72957a..b97a2bfa5e 100644 --- a/examples/contrib/SimpleProgramFSharp.fsproj +++ b/examples/contrib/SimpleProgramFSharp.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsProgram.fsproj b/examples/contrib/fsProgram.fsproj index 985335c041..724accfef9 100644 --- a/examples/contrib/fsProgram.fsproj +++ b/examples/contrib/fsProgram.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsdiet.fsproj b/examples/contrib/fsdiet.fsproj index a071a47781..625bc11c38 100644 --- a/examples/contrib/fsdiet.fsproj +++ b/examples/contrib/fsdiet.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsequality-inequality.fsproj b/examples/contrib/fsequality-inequality.fsproj index c08d85747a..42cc31d2ef 100644 --- a/examples/contrib/fsequality-inequality.fsproj +++ b/examples/contrib/fsequality-inequality.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsequality.fsproj b/examples/contrib/fsequality.fsproj index 2927350be2..253170a965 100644 --- a/examples/contrib/fsequality.fsproj +++ b/examples/contrib/fsequality.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsinteger-linear-program.fsproj b/examples/contrib/fsinteger-linear-program.fsproj index aa62b7d8a4..581d2caaa9 100644 --- a/examples/contrib/fsinteger-linear-program.fsproj +++ b/examples/contrib/fsinteger-linear-program.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsintegerprogramming.fsproj b/examples/contrib/fsintegerprogramming.fsproj index c068a236c6..04fb7eb466 100644 --- a/examples/contrib/fsintegerprogramming.fsproj +++ b/examples/contrib/fsintegerprogramming.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsknapsack.fsproj b/examples/contrib/fsknapsack.fsproj index d58e145e36..772107e00f 100644 --- a/examples/contrib/fsknapsack.fsproj +++ b/examples/contrib/fsknapsack.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fslinearprogramming.fsproj b/examples/contrib/fslinearprogramming.fsproj index 5211a21d65..e2cd747651 100644 --- a/examples/contrib/fslinearprogramming.fsproj +++ b/examples/contrib/fslinearprogramming.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsnetwork-max-flow-lpSolve.fsproj b/examples/contrib/fsnetwork-max-flow-lpSolve.fsproj index d2eb71132e..dd5dfbe69b 100644 --- a/examples/contrib/fsnetwork-max-flow-lpSolve.fsproj +++ b/examples/contrib/fsnetwork-max-flow-lpSolve.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsnetwork-max-flow.fsproj b/examples/contrib/fsnetwork-max-flow.fsproj index e7e5a5c854..7fb12d78ce 100644 --- a/examples/contrib/fsnetwork-max-flow.fsproj +++ b/examples/contrib/fsnetwork-max-flow.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsnetwork-min-cost-flow.fsproj b/examples/contrib/fsnetwork-min-cost-flow.fsproj index 6c38396d60..c4180aca1e 100644 --- a/examples/contrib/fsnetwork-min-cost-flow.fsproj +++ b/examples/contrib/fsnetwork-min-cost-flow.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsrabbit-pheasant.fsproj b/examples/contrib/fsrabbit-pheasant.fsproj index 35deb16b87..b68f964249 100644 --- a/examples/contrib/fsrabbit-pheasant.fsproj +++ b/examples/contrib/fsrabbit-pheasant.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsvolsay.fsproj b/examples/contrib/fsvolsay.fsproj index a87738b21a..0194ae4cdc 100644 --- a/examples/contrib/fsvolsay.fsproj +++ b/examples/contrib/fsvolsay.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsvolsay3-lpSolve.fsproj b/examples/contrib/fsvolsay3-lpSolve.fsproj index 405051c253..89bd1267b6 100644 --- a/examples/contrib/fsvolsay3-lpSolve.fsproj +++ b/examples/contrib/fsvolsay3-lpSolve.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor diff --git a/examples/contrib/fsvolsay3.fsproj b/examples/contrib/fsvolsay3.fsproj index 653d890462..c1c29aac9b 100644 --- a/examples/contrib/fsvolsay3.fsproj +++ b/examples/contrib/fsvolsay3.fsproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp3.1 false LatestMajor From 058ab7bce0ad8229d4c0b50ac997ade3780b2747 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 21 Sep 2021 13:23:27 +0200 Subject: [PATCH 6/7] remove github actions setup_dotnet code --- .github/workflows/cmake_macos_dotnet.yml | 8 -------- .github/workflows/cmake_windows_dotnet.yml | 8 -------- .github/workflows/make_macos_dotnet.yml | 8 -------- .github/workflows/make_windows_dotnet.yml | 8 -------- 4 files changed, 32 deletions(-) diff --git a/.github/workflows/cmake_macos_dotnet.yml b/.github/workflows/cmake_macos_dotnet.yml index 07592be1dd..9757bb3724 100644 --- a/.github/workflows/cmake_macos_dotnet.yml +++ b/.github/workflows/cmake_macos_dotnet.yml @@ -6,10 +6,6 @@ jobs: # Building using the github runner environement directly. cmake_make: runs-on: macos-latest - strategy: - fail-fast: false - matrix: - dotnet-version: ['3.1.x', '5.0.x'] steps: - uses: actions/checkout@v2 - name: Check cmake @@ -18,10 +14,6 @@ jobs: run: brew install swig - name: Check swig run: swig -version - - name: Setup dotnet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - name: Check dotnet run: dotnet --info - name: Configure diff --git a/.github/workflows/cmake_windows_dotnet.yml b/.github/workflows/cmake_windows_dotnet.yml index 4097f47a4c..cf8304c272 100644 --- a/.github/workflows/cmake_windows_dotnet.yml +++ b/.github/workflows/cmake_windows_dotnet.yml @@ -6,10 +6,6 @@ jobs: # Building using the github runner environement directly. cmake: runs-on: windows-latest - strategy: - fail-fast: false - matrix: - dotnet-version: ['3.1.x', '5.0.x'] steps: - uses: actions/checkout@v2 - name: Check cmake @@ -21,10 +17,6 @@ jobs: echo "$((Get-Item .).FullName)/swigwin-4.0.2" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Check swig run: swig -version - - name: Setup dotnet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - name: Check dotnet run: dotnet --info - name: Configure diff --git a/.github/workflows/make_macos_dotnet.yml b/.github/workflows/make_macos_dotnet.yml index 2f015a9703..2c31078c20 100644 --- a/.github/workflows/make_macos_dotnet.yml +++ b/.github/workflows/make_macos_dotnet.yml @@ -6,10 +6,6 @@ jobs: # Building using the github runner environement directly. make: runs-on: macos-latest - strategy: - fail-fast: false - matrix: - dotnet-version: ['3.1.x', '5.0.x'] steps: - uses: actions/checkout@v2 - name: Check make @@ -18,10 +14,6 @@ jobs: run: brew install swig - name: Check swig run: swig -version - - name: Setup dotnet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - name: Check dotnet run: dotnet --info - name: Build third party diff --git a/.github/workflows/make_windows_dotnet.yml b/.github/workflows/make_windows_dotnet.yml index 3a53261362..1b37a7c626 100644 --- a/.github/workflows/make_windows_dotnet.yml +++ b/.github/workflows/make_windows_dotnet.yml @@ -6,10 +6,6 @@ jobs: # Building using the github runner environement directly. make: runs-on: windows-latest - strategy: - fail-fast: false - matrix: - dotnet-version: ['3.1.x', '5.0.x'] steps: - uses: actions/checkout@v2 - uses: ilammy/msvc-dev-cmd@v1 @@ -19,10 +15,6 @@ jobs: rm 'C:\Program Files\Git\usr\bin\sh.exe' rm 'C:\Program Files\Git\bin\sh.exe' shell: bash - - name: Setup dotnet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - name: Check dotnet run: dotnet --info - name: Check make From 8c733da2a674dc3a4d4d098a8239979d76e34f08 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 21 Sep 2021 13:47:34 +0200 Subject: [PATCH 7/7] update cmake dockerfiles and tools alpine dockerfile for dotnet 5.0 --- cmake/docker/alpine/dotnet.Dockerfile | 11 +++++++++++ cmake/docker/archlinux/dotnet.Dockerfile | 2 +- cmake/docker/centos/dotnet.Dockerfile | 2 +- cmake/docker/debian/dotnet.Dockerfile | 2 +- cmake/docker/fedora/dotnet.Dockerfile | 2 +- cmake/docker/opensuse/dotnet.Dockerfile | 11 +++++++++++ cmake/docker/ubuntu/dotnet.Dockerfile | 2 +- tools/docker/amd64/alpine-edge.Dockerfile | 13 +++++++++++++ .../docker/test/amd64/alpine-edge/dotnet.Dockerfile | 11 +++++++++++ 9 files changed, 51 insertions(+), 5 deletions(-) diff --git a/cmake/docker/alpine/dotnet.Dockerfile b/cmake/docker/alpine/dotnet.Dockerfile index 8d20f3fca5..f1049d5bf1 100644 --- a/cmake/docker/alpine/dotnet.Dockerfile +++ b/cmake/docker/alpine/dotnet.Dockerfile @@ -12,6 +12,17 @@ RUN dotnet_sdk_version=3.1.404 \ && rm dotnet.tar.gz # Trigger first run experience by running arbitrary cmd RUN dotnet --info +# see: https://dotnet.microsoft.com/download/dotnet-core/5.0 +RUN dotnet_sdk_version=5.0.401 \ +&& wget -O dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/a80a3834-c8a1-4012-b7d9-a3a5a1e4ba30/29e11d1acb7595d79ce48a5f1fb33c82/dotnet-sdk-$dotnet_sdk_version-linux-musl-x64.tar.gz \ +&& dotnet_sha512='a2077f4d1c9da9c69453b771cd239bad27f62379402cc5e1c74a1f2a960fd55efc85cc15eafbac11f17ea975895ce107fab4bbfc49880a0a14791e8ac13ca2de' \ +&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ +&& mkdir -p /usr/share/dotnet \ +&& tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \ +&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ +&& rm dotnet.tar.gz +# Trigger first run experience by running arbitrary cmd +RUN dotnet --info FROM env AS devel WORKDIR /home/project diff --git a/cmake/docker/archlinux/dotnet.Dockerfile b/cmake/docker/archlinux/dotnet.Dockerfile index 59980352be..3ccc11050f 100644 --- a/cmake/docker/archlinux/dotnet.Dockerfile +++ b/cmake/docker/archlinux/dotnet.Dockerfile @@ -1,7 +1,7 @@ FROM ortools/cmake:archlinux_swig AS env # Currently dotnet-sdk (.Net 5) is broken # see: https://github.com/google/or-tools/issues/2465 -RUN pacman -Syu --noconfirm dotnet-sdk-3.1 +RUN pacman -Syu --noconfirm dotnet-sdk-3.1 dotnet-sdk-5.0 FROM env AS devel WORKDIR /home/project diff --git a/cmake/docker/centos/dotnet.Dockerfile b/cmake/docker/centos/dotnet.Dockerfile index e07e409dfb..ab5f0e627c 100644 --- a/cmake/docker/centos/dotnet.Dockerfile +++ b/cmake/docker/centos/dotnet.Dockerfile @@ -1,7 +1,7 @@ FROM ortools/cmake:centos_swig AS env # see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-centos8 RUN dnf -y update \ -&& dnf -y install dotnet-sdk-3.1 \ +&& dnf -y install dotnet-sdk-3.1 dotnet-sdk-5.0 \ && dnf clean all \ && rm -rf /var/cache/dnf # Trigger first run experience by running arbitrary cmd diff --git a/cmake/docker/debian/dotnet.Dockerfile b/cmake/docker/debian/dotnet.Dockerfile index c433c5756f..10605ed77f 100644 --- a/cmake/docker/debian/dotnet.Dockerfile +++ b/cmake/docker/debian/dotnet.Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update -qq \ && wget -q https://packages.microsoft.com/config/debian/10/prod.list \ && mv prod.list /etc/apt/sources.list.d/microsoft-prod.list \ && apt-get update -qq \ -&& apt-get install -yq dotnet-sdk-3.1 \ +&& apt-get install -yq dotnet-sdk-3.1 dotnet-sdk-5.0 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Trigger first run experience by running arbitrary cmd diff --git a/cmake/docker/fedora/dotnet.Dockerfile b/cmake/docker/fedora/dotnet.Dockerfile index 52be618aca..f68de74da0 100644 --- a/cmake/docker/fedora/dotnet.Dockerfile +++ b/cmake/docker/fedora/dotnet.Dockerfile @@ -1,7 +1,7 @@ FROM ortools/cmake:fedora_swig AS env # see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-fedora RUN dnf -y update \ -&& dnf -y install dotnet-sdk-3.1 \ +&& dnf -y install dotnet-sdk-3.1 dotnet-sdk-5.0 \ && dnf clean all # Trigger first run experience by running arbitrary cmd RUN dotnet --info diff --git a/cmake/docker/opensuse/dotnet.Dockerfile b/cmake/docker/opensuse/dotnet.Dockerfile index 42c53ad381..23c0a6b745 100644 --- a/cmake/docker/opensuse/dotnet.Dockerfile +++ b/cmake/docker/opensuse/dotnet.Dockerfile @@ -13,6 +13,17 @@ RUN dotnet_sdk_version=3.1.404 \ && rm dotnet.tar.gz # Trigger first run experience by running arbitrary cmd RUN dotnet --info +# see: https://dotnet.microsoft.com/download/dotnet-core/5.0 +RUN dotnet_sdk_version=5.0.401 \ +&& wget -O dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/5972698f-ba44-4664-9c50-bdc69ca70fb7/1cf7d94425d8dd4d5789dfa978d61475/dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz \ +&& dotnet_sha512='a444d44007709ceb68d8f72dec0531e17f85f800efc0007ace4fa66ba27f095066930e6c6defcd2f85cdedea2fec25e163f5da461c1c2b8563e5cd7cb47091e0' \ +&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ +&& mkdir -p /usr/share/dotnet \ +&& tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \ +&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ +&& rm dotnet.tar.gz +# Trigger first run experience by running arbitrary cmd +RUN dotnet --info FROM env AS devel WORKDIR /home/project diff --git a/cmake/docker/ubuntu/dotnet.Dockerfile b/cmake/docker/ubuntu/dotnet.Dockerfile index 7425952f56..486913c666 100644 --- a/cmake/docker/ubuntu/dotnet.Dockerfile +++ b/cmake/docker/ubuntu/dotnet.Dockerfile @@ -5,7 +5,7 @@ RUN apt-get update -qq \ && wget -q https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ && dpkg -i packages-microsoft-prod.deb \ && apt-get update -qq \ -&& DEBIAN_FRONTEND=noninteractive apt-get install -yq dotnet-sdk-3.1 \ +&& DEBIAN_FRONTEND=noninteractive apt-get install -yq dotnet-sdk-3.1 dotnet-sdk-5.0 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Trigger first run experience by running arbitrary cmd diff --git a/tools/docker/amd64/alpine-edge.Dockerfile b/tools/docker/amd64/alpine-edge.Dockerfile index 1b9ce0619e..5ee440fc99 100644 --- a/tools/docker/amd64/alpine-edge.Dockerfile +++ b/tools/docker/amd64/alpine-edge.Dockerfile @@ -33,6 +33,19 @@ RUN dotnet_sdk_version=3.1.404 \ && rm dotnet.tar.gz # Trigger first run experience by running arbitrary cmd RUN dotnet --info +https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-5.0.401-linux-x64-alpine-binaries +# see: https://dotnet.microsoft.com/download/dotnet-core/5.0 +RUN dotnet_sdk_version=5.0.401 \ +&& wget -O dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/a80a3834-c8a1-4012-b7d9-a3a5a1e4ba30/29e11d1acb7595d79ce48a5f1fb33c82/dotnet-sdk-$dotnet_sdk_version-linux-musl-x64.tar.gz \ +&& dotnet_sha512='a2077f4d1c9da9c69453b771cd239bad27f62379402cc5e1c74a1f2a960fd55efc85cc15eafbac11f17ea975895ce107fab4bbfc49880a0a14791e8ac13ca2de' \ +&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ +&& mkdir -p /usr/share/dotnet \ +&& tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \ +&& ln -s /usr/share/dotnet/dotnet /usr/bin/ \ +&& chmod a+x /usr/bin/dotnet \ +&& rm dotnet.tar.gz +# Trigger first run experience by running arbitrary cmd +RUN dotnet --info ################ ## OR-TOOLS ## diff --git a/tools/docker/test/amd64/alpine-edge/dotnet.Dockerfile b/tools/docker/test/amd64/alpine-edge/dotnet.Dockerfile index 90decdc1be..abc0622987 100644 --- a/tools/docker/test/amd64/alpine-edge/dotnet.Dockerfile +++ b/tools/docker/test/amd64/alpine-edge/dotnet.Dockerfile @@ -18,6 +18,17 @@ RUN dotnet_sdk_version=3.1.404 \ && rm dotnet.tar.gz # Trigger first run experience by running arbitrary cmd RUN dotnet --info +# see: https://dotnet.microsoft.com/download/dotnet-core/5.0 +RUN dotnet_sdk_version=5.0.401 \ +&& wget -O dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/a80a3834-c8a1-4012-b7d9-a3a5a1e4ba30/29e11d1acb7595d79ce48a5f1fb33c82/dotnet-sdk-$dotnet_sdk_version-linux-musl-x64.tar.gz \ +&& dotnet_sha512='a2077f4d1c9da9c69453b771cd239bad27f62379402cc5e1c74a1f2a960fd55efc85cc15eafbac11f17ea975895ce107fab4bbfc49880a0a14791e8ac13ca2de' \ +&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ +&& mkdir -p /usr/share/dotnet \ +&& tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \ +&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ +&& rm dotnet.tar.gz +# Trigger first run experience by running arbitrary cmd +RUN dotnet --info WORKDIR /root ADD or-tools_alpine-edge_v*.tar.gz .