Skip to content
Snippets Groups Projects
Commit 3b510bc3 authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

doc(build): adding tutorial to build new components

parent 6ff392a1
No related branches found
No related tags found
No related merge requests found
...@@ -10,3 +10,12 @@ ...@@ -10,3 +10,12 @@
[submodule "component/oai-nrf"] [submodule "component/oai-nrf"]
path = component/oai-nrf path = component/oai-nrf
url = https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf.git url = https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf.git
[submodule "component/oai-ausf"]
path = component/oai-ausf
url = https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-ausf.git
[submodule "component/oai-udm"]
path = component/oai-udm
url = https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udm.git
[submodule "component/oai-udr"]
path = component/oai-udr
url = https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udr.git
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
<a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-AMF/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-AMF%2F&label=build%20AMF"></a> <a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-AMF/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-AMF%2F&label=build%20AMF"></a>
<a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-NRF/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-NRF%2F&label=build%20NRF"></a> <a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-NRF/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-NRF%2F&label=build%20NRF"></a>
<a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-SMF/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-SMF%2F&label=build%20SMF"></a> <a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-SMF/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-SMF%2F&label=build%20SMF"></a>
<a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-AUSF/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-AUSF%2F&label=build%20AUSF"></a>
<a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-UDM/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-UDM%2F&label=build%20UDM"></a>
<a href="https://jenkins-oai.eurecom.fr/job/OAI-CN5G-UDR/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins-oai.eurecom.fr%2Fjob%2FOAI-CN5G-UDR%2F&label=build%20UDR"></a>
</p> </p>
<h2 align="center"> <h2 align="center">
...@@ -17,11 +20,11 @@ ...@@ -17,11 +20,11 @@
At the moment, it contains the following network elements: At the moment, it contains the following network elements:
* Access and Mobility Management Function (**[AMF](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf)**) * Access and Mobility Management Function (**[AMF](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf)**)
* Authentication Server Management Function (**AUSF**) * Authentication Server Management Function (**[AUSF](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-ausf)**)
* Network Repository Function (**[NRF](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf)**) * Network Repository Function (**[NRF](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf)**)
* Session Management Function (**[SMF](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-smf)**) * Session Management Function (**[SMF](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-smf)**)
* Unified Data Management (**UDM**) * Unified Data Management (**[UDM](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udm)**)
* Unified Data Repository (**UDR**) * Unified Data Repository (**[UDR](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-udr)**)
* User Plane Function (**UPF**) with 2 variants: * User Plane Function (**UPF**) with 2 variants:
* Simple Implementation based on our 4G CUPS component (**[SPGWU-TINY](https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny)**) * Simple Implementation based on our 4G CUPS component (**[SPGWU-TINY](https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny)**)
* VPP-Based Implementation (**UPF-VPP**) * VPP-Based Implementation (**UPF-VPP**)
......
...@@ -188,7 +188,7 @@ pipeline { ...@@ -188,7 +188,7 @@ pipeline {
sh 'git checkout -f ' + upstreamTagToUse sh 'git checkout -f ' + upstreamTagToUse
sh "zip -r -qq oai-cn5g-fed.zip .git" sh "zip -r -qq oai-cn5g-fed.zip .git"
sh "mkdir -p archives DS-TEST-RESULTS" sh "mkdir -p archives DS-TEST-RESULTS"
sh './scripts/syncComponents.sh --nrf-branch ' + nrfBranch + ' --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch + ' --spgwu-tiny-branch ' + spgwuBranch sh './scripts/syncComponents.sh --nrf-branch ' + nrfBranch + ' --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch + ' --spgwu-tiny-branch ' + spgwuBranch + ' --ausf-branch ' + ausfBranch + ' --udm-branch ' + udmBranch + ' --udr-branch ' + udrBranch
} }
if (scmEvent) { if (scmEvent) {
sh "git clean -x -d -f > /dev/null 2>&1" sh "git clean -x -d -f > /dev/null 2>&1"
...@@ -197,11 +197,11 @@ pipeline { ...@@ -197,11 +197,11 @@ pipeline {
} }
sh "zip -r -qq oai-cn5g-fed.zip .git" sh "zip -r -qq oai-cn5g-fed.zip .git"
sh "mkdir -p archives DS-TEST-RESULTS" sh "mkdir -p archives DS-TEST-RESULTS"
sh './scripts/syncComponents.sh --nrf-branch develop --amf-branch develop --smf-branch develop --spgwu-tiny-branch develop' sh './scripts/syncComponents.sh --nrf-branch develop --amf-branch develop --smf-branch develop --spgwu-tiny-branch develop --ausf-branch develop --udm-branch develop --udr-branch develop'
} }
if ((!upstreamEvent) && (!scmEvent)) { if ((!upstreamEvent) && (!scmEvent)) {
sh "git clean -x -d -f > /dev/null 2>&1" sh "git clean -x -d -f > /dev/null 2>&1"
sh './scripts/syncComponents.sh --nrf-branch ' + nrfBranch + ' --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch + ' --spgwu-tiny-branch ' + spgwuBranch sh './scripts/syncComponents.sh --nrf-branch ' + nrfBranch + ' --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch + ' --spgwu-tiny-branch ' + spgwuBranch + ' --ausf-branch ' + ausfBranch + ' --udm-branch ' + udmBranch + ' --udr-branch ' + udrBranch
sh "mkdir -p archives DS-TEST-RESULTS" sh "mkdir -p archives DS-TEST-RESULTS"
} }
// Verify that the images are available // Verify that the images are available
......
Subproject commit 93da5c30233453199c0b62ae0eb4cdaaa39e1a26
Subproject commit c9447d2dc4c9880c0df7fb25fa8632c23ab8f086
Subproject commit 88ea191b53264de71d0c32df7f309ddb186b7f9d
...@@ -100,12 +100,17 @@ $ git rebase origin/master ...@@ -100,12 +100,17 @@ $ git rebase origin/master
# Synchronize all git submodules # Synchronize all git submodules
$ ./scripts/syncComponents.sh --nrf-branch develop --amf-branch develop \ $ ./scripts/syncComponents.sh --nrf-branch develop --amf-branch develop \
--smf-branch develop --spgwu-tiny-branch develop --smf-branch develop --spgwu-tiny-branch develop \
--ausf-branch develop --udm-branch develop \
--udr-branch develop
--------------------------------------------------------- ---------------------------------------------------------
OAI-NRF component branch : develop OAI-NRF component branch : develop
OAI-AMF component branch : develop OAI-AMF component branch : develop
OAI-SMF component branch : develop OAI-SMF component branch : develop
OAI-SPGW-U component branch : develop OAI-SPGW-U component branch : develop
OAI-AUSF component branch : develop
OAI-UDM component branch : develop
OAI-UDR component branch : develop
--------------------------------------------------------- ---------------------------------------------------------
git submodule deinit --all --force git submodule deinit --all --force
git submodule init git submodule init
...@@ -196,7 +201,8 @@ The above command is with podman, in case of docker it can be changed with its d ...@@ -196,7 +201,8 @@ The above command is with podman, in case of docker it can be changed with its d
```bash ```bash
$ docker build --target oai-nrf --tag oai-nrf:latest \ $ docker build --target oai-nrf --tag oai-nrf:latest \
--file component/oai-nrf/docker/Dockerfile.nrf.ubuntu18 \ --file component/oai-nrf/docker/Dockerfile.nrf.ubuntu18 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" component/oai-nrf --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-nrf
$ docker image prune --force $ docker image prune --force
$ docker image ls $ docker image ls
oai-nrf latest 04334b29e103 1 minute ago 247MB oai-nrf latest 04334b29e103 1 minute ago 247MB
...@@ -227,7 +233,8 @@ The above command is with podman, in case of docker it can be changed with its d ...@@ -227,7 +233,8 @@ The above command is with podman, in case of docker it can be changed with its d
```bash ```bash
$ docker build --target oai-spgwu-tiny --tag oai-spgwu-tiny:latest \ $ docker build --target oai-spgwu-tiny --tag oai-spgwu-tiny:latest \
--file component/oai-upf-equivalent/docker/Dockerfile.ubuntu18.04 \ --file component/oai-upf-equivalent/docker/Dockerfile.ubuntu18.04 \
--build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" component/oai-upf-equivalent --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-upf-equivalent
$ docker image prune --force $ docker image prune --force
$ docker image ls $ docker image ls
oai-spgwu-tiny latest dec6311cef3b 1 minute ago 255MB oai-spgwu-tiny latest dec6311cef3b 1 minute ago 255MB
...@@ -251,4 +258,101 @@ $ sudo podman build --target oai-spgwu-tiny --tag oai-spgwu-tiny:latest \ ...@@ -251,4 +258,101 @@ $ sudo podman build --target oai-spgwu-tiny --tag oai-spgwu-tiny:latest \
The above command is with podman, in case of docker it can be changed with its docker equivalent. The above command is with podman, in case of docker it can be changed with its docker equivalent.
# 7. Build AUSF Image #
## 7.1 On a Ubuntu 18.04 Host ##
```bash
$ docker build --target oai-ausf --tag oai-ausf:latest \
--file component/oai-ausf/docker/Dockerfile.ausf.ubuntu18 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-ausf
$ docker image prune --force
$ docker image ls
oai-ausf latest 77a96de94c23 1 minute ago 231MB
...
```
## 7.2 On a RHEL8 Host ##
RHEL base images generally needs a subscription to access the package repository.
For that the base image needs ca and entitlement .pem files.
Copy the ca and entitlement .pem files in the oai-nrf repository in a new folder named `tmp` before building the image.
```bash
$ sudo podman build --target oai-ausf --tag oai-ausf:latest \
--file component/oai-ausf/docker/Dockerfile.ausf.rhel8 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-ausf
...
```
The above command is with podman, in case of docker it can be changed with its docker equivalent.
# 8. Build UDM Image #
## 8.1 On a Ubuntu 18.04 Host ##
```bash
$ docker build --target oai-udm --tag oai-udm:latest \
--file component/oai-udm/docker/Dockerfile.udm.ubuntu18 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-udm
$ docker image prune --force
$ docker image ls
oai-udm latest 10a4334e31be 1 minute ago 229MB
...
```
## 8.2 On a RHEL8 Host ##
RHEL base images generally needs a subscription to access the package repository.
For that the base image needs ca and entitlement .pem files.
Copy the ca and entitlement .pem files in the oai-nrf repository in a new folder named `tmp` before building the image.
```bash
$ sudo podman build --target oai-udm --tag oai-udm:latest \
--file component/oai-udm/docker/Dockerfile.udm.rhel8 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-udm
...
```
The above command is with podman, in case of docker it can be changed with its docker equivalent.
# 9. Build UDR Image #
## 9.1 On a Ubuntu 18.04 Host ##
```bash
$ docker build --target oai-udr --tag oai-udr:latest \
--file component/oai-udr/docker/Dockerfile.udr.ubuntu18 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-udr
$ docker image prune --force
$ docker image ls
oai-udr latest 581e07d59ec3 1 minute ago 234MB
...
```
## 9.2 On a RHEL8 Host ##
RHEL base images generally needs a subscription to access the package repository.
For that the base image needs ca and entitlement .pem files.
Copy the ca and entitlement .pem files in the oai-nrf repository in a new folder named `tmp` before building the image.
```bash
$ sudo podman build --target oai-udr --tag oai-udr:latest \
--file component/oai-udr/docker/Dockerfile.udr.rhel8 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-udr
...
```
The above command is with podman, in case of docker it can be changed with its docker equivalent.
You are ready to [Configure the Containers](./CONFIGURE_CONTAINERS.md) or deploying the images using [helm-charts](./DEPLOY_SA5G_HC.md) You are ready to [Configure the Containers](./CONFIGURE_CONTAINERS.md) or deploying the images using [helm-charts](./DEPLOY_SA5G_HC.md)
...@@ -48,6 +48,15 @@ function usage { ...@@ -48,6 +48,15 @@ function usage {
echo " --spgwu-tiny-branch ####" echo " --spgwu-tiny-branch ####"
echo " Specify the source branch for the OAI-SPGW-U-TINY component" echo " Specify the source branch for the OAI-SPGW-U-TINY component"
echo "" echo ""
echo " --ausf-branch ####"
echo " Specify the source branch for the OAI-AUSF component"
echo ""
echo " --udm-branch ####"
echo " Specify the source branch for the OAI-UDM component"
echo ""
echo " --udr-branch ####"
echo " Specify the source branch for the OAI-UDR component"
echo ""
echo " --help OR -h" echo " --help OR -h"
echo " Print this help message." echo " Print this help message."
echo "" echo ""
...@@ -57,6 +66,9 @@ NRF_BRANCH='master' ...@@ -57,6 +66,9 @@ NRF_BRANCH='master'
AMF_BRANCH='master' AMF_BRANCH='master'
SMF_BRANCH='master' SMF_BRANCH='master'
SPGWU_BRANCH='master' SPGWU_BRANCH='master'
AUSF_BRANCH='master'
UDM_BRANCH='master'
UDR_BRANCH='master'
doDefault=1 doDefault=1
...@@ -94,6 +106,24 @@ case $key in ...@@ -94,6 +106,24 @@ case $key in
shift shift
shift shift
;; ;;
--ausf-branch)
AUSF_BRANCH="$2"
doDefault=0
shift
shift
;;
--udm-branch)
UDM_BRANCH="$2"
doDefault=0
shift
shift
;;
--udr-branch)
UDR_BRANCH="$2"
doDefault=0
shift
shift
;;
*) *)
echo "Syntax Error: unknown option: $key" echo "Syntax Error: unknown option: $key"
echo "" echo ""
...@@ -108,6 +138,9 @@ echo "OAI-NRF component branch : ${NRF_BRANCH}" ...@@ -108,6 +138,9 @@ echo "OAI-NRF component branch : ${NRF_BRANCH}"
echo "OAI-AMF component branch : ${AMF_BRANCH}" echo "OAI-AMF component branch : ${AMF_BRANCH}"
echo "OAI-SMF component branch : ${SMF_BRANCH}" echo "OAI-SMF component branch : ${SMF_BRANCH}"
echo "OAI-SPGW-U component branch : ${SPGWU_BRANCH}" echo "OAI-SPGW-U component branch : ${SPGWU_BRANCH}"
echo "OAI-AUSF component branch : ${AUSF_BRANCH}"
echo "OAI-UDM component branch : ${UDM_BRANCH}"
echo "OAI-UDR component branch : ${UDR_BRANCH}"
echo "---------------------------------------------------------" echo "---------------------------------------------------------"
# First do a clean-up # First do a clean-up
...@@ -159,4 +192,31 @@ else ...@@ -159,4 +192,31 @@ else
git checkout -b $SPGWU_BRANCH origin/$SPGWU_BRANCH > /dev/null 2>&1 git checkout -b $SPGWU_BRANCH origin/$SPGWU_BRANCH > /dev/null 2>&1
fi fi
popd popd
pushd component/oai-ausf
git fetch --prune > /dev/null 2>&1
git branch -D $AUSF_BRANCH > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
git checkout $AUSF_BRANCH > /dev/null 2>&1
else
git checkout -b $AUSF_BRANCH origin/$AUSF_BRANCH > /dev/null 2>&1
fi
popd
pushd component/oai-udm
git fetch --prune > /dev/null 2>&1
git branch -D $UDM_BRANCH > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
git checkout $UDM_BRANCH > /dev/null 2>&1
else
git checkout -b $UDM_BRANCH origin/$UDM_BRANCH > /dev/null 2>&1
fi
popd
pushd component/oai-udr
git fetch --prune > /dev/null 2>&1
git branch -D $UDR_BRANCH > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
git checkout $UDR_BRANCH > /dev/null 2>&1
else
git checkout -b $UDR_BRANCH origin/$UDR_BRANCH > /dev/null 2>&1
fi
popd
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment