Skip to content

Commit aaba945

Browse files
committed
docker: optimize ru_emulator build
1 parent f9e3bb6 commit aaba945

File tree

2 files changed

+38
-22
lines changed

2 files changed

+38
-22
lines changed

.gitlab/ci/docker.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ metrics version check in retina:
124124
tags:
125125
- amd64-avx2
126126
timeout: 2h
127-
before_script:
127+
before_script: &docker_setup
128128
- dockerd-entrypoint.sh &
129129
- |
130130
while ! ( nc -zv localhost 2376 2>&1 >/dev/null )
131131
do
132132
sleep 1
133133
done
134134
135-
gnb docker compose:
135+
.gnb docker compose:
136136
extends: .docker compose
137137
variables: &build_in_compose_variables
138138
KUBERNETES_CPU_REQUEST: 6
@@ -149,15 +149,26 @@ gnb docker compose:
149149
- docker/docker-compose.yml
150150
- if: $CI_DESCRIPTION =~ /Nightly Build Unit Tests/
151151
interruptible: false
152-
script:
152+
before_script:
153+
- *docker_setup
153154
- docker compose -f docker/docker-compose.yml build --build-arg NUM_CORES=${KUBERNETES_CPU_LIMIT} --build-arg LIB=${LIB} --build-arg LIB_VERSION=${LIB_VERSION} gnb
154-
- sh -c "docker compose -f docker/docker-compose.yml run --no-deps gnb ${TEST_CMD}"
155-
parallel:
156-
matrix:
157-
- <<: *uhd_params
158-
TEST_CMD: gnb amf --no_core=true ru_sdr --device_driver uhd | grep 'Failed to open device with address'
159-
- <<: *dpdk_params
160-
TEST_CMD: gnb amf --no_core=true hal --eal_args='--help'
155+
- sh -c "docker compose -f docker/docker-compose.yml run --no-deps gnb which srscu"
156+
- sh -c "docker compose -f docker/docker-compose.yml run --no-deps gnb which srsdu"
157+
158+
gnb docker compose uhd:
159+
extends: .gnb docker compose
160+
variables:
161+
<<: *uhd_params
162+
script:
163+
- sh -c "docker compose -f docker/docker-compose.yml run --no-deps gnb gnb amf --no_core=true ru_sdr --device_driver uhd | grep 'Failed to open device with address'"
164+
165+
gnb docker compose dpdk:
166+
extends: .gnb docker compose
167+
variables:
168+
<<: *dpdk_params
169+
script:
170+
- sh -c "docker compose -f docker/docker-compose.yml run --no-deps gnb which ru_emulator"
171+
- sh -c "docker compose -f docker/docker-compose.yml run --no-deps gnb gnb amf --no_core=true hal --eal_args='--help'"
161172

162173
5gc docker compose:
163174
extends: .docker compose
@@ -296,10 +307,6 @@ grafana server image latest:
296307
export NAME="srsran-project"
297308
export VERSION="${SPLIT}_${SUFFIX}"
298309
export BUILD_ARGS="LIB=${LIB};LIB_VERSION=${LIB_VERSION};MARCH=${MARCH};NUM_CORES=${KUBERNETES_CPU_LIMIT};EXTRA_CMAKE_ARGS=\"${EXTRA_CMAKE_ARGS}\""
299-
needs:
300-
- job: gnb docker compose
301-
optional: true
302-
artifacts: false
303310
304311
srsran image split72:
305312
extends: .srsran image
@@ -338,6 +345,10 @@ srsran image split72:
338345
MARCH: armv8.2-a+crypto+fp16+dotprod
339346
TAG: arm64
340347
PLATFORM: arm64
348+
needs:
349+
- job: gnb docker compose dpdk
350+
optional: true
351+
artifacts: false
341352

342353
srsran image split8:
343354
extends: .srsran image
@@ -366,3 +377,7 @@ srsran image split8:
366377
MARCH: armv8.2-a+crypto+fp16+dotprod
367378
TAG: arm64
368379
PLATFORM: arm64
380+
needs:
381+
- job: gnb docker compose uhd
382+
optional: true
383+
artifacts: false

docker/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,18 @@ RUN /src/docker/scripts/build_${LIB}.sh ${LIB_VERSION} ${MARCH} ${NUM_CORES}
4848
ARG EXTRA_CMAKE_ARGS=""
4949
RUN if [ -z "$NUM_CORES" ]; then NUM_CORES=$(nproc); fi && \
5050
LIB_UPPER=$(echo $LIB | tr '[:lower:]' '[:upper:]') && \
51-
export ${LIB_UPPER}_DIR="/opt/${LIB}/${LIB_VERSION}" && \
52-
/src/docker/scripts/builder.sh \
53-
-m "-j${NUM_CORES} install" \
54-
-DBUILD_TESTS=True \
55-
-DENABLE_${LIB_UPPER}=On \
56-
-DMARCH=${MARCH} \
57-
-DCMAKE_INSTALL_PREFIX=/opt/srs \
51+
export ${LIB_UPPER}_DIR="/opt/${LIB}/${LIB_VERSION}" \
52+
&& \
53+
/src/docker/scripts/builder.sh -m "-j${NUM_CORES} install" \
54+
-DBUILD_TESTS=False -DENABLE_${LIB_UPPER}=On -DMARCH=${MARCH} -DCMAKE_INSTALL_PREFIX=/opt/srs \
55+
${EXTRA_CMAKE_ARGS} /src \
56+
&& \
57+
/src/docker/scripts/builder.sh -m "-j${NUM_CORES} ru_emulator" \
58+
-DBUILD_TESTS=True -DENABLE_${LIB_UPPER}=On -DMARCH=${MARCH} \
5859
${EXTRA_CMAKE_ARGS} /src
5960

6061
# Copy extra binaries
61-
RUN cp /src/build/tests/integrationtests/ofh/ru_emulator /usr/local/bin/ru_emulator
62+
RUN cp /src/build/tests/integrationtests/ofh/ru_emulator /opt/srs/bin/ru_emulator
6263

6364
################
6465
# Stage 2: Run #

0 commit comments

Comments
 (0)