Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build dependencies #239

Merged
merged 12 commits into from
Mar 21, 2024
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
55 changes: 55 additions & 0 deletions .devcontainer/install-ubuntu-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/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 \
clang-12 \
llvm \
build-essential \
libbpf-dev

# Set preference to clang-12
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-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
27 changes: 13 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ 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
Expand All @@ -30,6 +28,16 @@ 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
displayName: 'List compiler versions'

- template: templates/build.yaml

- script: |
Expand All @@ -56,13 +64,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
Loading