Skip to content

Commit 6a259f5

Browse files
committed
Update versions.env
Signed-off-by: Miłosz Linkiewicz <[email protected]>
1 parent 43db55f commit 6a259f5

File tree

6 files changed

+187
-176
lines changed

6 files changed

+187
-176
lines changed

media-proxy/Dockerfile

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,27 @@ ARG IMAGE_NAME=library/ubuntu:22.04@sha256:a6d2b38300ce017add71440577d5b0a90460d
88

99
FROM ${IMAGE_CACHE_REGISTRY}/${IMAGE_NAME} AS builder
1010

11+
ARG MCM_DIR="/opt/mcm"
1112
ARG VERSIONS_FILE="versions.env"
12-
COPY "${VERSIONS_FILE}" /opt/versions.env
13-
ENV BASH_ENV=/opt/versions.env
13+
ARG GITHUB_CREDENTIALS=""
14+
COPY . "${MCM_DIR}"
15+
COPY "${VERSIONS_FILE}" "${MCM_DIR}/versions.env"
1416

15-
ARG MTL_VER=""
16-
ARG DPDK_VER=""
17-
ARG GPRC_VER=""
18-
ARG JPEGXS_VER=""
19-
ARG LIBFABRIC_VER=""
17+
SHELL ["/bin/bash", "-ex", "-o", "pipefail", "-c"]
18+
ENV BASH_ENV="${MCM_DIR}/versions.env"
2019

21-
ARG MCM_DIR="/opt/mcm"
22-
ARG MTL_DIR="/opt/mtl"
23-
ARG DPDK_DIR="/opt/dpdk"
24-
ARG XDP_DIR="/opt/xdp"
25-
ARG GRPC_DIR="/opt/grpc"
26-
ARG JPEGXS_DIR="/opt/jpegxs"
27-
ARG LIBFABRIC_DIR="/opt/libfabric"
20+
ENV PREFIX_DIR="/install"
21+
ENV REPO_DIR="${MCM_DIR}"
22+
ENV BUILD_DIR="${REPO_DIR}/_build}"
23+
ENV GRPC_DIR="${BUILD_DIR}/grpc"
24+
ENV DPDK_DIR="${BUILD_DIR}/dpdk"
25+
ENV XDP_DIR="${BUILD_DIR}/xdp"
26+
ENV JPEGXS_DIR="${BUILD_DIR}/jpegxs"
27+
ENV LIBFABRIC_DIR="${BUILD_DIR}/libfabric"
2828

29-
ARG GITHUB_CREDENTIALS=""
30-
ARG PREFIX_DIR="/install"
3129
ENV PATH="${PREFIX_DIR}/bin:/root/.local/bin:/root/bin:/root/usr/bin:$PATH"
3230
ENV PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig
3331

34-
SHELL ["/bin/bash", "-ex", "-o", "pipefail", "-c"]
3532
# Install package dependencies
3633
RUN apt-get update --fix-missing && \
3734
apt-get full-upgrade -y && \
@@ -122,7 +119,6 @@ RUN ./build.sh build-only && \
122119

123120
# Build MCM
124121
WORKDIR ${MCM_DIR}
125-
COPY . ${MCM_DIR}
126122
RUN ./build.sh "${PREFIX_DIR}" && \
127123
cp "${MTL_DIR}/build/manager/MtlManager" "${PREFIX_DIR}/usr/local/bin/" && \
128124
cp -fR "/usr/local/lib/bpf/"* "${PREFIX_DIR}/usr/local/lib/bpf/" && \
@@ -137,7 +133,7 @@ RUN ./build.sh "${PREFIX_DIR}" && \
137133

138134
ARG IMAGE_CACHE_REGISTRY
139135
ARG IMAGE_NAME
140-
FROM ${IMAGE_CACHE_REGISTRY}/${IMAGE_NAME} as media-proxy
136+
FROM ${IMAGE_CACHE_REGISTRY}/${IMAGE_NAME} AS media-proxy
141137

142138
143139
LABEL org.opencontainers.image.title="Media Communications Mesh Media Proxy"
@@ -184,7 +180,7 @@ SHELL ["/bin/bash", "-c"]
184180
ENTRYPOINT ["/usr/local/bin/media_proxy"]
185181
HEALTHCHECK --interval=30s --timeout=5s CMD ps aux | grep "media_proxy" || exit 1
186182

187-
FROM media-proxy as mtl-manager
183+
FROM media-proxy AS mtl-manager
188184

189185
190186
LABEL org.opencontainers.image.title="Media Communications Mesh Mtl Manager"
@@ -198,7 +194,7 @@ SHELL ["/bin/bash", "-c"]
198194
ENTRYPOINT ["/usr/local/bin/MtlManager"]
199195
HEALTHCHECK --interval=30s --timeout=5s CMD if(( $(ps aux | grep "MtlManager" | wc -l) != 2 )); then exit 1; fi
200196

201-
FROM media-proxy as mesh-agent
197+
FROM media-proxy AS mesh-agent
202198

203199
204200
LABEL org.opencontainers.image.title="Media Communications Mesh Mesh Agent"

scripts/common.sh

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,22 @@
11
#!/bin/bash
22

33
# SPDX-License-Identifier: BSD-3-Clause
4-
# Copyright 2024 Intel Corporation
4+
# Copyright 2025 Intel Corporation
55

66
REPO_DIR="$(readlink -f "$(dirname -- "${BASH_SOURCE[0]}")/..")"
7-
export REPO_DIR
8-
export BUILD_DIR="${BUILD_DIR:-${REPO_DIR}/_build}"
9-
export DRIVERS_DIR="${DRIVERS_DIR:-/opt/intel/drivers}"
10-
export PREFIX_DIR="${PREFIX_DIR:-${REPO_DIR}/_install}"
11-
12-
MCM_VERSIONS_FILE_PATH="$(readlink -f "${MCM_VERSIONS_FILE:-${REPO_DIR}/versions.env}")"
13-
export MCM_VERSIONS_FILE_PATH
147

8+
MCM_VERSIONS_FILE_PATH="$(readlink -f "${MCM_VERSIONS_FILE_PATH:-${REPO_DIR}/versions.env}")"
9+
if [[ -f "${MCM_VERSIONS_FILE_PATH}" ]]; then
1510
# shellcheck source="versions.env"
16-
. "${MCM_VERSIONS_FILE_PATH}"
17-
18-
export MTL_DIR="${BUILD_DIR}/mtl"
19-
MTL_VERSIONS_FILE_PATH="${MTL_VERSIONS_FILE:-${MTL_DIR}/versions.env}"
20-
21-
if [[ -f "${MTL_VERSIONS_FILE_PATH}" ]]; then
22-
MTL_VERSIONS_FILE_PATH="$(readlink -f "${MTL_VERSIONS_FILE_PATH}")"
23-
export MTL_VERSIONS_FILE_PATH
24-
# shellcheck source=/dev/null
25-
. "${MTL_VERSIONS_FILE_PATH}"
11+
. "${MCM_VERSIONS_FILE_PATH}"
2612
fi
2713

28-
export DPDK_DIR="${BUILD_DIR}/dpdk"
29-
export XDP_DIR="${BUILD_DIR}/xdp"
30-
export BPF_DIR="${XDP_DIR}/lib/libbpf"
31-
export GRPC_DIR="${BUILD_DIR}/grpc"
32-
export JPEGXS_DIR="${BUILD_DIR}/jpegxs"
33-
export LIBFABRIC_DIR="${BUILD_DIR}/libfabric"
34-
export LIBFDT_DIR="${BUILD_DIR}/libfdt"
35-
export JSONC_DIR="${BUILD_DIR}/json-c"
36-
export CMAKE_DIR="${BUILD_DIR}/cmake"
37-
export NASM_DIR="${BUILD_DIR}/nasm"
38-
39-
export ICE_DIR="${DRIVERS_DIR}/ice/${ICE_VER}"
40-
export IRDMA_DIR="${DRIVERS_DIR}/irdma/${IRDMA_VER}"
41-
4214
PM="${PM:-apt-get}"
43-
KERNEL_VERSION="${KERNEL_VERSION:-$(uname -r)}"
44-
export TZ="${TZ:-Europe/Warsaw}"
45-
export NPROC="${NPROC:-$(nproc)}"
15+
NPROC="${NPROC:-$(nproc)}"
4616

4717
if ! grep "/root/.local/bin" <<< "${PATH}" > /dev/null 2>&1; then
48-
export PATH="/root/.local/bin:/root/bin:/root/usr/bin:${PATH}"
49-
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig:${PKG_CONFIG_PATH}"
18+
export PATH="/root/.local/bin:/root/bin:/root/usr/bin:${PATH}"
19+
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig:${PKG_CONFIG_PATH}"
5020
fi
5121

5222
BOLD="${BOLD:-\e[1;}"

scripts/setup_build_env.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
SCRIPT_DIR="$(readlink -f "$(dirname -- "${BASH_SOURCE[0]}")")"
44
. "${SCRIPT_DIR}/common.sh"
55

6-
export PM="${PM:-apt-get}"
7-
export DEBIAN_FRONTEND="noninteractive"
8-
9-
export KERNEL_VERSION="${KERNEL_VERSION:-$(uname -r)}"
10-
export INSTALL_USE_CUSTOM_PATH="${INSTALL_USE_CUSTOM_PATH:-false}"
11-
126
SYS_PKG_CONFIG_PATH="${SYS_PKG_CONFIG_PATH:-/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig}"
137
if [[ "${PKG_CONFIG_PATH}" != *"${SYS_PKG_CONFIG_PATH}"* ]]; then
148
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${SYS_PKG_CONFIG_PATH}"

scripts/setup_ice_irdma.sh

Lines changed: 95 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/usr/bin/env bash
22

33
SCRIPT_DIR="$(readlink -f "$(dirname -- "${BASH_SOURCE[0]}")")"
4-
export WORKING_DIR="${BUILD_DIR:-${REPO_DIR}/build/rdma}"
5-
export PERF_DIR="${DRIVERS_DIR}/perftest"
6-
74
. "${SCRIPT_DIR}/setup_build_env.sh"
85

96
function print_usage()
@@ -15,19 +12,21 @@ function print_usage()
1512
log_info ""
1613
log_info "\tall"
1714
log_info "\t\t get, build, and install whole stack."
18-
log_info "\tget-ice"
19-
log_info "\t\t get, build, and install ice, rdma, and irdma drivers stack."
20-
log_info "\tget-irdma"
21-
log_info "\t\t setup and pre-configure rdma, irdma and libfabrics ."
22-
log_info "\tget-perftest"
15+
log_info "\tice"
16+
log_info "\t\t get, build, and install ICE (cvl) drivers stack."
17+
log_info "\tiavf"
18+
log_info "\t\t get, build, and install IAVF (virtual functions) drivers stack."
19+
log_info "\tirdma"
20+
log_info "\t\t setup and pre-configure iRDMA and libfabrics."
21+
log_info "\tperftest"
2322
log_info "\t\t download and install perftest and dependencies."
2423
log_info "\tcheck-mtu"
2524
log_info "\t\t fast-check basics in environment."
2625
log_info "\tset-mtu <INTERFACE>"
2726
log_info "\t\t temporarily set MTU to 9000 for given interface."
2827
log_info "\trun-perftest <INTERFACE>"
2928
log_info "\t\t execute installed perftests."
30-
log_info ""
29+
log_info ""
3130
log_info "\tintel"
3231
log_info "\t\t animation in bash"
3332
}
@@ -79,52 +78,80 @@ function install_os_dependencies()
7978
return 0
8079
}
8180

82-
function get_irdma_driver_tgz() {
83-
echo "https://downloadmirror.intel.com/${IRDMA_DMID}/irdma-${IRDMA_VER}.tgz"
84-
}
85-
8681
function get_and_patch_intel_drivers()
8782
{
8883
log_info "Intel drivers: Starting download and patching actions."
89-
if [[ ! -d "${MTL_DIR}" ]]; then
90-
git_download_strip_unpack "OpenVisualCloud/Media-Transport-Library" "${MTL_VER}" "${MTL_DIR}"
91-
fi
84+
if [[ ! -d "${MTL_DIR}" ]]; then git_download_strip_unpack "OpenVisualCloud/Media-Transport-Library" "${MTL_VER}" "${MTL_DIR}"; fi
85+
if [[ -d "${ICE_DIR}" ]]; then rm -rf "${ICE_DIR}"; fi
86+
87+
git_download_strip_unpack "intel/ethernet-linux-ice" "refs/tags/v${ICE_VER}" "${ICE_DIR}"
88+
9289
if [ ! -d "${MTL_DIR}/patches/ice_drv/${ICE_VER}/" ]; then
93-
log_error "MTL patch for ICE=v${ICE_VER} could not be found: ${MTL_DIR}/patches/ice_drv/${ICE_VER}"
90+
log_error "No Intel ICE (cvl) patches for ICE=v${ICE_VER} found at ${MTL_DIR}/patches/ice_drv/${ICE_VER}"
91+
log_error "version supported: $(ls "${MTL_DIR}/patches/ice_drv/")"
9492
return 1
9593
fi
96-
if [[ -d "${ICE_DIR}" ]]; then
97-
rm -rf "${ICE_DIR}"
98-
fi
99-
git_download_strip_unpack "intel/ethernet-linux-ice" "refs/tags/v${ICE_VER}" "${ICE_DIR}"
100-
10194
pushd "${ICE_DIR}" && \
102-
patch -p1 -i <(cat "${MTL_DIR}/patches/ice_drv/${ICE_VER}/"*.patch) && \
95+
patch -p1 -i <(cat "${MTL_DIR}/patches/ice_drv/${ICE_VER}/"*.patch) && \
10396
popd && \
104-
{ log_success "Intel drivers: Finished download and patching actions." && return 0; } ||
97+
{ log_success "Intel drivers: Finished download and patching actions." && return 0; } || \
10598
{ log_error "Intel drivers: Failed to download or patch." && return 1; }
10699
}
107100

108-
function build_install_and_config_intel_drivers()
101+
function build_install_and_config_ice_driver()
109102
{
110-
log_info "Intel ICE: Driver starting the build and install workflow."
111-
if ! as_root make "-j${NPROC}" -C "${ICE_DIR}/src" install; then
112-
log_error "Intel ICE: Failed to build and install drivers"
113-
exit 5
114-
fi
115-
as_root rmmod irdma 2>&1 || true
116-
as_root rmmod ice
117-
as_root modprobe ice
118-
log_success "Intel ICE: Drivers finished install process."
103+
log_info "Intel ICE: Driver starting the build and install workflow."
104+
get_and_patch_intel_drivers
119105

120-
return 0
106+
as_root make "-j${NPROC}" -C "${ICE_DIR}/src" clean || true
107+
if ! as_root make "-j${NPROC}" -C "${ICE_DIR}/src" ; then
108+
log_error "Intel ICE: Failed to build and install drivers"
109+
exit 5
110+
fi
111+
if ! as_root make "-j${NPROC}" -C "${ICE_DIR}/src" install; then
112+
log_error "Intel ICE: Failed to build and install drivers"
113+
exit 5
114+
fi
115+
as_root rmmod irdma 2>/dev/null || true
116+
as_root rmmod ice 2>/dev/null || true
117+
sleep 1 && \
118+
as_root modprobe ice && \
119+
log_success "Intel ICE: Drivers finished install process."
120+
return 0
121+
}
122+
123+
function build_install_and_config_intel_driver()
124+
{
125+
build_install_and_config_ice_driver
126+
return $?
121127
}
122128

123-
function build_install_and_config_irdma_drivers()
129+
function build_install_and_config_iavf_driver()
124130
{
125-
IRDMA_REPO="$(get_irdma_driver_tgz)"
131+
log_info "Intel IAVF: Driver starting the build and install workflow."
132+
git_download_strip_unpack "intel/ethernet-linux-iavf" "refs/tags/v${IAVF_VER}" "${IAVF_DIR}"
133+
134+
as_root make "-j${NPROC}" -C "${IAVF_DIR}/src" clean || true
135+
if ! as_root make "-j${NPROC}" -C "${IAVF_DIR}/src" ; then
136+
log_error "Intel IAVF: Failed to build and install drivers"
137+
exit 5
138+
fi
139+
if ! as_root make "-j${NPROC}" -C "${IAVF_DIR}/src" install; then
140+
log_error "Intel IAVF: Failed to build and install drivers"
141+
exit 6
142+
fi
143+
as_root rmmod iavf || true
144+
sleep 1 && \
145+
as_root modprobe iavf || true
146+
log_success "Intel IAVF: Drivers finished install process."
147+
return 0
148+
}
149+
150+
function build_install_and_config_irdma_driver()
151+
{
152+
IRDMA_REPO="${IRDMA_REPO:-"https://downloadmirror.intel.com/${IRDMA_DMID}/irdma-${IRDMA_VER}.tgz"}"
126153
wget_download_strip_unpack "${IRDMA_REPO}" "${IRDMA_DIR}"
127-
154+
128155
if pushd "${IRDMA_DIR}"; then
129156
"${IRDMA_DIR}/build_core.sh" -y || exit 2
130157
as_root "${IRDMA_DIR}/install_core.sh" || exit 3
@@ -253,14 +280,14 @@ function run_perftest()
253280
network_mask="${3:-24}"
254281
ip addr show dev "${interface_name}" | grep "${network_address}" || \
255282
ip addr add "${network_address}/${network_mask}" dev "${interface_name}"
256-
taskset -c 1 ib_write_bw --qp=4 --report_gbit -D 60 --tos 96 -R &> "${WORKING_DIR}/perftest_server.log" &
283+
taskset -c 1 ib_write_bw --qp=4 --report_gbit -D 60 --tos 96 -R &> "${PERF_RUN_DIR}/perftest_server.log" &
257284
server_pid=$!
258-
ib_write_bw "${network_address}" --qp=4 --report_gbit -D 60 --tos 96 -R &> "${WORKING_DIR}/perftest_client.log" &
285+
ib_write_bw "${network_address}" --qp=4 --report_gbit -D 60 --tos 96 -R &> "${PERF_RUN_DIR}/perftest_client.log" &
259286
client_pid=$!
260287
log_info "perftest is running. Waiting 60 s..."
261288
wait $server_pid
262289
wait $client_pid
263-
log_info "perftest completed. See results in $WORKING_DIR/perftest_server.log and ${WORKING_DIR}/perftest_client.log"
290+
log_info "perftest completed. See results in $PERF_RUN_DIR/perftest_server.log and ${PERF_RUN_DIR}/perftest_client.log"
264291
ip addr del "${network_address}/${network_mask}" dev "${interface_name}"
265292
}
266293

@@ -273,38 +300,45 @@ then
273300
exit 1
274301
fi
275302

276-
if [[ -f "${WORKING_DIR}" ]]; then
277-
log_error "Can't create rdma directory because of the rdma file ${WORKING_DIR}"
303+
if [[ -f "${PERF_RUN_DIR}" ]]; then
304+
log_error "Can't create rdma directory because of the rdma file ${PERF_RUN_DIR}"
278305
exit 1
279306
fi
280-
rm -f "./${WORKING_DIR}/*"
281-
mkdir -p "${WORKING_DIR}" "${PERF_DIR}"
282-
283-
set -eEo pipefail
284-
285-
if [[ "${1}" == "get-ice" || "${1}" == "all" ]]; then
286-
install_os_dependencies && \
287-
get_and_patch_intel_drivers && \
288-
build_install_and_config_intel_drivers
307+
rm -f "./${PERF_RUN_DIR}/*"
308+
mkdir -p "${PERF_RUN_DIR}" "${PERF_DIR}"
309+
310+
set -eEo pipefail
311+
312+
if [[ "${1}" == *"ice" || "${1}" == *"iavf" || "${1}" == *"irdma" || "${1}" == "all" ]]; then
313+
install_os_dependencies
314+
fi
315+
if [[ "${1}" == *"ice" || "${1}" == "all" ]]; then
316+
317+
build_install_and_config_ice_driver
289318
return_code="$?"
290319
if [[ "${return_code}" == "0" ]]; then
291-
log_success "Finished: Build and install and configuration of Intel drivers.";
320+
log_success "Finished: Intel ICE (cvl) driver build, install and configuration.";
292321
else
293-
log_error "Intel drivers configuration/installation failed."
322+
log_error "Intel ICE drivers configuration/installation failed."
294323
fi
295324
fi
296-
if [[ "${1}" == "get-irdma" || "${1}" == "all" ]]; then
297-
if [[ "${1}" == "get-irdma" ]]; then
298-
install_os_dependencies && \
299-
lib_install_fabrics
325+
if [[ "${1}" == *"iavf" || "${1}" == "all" ]]; then
326+
build_install_and_config_iavf_driver
327+
return_code="$?"
328+
if [[ "${return_code}" == "0" ]]; then
329+
log_success "Finished: Intel IAVF driver build, install and configuration.";
330+
else
331+
log_error "Intel IAVF drivers configuration/installation failed."
300332
fi
301-
build_install_and_config_irdma_drivers && \
333+
fi
334+
if [[ "${1}" == *"irdma" || "${1}" == "all" ]]; then
335+
build_install_and_config_irdma_driver && \
302336
config_intel_rdma_driver
303337
return_code="$?"
304338
if [[ "${return_code}" == "0" ]]; then
305-
log_success "Finished: irdma driver configuration for Intel hardware backend."
339+
log_success "Finished: Intel IRDMA driver build, install and configuration."
306340
else
307-
log_error "Intel irdma configuration failed."
341+
log_error "Intel IRDMA drivers configuration/installation failed."
308342
exit "${return_code}"
309343
fi
310344
fi

0 commit comments

Comments
 (0)