[CI][DOCKER] display intermediate logs for CI purpose
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
@@ -198,22 +198,7 @@ class Containerize():
|
|||||||
mySSH.command(self.cli + ' image rm ' + image + ':' + imageTag, '\$', 5)
|
mySSH.command(self.cli + ' image rm ' + image + ':' + imageTag, '\$', 5)
|
||||||
# Build the shared image
|
# Build the shared image
|
||||||
mySSH.command(self.cli + ' build --target ' + sharedimage + ' --tag ' + sharedimage + ':' + imageTag + ' --file docker/Dockerfile.ran' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-build.log 2>&1', '\$', 1600)
|
mySSH.command(self.cli + ' build --target ' + sharedimage + ' --tag ' + sharedimage + ':' + imageTag + ' --file docker/Dockerfile.ran' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-build.log 2>&1', '\$', 1600)
|
||||||
# Build the target image(s)
|
# First verify if the shared image was properly created.
|
||||||
previousImage = sharedimage + ':' + imageTag
|
|
||||||
danglingShaOnes=[]
|
|
||||||
for image,pattern in imageNames:
|
|
||||||
# the archived Dockerfiles have "ran-build:latest" as base image
|
|
||||||
# we need to update them with proper tag
|
|
||||||
mySSH.command('sed -i -e "s#' + sharedimage + ':latest#' + sharedimage + ':' + imageTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5)
|
|
||||||
mySSH.command(self.cli + ' build --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200)
|
|
||||||
# Retrieving the dangling image(s) for the log collection
|
|
||||||
mySSH.command(self.cli + ' images --filter "dangling=true" --filter "since=' + previousImage + '" -q | sed -e "s#^#sha=#"', '\$', 5)
|
|
||||||
result = re.search('sha=(?P<imageShaOne>[a-zA-Z0-9\-\_]+)', mySSH.getBefore())
|
|
||||||
if result is not None:
|
|
||||||
danglingShaOnes.append((image, result.group('imageShaOne')))
|
|
||||||
previousImage = image + ':' + imageTag
|
|
||||||
|
|
||||||
# First verify if images were properly created.
|
|
||||||
status = True
|
status = True
|
||||||
mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + sharedimage + ':' + imageTag, '\$', 5)
|
mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + sharedimage + ':' + imageTag, '\$', 5)
|
||||||
if (mySSH.getBefore().count('No such object') != 0) or (mySSH.getBefore().count('no such image') != 0):
|
if (mySSH.getBefore().count('No such object') != 0) or (mySSH.getBefore().count('no such image') != 0):
|
||||||
@@ -238,7 +223,29 @@ class Containerize():
|
|||||||
self.allImagesSize['ran-build'] = str(round(imageSize,1)) + ' Gbytes'
|
self.allImagesSize['ran-build'] = str(round(imageSize,1)) + ' Gbytes'
|
||||||
else:
|
else:
|
||||||
logging.debug('ran-build size is unknown')
|
logging.debug('ran-build size is unknown')
|
||||||
|
# If the shared image failed, no need to continue
|
||||||
|
if not status:
|
||||||
|
mySSH.close()
|
||||||
|
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
|
||||||
|
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
|
||||||
|
HTML.CreateHtmlTabFooter(False)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Build the target image(s)
|
||||||
|
previousImage = sharedimage + ':' + imageTag
|
||||||
|
danglingShaOnes=[]
|
||||||
for image,pattern in imageNames:
|
for image,pattern in imageNames:
|
||||||
|
# the archived Dockerfiles have "ran-build:latest" as base image
|
||||||
|
# we need to update them with proper tag
|
||||||
|
mySSH.command('sed -i -e "s#' + sharedimage + ':latest#' + sharedimage + ':' + imageTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5)
|
||||||
|
mySSH.command(self.cli + ' build --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200)
|
||||||
|
# Retrieving the dangling image(s) for the log collection
|
||||||
|
mySSH.command(self.cli + ' images --filter "dangling=true" --filter "since=' + previousImage + '" -q | sed -e "s#^#sha=#"', '\$', 5)
|
||||||
|
result = re.search('sha=(?P<imageShaOne>[a-zA-Z0-9\-\_]+)', mySSH.getBefore())
|
||||||
|
if result is not None:
|
||||||
|
danglingShaOnes.append((image, result.group('imageShaOne')))
|
||||||
|
previousImage = image + ':' + imageTag
|
||||||
|
# checking the status of the build
|
||||||
mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + image + ':' + imageTag, '\$', 5)
|
mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + image + ':' + imageTag, '\$', 5)
|
||||||
if (mySSH.getBefore().count('No such object') != 0) or (mySSH.getBefore().count('no such image') != 0):
|
if (mySSH.getBefore().count('No such object') != 0) or (mySSH.getBefore().count('no such image') != 0):
|
||||||
logging.error('Could not build properly ' + image)
|
logging.error('Could not build properly ' + image)
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ REL="Rel15"
|
|||||||
HW="None"
|
HW="None"
|
||||||
TP="None"
|
TP="None"
|
||||||
EPC=0
|
EPC=0
|
||||||
|
VERBOSE_CI=0
|
||||||
VERBOSE_COMPILE=0
|
VERBOSE_COMPILE=0
|
||||||
CFLAGS_PROCESSOR_USER=""
|
CFLAGS_PROCESSOR_USER=""
|
||||||
RUN_GROUP=0
|
RUN_GROUP=0
|
||||||
@@ -324,6 +325,10 @@ function main() {
|
|||||||
HWLAT_TEST=1
|
HWLAT_TEST=1
|
||||||
echo_info "Will compile hw latency test program"
|
echo_info "Will compile hw latency test program"
|
||||||
shift;;
|
shift;;
|
||||||
|
--verbose-ci)
|
||||||
|
VERBOSE_CI=1
|
||||||
|
echo_info "Will compile with verbose instructions in CI Docker env"
|
||||||
|
shift;;
|
||||||
--verbose-compile)
|
--verbose-compile)
|
||||||
VERBOSE_COMPILE=1
|
VERBOSE_COMPILE=1
|
||||||
echo_info "Will compile with verbose instructions"
|
echo_info "Will compile with verbose instructions"
|
||||||
|
|||||||
@@ -221,6 +221,11 @@ compilations() {
|
|||||||
ret=$?
|
ret=$?
|
||||||
} > $dlog/$2.$REL.txt 2>&1
|
} > $dlog/$2.$REL.txt 2>&1
|
||||||
set -e
|
set -e
|
||||||
|
if [ "$VERBOSE_CI" == "1" ]; then
|
||||||
|
echo_info "====== Start of log for $2.$REL.txt ======"
|
||||||
|
cat $dlog/$2.$REL.txt
|
||||||
|
echo_info "====== End of log for $2.$REL.txt ======"
|
||||||
|
fi
|
||||||
if [[ $ret -ne 0 ]]; then
|
if [[ $ret -ne 0 ]]; then
|
||||||
check_warnings "$dlog/$2.$REL.txt"
|
check_warnings "$dlog/$2.$REL.txt"
|
||||||
check_errors "$dlog/$2.$REL.txt"
|
check_errors "$dlog/$2.$REL.txt"
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ COPY . .
|
|||||||
RUN /bin/sh oaienv && \
|
RUN /bin/sh oaienv && \
|
||||||
cd cmake_targets && \
|
cd cmake_targets && \
|
||||||
mkdir -p log && \
|
mkdir -p log && \
|
||||||
./build_oai --eNB --ninja -w USRP
|
./build_oai --eNB --ninja -w USRP --verbose-ci
|
||||||
|
|
||||||
# debug
|
# debug
|
||||||
#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15
|
#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ COPY . .
|
|||||||
RUN /bin/sh oaienv && \
|
RUN /bin/sh oaienv && \
|
||||||
cd cmake_targets && \
|
cd cmake_targets && \
|
||||||
mkdir -p log && \
|
mkdir -p log && \
|
||||||
./build_oai --eNB --ninja -w USRP
|
./build_oai --eNB --ninja -w USRP --verbose-ci
|
||||||
|
|
||||||
RUN apt-get install -y python3-pip && \
|
RUN apt-get install -y python3-pip && \
|
||||||
pip3 install --ignore-installed pyyaml && \
|
pip3 install --ignore-installed pyyaml && \
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ COPY . .
|
|||||||
RUN /bin/sh oaienv && \
|
RUN /bin/sh oaienv && \
|
||||||
cd cmake_targets && \
|
cd cmake_targets && \
|
||||||
mkdir -p log && \
|
mkdir -p log && \
|
||||||
./build_oai --gNB --ninja -w USRP
|
./build_oai --gNB --ninja -w USRP --verbose-ci
|
||||||
|
|
||||||
#debug
|
#debug
|
||||||
#RUN ldconfig -v
|
#RUN ldconfig -v
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ COPY . .
|
|||||||
RUN /bin/sh oaienv && \
|
RUN /bin/sh oaienv && \
|
||||||
cd cmake_targets && \
|
cd cmake_targets && \
|
||||||
mkdir -p log && \
|
mkdir -p log && \
|
||||||
./build_oai --gNB --ninja -w USRP
|
./build_oai --gNB --ninja -w USRP --verbose-ci
|
||||||
|
|
||||||
#debug
|
#debug
|
||||||
RUN ldconfig -v
|
RUN ldconfig -v
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ COPY . .
|
|||||||
RUN /bin/sh oaienv && \
|
RUN /bin/sh oaienv && \
|
||||||
cd cmake_targets && \
|
cd cmake_targets && \
|
||||||
mkdir -p log && \
|
mkdir -p log && \
|
||||||
./build_oai --UE --ninja -w USRP
|
./build_oai --UE --ninja -w USRP --verbose-ci
|
||||||
|
|
||||||
# debug
|
# debug
|
||||||
#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-uesoftmodem.Rel15
|
#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-uesoftmodem.Rel15
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ COPY . .
|
|||||||
RUN /bin/sh oaienv && \
|
RUN /bin/sh oaienv && \
|
||||||
cd cmake_targets && \
|
cd cmake_targets && \
|
||||||
mkdir -p log && \
|
mkdir -p log && \
|
||||||
./build_oai --UE --ninja -w USRP
|
./build_oai --UE --ninja -w USRP --verbose-ci
|
||||||
|
|
||||||
# debug
|
# debug
|
||||||
#RUN ldconfig -v
|
#RUN ldconfig -v
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ COPY . .
|
|||||||
RUN /bin/sh oaienv && \
|
RUN /bin/sh oaienv && \
|
||||||
cd cmake_targets && \
|
cd cmake_targets && \
|
||||||
mkdir -p log && \
|
mkdir -p log && \
|
||||||
./build_oai --nrUE --ninja -w USRP
|
./build_oai --nrUE --ninja -w USRP --verbose-ci
|
||||||
|
|
||||||
# debug
|
# debug
|
||||||
#RUN ldconfig -v
|
#RUN ldconfig -v
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ COPY . .
|
|||||||
RUN /bin/sh oaienv && \
|
RUN /bin/sh oaienv && \
|
||||||
cd cmake_targets && \
|
cd cmake_targets && \
|
||||||
mkdir -p log && \
|
mkdir -p log && \
|
||||||
./build_oai --nrUE --ninja -w USRP
|
./build_oai --nrUE --ninja -w USRP --verbose-ci
|
||||||
|
|
||||||
# debug
|
# debug
|
||||||
#RUN ldconfig -v
|
#RUN ldconfig -v
|
||||||
|
|||||||
Reference in New Issue
Block a user