Skip to content

Commit

Permalink
Release v0.7.0 (#2169)
Browse files Browse the repository at this point in the history
* wip

* wip

* wip

* doc

* Fix bpftoc generation script
  • Loading branch information
gtrevi authored Mar 9, 2023
1 parent 82bc565 commit 9f58bcb
Show file tree
Hide file tree
Showing 120 changed files with 181 additions and 151 deletions.
90 changes: 60 additions & 30 deletions docs/ReleaseProcess.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,63 @@
# Release Process

This file details the steps for creating a versioned release of
eBPF for Windows.

Note: Currently releases are not production signed.

1. Update the version number, making sure to follow [Semantic Versioning 2.0](https://semver.org), in the following files:
* resource\ebpf_version.h
* installer\Product.wxs (in the XML attribute `<Wix... <Product... Version="x.y.z" ...>...>`)
* docs\tutorial.md
2. Regenerate the expected bpf2c output:
``` .\scripts\generate_expected_bpf2c_output.ps1 .\x64\Debug\```
and (until issue #2026 is fixed) manually update:
* .\tests\bpf2c_tests\expected\bpf_{dll,raw,sys}.c
* .\tests\bpf2c_tests\expected\empty_{dll,raw,sys}.c
3. Create a pull request with the version number changes
4. Once the build completes on the PR, download the
"ebpf-for-windows.msi" and "ebpf-for-windows nuget" build artifacts
(accessible via the Actions tab on github)
5. Extract the .msi and .nupkg, respectively, out of them
6. Test the MSI manually (since not yet tested in CI/CD):
1. Copy the MSI into a VM (if not already there)
2. Install it, and run a command or two (bpftool prog show, netsh eb sh prog) to make sure it's installed
7. Add a tag to the commit with the version number changes
(e.g., "git tag v0.3.0", "git push --tags")
8. Go to the repo on github and click on "tags" (a bit to the right of the branch combo box)
9. Find the tag you created, and click "..." on the right and "Create release"
10. Start uploading the .msi and .nupkg files
11. Manually enter release notes or click "Generate release notes"
12. Click "This is a pre-release" unless the release is production-signed
13. Once the uploads are complete (it may take a while), click "Publish release"
14. Upload the .nupkg file to nuget.org
eBPF for Windows:

>**Note**: Currently releases are *not* production signed.
1. On your private repo fork, create a new release branch from `main`, i.e., "`user/release-vX.Y.Z`".
1. Update the version number, making sure to follow [Semantic Versioning 2.0](https://semver.org) ("`x.y.z`"), in the following files:
* `resource\ebpf_version.h`
* `installer\Product.wxs`, within the following XML attribute:

```xml
<Wix... <Product... Version="x.y.z" ...>...>
```
* `docs\tutorial.md`
1. Open Visual Studio and *Rebuild* `ebpf-for-windows.sln` in "`x64/Debug`" mode.
1. Regenerate the expected `bpf2c` output (i.e. the corresponding "`.c`" files for all the solution's test/demo "`.o`" files), by running the following script:

```ps
.\scripts\generate_expected_bpf2c_output.ps1 .\x64\Debug\
```
1. Commit all the changes in the release branch into your forked repo.
1. Create a **Draft** pull-request for the release branch into the main `ebpf-for-windows` repo, and title the PR as *"Release v`X.Y.Z`"* (replace "`X.Y.Z`" with the version number being released).
1. Once the CI/CD pipeline for the PR completes, download the
"`ebpf-for-windows MSI installer (Release)`" and "`ebpf-for-windows nuget`" build artifacts
(accessible via the "`Actions`" tab on GitHub).
1. Extract the `*.msi` and `*.nupkg` files, respectively, out of them, and rename them in the following format (replace "`X.Y.Z`" with the version number being released):

- `eBPF-for-Windows.X.Y.Z.msi`
- `eBPF-for-Windows.X.Y.Z.nupkg`

1. Test the MSI manually (since not yet tested in CI/CD):
1. Copy the MSI into a VM.
>**Note**: currently only test-signed VMs are supported.
1. Install the MSI by *enabling all its features* from the GUI.
1. **After** the MSI has successfully installed, open a **new** *Admin Command Prompt*, and run the following commands to make sure the eBPF platform is correctly installed and working, e.g.:

```bash
# Verify that the eBPF drivers are running:
sc.exe query eBPFCore
sc.exe query NetEbpfExt

# Verify that the netsh extension is operational:
netsh ebpf show prog

# Run the unit tests, and expect a full pass:
cd <eBPF install folder>\testing
unit_tests.exe -d yes

# Test some additional commands, e.g.:
bpftool prog show
```
1. Submit the PR for review (from its draft state), and wait for it to be approved and merged into `main`.
1. Go to the repo on GitHub and click on "`<Code>`" and click on right the "`Create a new release`" link.
1. Click on the "`Choose a tag`" combo box and input the new version number as "`vX.Y.Z`", then click on "`Create new tag: X.Y.Z on publish`".
1. Click on the "`Target`" combo box, select the "`Recent commits`" tab and search for the commit checksum for the release PR just merged into `main`.
1. Fill in the release title as "`vX.Y.Z`" (replace "`X.Y.Z`" with the version number being released).
1. Manually enter release notes or click "`Generate release notes`".
1. Attach the `.msi` and `.nupkg` files by dropping them in the "`Attach binaries by dropping them here or selecting them.`" area.
1. Check the "`Set as a pre-release`" checkbox, unless the release is production-signed.
1. Once the uploads are complete (it may take a while), click "`Publish release`".
1. Upload the `.nupkg` file to [nuget.org](nuget.org), and put a markup link to "`.\README.md`" as the description for the package (the metadata inside the `.nuget` package itself will automatically populate all the other form fields).
6 changes: 3 additions & 3 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,10 @@ int func()
Let's compile it and see what it looks like. Here we compile with `-g`
to include source line info:

> Note: Replace `.\eBPF-for-Windows.0.6.0\build\native\include\` with the path to the ebpf-for-windows nuget `./include` directory (should be in the directory where you ran `nuget install eBPF-for-Windows`). This is the first time we included header files while building so we need to use the Windows eBPF headers which we get from the nuget package.
> Note: Replace `.\eBPF-for-Windows.0.7.0\build\native\include\` with the path to the ebpf-for-windows nuget `./include` directory (should be in the directory where you ran `nuget install eBPF-for-Windows`). This is the first time we included header files while building so we need to use the Windows eBPF headers which we get from the nuget package.
```
> clang -I .\eBPF-for-Windows.0.6.0\build\native\include\ -target bpf -Werror -g -O2 -c helpers.c -o helpers.o
> clang -I .\eBPF-for-Windows.0.7.0\build\native\include\ -target bpf -Werror -g -O2 -c helpers.c -o helpers.o
> llvm-objdump --triple bpf -S helpers.o
Expand Down Expand Up @@ -793,7 +793,7 @@ using the map parameters specified. We can see the fields encoded
into the `maps` section as follows:

```
> clang -I -I .\eBPF-for-Windows.0.6.0\build\native\include\ -target bpf -Werror -g -O2 -c maponly.c -o maponly.o
> clang -I -I .\eBPF-for-Windows.0.7.0\build\native\include\ -target bpf -Werror -g -O2 -c maponly.c -o maponly.o
> llvm-objdump -s -section maps maponly.o
maponly.o: file format ELF64-BPF
Expand Down
2 changes: 1 addition & 1 deletion installer/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT
<?define ProductVersion="022C44B5-8969-4B75-8DB0-73F98B1BD7DC"?>
<?define UpgradeCode="B6BCACB1-C872-4159-ABCB-43A50668056C"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:ui="http://schemas.microsoft.com/wix/UIExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="$(var.ProductVersion)" Name="eBPF for Windows" Language="1033" Version="0.6.0" Manufacturer="Microsoft" UpgradeCode="$(var.UpgradeCode)">
<Product Id="$(var.ProductVersion)" Name="eBPF for Windows" Language="1033" Version="0.7.0" Manufacturer="Microsoft" UpgradeCode="$(var.UpgradeCode)">
<Package Description="eBPF for Windows" InstallerVersion="301" Compressed="yes" InstallScope="perMachine" Manufacturer="Microsoft" Platform="x64" />
<MajorUpgrade AllowSameVersionUpgrades="yes"
Disallow="yes" DisallowUpgradeErrorMessage="An older version of [ProductName] is already installed. Please remove it first."
Expand Down
2 changes: 1 addition & 1 deletion resource/ebpf_version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation
// SPDX-License-Identifier: MIT

#define EBPF_VERSION "0.6.0"
#define EBPF_VERSION "0.7.0"
2 changes: 1 addition & 1 deletion scripts/generate_expected_bpf2c_output.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function Update-ExpectedOutput
}

$ext = [System.IO.Path]::GetExtension($file.Name)
if (($ext -ne ".c") -and ($ext -ne ".C"))
if (($ext -ne ".c") -and ($ext -ne ".C") -and ($ext -ne ".o") -and ($ext -ne ".O"))
{
continue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/atomic_instruction_others_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/atomic_instruction_others_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/atomic_instruction_others_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bad_map_name_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bad_map_name_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bad_map_name_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_ringbuf_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_ringbuf_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_ringbuf_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bpf_call_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bpf_call_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bpf_call_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bpf_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bpf_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/bpf_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/cgroup_sock_addr2_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/cgroup_sock_addr2_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/cgroup_sock_addr2_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/bpf2c_tests/expected/cgroup_sock_addr_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ static void
_get_version(_Out_ bpf2c_version_t* version)
{
version->major = 0;
version->minor = 6;
version->minor = 7;
version->revision = 0;
}

Expand Down
Loading

0 comments on commit 9f58bcb

Please sign in to comment.