Skip to content

Commit

Permalink
Update build dependencies (#239)
Browse files Browse the repository at this point in the history
* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies

* Update build dependencies
  • Loading branch information
MarioHewardt authored Mar 21, 2024
1 parent d39bbaa commit 03aa1b1
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 144 deletions.
35 changes: 4 additions & 31 deletions .devcontainer/Dockerfile_AzureLinux
Original file line number Diff line number Diff line change
@@ -1,33 +1,6 @@
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0

# install all needed packages for builds
RUN yum install -y ca-certificates \
git \
gdb \
zlib-devel \
gcc \
rpm-build \
make \
curl \
libcurl-devel \
libicu-devel \
libunwind-devel \
nmap \
wget \
clang \
glibc-devel \
kernel-headers-5.15.125.1-2.cm2.noarch \
binutils \
lsb-release \
cmake \
bpftool \
libbpf-devel

# install JQ since it doesn't have a .rpm package
RUN curl https://stedolan.github.io/jq/download/linux64/jq > /usr/bin/jq && chmod +x /usr/bin/jq

# install .net core 6 for ESRP signing and integration tests
RUN yum install -y dotnet-sdk-6.0

# Update packages to latest
RUN yum update -y
# Install dependencies
COPY install-azurelinux-dependencies.sh /usr/local/bin/install_dependencies.sh
RUN chmod +x /usr/local/bin/install_dependencies.sh && \
/usr/local/bin/install_dependencies.sh
46 changes: 5 additions & 41 deletions .devcontainer/Dockerfile_Rocky
Original file line number Diff line number Diff line change
@@ -1,42 +1,6 @@
FROM rockylinux:8
FROM mcr.microsoft.com/mirror/docker/library/rockylinux:8

# install all needed packges to build .rpm packages
RUN echo "assumeyes=1" >> /etc/yum.conf

# install endpoint for git > 2.0
RUN yum install http://opensource.wandisco.com/rhel/8/git/x86_64/wandisco-git-release-8-1.noarch.rpm

# Enable powertools and extra repos
RUN dnf install dnf-plugins-core && dnf install epel-release && dnf config-manager --set-enabled powertools && dnf update

# install all needed packages for builds
RUN yum install git \
gdb \
zlib-devel \
gcc-toolset-10 \
rpm-build \
make \
curl \
libcurl-devel \
libicu-devel \
libunwind-devel \
nmap \
wget \
clang \
redhat-lsb \
cmake \
elfutils-libelf-devel \
libbpf-devel \
bpftool

# install JQ since it doesn't have a .rpm package
RUN curl https://stedolan.github.io/jq/download/linux64/jq > /usr/bin/jq && chmod +x /usr/bin/jq

# install .net core 6 for ESRP signing and integration tests
RUN yum install dotnet-runtime-6.0
RUN yum install dotnet-sdk-6.0

# Update packages to latest
RUN yum update

WORKDIR /azp
# Install dependencies
COPY install-rocky-dependencies.sh /usr/local/bin/install_dependencies.sh
RUN chmod +x /usr/local/bin/install_dependencies.sh && \
/usr/local/bin/install_dependencies.sh
63 changes: 5 additions & 58 deletions .devcontainer/Dockerfile_Ubuntu
Original file line number Diff line number Diff line change
@@ -1,63 +1,10 @@
FROM ubuntu:20.04
FROM mcr.microsoft.com/mirror/docker/library/ubuntu:20.04

# To make it easier for build and release pipelines to run apt-get,
# configure apt to not require confirmation (assume the -y argument by default)
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes

RUN apt-get update
RUN apt -y install software-properties-common
RUN add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
RUN apt-get update

RUN apt upgrade -y \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
jq \
git \
iputils-ping \
libcurl4 \
libicu55 \
libunwind8 \
netcat \
gdb \
zlib1g-dev \
stress-ng \
wget \
dpkg-dev \
fakeroot \
lsb-release \
gettext \
liblocale-gettext-perl \
pax \
cmake \
libelf-dev \
clang \
clang-12 \
llvm \
build-essential \
libbpf-dev

# Set preference to clang-12
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100

# Build and install bpftool
RUN rm -rf /usr/sbin/bpftool
RUN git clone --recurse-submodules https://github.com/libbpf/bpftool.git
WORKDIR bpftool/src
RUN make install
RUN ln -s /usr/local/sbin/bpftool /usr/sbin/bpftool

# install debbuild
RUN wget https://github.com/debbuild/debbuild/releases/download/22.02.1/debbuild_22.02.1-0ubuntu20.04_all.deb \
&& dpkg -i debbuild_22.02.1-0ubuntu20.04_all.deb

# install .NET 6 for signing process and integration tests
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN rm packages-microsoft-prod.deb
RUN apt -y update && apt-get install -y dotnet-runtime-6.0
RUN apt-get install -y dotnet-sdk-6.0

WORKDIR /azp
# Install dependencies
COPY install-ubuntu-dependencies.sh /usr/local/bin/install_dependencies.sh
RUN chmod +x /usr/local/bin/install_dependencies.sh && \
/usr/local/bin/install_dependencies.sh
35 changes: 35 additions & 0 deletions .devcontainer/install-azurelinux.dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# install all needed packages for builds
yum install -y ca-certificates \
git \
gdb \
zlib-devel \
gcc \
rpm-build \
make \
curl \
libcurl-devel \
libicu-devel \
libunwind-devel \
nmap \
wget \
clang \
glibc-devel \
kernel-headers-5.15.125.1-2.cm2.noarch \
binutils \
lsb-release \
cmake \
bpftool \
libbpf-devel \
sudo \
which

# install JQ since it doesn't have a .rpm package
curl https://stedolan.github.io/jq/download/linux64/jq > /usr/bin/jq && chmod +x /usr/bin/jq

# install .net core 6 for ESRP signing and integration tests
yum install -y dotnet-sdk-6.0

# Update packages to latest
yum update -y
30 changes: 30 additions & 0 deletions .devcontainer/install-rocky-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

echo "assumeyes=1" >> /etc/yum.conf
yum install http://opensource.wandisco.com/rhel/8/git/x86_64/wandisco-git-release-8-1.noarch.rpm
dnf install dnf-plugins-core && dnf install epel-release && dnf config-manager --set-enabled powertools && dnf update
yum install git \
gdb \
python3 \
zlib-devel \
gcc-toolset-10 \
rpm-build \
make \
curl \
libcurl-devel \
libicu-devel \
libunwind-devel \
nmap \
wget \
clang \
redhat-lsb \
cmake \
elfutils-libelf-devel \
libbpf-devel \
bpftool

pip3 uninstall -y setuptools
pip3 uninstall -y pip
curl https://stedolan.github.io/jq/download/linux64/jq > /usr/bin/jq && chmod +x /usr/bin/jq
yum install dotnet-runtime-6.0
yum install dotnet-sdk-6.0
58 changes: 58 additions & 0 deletions .devcontainer/install-ubuntu-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
echo "APT::Get::Assume-Yes \"true\";" > sudo /etc/apt/apt.conf.d/90assumeyes
DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ca-certificates \
curl \
jq \
git \
iputils-ping \
libcurl4 \
libicu55 \
libunwind8 \
netcat \
gdb \
zlib1g-dev \
stress-ng \
wget \
dpkg-dev \
fakeroot \
lsb-release \
gettext \
liblocale-gettext-perl \
pax \
cmake \
libelf-dev \
clang-12 \
llvm \
build-essential \
libbpf-dev

# Set preference to clang-12
yes '' | sudo update-alternatives --force --all
sudo update-alternatives --remove-all clang
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 100
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-12 100

# Build and install bpftool
sudo rm -rf /usr/sbin/bpftool
git clone --recurse-submodules https://github.com/libbpf/bpftool.git
cd bpftool/src
sudo make install
sudo ln -s /usr/local/sbin/bpftool /usr/sbin/bpftool

# install debbuild
wget https://github.com/debbuild/debbuild/releases/download/22.02.1/debbuild_22.02.1-0ubuntu20.04_all.deb \
&& sudo dpkg -i debbuild_22.02.1-0ubuntu20.04_all.deb

# install .NET 6 for signing process and integration tests
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt -y update && sudo apt-get install -y dotnet-runtime-6.0
sudo apt-get install -y dotnet-sdk-6.0
29 changes: 15 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ pr:
stages:
- stage: "Build"
jobs:
- job: "ProcDump_Run_Unit_Tests"
- job: "ProcDump_Build_Run_Unit_Tests"
pool:
name: "Sysinternals-for-Linux-AME"
demands:
- ImageOverride -equals procdump-ubuntu-build-agent
vmImage: "ubuntu-20.04"
steps:
- script: |
clang --version
clang++ --version
gcc --version
displayName: 'List compiler versions'
- script: |
Expand All @@ -30,6 +29,17 @@ stages:
service rsyslog start || true
displayName: 'Enable syslog'
- script: |
chmod +x .devcontainer/install-ubuntu-dependencies.sh
.devcontainer/install-ubuntu-dependencies.sh
displayName: "Install pre-reqs for Ubuntu"
- script: |
clang --version
clang++ --version
gcc --version
displayName: 'List compiler versions'
- template: templates/build.yaml

- script: |
Expand All @@ -56,13 +66,4 @@ stages:
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/logs/procdumpprofiler.log'
ArtifactName: 'procdumpprofiler.log'
publishLocation: 'Container'

- job: "Build_ProcDump"
pool:
name: "Sysinternals-for-Linux-AME"
demands:
- ImageOverride -equals procdump-ubuntu-build-agent
steps:
- template: templates/build.yaml
displayName: 'Build ProcDump'
publishLocation: 'Container'
1 change: 1 addition & 0 deletions sudo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APT::Get::Assume-Yes "true"; /etc/apt/apt.conf.d/90assumeyes

0 comments on commit 03aa1b1

Please sign in to comment.