Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-SMF
Commits
fdd0cf3b
Commit
fdd0cf3b
authored
Sep 21, 2022
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into event_exposure
parents
10bdb7c3
f1873ad2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
27 deletions
+55
-27
build/scripts/build_helper
build/scripts/build_helper
+4
-1
ci-scripts/Jenkinsfile-GitLab-Docker
ci-scripts/Jenkinsfile-GitLab-Docker
+9
-1
ci-scripts/docker/Dockerfile.ci.ubuntu
ci-scripts/docker/Dockerfile.ci.ubuntu
+2
-1
ci-scripts/generateHtmlReport.py
ci-scripts/generateHtmlReport.py
+1
-1
docker/Dockerfile.smf.rhel8
docker/Dockerfile.smf.rhel8
+1
-0
src/common/utils/fqdn.cpp
src/common/utils/fqdn.cpp
+38
-23
No files found.
build/scripts/build_helper
View file @
fdd0cf3b
...
...
@@ -296,7 +296,10 @@ check_enable_epel_repos() {
echo "EPEL repos already present. Good."
else
echo "EPEL repos not present. Installing them."
$SUDO $INSTALLER install $OPTION https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget --tries=4 --retry-connrefused --wait=8 \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$SUDO $INSTALLER install $OPTION epel-release-latest-7.noarch.rpm
rm -f epel-release-latest-7.noarch.rpm
fi
fi
}
...
...
ci-scripts/Jenkinsfile-GitLab-Docker
View file @
fdd0cf3b
...
...
@@ -182,6 +182,7 @@ pipeline {
// Currently this pipeline only runs for pushes to `develop` branch
// First clean image registry
try
{
myShCmd
(
'docker image tag oai-smf:develop oai-smf:develop-previous'
,
rem_u18_host_flag
,
rem_u18_host_user
,
rem_u18_host
)
myShCmd
(
'docker image rm oai-smf:develop'
,
rem_u18_host_flag
,
rem_u18_host_user
,
rem_u18_host
)
}
catch
(
Exception
e
)
{
echo
"Maybe a previous build went wrong"
...
...
@@ -200,7 +201,7 @@ pipeline {
}
// "latest" is the tag used in the docker file.
myShCmd
(
'docker image tag oai-smf-base:'
+
SMF_BASE_IMAGE_TAG
+
' oai-smf-base:latest'
,
rem_u18_host_flag
,
rem_u18_host_user
,
rem_u18_host
)
myShCmd
(
'docker build --no-cache --target oai-smf --tag oai-smf:'
+
smf_tag
+
' --file ci-scripts/docker/Dockerfile.ci.ubuntu
.18.04
. > archives/smf_docker_image_build.log 2>&1'
,
rem_u18_host_flag
,
rem_u18_host_user
,
rem_u18_host
)
myShCmd
(
'docker build --no-cache --target oai-smf --tag oai-smf:'
+
smf_tag
+
' --file ci-scripts/docker/Dockerfile.ci.ubuntu . > archives/smf_docker_image_build.log 2>&1'
,
rem_u18_host_flag
,
rem_u18_host_user
,
rem_u18_host
)
}
// Putting a place holder to try out on the flattening of image.
// If not satisfactory, we can remove it.
...
...
@@ -221,8 +222,11 @@ pipeline {
}
success
{
sh
"echo 'OAI-SMF DOCKER IMAGE BUILD: OK' >> archives/smf_docker_image_build.log"
myShCmd
(
'docker image rm oai-smf:develop-previous || true'
,
rem_u18_host_flag
,
rem_u18_host_user
,
rem_u18_host
)
}
unsuccessful
{
myShCmd
(
'docker image tag oai-smf:develop-previous oai-smf:develop || true'
,
rem_u18_host_flag
,
rem_u18_host_user
,
rem_u18_host
)
myShCmd
(
'docker image rm oai-smf:develop-previous || true'
,
rem_u18_host_flag
,
rem_u18_host_user
,
rem_u18_host
)
sh
"echo 'OAI-SMF DOCKER IMAGE BUILD: KO' >> archives/smf_docker_image_build.log"
}
}
...
...
@@ -237,6 +241,7 @@ pipeline {
// Currently this pipeline only runs for pushes to `develop` branch
// First clean image registry
try
{
myShCmd
(
'sudo podman image tag oai-smf:develop oai-smf:develop-previous || true'
,
rem_rhel_host_flag
,
rem_rhel_host_user
,
rem_rhel_host
)
myShCmd
(
'sudo podman image rm oai-smf:develop || true'
,
rem_rhel_host_flag
,
rem_rhel_host_user
,
rem_rhel_host
)
}
catch
(
Exception
e
)
{
echo
"Maybe a previous build went wrong"
...
...
@@ -270,9 +275,12 @@ pipeline {
}
}
success
{
myShCmd
(
'sudo podman image rm oai-smf:develop-previous || true'
,
rem_rhel_host_flag
,
rem_rhel_host_user
,
rem_rhel_host
)
sh
"echo 'OAI-SMF PODMAN RHEL8 IMAGE BUILD: OK' >> archives/smf_podman_image_build.log"
}
unsuccessful
{
myShCmd
(
'sudo podman image tag oai-smf:develop-previous oai-smf:develop || true'
,
rem_rhel_host_flag
,
rem_rhel_host_user
,
rem_rhel_host
)
myShCmd
(
'sudo podman image rm oai-smf:develop-previous || true'
,
rem_rhel_host_flag
,
rem_rhel_host_user
,
rem_rhel_host
)
sh
"echo 'OAI-SMF PODMAN RHEL8 IMAGE BUILD: KO' >> archives/smf_podman_image_build.log"
}
}
...
...
ci-scripts/docker/Dockerfile.ci.ubuntu
.18.04
→
ci-scripts/docker/Dockerfile.ci.ubuntu
View file @
fdd0cf3b
...
...
@@ -33,13 +33,14 @@
ARG BASE_IMAGE=ubuntu:bionic
FROM oai-smf-base:latest as oai-smf-builder
RUN rm -Rf /openair-smf/
WORKDIR /openair-smf/
COPY . /openair-smf
RUN cp -Rf /openair-smf-ext-ref /openair-smf/build/ext
# Building SMF
WORKDIR /openair-smf/build/scripts
RUN ldconfig && \
cp -Rf /openair-smf-ext-ref /openair-smf/build/ext && \
./build_smf --clean --Verbose --build-type Release --jobs && \
ldd /openair-smf/build/smf/build/smf && \
mv /openair-smf/build/smf/build/smf /openair-smf/build/smf/build/oai_smf
...
...
ci-scripts/generateHtmlReport.py
View file @
fdd0cf3b
...
...
@@ -492,7 +492,7 @@ class HtmlReport():
base_image
=
False
with
open
(
cwd
+
'/archives/'
+
logFileName
,
'r'
)
as
logfile
:
for
line
in
logfile
:
result
=
re
.
search
(
'FROM oai-smf-base'
,
line
)
result
=
re
.
search
(
'FROM oai-smf-base
:latest
'
,
line
)
if
result
is
not
None
:
base_image
=
True
result
=
re
.
search
(
section_start_pattern
,
line
)
...
...
docker/Dockerfile.smf.rhel8
View file @
fdd0cf3b
...
...
@@ -51,6 +51,7 @@ RUN rm -f /etc/rhsm-host && \
boost-devel \
openssl-devel \
openssl \
wget \
libasan && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
...
...
src/common/utils/fqdn.cpp
View file @
fdd0cf3b
...
...
@@ -23,36 +23,51 @@
#include "logger.hpp"
#include <boost/asio.hpp>
#include <iostream>
#include <chrono>
#include <thread>
#define MAX_NB_RESOLVE_TRIES 4
#define TIME_BETWEEN_TRIES 2
bool
fqdn
::
resolve
(
const
std
::
string
&
host_name
,
std
::
string
&
address
,
uint32_t
&
port
,
uint8_t
&
addr_type
,
const
std
::
string
&
protocol
)
{
try
{
boost
::
asio
::
io_context
io_context
=
{};
int
tries
=
0
;
Logger
::
smf_app
().
debug
(
"Resolving a DNS (name %s)"
,
host_name
.
c_str
());
while
(
tries
<
MAX_NB_RESOLVE_TRIES
)
{
try
{
boost
::
asio
::
io_context
io_context
=
{};
Logger
::
smf_app
().
debug
(
"Resolving DNS Try #%u"
,
tries
);
boost
::
asio
::
ip
::
tcp
::
resolver
resolver
{
io_context
};
boost
::
asio
::
ip
::
tcp
::
resolver
::
results_type
endpoints
=
resolver
.
resolve
(
host_name
,
protocol
);
boost
::
asio
::
ip
::
tcp
::
resolver
resolver
{
io_context
};
boost
::
asio
::
ip
::
tcp
::
resolver
::
results_type
endpoints
=
resolver
.
resolve
(
host_name
,
protocol
);
addr_type
=
0
;
// IPv4 by default
for
(
auto
it
=
endpoints
.
cbegin
();
it
!=
endpoints
.
cend
();
it
++
)
{
// get the first Endpoint
boost
::
asio
::
ip
::
tcp
::
endpoint
endpoint
=
*
it
;
address
=
endpoint
.
address
().
to_string
();
port
=
endpoint
.
port
();
Logger
::
smf_app
().
debug
(
"Resolve a DNS (name %s, protocol %s): Ip Addr %s, port %u"
,
host_name
.
c_str
(),
protocol
.
c_str
(),
address
.
c_str
(),
port
);
if
(
endpoint
.
address
().
is_v4
())
addr_type
=
0
;
else
addr_type
=
1
;
return
true
;
addr_type
=
0
;
// IPv4 by default
for
(
auto
it
=
endpoints
.
cbegin
();
it
!=
endpoints
.
cend
();
it
++
)
{
// get the first Endpoint
boost
::
asio
::
ip
::
tcp
::
endpoint
endpoint
=
*
it
;
address
=
endpoint
.
address
().
to_string
();
port
=
endpoint
.
port
();
Logger
::
smf_app
().
debug
(
"Resolved a DNS (name %s, protocol %s): Ip Addr %s, port %u"
,
host_name
.
c_str
(),
protocol
.
c_str
(),
address
.
c_str
(),
port
);
if
(
endpoint
.
address
().
is_v4
())
addr_type
=
0
;
else
addr_type
=
1
;
return
true
;
}
}
catch
(
std
::
exception
&
e
)
{
tries
++
;
if
(
tries
==
MAX_NB_RESOLVE_TRIES
)
{
throw
std
::
runtime_error
(
"Cannot resolve a DNS name "
+
std
::
string
(
e
.
what
())
+
" after "
+
std
::
to_string
(
tries
)
+
" tries"
);
return
false
;
}
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
TIME_BETWEEN_TRIES
));
}
}
catch
(
std
::
exception
&
e
)
{
throw
std
::
runtime_error
(
"Cannot resolve a DNS name "
+
std
::
string
(
e
.
what
()));
return
false
;
}
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment