Commit 16e3b213 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: Adding building of the test images and deploy without testing

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@openairinterface.org>
parent bc90efdb
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface SMF service
# Valid for Ubuntu-18.04 (bionic)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-smf-builder
ARG EURECOM_PROXY
ARG GITLAB_USERNAME
ARG GITLAB_PASSWORD
ARG BUILD_FOR_CI
ARG CI_SRC_BRANCH
ARG CI_SRC_COMMIT
ARG CI_DEST_BRANCH
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v EURECOM_PROXY ]]; then git config --global http.proxy $EURECOM_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# In normal case, we build out of the develop branch
RUN /bin/bash -c "if [[ -v CI_SRC_BRANCH ]]; then git clone https://$GITLAB_USERNAME:$GITLAB_PASSWORD@gitlab.eurecom.fr/oai/oai-cn5g-smf.git -b $CI_SRC_BRANCH /openair-smf; else git clone https://$GITLAB_USERNAME:$GITLAB_PASSWORD@gitlab.eurecom.fr/oai/oai-cn5g-smf.git -b develop /openair-smf; fi"
# For CI, especially for Pull/Merge Requests, we build out of temp merge
WORKDIR /openair-smf
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.name \"OAI CI\"; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.email ci@openairinterface.org; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git checkout -f $CI_SRC_COMMIT; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git merge --ff origin/$CI_DEST_BRANCH -m \"Temporary merge for CI\"; fi"
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --install-deps --force
WORKDIR /openair-smf/src/test/amf_client
RUN mkdir build && cd build && cmake .. && make
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as test-amf-client
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# We install some debug tools for the moment in addition of mandatory libraries
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
net-tools \
libcurl4-gnutls-dev \
&& rm -rf /var/lib/apt/lists/*
# Copying executable and generated libraries
WORKDIR /test-amf-client/bin
COPY --from=oai-smf-builder /openair-smf/src/test/amf_client/build/amf-client .
COPY --from=oai-smf-builder /usr/local/lib/libpistache.so /usr/local/lib/
RUN ldconfig
WORKDIR /test-amf-client
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface SMF service
# Valid for Ubuntu-18.04 (bionic)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-smf-builder
ARG EURECOM_PROXY
ARG GITLAB_USERNAME
ARG GITLAB_PASSWORD
ARG BUILD_FOR_CI
ARG CI_SRC_BRANCH
ARG CI_SRC_COMMIT
ARG CI_DEST_BRANCH
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v EURECOM_PROXY ]]; then git config --global http.proxy $EURECOM_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# In normal case, we build out of the develop branch
RUN /bin/bash -c "if [[ -v CI_SRC_BRANCH ]]; then git clone https://$GITLAB_USERNAME:$GITLAB_PASSWORD@gitlab.eurecom.fr/oai/oai-cn5g-smf.git -b $CI_SRC_BRANCH /openair-smf; else git clone https://$GITLAB_USERNAME:$GITLAB_PASSWORD@gitlab.eurecom.fr/oai/oai-cn5g-smf.git -b develop /openair-smf; fi"
# For CI, especially for Pull/Merge Requests, we build out of temp merge
WORKDIR /openair-smf
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.name \"OAI CI\"; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.email ci@openairinterface.org; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git checkout -f $CI_SRC_COMMIT; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git merge --ff origin/$CI_DEST_BRANCH -m \"Temporary merge for CI\"; fi"
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --install-deps --force
WORKDIR /openair-smf/src/test/amf
RUN mkdir build && cd build && cmake .. && make
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as test-amf-server
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# We install some debug tools for the moment in addition of mandatory libraries
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
net-tools \
&& rm -rf /var/lib/apt/lists/*
# Copying executable and generated libraries
WORKDIR /test-amf-server/bin
COPY --from=oai-smf-builder /openair-smf/src/test/amf/build/amf-server .
COPY --from=oai-smf-builder /usr/local/lib/libpistache.so /usr/local/lib/
RUN ldconfig
WORKDIR /test-amf-server
......@@ -62,7 +62,7 @@ RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git merge --ff origin/$CI_DEST_
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --install-deps --force
RUN ./build_smf --clean --Verbose --build-type Release --jobs
RUN ./build_smf --clean --Verbose --build-type Debug --jobs
#---------------------------------------------------------------------
# TARGET IMAGE
......
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface SMF service
# Valid for Ubuntu-18.04 (bionic)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-smf-builder
ARG EURECOM_PROXY
ARG GITLAB_USERNAME
ARG GITLAB_PASSWORD
ARG BUILD_FOR_CI
ARG CI_SRC_BRANCH
ARG CI_SRC_COMMIT
ARG CI_DEST_BRANCH
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v EURECOM_PROXY ]]; then git config --global http.proxy $EURECOM_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# In normal case, we build out of the develop branch
RUN /bin/bash -c "if [[ -v CI_SRC_BRANCH ]]; then git clone https://$GITLAB_USERNAME:$GITLAB_PASSWORD@gitlab.eurecom.fr/oai/oai-cn5g-smf.git -b $CI_SRC_BRANCH /openair-smf; else git clone https://$GITLAB_USERNAME:$GITLAB_PASSWORD@gitlab.eurecom.fr/oai/oai-cn5g-smf.git -b develop /openair-smf; fi"
# For CI, especially for Pull/Merge Requests, we build out of temp merge
WORKDIR /openair-smf
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.name \"OAI CI\"; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.email ci@openairinterface.org; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git checkout -f $CI_SRC_COMMIT; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git merge --ff origin/$CI_DEST_BRANCH -m \"Temporary merge for CI\"; fi"
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --install-deps --force
WORKDIR /openair-smf/src/test/udm
RUN mkdir build && cd build && cmake .. && make
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as test-udm-server
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# We install some debug tools for the moment in addition of mandatory libraries
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
net-tools \
&& rm -rf /var/lib/apt/lists/*
# Copying executable and generated libraries
WORKDIR /test-udm-server/bin
COPY --from=oai-smf-builder /openair-smf/src/test/udm/build/udm-server .
COPY --from=oai-smf-builder /usr/local/lib/libpistache.so /usr/local/lib/
RUN ldconfig
WORKDIR /test-udm-server
This diff is collapsed.
......@@ -66,12 +66,37 @@ static void setUpUnixSignals(std::vector<int> quitSignals) {
using namespace oai::amf::api;
int main() {
int main(int argc, char* argv[]) {
#ifdef __linux__
std::vector<int> sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP};
setUpUnixSignals(sigs);
#endif
Pistache::Address addr("172.16.1.102", Pistache::Port(80));
std::string amf_ip_address;
if ((argc != 1) && (argc != 3)) {
std::cout << "Error: Usage is " <<std::endl;
std::cout << " " << argv[0] << " [ -i www.xxx.yy.zz ]" <<std::endl;
return -1;
}
if (argc == 1) {
amf_ip_address.append(std::string("172.16.1.102"));
} else {
int opt = 0;
while ((opt = getopt(argc, argv, "i:")) != -1) {
switch(opt) {
case 'i':
amf_ip_address.append(optarg);
break;
default:
std::cout << "Error: Usage is " <<std::endl;
std::cout << " " << argv[0] << " [ -i www.xxx.yy.zz ]" <<std::endl;
return -1;
break;
}
}
}
Pistache::Address addr(amf_ip_address, Pistache::Port(80));
httpEndpoint = new Pistache::Http::Endpoint((addr));
auto router = std::make_shared<Pistache::Rest::Router>();
......
......@@ -67,7 +67,7 @@ unsigned char * format_string_as_hex(std::string str){
return datavalue;
}
void send_pdu_session_establishment_request()
void send_pdu_session_establishment_request(std::string smf_ip_address)
{
std::cout << "[AMF N11] PDU Session Establishment Request"<<std::endl;
......@@ -81,7 +81,9 @@ void send_pdu_session_establishment_request()
//Fill Json part
//get supi and put into URL
std::string supi_str;
std::string url = std::string("http://172.16.1.101/nsmf-pdusession/v2/sm-contexts");
std::string url = std::string("http://");
url.append(smf_ip_address);
url.append(std::string("/nsmf-pdusession/v2/sm-contexts"));
//Fill the json part
pdu_session_establishment_request["supi"] = "imsi-200000000000001";
......@@ -175,7 +177,7 @@ void send_pdu_session_establishment_request()
}
void send_pdu_session_update_sm_context_establishment()
void send_pdu_session_update_sm_context_establishment(std::string smf_ip_address)
{
std::cout << "[AMF N11] send_pdu_session_update_sm_context_establishment"<<std::endl;
......@@ -227,7 +229,9 @@ void send_pdu_session_update_sm_context_establishment()
std::string supi_str;
//std::string url = std::string("http://172.16.1.101/nsmf-pdusession/v2/sm-contexts");
//std::string url = std::string("http://172.16.1.101/nsmf-pdusession/v2/sm-contexts/imsi-200000000000001/modify");
std::string url = std::string("http://172.16.1.101/nsmf-pdusession/v2/sm-contexts/1/modify");
std::string url = std::string("http://");
url.append(smf_ip_address);
url.append(std::string("/nsmf-pdusession/v2/sm-contexts/1/modify"));
//Fill the json part
pdu_session_modification_request["n2SmInfoType"] = "PDU_RES_SETUP_RSP";
......@@ -309,7 +313,7 @@ void send_pdu_session_update_sm_context_establishment()
}
void send_pdu_session_update_sm_context_modification()
void send_pdu_session_update_sm_context_modification(std::string smf_ip_address)
{
std::cout << "[AMF N11] send_pdu_session_update_sm_context_modification"<<std::endl;
......@@ -348,7 +352,9 @@ void send_pdu_session_update_sm_context_modification()
std::string supi_str;
//std::string url = std::string("http://172.16.1.101/nsmf-pdusession/v2/sm-contexts");
//std::string url = std::string("http://172.16.1.101/nsmf-pdusession/v2/sm-contexts/imsi-200000000000001/modify");
std::string url = std::string("http://172.16.1.101/nsmf-pdusession/v2/sm-contexts/1/modify");
std::string url = std::string("http://");
url.append(smf_ip_address);
url.append(std::string("/nsmf-pdusession/v2/sm-contexts/1/modify"));
//Fill the json part
pdu_session_modification_request["n1SmMsg"]["contentId"] = "n1SmMsg"; //part 2
......@@ -431,11 +437,36 @@ void send_pdu_session_update_sm_context_modification()
int main(int argc, char* argv[])
{
std::string smf_ip_address;
send_pdu_session_establishment_request();
if ((argc != 1) && (argc != 3)) {
std::cout << "Error: Usage is " <<std::endl;
std::cout << " " << argv[0] << " [ -i www.xxx.yy.zz ]" <<std::endl;
return -1;
}
if (argc == 1) {
smf_ip_address.append(std::string("172.16.1.101"));
} else {
int opt = 0;
while ((opt = getopt(argc, argv, "i:")) != -1) {
switch(opt) {
case 'i':
smf_ip_address.append(optarg);
break;
default:
std::cout << "Error: Usage is " <<std::endl;
std::cout << " " << argv[0] << " [ -i www.xxx.yy.zz ]" <<std::endl;
return -1;
break;
}
}
}
send_pdu_session_establishment_request(smf_ip_address);
usleep(100000);
send_pdu_session_update_sm_context_establishment();
//send_pdu_session_update_sm_context_modification();
send_pdu_session_update_sm_context_establishment(smf_ip_address);
//send_pdu_session_update_sm_context_modification(smf_ip_address);
return 0;
}
......@@ -77,12 +77,37 @@ static void setUpUnixSignals(std::vector<int> quitSignals) {
using namespace oai::udm::api;
int main() {
int main(int argc, char* argv[]) {
#ifdef __linux__
std::vector<int> sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP};
setUpUnixSignals(sigs);
#endif
Pistache::Address addr("172.16.1.103", Pistache::Port(80));
std::string udm_ip_address;
if ((argc != 1) && (argc != 3)) {
std::cout << "Error: Usage is " <<std::endl;
std::cout << " " << argv[0] << " [ -i www.xxx.yy.zz ]" <<std::endl;
return -1;
}
if (argc == 1) {
udm_ip_address.append(std::string("172.16.1.103"));
} else {
int opt = 0;
while ((opt = getopt(argc, argv, "i:")) != -1) {
switch(opt) {
case 'i':
udm_ip_address.append(optarg);
break;
default:
std::cout << "Error: Usage is " <<std::endl;
std::cout << " " << argv[0] << " [ -i www.xxx.yy.zz ]" <<std::endl;
return -1;
break;
}
}
}
Pistache::Address addr(udm_ip_address, Pistache::Port(80));
httpEndpoint = new Pistache::Http::Endpoint((addr));
auto router = std::make_shared<Pistache::Rest::Router>();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment