Skip to content
Snippets Groups Projects

doc(build): explanation on git submodules and refactor of sync script

Merged Raphael Defosseux requested to merge doc-submodule-explanation-for-build into master
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 65
50
@@ -24,34 +24,53 @@ They are named as `git sub-modules` in the `component` folder.
Before doing anything, you SHALL retrieve the code for each git sub-module.
**CAUTION: Starting from v1.5.1, we did a refactoring effort on source files, build scripts and CI scripts. So now there are a lot of nested git submodules.**
Normally the `./scripts/syncComponents.sh` should help synchronize all of them.
Now if you have non-tracked files or modified files within git submodules, this script may not work.
Use the `--verbose` option to see the execution of each command.
If the synchronization fails, you may need to go into the path of the failing git-submodule(s) and clean the workspace from non-tracked/modified files. And then execute the `./scripts/syncComponents.sh` script again.
The 2 most important commands to know are :
1. `git submodule deinit --force .`
2. `git submodule update --init --recursive`
You can execute them at this federation level or at the nf component level.
## 1.1. You are interested in a stable version. ##
We recommend to synchronize with the master branches on all git sub-modules.
We also recommend that you synchronize this "tutorial" repository with a provided tag. By doing so, the `docker-compose` files will be aligned with feature sets of each cNF.
**At the time of writing (19/01/2023), the release tag was `v1.5.0`.**
**At the time of writing (2023/05/xx), the release tag was `v1.5.1`.**
| CNF Name | Branch Name | Tag | Ubuntu 18.04 | RHEL8 (UBI8) |
| CNF Name | Branch Name | Tag | Ubuntu 22.04 | RHEL8 (UBI8) |
| ----------- | ----------- | -------- | ------------ | ----------------|
| FED REPO | N/A | `v1.5.0` | | |
| AMF | `master` | `v1.5.0` | X | X |
| SMF | `master` | `v1.5.0` | X | X |
| NRF | `master` | `v1.5.0` | X | X |
| SPGW-U-TINY | `master` | `v1.5.0` | X | X |
| UDR | `master` | `v1.5.0` | X | X |
| UDM | `master` | `v1.5.0` | X | X |
| AUSF | `master` | `v1.5.0` | X | X |
| UPF-VPP | `master` | `v1.5.0` | X | X |
| NSSF | `master` | `v1.5.0` | X | X |
| FED REPO | N/A | `v1.5.1` | | |
| AMF | `master` | `v1.5.1` | X | X |
| SMF | `master` | `v1.5.1` | X | X |
| NRF | `master` | `v1.5.1` | X | X |
| SPGW-U-TINY | `master` | `v1.5.1` | X | X |
| UDR | `master` | `v1.5.1` | X | X |
| UDM | `master` | `v1.5.1` | X | X |
| AUSF | `master` | `v1.5.1` | X | X |
| UPF-VPP | `master` | `v1.5.1` | X | X |
| NSSF | `master` | `v1.5.1` | X | X |
| NEF | `master` | `v1.5.1` | X | X |
| PCF | `master` | `v1.5.1` | X | X |
```bash
# Clone directly on the v1.5.0 release tag
$ git clone --branch v1.5.0 https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed.git
# Clone directly on the v1.5.1 release tag
$ git clone --branch v1.5.1 https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed.git
$ cd oai-cn5g-fed
# If you forgot to clone directly to the v1.5.0 release tag
$ git checkout -f v1.5.0
# If you forgot to clone directly to the v1.5.1 release tag
$ git checkout -f v1.5.1
# Synchronize all git submodules
$ ./scripts/syncComponents.sh
@@ -70,7 +89,7 @@ OAI-PCF component branch : master
---------------------------------------------------------
git submodule deinit --all --force
git submodule init
git submodule update
git submodule update --init --recursive
```
## 1.2. You are interested in the latest features. ##
@@ -117,7 +136,7 @@ OAI-PCF component branch : develop
---------------------------------------------------------
git submodule deinit --all --force
git submodule init
git submodule update
git submodule update --init --recursive
```
# 2. Generic Parameters #
@@ -135,7 +154,7 @@ We are supporting the following releases:
* Ubuntu `20.04` or `focal`
* Ubuntu `22.04` or `jammy`
When building, you can specify which base image to work on (by default it will be `ubuntu:bionic`).
When building, you can specify which base image to work on (by default it will be `ubuntu:focal`).
You just add the `--build-arg BASE_IMAGE=ubuntu:xxxx` option.
@@ -146,13 +165,13 @@ You just add the `--build-arg BASE_IMAGE=ubuntu:xxxx` option.
For example, I am building using `ubuntu:focal` as base image:
```bash
$ docker build --target oai-amf --tag oai-amf:v1.5.0 \
$ docker build --target oai-amf --tag oai-amf:v1.5.1 \
--file component/oai-amf/docker/Dockerfile.amf.ubuntu \
--build-arg BASE_IMAGE=ubuntu:focal \
component/oai-amf
$ docker image prune --force
$ docker image ls
oai-amf v1.5.0 f478bafd7a06 1 minute ago 179MB
oai-amf v1.5.1 f478bafd7a06 1 minute ago 179MB
...
```
@@ -167,7 +186,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-amf --tag oai-amf:v1.5.0 \
$ sudo podman build --target oai-amf --tag oai-amf:v1.5.1 \
--file component/oai-amf/docker/Dockerfile.amf.rhel8 \
component/oai-amf
...
@@ -183,13 +202,13 @@ The above command is with podman, in case you use docker, it can be changed with
For example, I am building using `ubuntu:22.04` as base image:
```bash
$ docker build --target oai-smf --tag oai-smf:v1.5.0 \
$ docker build --target oai-smf --tag oai-smf:v1.5.1 \
--file component/oai-smf/docker/Dockerfile.smf.ubuntu \
--build-arg BASE_IMAGE=ubuntu:22.04 \
component/oai-smf
$ docker image prune --force
$ docker image ls
oai-smf v1.5.0 f478bafd7a06 1 minute ago 193MB
oai-smf v1.5.1 f478bafd7a06 1 minute ago 193MB
...
```
@@ -204,7 +223,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-smf --tag oai-smf:v1.5.0 \
$ sudo podman build --target oai-smf --tag oai-smf:v1.5.1 \
--file component/oai-smf/docker/Dockerfile.smf.rhel8 \
component/oai-smf
...
@@ -219,13 +238,13 @@ The above command is with podman, in case you use docker it can be changed with
For example, I am building using `ubuntu:jammy` as base image:
```bash
$ docker build --target oai-nrf --tag oai-nrf:v1.5.0 \
$ docker build --target oai-nrf --tag oai-nrf:v1.5.1 \
--file component/oai-nrf/docker/Dockerfile.nrf.ubuntu \
--build-arg BASE_IMAGE=ubuntu:jammy \
component/oai-nrf
$ docker image prune --force
$ docker image ls
oai-nrf v1.5.0 04334b29e103 1 minute ago 247MB
oai-nrf v1.5.1 04334b29e103 1 minute ago 247MB
...
```
@@ -240,7 +259,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-nrf --tag oai-nrf:v1.5.0 \
$ sudo podman build --target oai-nrf --tag oai-nrf:v1.5.1 \
--file component/oai-nrf/docker/Dockerfile.nrf.rhel8 \
component/oai-nrf
...
@@ -252,20 +271,16 @@ The above command is with podman, in case you use docker it can be changed with
## 6.1 On a Ubuntu Host ##
**CAUTION: SPGWU cannot be built using a ubuntu:22.04 or ubuntu:jammy base image.**
**It can only be `bionic` or `focal`.**
For example, I am building using `ubuntu:20.04` as base image:
```bash
$ docker build --target oai-spgwu-tiny --tag oai-spgwu-tiny:v1.5.0 \
$ docker build --target oai-spgwu-tiny --tag oai-spgwu-tiny:v1.5.1 \
--file component/oai-upf-equivalent/docker/Dockerfile.ubuntu \
--build-arg BASE_IMAGE=ubuntu:20.04 \
component/oai-upf-equivalent
$ docker image prune --force
$ docker image ls
oai-spgwu-tiny v1.5.0 dec6311cef3b 1 minute ago 155MB
oai-spgwu-tiny v1.5.1 dec6311cef3b 1 minute ago 155MB
...
```
@@ -280,7 +295,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-spgwu-tiny --tag oai-spgwu-tiny:v1.5.0 \
$ sudo podman build --target oai-spgwu-tiny --tag oai-spgwu-tiny:v1.5.1 \
--file component/oai-spgwu-tiny/docker/Dockerfile.rhel8 \
component/oai-upf-equivalent
...
@@ -293,12 +308,12 @@ The above command is with podman, in case you use docker it can be changed with
## 7.1 On a Ubuntu Host ##
```bash
$ docker build --target oai-ausf --tag oai-ausf:v1.5.0 \
$ docker build --target oai-ausf --tag oai-ausf:v1.5.1 \
--file component/oai-ausf/docker/Dockerfile.ausf.ubuntu \
component/oai-ausf
$ docker image prune --force
$ docker image ls
oai-ausf v1.5.0 77a96de94c23 1 minute ago 231MB
oai-ausf v1.5.1 77a96de94c23 1 minute ago 231MB
...
```
@@ -313,7 +328,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-ausf --tag oai-ausf:v1.5.0 \
$ sudo podman build --target oai-ausf --tag oai-ausf:v1.5.1 \
--file component/oai-ausf/docker/Dockerfile.ausf.rhel8 \
component/oai-ausf
...
@@ -326,12 +341,12 @@ The above command is with podman, in case you use docker it can be changed with
## 8.1 On a Ubuntu Host ##
```bash
$ docker build --target oai-udm --tag oai-udm:v1.5.0 \
$ docker build --target oai-udm --tag oai-udm:v1.5.1 \
--file component/oai-udm/docker/Dockerfile.udm.ubuntu \
component/oai-udm
$ docker image prune --force
$ docker image ls
oai-udm v1.5.0 10a4334e31be 1 minute ago 229MB
oai-udm v1.5.1 10a4334e31be 1 minute ago 229MB
...
```
@@ -346,7 +361,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-udm --tag oai-udm:v1.5.0 \
$ sudo podman build --target oai-udm --tag oai-udm:v1.5.1 \
--file component/oai-udm/docker/Dockerfile.udm.rhel8 \
component/oai-udm
...
@@ -359,12 +374,12 @@ The above command is with podman, in case you use docker it can be changed with
## 9.1 On a Ubuntu Host ##
```bash
$ docker build --target oai-udr --tag oai-udr:v1.5.0 \
$ docker build --target oai-udr --tag oai-udr:v1.5.1 \
--file component/oai-udr/docker/Dockerfile.udr.ubuntu \
component/oai-udr
$ docker image prune --force
$ docker image ls
oai-udr v1.5.0 581e07d59ec3 1 minute ago 234MB
oai-udr v1.5.1 581e07d59ec3 1 minute ago 234MB
...
```
@@ -379,7 +394,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-udr --tag oai-udr:v1.5.0 \
$ sudo podman build --target oai-udr --tag oai-udr:v1.5.1 \
--file component/oai-udr/docker/Dockerfile.udr.rhel8 \
component/oai-udr
...
@@ -393,12 +408,12 @@ The above command is with podman, in case you use docker it can be changed with
## 10.1 On a Ubuntu Host ##
```bash
$ docker build --target oai-upf-vpp --tag oai-upf-vpp:v1.5.0 \
$ docker build --target oai-upf-vpp --tag oai-upf-vpp:v1.5.1 \
--file component/oai-upf-vpp/docker/Dockerfile.upf-vpp.ubuntu \
component/oai-upf-vpp
$ docker image prune --force
$ docker image ls
oai-upf-vpp v1.5.0 581e07d59ec3 1 minute ago 937MB
oai-upf-vpp v1.5.1 581e07d59ec3 1 minute ago 937MB
...
```
@@ -413,7 +428,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-upf-vpp --tag oai-upf-vpp:v1.5.0 \
$ sudo podman build --target oai-upf-vpp --tag oai-upf-vpp:v1.5.1 \
--file component/oai-upf-vpp/docker/Dockerfile.upf-vpp.rhel7 \
component/oai-upf-vpp
...
@@ -426,12 +441,12 @@ The above command is with podman, in case you use docker it can be changed with
## 11.1 On a Ubuntu Host ##
```bash
$ docker build --target oai-nssf --tag oai-nssf:v1.5.0 \
$ docker build --target oai-nssf --tag oai-nssf:v1.5.1 \
--file component/oai-nssf/docker/Dockerfile.nssf.ubuntu \
component/oai-nssf
$ docker image prune --force
$ docker image ls
oai-nssf v1.5.0 77a96de94c23 1 minute ago 231MB
oai-nssf v1.5.1 77a96de94c23 1 minute ago 231MB
...
```
@@ -446,7 +461,7 @@ Copy the ca and entitlement .pem files in your present working directory `pwd` b
$: mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca
$: cp /etc/pki/entitlement/*pem ./etc-pki-entitlement
$: cp /etc/rhsm/ca/*pem ./rhsm-ca
$ sudo podman build --target oai-nssf --tag oai-nssf:v1.5.0 \
$ sudo podman build --target oai-nssf --tag oai-nssf:v1.5.1 \
--file component/oai-nssf/docker/Dockerfile.nssf.rhel8 \
component/oai-nssf
...
Loading