Skip to content

Commit

Permalink
backport ci/cd/release stuff from main
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed May 30, 2024
1 parent 48ace85 commit 2b0085b
Show file tree
Hide file tree
Showing 36 changed files with 528 additions and 124 deletions.
4 changes: 4 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ install_make
build_cross
dependencies/install
dependencies/sources
temp_cpp
temp_dotnet
temp_java
temp_python
5 changes: 0 additions & 5 deletions .github/workflows/amd64_macos_bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
python-version: ${{ matrix.python.version }}
- name: Check Python
run: python --version
- name: Install Bazel
run: |
brew update
brew unlink bazelisk
brew install bazel
- name: Check Bazel
run: bazel version
- name: Build
Expand Down
10 changes: 5 additions & 5 deletions cmake/docker/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ RUN dnf -y update \
RUN echo "source /opt/rh/gcc-toolset-11/enable" >> /etc/bashrc
SHELL ["/bin/bash", "--login", "-c"]

# Install CMake 3.26.4
RUN wget -q "https://cmake.org/files/v3.26/cmake-3.26.4-linux-x86_64.sh" \
&& chmod a+x cmake-3.26.4-linux-x86_64.sh \
&& ./cmake-3.26.4-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.26.4-linux-x86_64.sh
# Install CMake 3.28.3
RUN wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh
CMD [ "/usr/bin/bash" ]

# Install SWIG 4.2.0
Expand Down
11 changes: 6 additions & 5 deletions cmake/docker/glop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ RUN apt-get update -qq \
&& apt-get install -yq git wget libssl-dev build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install CMake 3.27.7
RUN wget -q "https://cmake.org/files/v3.27/cmake-3.27.7-linux-x86_64.sh" \
&& chmod a+x cmake-3.27.7-linux-x86_64.sh \
&& ./cmake-3.27.7-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.27.7-linux-x86_64.sh

# Install CMake 3.28.3
RUN wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh
CMD [ "/usr/bin/bash" ]

FROM env AS devel
Expand Down
10 changes: 5 additions & 5 deletions cmake/docker/toolchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ RUN apt-get update -qq \
ENTRYPOINT ["/usr/bin/bash", "-c"]
CMD ["/usr/bin/bash"]

# Install CMake 3.25.2
RUN wget "https://cmake.org/files/v3.25/cmake-3.25.2-linux-x86_64.sh" \
&& chmod a+x cmake-3.25.2-linux-x86_64.sh \
&& ./cmake-3.25.2-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.25.2-linux-x86_64.sh
# Install CMake 3.28.3
RUN wget "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh

FROM env AS devel
WORKDIR /home/project
Expand Down
10 changes: 5 additions & 5 deletions cmake/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ RUN apt-get update -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install CMake 3.25.2
RUN wget -q "https://cmake.org/files/v3.25/cmake-3.25.2-linux-x86_64.sh" \
&& chmod a+x cmake-3.25.2-linux-x86_64.sh \
&& ./cmake-3.25.2-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.25.2-linux-x86_64.sh
# Install CMake 3.28.3
RUN wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh
CMD [ "/usr/bin/bash" ]

FROM base AS swig
Expand Down
10 changes: 5 additions & 5 deletions makefiles/docker/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ RUN dnf -y update \
RUN echo "source /opt/rh/gcc-toolset-11/enable" >> /etc/bashrc
SHELL ["/bin/bash", "--login", "-c"]

# Install CMake 3.26.4
RUN wget -q "https://cmake.org/files/v3.26/cmake-3.26.4-linux-x86_64.sh" \
&& chmod a+x cmake-3.26.4-linux-x86_64.sh \
&& ./cmake-3.26.4-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.26.4-linux-x86_64.sh
# Install CMake 3.28.3
RUN wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh
CMD [ "/usr/bin/bash" ]

# Install SWIG 4.1.1
Expand Down
10 changes: 5 additions & 5 deletions makefiles/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ RUN apt-get update -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install CMake 3.25.2
RUN wget -q "https://cmake.org/files/v3.25/cmake-3.25.2-linux-x86_64.sh" \
&& chmod a+x cmake-3.25.2-linux-x86_64.sh \
&& ./cmake-3.25.2-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.25.2-linux-x86_64.sh
# Install CMake 3.28.3
RUN wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-x86_64.sh" \
&& chmod a+x cmake-3.28.3-linux-x86_64.sh \
&& ./cmake-3.28.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-x86_64.sh
CMD [ "/usr/bin/bash" ]

FROM base AS swig
Expand Down
10 changes: 6 additions & 4 deletions tools/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ help:
@echo -e "\t\t${BOLD}archlinux${RESET} (latest)"
@echo -e "\t\t${BOLD}centos-7${RESET} (Centos 7 LTS)"
@echo -e "\t\t${BOLD}debian-sid${RESET} (unstable)"
@echo -e "\t\t${BOLD}debian-11${RESET} (bullseye)"
@echo -e "\t\t${BOLD}debian-13${RESET} (Trixie)"
@echo -e "\t\t${BOLD}debian-12${RESET} (Bookworm)"
@echo -e "\t\t${BOLD}debian-11${RESET} (Bullseye)"
# @echo -e "\t\t${BOLD}debian-10${RESET} (buster)"
# @echo -e "\t\t${BOLD}fedora-39${RESET}"
@echo -e "\t\t${BOLD}fedora-39${RESET}"
@echo -e "\t\t${BOLD}fedora-38${RESET}"
@echo -e "\t\t${BOLD}fedora-37${RESET}"
# @echo -e "\t\t${BOLD}opensuse-leap${RESET} (latest)"
Expand Down Expand Up @@ -404,8 +406,8 @@ DISTROS := \
alpine-edge \
archlinux \
centos-7 \
debian-11 debian-sid \
fedora-37 fedora-38 \
debian-11 debian-12 debian-13 debian-sid \
fedora-37 fedora-38 fedora-39 \
ubuntu-20.04 ubuntu-22.04 ubuntu-23.04 ubuntu-23.10

# List of stages
Expand Down
10 changes: 5 additions & 5 deletions tools/docker/images/centos-7.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ ENTRYPOINT ["/usr/bin/bash", "--login", "-c"]
CMD ["/usr/bin/bash", "--login"]
# RUN g++ --version

# Install CMake v3.26.4
# Install CMake 3.28.3
RUN ARCH=$(uname -m) \
&& wget -q "https://cmake.org/files/v3.26/cmake-3.26.4-linux-${ARCH}.sh" \
&& chmod a+x cmake-3.26.4-linux-${ARCH}.sh \
&& ./cmake-3.26.4-linux-${ARCH}.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.26.4-linux-${ARCH}.sh
&& wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-${ARCH}.sh" \
&& chmod a+x cmake-3.28.3-linux-${ARCH}.sh \
&& ./cmake-3.28.3-linux-${ARCH}.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-${ARCH}.sh

# Install Swig 4.1.1
RUN curl --location-trusted \
Expand Down
10 changes: 5 additions & 5 deletions tools/docker/images/debian-10.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ RUN apt-get update -qq \
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/bin/bash"]

# Install CMake v3.26.4
# Install CMake 3.28.3
RUN ARCH=$(uname -m) \
&& wget -q "https://cmake.org/files/v3.26/cmake-3.26.4-linux-${ARCH}.sh" \
&& chmod a+x cmake-3.26.4-linux-${ARCH}.sh \
&& ./cmake-3.26.4-linux-${ARCH}.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.26.4-linux-${ARCH}.sh
&& wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-${ARCH}.sh" \
&& chmod a+x cmake-3.28.3-linux-${ARCH}.sh \
&& ./cmake-3.28.3-linux-${ARCH}.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-${ARCH}.sh

# Install .Net
# see https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian#debian-10-
Expand Down
10 changes: 5 additions & 5 deletions tools/docker/images/debian-11.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ RUN apt-get update -qq \
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/bin/bash"]

# Install CMake v3.26.4
# Install CMake 3.28.3
RUN ARCH=$(uname -m) \
&& wget -q "https://cmake.org/files/v3.26/cmake-3.26.4-linux-${ARCH}.sh" \
&& chmod a+x cmake-3.26.4-linux-${ARCH}.sh \
&& ./cmake-3.26.4-linux-${ARCH}.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.26.4-linux-${ARCH}.sh
&& wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-${ARCH}.sh" \
&& chmod a+x cmake-3.28.3-linux-${ARCH}.sh \
&& ./cmake-3.28.3-linux-${ARCH}.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-${ARCH}.sh

# Install .Net
# see https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian#debian-11-
Expand Down
114 changes: 114 additions & 0 deletions tools/docker/images/debian-12.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# ref: https://hub.docker.com/_/debian
FROM debian:12 AS env

#############
## SETUP ##
#############
RUN apt-get update -qq \
&& apt-get install -qq \
git pkg-config wget make autoconf libtool zlib1g-dev gawk g++ curl subversion \
swig lsb-release \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/bin/bash"]

# Install CMake 3.28.3
RUN ARCH=$(uname -m) \
&& wget -q "https://cmake.org/files/v3.28/cmake-3.28.3-linux-${ARCH}.sh" \
&& chmod a+x cmake-3.28.3-linux-${ARCH}.sh \
&& ./cmake-3.28.3-linux-${ARCH}.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.28.3-linux-${ARCH}.sh

# Install .Net
# see https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian#debian-11-
RUN apt-get update -qq \
&& apt-get install -qq gpg apt-transport-https \
&& wget -q "https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb" -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update -qq \
&& apt-get install -qq dotnet-sdk-3.1 dotnet-sdk-6.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info

# Java Install
RUN apt-get update -qq \
&& apt-get install -qq default-jdk maven \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV JAVA_HOME=/usr/lib/jvm/default-java

# Install Python
RUN apt-get update -qq \
&& apt-get install -qq python3 python3-dev python3-pip python3-venv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN python3 -m pip install absl-py mypy mypy-protobuf

ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

################
## OR-TOOLS ##
################
FROM env AS devel
WORKDIR /root
# Copy the snk key
COPY or-tools.snk /root/or-tools.snk
ENV DOTNET_SNK=/root/or-tools.snk

ARG SRC_GIT_BRANCH
ENV SRC_GIT_BRANCH ${SRC_GIT_BRANCH:-main}
ARG SRC_GIT_SHA1
ENV SRC_GIT_SHA1 ${SRC_GIT_SHA1:-unknown}

ARG OR_TOOLS_PATCH
ENV OR_TOOLS_PATCH ${OR_TOOLS_PATCH:-9999}

# Download sources
# use SRC_GIT_SHA1 to modify the command
# i.e. avoid docker reusing the cache when new commit is pushed
SHELL ["/bin/bash", "-c"]
RUN git clone -b "${SRC_GIT_BRANCH}" --single-branch --depth=1 https://github.com/google/or-tools \
&& [[ $(cd or-tools && git rev-parse --verify HEAD) == ${SRC_GIT_SHA1} ]]
WORKDIR /root/or-tools

# C++
## build
FROM devel AS cpp_build
RUN make detect_cpp \
&& make cpp JOBS=8
## archive
FROM cpp_build AS cpp_archive
RUN make archive_cpp

# .Net
## build
FROM cpp_build AS dotnet_build
ENV USE_DOTNET_CORE_31=ON
RUN make detect_dotnet \
&& make dotnet JOBS=8
## archive
FROM dotnet_build AS dotnet_archive
RUN make archive_dotnet

# Java
## build
FROM cpp_build AS java_build
RUN make detect_java \
&& make java JOBS=8
## archive
FROM java_build AS java_archive
RUN make archive_java

# Python
## build
FROM cpp_build AS python_build
RUN make detect_python \
&& make python JOBS=8
## archive
FROM python_build AS python_archive
RUN make archive_python
Loading

0 comments on commit 2b0085b

Please sign in to comment.