Skip to content

Commit

Permalink
Merge branch 'v9_0'
Browse files Browse the repository at this point in the history
  • Loading branch information
abower-amd committed Oct 4, 2024
2 parents 7a834aa + a0017fa commit 7891fc3
Show file tree
Hide file tree
Showing 11 changed files with 225 additions and 72 deletions.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,25 @@ else
$(error ZF_DEVEL unsupported when building from installed onload)
endif
$(info Using installed onload libraries and headers)

ifneq ("$(wildcard /usr/lib64/libcitools1.a)","")
CITOOLS_LIB := /usr/lib64/libcitools1.a
CIUL_LIB := /usr/lib64/libciul1.a
else ifneq ("$(wildcard /usr/lib/x86_64-linux-gnu/libcitools1.a)","")
CITOOLS_LIB := /usr/lib/x86_64-linux-gnu/libcitools1.a
else
$(warning Could not find libcitools1.a. Have you installed onload development headers?)
endif
$(info libcitools1.a found at $(CITOOLS_LIB))

ifneq ("$(wildcard /usr/lib64/libciul1.a)","")
CIUL_LIB := /usr/lib64/libciul1.a
else ifneq ("$(wildcard /usr/lib/x86_64-linux-gnu/libciul1.a)","")
CIUL_LIB := /usr/lib/x86_64-linux-gnu/libciul1.a
else
$(warning Could not find libciul1.a. Have you installed onload development headers?)
endif
$(info libciul1.a found at $(CIUL_LIB))

endif
include Makefile-top.inc

Expand Down
22 changes: 22 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ make
```

### Packaging

#### SRPM instructions
Use the [`zf_make_official_srpm`](./scripts/zf_make_official_srpm) script to create an SRPM package:

```bash
Expand Down Expand Up @@ -51,6 +53,26 @@ invocation of `rpmbuild` above:

Where the `${onload}` variable points to an Onload tarball.


#### Deb instructions

To install TCPDirect from a DEB:

The DEB package depends on `*onload-user` and `*onload-dev` packages in addition
to any other dependencies.

```bash
# 1. Extract debian-source tarball:
tar -xf tcpdirect_<version>-debiansource.tgz
# 2. Unpack debian source archive
dpkg-source -x tcpdirect_<version>-1.dsc
# 3. Enter newly created tcpdirect directory
cd tcpdirect-<version>
# 4. Build debian package
debuild -i -uc -us
# 5. Install debian package
dpkg -i ../tcpdirect_<version>-1_amd64.deb
```
## How to run unit tests

### Dependencies
Expand Down
29 changes: 13 additions & 16 deletions ci/test.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,15 @@ nm.slack_notify() {
archiveArtifacts(artifacts: '*.tgz')
archiveArtifacts(artifacts: '*.md5')
archiveArtifacts(artifacts: '*.txt')
sh 'rm *ReleaseNotes.txt'
stash name: 'text_files', includes: '*.txt'
zip_and_archive_files(
"tcpdirect-${tcpdirect_version_long}-tarball-doxbox.zip",
'*.tgz',
'*.md5',
'*.txt'
)
stash(
name: "tcpdirect-release-tarball",
includes: "tcpdirect-${tcpdirect_version_long}.tgz",
)
}
stash(name: "tcpdirect-build-artifacts", includes: "tcpdirect/build/artifacts/**")
}
}

Expand All @@ -220,25 +216,26 @@ nm.slack_notify() {
sh "rm -rf ${outdir}"
}
},
"publish release deb": {
"publish deb": {
node("deb") {
stage('stage installation') {
stage('Create source tarball') {
deleteDir()
unstash('tcpdirect-release-tarball')
sh "tar xvzf tcpdirect-${tcpdirect_version_long}.tgz"
sh "tcpdirect-${tcpdirect_version_long}/scripts/zf_install --packaging --dest-dir staging/usr"
stash(name: "tcpdirect-staged-installation", includes: "staging/**")
unstash('tcpdirect-src')
sh "tcpdirect/scripts/zf_mksrc --version ${tcpdirect_version_long}"
stash name: 'tcpdirect-tar', includes: "tcpdirect-${tcpdirect_version_long}.tar.gz"
sh "mv tcpdirect-${tcpdirect_version_long}.tar.gz tcpdirect-source-${tcpdirect_version_long}.tar.gz"
archiveArtifacts allowEmptyArchive: true, artifacts: "tcpdirect-source-${tcpdirect_version_long}.tar.gz", followSymlinks: false
}
stage('build deb') {
stage('create deb') {
deleteDir()
unstash('tcpdirect-staged-installation')
unstash('tcpdirect-tar')
unstash('tcpdirect-src')
sh "tcpdirect/scripts/zf_make_official_deb --version ${tcpdirect_version_long} staging"
archiveArtifacts allowEmptyArchive: true, artifacts: '*.deb', followSymlinks: false
sh "tcpdirect/scripts/zf_make_official_deb --version ${tcpdirect_version_long} tcpdirect-${tcpdirect_version_long}.tar.gz"
archiveArtifacts allowEmptyArchive: true, artifacts: '*debiansource.tgz', followSymlinks: false
unstash('text_files')
zip_and_archive_files(
"tcpdirect-${tcpdirect_version_long}-deb-doxbox.zip",
'*.deb',
'*debiansource.tgz',
'*.txt'
)
}
Expand Down
86 changes: 57 additions & 29 deletions doc/ReleaseNotes
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
TCPDirect-9.0.0
===============

This is a feature release of TCPDirect that includes fixes and other changes
since the TCPDirect-8.1.3.8.

See the ChangeLog for a list of fixes.
This is a feature release of TCPDirect that includes improvements since
TCPDirect-8.1.3.8. See the ChangeLog for a list of changes.

TCPDirect must be used with a matching version of Onload, in this case
Onload version 9.0.0. The network adapter and operating system support
derives from those supported by Onload.


Public Onload/ef_vi control plane API
-------------------------------------

The Onload control plane in this Onload-9.0.0 is presented via a new
public API that can be used by ef_vi applications. As an ef_vi application,
TCPDirect now uses this API to query the control plane server.


TCPDirect distributed as source code
------------------------------------

Expand All @@ -29,35 +19,40 @@ TCPDirect distributed as source code
suitable new build and installation workflows for the TCPDirect source
package.

In particular, this means an additional Onload development package
is required, which contains the necessary headers for building TCPDirect.

Installation (TBD: update this section)
------------

To install TCPDirect from a tarball:

1. As root, unpack the tar file using the tar command:
New onload development package
------------------------------

tar -zxvf tcpdirect-<version>.tgz
Onload now includes a package containing headers required by ef_vi
applications like TCPDirect. Installing this package is required to
build TCPDirect and TCPDirect applications.

This will unpack the tar file and, within the current directory,
create a sub-directory called tcpdirect-<version> which contains
other sub-directories including the scripts directory from
which subsequent install commands can be run.
Please ensure the openonload-devel RPM or onload-dev DEB is installed
after building Onload before attempting to build TCPDirect.

2. Go to the scripts directory:

cd tcpdirect-<version>/scripts
Public Onload/ef_vi control plane API
-------------------------------------

3. Install TCPDirect in the system directories:
The Onload control plane in this Onload-9.0.0 is presented via a new
public API that can be used by ef_vi applications. As an ef_vi application,
TCPDirect now uses this API to query the control plane server.

./zf_install

Successful installation is indicated with the following output:
Installation
------------

TCPDirect install complete
To install TCPDirect from a Source RPM:

0. The source RPM package depends on the Onload userspace and development
packages in addition to any other dependencies on standard system
packages:

To install TCPDirect from a Source RPM:
- onload
- onload-devel

1. Build the binary RPM from the source RPM file:

Expand All @@ -77,5 +72,38 @@ Installation (TBD: update this section)
rpm -Uvh <path>/tcpdirect-<module_version>.rpm


To install TCPDirect from a DEB:

0. The DEB source package depends on the Onload userspace and development
packages in addition to any other dependencies on standard system
packages:

- onload-user
- onload-dev

1. Extract debian-source tarball:

tar -xf tcpdirect_<version>-debiansource.tgz

2. Unpack debian source archive

dpkg-source -x tcpdirect_<version>-1.dsc

3. Enter newly created tcpdirect directory

cd tcpdirect-<version>

4. Build debian package

debuild -i -uc -us

5. Install debian package

dpkg -i tcpdirect_<version>-1_amd64.deb

There is no longer a 'tarball' distribution type as the RPM and DEB source
packages are suitable for all supported OSs.


SPDX-License-Identifier: MIT
SPDX-FileCopyrightText: (c) 2023-2024 Advanced Micro Devices, Inc.
12 changes: 8 additions & 4 deletions scripts/debian-templ/control
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Package: tcpdirect
Version: #VERSION#
Source: tcpdirect
Section: libs
Priority: optional
Maintainer: AMD NIC Support <support-nic@amd.com>
Build-Depends: debhelper (>= 8.0.0), onload-user, onload-dev, build-essential
Standards-Version: 3.9.3
Homepage: http://www.openonload.org

Package: tcpdirect
Architecture: amd64
Depends: onload-user | enterpriseonload-user | openonload-user | cloudonload-user
Maintainer: Support <support-nic@amd.com>
Depends: onload-user
Description: TCPDirect library
28 changes: 28 additions & 0 deletions scripts/debian-templ/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1

# dpkg-buildflags sets link time optimisation by default. Because we want to
# finish before the heat death of the universe, we disable the optimisation for
# this package.
export DEB_BUILD_MAINT_OPTIONS=optimize=-lto

%:
dh $@

override_dh_auto_build:
./scripts/zf_mkdist --name tcpdirect --version #VERSION#
tar -xzvf build/tcpdirect-#VERSION#.tgz

override_dh_auto_install:
mkdir -p $(CURDIR)/debian/tcpdirect/usr
cp ./scripts/zf_install tcpdirect-#VERSION#/scripts
./tcpdirect-#VERSION#/scripts/zf_install --dest-dir $(CURDIR)/debian/tcpdirect/usr --packaging

# By default, dh_compresses any files in usr/share/doc that is over 4k. This
# includes the example source and header files, which prevents easy compilation.
# Exclude the examples from the compress so that they are still compilable.
override_dh_compress:
dh_compress -Xexamples
1 change: 1 addition & 0 deletions scripts/debian-templ/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
38 changes: 19 additions & 19 deletions scripts/zf_make_official_deb
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ lib64_path() {
usage() {
err
err "usage:"
err " $me [options] <staged_tree>"
err " $me [options] <zf_tarball>"
err
err "options:"
err " --out <path> - directory to write source package to"
err " --version <version> - version number for debian package"
err
err "notes:"
err " prepare an appropriate staging directory. Example usage:"
err " zf_install --packaging --dest-dir staging/usr"
err " $me staging"
exit 1
}

Expand All @@ -55,7 +51,7 @@ done

[ $# -eq 1 ] || usage

staged=$1
tarball=$1

if [ ! -d "$outdir" ]; then
echo "$outdir does not appear to be a directory";
Expand All @@ -67,11 +63,9 @@ if [ -z "$version" ]; then
fi

# soversion=$(awk '/^ONLOAD_EXT_VERSION_MAJOR/{print $3}' $TOP/../mk/site/libs.mk)
deb_ver="1"
arch="amd64"
package_name="tcpdirect"
package="${package_name}_${version}"
tcpdirect_dir="${package}-${deb_ver}_${arch}"
tcpdirect_dir="${package_name}-${version}"
tempfile=$(mktemp -d)

if [ ! -d "$tempfile" ]; then
Expand All @@ -81,28 +75,34 @@ fi

echo "Creating package $package in $tempfile"

try mkdir -p "$tempfile/$tcpdirect_dir/DEBIAN"
try cp "${tarball}" "${tempfile}/${package}.orig.tar.gz"
try mkdir -p "$tempfile/$tcpdirect_dir/debian"

# Make any necessary replacements in the control files
for i in "$TOP"/scripts/debian-templ/*; do
try sed -e "s/#VERSION#/$version/g" -e "s|#LIBDIR#|"$(lib64_path)"|g" < "$i" > "${tempfile}/${tcpdirect_dir}/DEBIAN/$(basename "$i")";
find "$TOP"/scripts/debian-templ/* -type f | while read -r i; do
debfile="${tempfile}/${tcpdirect_dir}/debian/$(basename "$i")"
try sed -e "s/#VERSION#/$version/g" -e "s|#LIBDIR#|$(lib64_path)|g" < "$i" > "$debfile";
done

# Accoding to the Debian Policy Manual, executable maintainer scripts should be
# owned by root:root and have mode 755
for i in postinst postrm; do
try chmod 0755 "${tempfile}/${tcpdirect_dir}/DEBIAN/$i"
try chmod 0755 "${tempfile}/${tcpdirect_dir}/debian/$i"
done

dest_dir="${tempfile}/${tcpdirect_dir}"
try cd "$tempfile"
try tar xf "$package.orig.tar.gz" -C "$tcpdirect_dir" --strip-components=1
try cd "$tcpdirect_dir/debian"
try debuild -S -i -uc -us -d
try cd "$tempfile"

try cp -a ${staged}/* "${dest_dir}"
echo "Using package components:"
ls -- *.[gx]z *.dsc

try cd "$tempfile"
try fakeroot dpkg-deb -b "$tcpdirect_dir"
try mv "$tcpdirect_dir.deb" "$outdir/"
try tar zcf "$package-debiansource.tgz" --owner=root --group=root -- *.[gx]z *.dsc
try mv "$package-debiansource.tgz" "$outdir/"
try rm -rf "$tempfile"

echo ""
echo "Wrote $outdir/$tcpdirect_dir.deb"
echo "Wrote $outdir/$package-debiansource.tgz"
echo ""
4 changes: 3 additions & 1 deletion scripts/zf_make_tarball
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ make_release_package() {
cp "${script_dir}"/zf_install "${stage_dir}/scripts"
cp "${script_dir}"/zf_uninstall "${stage_dir}/scripts"
cp "${script_dir}"/zf_debug "${stage_dir}/scripts"
cp "${script_dir}"/tcpdirect_misc/tcpdirect.spec "${stage_dir}/scripts"

if [ -f "${script_dir}"/tcpdirect_misc/tcpdirect.spec ]; then
cp "${script_dir}"/tcpdirect_misc/tcpdirect.spec "${stage_dir}/scripts"
fi

# Add documents to tarball
# Currently only ReleaseNotes exists (in a separate branch), so checks are added for each file
Expand Down
Loading

0 comments on commit 7891fc3

Please sign in to comment.