Skip to content

Commit

Permalink
Merge pull request #319 from microsoft/release/v0.4.0
Browse files Browse the repository at this point in the history
Release v0.4.0
  • Loading branch information
abeltrano authored Jul 22, 2024
2 parents 8c51a0f + f8a69e7 commit 7089dc9
Show file tree
Hide file tree
Showing 165 changed files with 2,355 additions and 498 deletions.
104 changes: 53 additions & 51 deletions .docker/netremote-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

FROM ubuntu:mantic as netremote-build
FROM ubuntu:noble as netremote-build

# Set arguments used only in this Dockerfile.
ARG BUILD_DATE="2024-02-28T21:09:49+00:00"
ARG BUILD_DATE="2024-06-30T02:17:53+00:00"
ARG DEBIAN_FRONTEND=noninteractive
ARG APT_ARGS_COMMON="-yqq --no-install-recommends"

LABEL maintainer="Andrew Beltrano (anbeltra@microsoft.com)"
LABEL org.opencontainers.image.authors = "netremoteowners@microsoft.com"
LABEL org.label-schema.build-date = "${BUILD_DATE}"
LABEL org.label-schema.name = "Microsoft NetRemote build environment"
LABEL org.label-schema.name = "NetRemote build environment"
LABEL org.label-schema.description = "Build environment for the NetRemote project"
LABEL org.label-schema.vendor = "Microsoft"
LABEL org.label-schema.version = "1.0.0"
Expand All @@ -22,13 +22,13 @@ LABEL org.label-schema.schema-version = "1.0"
# sudo apt -y update && sudo apt -y upgrade
#
# 2. Install core build tools and dependencies:
# sudo apt install -y --no-install-recommends autoconf automake autopoint build-essential ca-certificates cmake curl dotnet7 git gnupg libltdl-dev libmount-dev libtool linux-libc-dev ninja-build pkg-config python3-jinja2 tar unzip zip
# sudo apt install -y --no-install-recommends autoconf automake autopoint build-essential ca-certificates cmake curl dotnet7 git gnupg libltdl-dev libmount-dev libtool linux-libc-dev libstdc++-14-dev ninja-build pkg-config python3-jinja2 tar unzip zip
#
# 3. Install complete LLVM 17 + clang 17 toolchain:
# sudo apt install -y --no-install-recommends libllvm-17-ocaml-dev libllvm17 llvm-17 llvm-17-dev llvm-17-doc llvm-17-examples llvm-17-runtime clang-17 clang-tools-17 clang-17-doc libclang-common-17-dev libclang-17-dev libclang1-17 clang-format-17 python3-clang-17 clangd-17 clang-tidy-17 libclang-rt-17-dev libpolly-17-dev libfuzzer-17-dev lldb-17 lld-17 libc++-17-dev libc++abi-17-dev libomp-17-dev libclc-17-dev libunwind-17-dev libmlir-17-dev mlir-17-tools libbolt-17-dev bolt-17 flang-17 libclang-rt-17-dev-wasm32 libclang-rt-17-dev-wasm64 libc++-17-dev-wasm32 libc++abi-17-dev-wasm32 libclang-rt-17-dev-wasm32 libclang-rt-17-dev-wasm64
# 3. Install complete LLVM 18 + clang toolchain:
# sudo apt install -y --no-install-recommends libllvm-18-ocaml-dev libllvm18 llvm-18 llvm-18-dev llvm-18-doc llvm-18-examples llvm-18-runtime clang-18 clang-tools-18 clang-18-doc libclang-common-18-dev libclang-18-dev libclang1-18 clang-format-18 python3-clang-18 clangd-18 clang-tidy-18 libclang-rt-18-dev libpolly-18-dev libfuzzer-18-dev lldb-18 libc++-18-dev libc++abi-18-dev libomp-18-dev libclc-18-dev libunwind-18-dev libmlir-18-dev mlir-18-tools libbolt-18-dev bolt-18 flang-18 libclang-rt-18-dev-wasm32 libclang-rt-18-dev-wasm64 libc++-18-dev-wasm32 libc++abi-18-dev-wasm32 libclang-rt-18-dev-wasm32 libclang-rt-18-dev-wasm64 libllvmlibc-18-dev
#
# 4. Install other development dependencies and helpful tools:
# sudo apt install -y --no-install-recommends bc bison dwarves flex libelf-dev dos2unix file gnupg2 iproute2 mtools neofetch rsync ssh sudo emacs gdb kmod nano policycoreutils-python-utils python-is-python3 vim
# sudo apt install -y -qq --no-install-recommends bc bison dwarves flex libelf-dev dos2unix file gnupg2 iproute2 mtools neofetch rsync ssh sudo emacs gdb kmod nano policycoreutils-python-utils python-is-python3 vim
#
# 5. Install hostapd development dependencies and tools:
# sudo apt install -y libnl-3-dev libssl-dev libnl-genl-3-dev libnl-3-dev libdbus-c++-dev libnl-route-3-dev flex bison dwarves libelf-dev bc iw debconf-utils
Expand All @@ -47,59 +47,59 @@ RUN apt-get $APT_ARGS_COMMON update && \
ca-certificates \
cmake \
curl \
dotnet7 \
git \
gnupg \
libltdl-dev \
libmount-dev \
libtool \
linux-libc-dev \
libstdc++-14-dev \
ninja-build \
pkg-config \
python3-jinja2 \
tar \
unzip \
zip \
# LLVM + Clang toolchain.
# libllvm-17-ocaml-dev libllvm17 llvm-17 llvm-17-dev llvm-17-doc llvm-17-examples llvm-17-runtime clang-17 clang-tools-17 clang-17-doc libclang-common-17-dev libclang-17-dev libclang1-17 clang-format-17 python3-clang-17 clangd-17 clang-tidy-17 libclang-rt-17-dev libpolly-17-dev libfuzzer-17-dev lldb-17 lld-17 libc++-17-dev libc++abi-17-dev libomp-17-dev libclc-17-dev libunwind-17-dev libmlir-17-dev mlir-17-tools libbolt-17-dev bolt-17 flang-17 libclang-rt-17-dev-wasm32 libclang-rt-17-dev-wasm64 libc++-17-dev-wasm32 libc++abi-17-dev-wasm32 libclang-rt-17-dev-wasm32 libclang-rt-17-dev-wasm64
bolt-17 \
clang-17 \
clang-17-doc \
clang-format-17 \
clang-tidy-17 \
clang-tools-17 \
clangd-17 \
flang-17 \
libbolt-17-dev \
libc++-17-dev \
libc++-17-dev-wasm32 \
libc++abi-17-dev \
libc++abi-17-dev-wasm32 \
libclang-17-dev \
libclang-common-17-dev \
libclang-rt-17-dev \
libclang-rt-17-dev-wasm32 \
libclang-rt-17-dev-wasm32 \
libclang-rt-17-dev-wasm64 \
libclang-rt-17-dev-wasm64 \
libclang1-17 \
libclc-17-dev \
libfuzzer-17-dev \
libllvm-17-ocaml-dev \
libllvm17 \
libmlir-17-dev \
libomp-17-dev \
libpolly-17-dev \
libunwind-17-dev \
lld-17 \
lldb-17 \
llvm-17 \
llvm-17-dev \
llvm-17-doc \
llvm-17-examples \
llvm-17-runtime \
mlir-17-tools \
python3-clang-17 \
# LLVM + Clang 18 toolchain.
# libllvm-18-ocaml-dev libllvm18 llvm-18 llvm-18-dev llvm-18-doc llvm-18-examples llvm-18-runtime clang-18 clang-tools-18 clang-18-doc libclang-common-18-dev libclang-18-dev libclang1-18 clang-format-18 python3-clang-18 clangd-18 clang-tidy-18 libclang-rt-18-dev libpolly-18-dev libfuzzer-18-dev lldb-18 libc++-18-dev libc++abi-18-dev libomp-18-dev libclc-18-dev libunwind-18-dev libmlir-18-dev mlir-18-tools libbolt-18-dev bolt-18 flang-18 libclang-rt-18-dev-wasm32 libclang-rt-18-dev-wasm64 libc++-18-dev-wasm32 libc++abi-18-dev-wasm32 libclang-rt-18-dev-wasm32 libclang-rt-18-dev-wasm64 libllvmlibc-18-dev
libllvm-18-ocaml-dev \
libllvm18 \
llvm-18 \
llvm-18-dev \
llvm-18-doc \
llvm-18-examples \
llvm-18-runtime \
clang-18 \
clang-tools-18 \
clang-18-doc \
libclang-common-18-dev \
libclang-18-dev \
libclang1-18 \
clang-format-18 \
python3-clang-18 \
clangd-18 \
clang-tidy-18 \
libclang-rt-18-dev \
libpolly-18-dev \
libfuzzer-18-dev \
lldb-18 \
libc++-18-dev \
libc++abi-18-dev \
libomp-18-dev \
libclc-18-dev \
libunwind-18-dev \
libmlir-18-dev \
mlir-18-tools \
libbolt-18-dev \
bolt-18 \
flang-18 \
libclang-rt-18-dev-wasm32 \
libclang-rt-18-dev-wasm64 \
libc++-18-dev-wasm32 \
libc++abi-18-dev-wasm32 \
libclang-rt-18-dev-wasm32 \
libclang-rt-18-dev-wasm64 \
libllvmlibc-18-dev \
# hostapd build dependencies.
# libnl-3-200-dbg libnl-3-dev libssl-dev libnl-genl-3-dev
libnl-3-200-dbg \
Expand Down Expand Up @@ -128,7 +128,7 @@ RUN mkdir -p ${VCPKG_BINARY_CACHE}
# Obtain vcpkg, bootstrap it, and install dependencies.
COPY vcpkg.json .

RUN git clone https://github.com/microsoft/vcpkg.git --depth 1 && \
RUN git clone https://github.com/microsoft/vcpkg.git && \
./vcpkg/bootstrap-vcpkg.sh && \
./vcpkg/vcpkg install --clean-buildtrees-after-build --clean-downloads-after-build

Expand All @@ -140,7 +140,7 @@ ENTRYPOINT [ "/bin/entrypoint-build.sh" ]

FROM netremote-build as netremote-dev

LABEL org.label-schema.name = "Microsoft NetRemote development environment"
LABEL org.label-schema.name = "NetRemote development environment"
LABEL org.label-schema.description = "Development environment for the NetRemote project"

# Install packages.
Expand Down Expand Up @@ -174,8 +174,10 @@ RUN apt-get $APT_ARGS_COMMON update && \
python-is-python3 \
vim \
# Wireless tools.
# iw
iw \
# Packaging tools.
# debconf-utils
debconf-utils \
&& \
# Reduce image size by removing package cache.
Expand Down
37 changes: 24 additions & 13 deletions .docker/netremote-dev/entrypoint-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@

set -euf -o pipefail

REPOSITORY_ROOT=${1:-${PWD}}
readonly REPOSITORY_ROOT="${1:-${PWD}}"
readonly CMAKE_PRESET_CONFIGURE="${2:-cicd-linux}"
readonly CMAKE_PRESET_BUILD="${3:-build-cicd-linux}"
readonly CMAKE_PRESET_PACKAGE="${4:-cicd-linux}"
readonly CMAKE_PRESET_TEST="${5:-test-cicd-linux}"
readonly CMAKE_BUILD_CONFIG="${6:-Debug}"

echo "------------------------------------"
echo "Build entrypoint script parameters:"
echo "------------------------------------"
echo "Source Repository Root=${REPOSITORY_ROOT}"
echo "CMake"
echo " Build Configuration=${CMAKE_BUILD_CONFIG}"
echo " Presets"
echo " Configure='${CMAKE_PRESET_CONFIGURE}'"
echo " Build='${CMAKE_PRESET_BUILD}'"
echo " Test='${CMAKE_PRESET_TEST}'"
echo " Package='${CMAKE_PRESET_PACKAGE}'"

# Verify the repository root is a git repository.
if [[ ! -d ${REPOSITORY_ROOT}/.git ]]; then
Expand All @@ -16,17 +33,11 @@ if [[ ! -f ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake ]]; then
exit 1
fi

# Assign cmake presets.
# TODO: these should be passed in as arguments instead.
PRESET_CONFIGURE=release-linux
PRESET_BUILD=release-linux-debug
BUILD_CONFIG=Debug

# Add the workspace directory to the safe directory list.
git config --global --add safe.directory ${REPOSITORY_ROOT}
git config --global --add safe.directory "${REPOSITORY_ROOT}"

# Change to the root of the repo.
cd ${REPOSITORY_ROOT}
cmake --preset ${PRESET_CONFIGURE}
cmake --build --preset ${PRESET_BUILD}
cmake --install out/build/${PRESET_CONFIGURE} --config ${BUILD_CONFIG}
# Change to the root of the repo then execute then perform CMake configure, build, and test.
cd "${REPOSITORY_ROOT}"
cmake --preset "${CMAKE_PRESET_CONFIGURE}"
cmake --build --preset "${CMAKE_PRESET_BUILD}"
ctest --preset "${CMAKE_PRESET_TEST}" -C "${CMAKE_BUILD_CONFIG}"
2 changes: 1 addition & 1 deletion .docker/netremote-dev/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "netremote",
"version-string": "0.3.0",
"version-string": "0.4.0",
"dependencies": [
{
"name": "sdbus-cpp",
Expand Down
21 changes: 21 additions & 0 deletions .github/actions/build-with-docker/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@

name: 'Build'
description: 'Build the repository in a docker container'
inputs:
cmake-preset-configure:
required: false
default: 'dev-linux'
description: 'The name of the preset to use for the CMake configure operation'
cmake-preset-build:
required: false
default: 'build-dev-linux'
description: 'The name of the preset to use for the CMake build operation'
cmake-preset-package:
required: false
default: 'packaging-dev-linux'
description: 'The name of the preset to use for the CMake package operation'
cmake-build-config:
required: false
default: 'Debug'
description: 'The build configuration to use for the CMake build operation'
runs:
using: 'docker'
image: 'docker://abeltrano/netremote-build:latest'
args:
- '/github/workspace'
- ${{ inputs.cmake-preset-configure }}
- ${{ inputs.cmake-preset-build }}
- ${{ inputs.cmake-preset-package }}
- ${{ inputs.cmake-build-config }}
39 changes: 24 additions & 15 deletions .github/actions/build-with-host/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name: 'build-on-host'
description: 'Build the repository on the runner host system'
inputs:
os:
required: true
description: 'The target operating system to build for'
build-type:
required: false
default: 'Debug'
Expand All @@ -24,7 +27,7 @@ inputs:
description: 'Publish build artifacts'
preset-name:
required: false
default: 'dev-windows'
default: 'dev'
description: 'The name of the preset to use for all CMake operations (configure, build, test, install, package)'

runs:
Expand All @@ -36,43 +39,49 @@ runs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_DEFAULT_BINARY_CACHE', 'C:/vcpkg/archive');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite');
- name: Install vcpkg dependencies with Github Actions Cache
- name: Install Linux build dependencies
if: ${{ inputs.os == 'linux' }}
run: |
echo "VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}" >> "${GITHUB_ENV}"
echo "VCPKG_BINARY_SOURCES=${VCPKG_BINARY_SOURCES}" >> "${GITHUB_ENV}"
New-Item -Path ${env:VCPKG_DEFAULT_BINARY_CACHE} -ItemType Directory -Force
shell: pwsh
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get upgrade
# Install core build dependencies
sudo -E apt-get install -qq --no-install-recommends autoconf automake autopoint build-essential ca-certificates cmake curl git gnupg libltdl-dev libmount-dev libtool linux-libc-dev libstdc++-14-dev ninja-build pkg-config python3-jinja2 tar unzip zip
# Install LLVM 18 toolchain
sudo -E apt-get install -qq --no-install-recommends libllvm-18-ocaml-dev libllvm18 llvm-18 llvm-18-dev llvm-18-doc llvm-18-examples llvm-18-runtime clang-18 clang-tools-18 clang-18-doc libclang-common-18-dev libclang-18-dev libclang1-18 clang-format-18 python3-clang-18 clangd-18 clang-tidy-18 libclang-rt-18-dev libpolly-18-dev libfuzzer-18-dev lldb-18 libc++-18-dev libc++abi-18-dev libomp-18-dev libclc-18-dev libunwind-18-dev libmlir-18-dev mlir-18-tools libbolt-18-dev bolt-18 flang-18 libclang-rt-18-dev-wasm32 libclang-rt-18-dev-wasm64 libc++-18-dev-wasm32 libc++abi-18-dev-wasm32 libclang-rt-18-dev-wasm32 libclang-rt-18-dev-wasm64 libllvmlibc-18-dev
# Install hostapd dependencies
sudo -E apt-get install -qq --no-install-recommends libnl-3-200-dbg libnl-3-dev libssl-dev libnl-genl-3-dev libdbus-c++-dev libnl-route-3-dev
shell: bash

- name: CMake Configure
if: ${{ ! inputs.arch }}
run: cmake --preset ${{ inputs.preset-name }} --fresh -DCMAKE_BUILD_TYPE=${{ inputs.build-type }}
run: cmake --preset ${{ inputs.preset-name }}-${{ inputs.os }} --fresh -DCMAKE_BUILD_TYPE=${{ inputs.build-type }}
shell: pwsh

- name: CMake Configure Cross-Compile ${{ inputs.arch }}
if: ${{ inputs.arch }}
run: cmake --preset ${{ inputs.preset-name }} --fresh -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DNETREMOTE_EXCLUDE_TESTS=TRUE -A ${{ inputs.arch }}
run: cmake --preset ${{ inputs.preset-name }}-${{ inputs.os }} --fresh -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DNETREMOTE_EXCLUDE_TESTS=TRUE -A ${{ inputs.arch }}
shell: pwsh

- name: CMake Build
run: cmake --build --preset build-${{ inputs.preset-name }} --config ${{ inputs.build-type }}
run: cmake --build --preset build-${{ inputs.preset-name }}-${{ inputs.os }} --config ${{ inputs.build-type }}
shell: pwsh

- name: CMake Test (ctest)
if: ${{ inputs.test == 'true' && ! inputs.arch }}
run: ctest --preset ${{ inputs.preset-name }} -C ${{ inputs.build-type }}
run: ctest --preset test-${{ inputs.preset-name }}-${{ inputs.os }} -C ${{ inputs.build-type }}
shell: pwsh

- name: CMake Install
if: inputs.install == 'true'
run: cmake --build --preset build-${{ inputs.preset-name }} --target install --config ${{ inputs.build-type }}
run: cmake --build --preset build-${{ inputs.preset-name }}-${{ inputs.os }} --target install --config ${{ inputs.build-type }}
shell: pwsh

- name: CMake Package (cpack)
if: inputs.package == 'true'
run: cpack --preset package-${{ inputs.preset-name }} -C ${{ inputs.build-type }}
run: cpack --preset packaging-${{ inputs.preset-name }}-${{ inputs.os }} -C ${{ inputs.build-type }}
shell: pwsh

- name: Publish Artifacts
Expand All @@ -81,5 +90,5 @@ runs:
with:
name: release-package-${{ runner.os }}-${{ inputs.build-type }}-${{ inputs.arch != '' && inputs.arch || runner.arch }}
path: |
${{ github.workspace }}/out/package/${{ inputs.preset-name }}/*.tar.*
${{ github.workspace }}/out/package/${{ inputs.preset-name }}/*.zip
${{ github.workspace }}/out/package/${{ inputs.preset-name }}-${{ inputs.os }}/*.tar.*
${{ github.workspace }}/out/package/${{ inputs.preset-name }}-${{ inputs.os }}/*.zip
18 changes: 0 additions & 18 deletions .github/workflows/build-linux.yml

This file was deleted.

Loading

0 comments on commit 7089dc9

Please sign in to comment.