BUILD_IMAGES.md 7.64 KB
Newer Older
Raphael Defosseux's avatar
Raphael Defosseux committed
1
2
3
4
5
6
7
8
9
<table style="border-collapse: collapse; border: none;">
  <tr style="border-collapse: collapse; border: none;">
    <td style="border-collapse: collapse; border: none;">
      <a href="http://www.openairinterface.org/">
         <img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
         </img>
      </a>
    </td>
    <td style="border-collapse: collapse; border: none; vertical-align: center;">
Sagar Arora's avatar
Sagar Arora committed
10
      <b><font size = "5">OpenAirInterface 5G Core Network Deployment : Building Container Images</font></b>
Raphael Defosseux's avatar
Raphael Defosseux committed
11
12
13
14
    </td>
  </tr>
</table>

Sagar Arora's avatar
Sagar Arora committed
15
# 1.  Retrieve the correct network function branches #
Raphael Defosseux's avatar
Raphael Defosseux committed
16

17
18
19
20
21
22
23
24
25
26
| CNF Name    | Branch Name | Commit at time of writing                  | Ubuntu 18.04 | RHEL8 (UBI8)    |
| ----------- |:----------- | ------------------------------------------ | ------------ | ----------------|
| AMF         | `develop`   | `f31dc5a5a013882f4c5f6132d1b2af7f6c98ece2` | X            | X               |
| SMF         | `develop`   | `7e3ffb6b444269b7667501ee82da9c7b3f7bf9eb` | X            | X               |
| NRF         | `develop`   | `f722502f92333747503b13491962ade7c5e6dbca` | X            | X               |
| SPGW-U-TINY | `develop`   | `7f687f853eaa7617ba56da186d0d55afb6219558` | X            | X               |

**UPDATE (2021/07/12): all branches have been tagged with `2021.w28`.**

**PLEASE USE newer commits than these tags.**
Raphael Defosseux's avatar
Raphael Defosseux committed
27
28
29
30

```bash
$ git clone https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed.git
$ cd oai-cn5g-fed
31
32
33
34

# You can specify a tag on the parent GIT repository such as `2021.w28`
$ git checkout 2021.w28
# Or you can sync to the latest version
Raphael Defosseux's avatar
Raphael Defosseux committed
35
$ git checkout master
36
37
38
39
40
41
42
43
44

# Then you need to resync the sub-modules (ie AMF, SPGW-U-TINY, SMF, NRF).
# You can specify:
#   ---  a valid tag (such as seen)
#   ---  a newer tag
#   ---  a branch to get the latest (`develop` being the latest stable)
#        Usually the better option is to specify `develop`


Sagar Arora's avatar
Sagar Arora committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
$ ./scripts/syncComponents.sh -h
Openair-CN components synchronization
   Original Author: Raphael Defosseux

   Requirement: git shall be installed

   By default (no options) all components will be synchronized to
     the 'develop' branch.
   Each component can be synchronized a dedicated branch.

Usage:
------
    syncComponents.sh [OPTIONS]

Options:
--------
    --nrf-branch ####
    Specify the source branch for the OAI-NRF component

    --amf-branch ####
    Specify the source branch for the OAI-AMF component

    --smf-branch ####
    Specify the source branch for the OAI-SMF component

    --spgwu-tiny-branch ####
    Specify the source branch for the OAI-SPGW-U-TINY component

    --help OR -h
    Print this help message.

76
$ ./scripts/syncComponents.sh --spgwu-tiny-branch 2021.w28
Raphael Defosseux's avatar
Raphael Defosseux committed
77
78
79
---------------------------------------------------------
OAI-AMF    component branch : develop
OAI-SMF    component branch : develop
Sagar Arora's avatar
Sagar Arora committed
80
OAI-NRF    component branch : develop
81
OAI-SPGW-U component branch : 2021.w28
Raphael Defosseux's avatar
Raphael Defosseux committed
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---------------------------------------------------------
....
```

# 2. Generic Parameters #

Here in our network configuration, we need to pass the "GIT PROXY" configuration.

*   If you do not need, remove the `--build-arg NEEDED_GIT_PROXY=".."` option.
*   If you do need it, change with your proxy value.

# 3. Build AMF Image #

## 3.1 On a Ubuntu 18.04 Host ##

```bash
98
$ docker build --target oai-amf --tag oai-amf:develop \
99
               --file component/oai-amf/docker/Dockerfile.amf.ubuntu18 \
Raphael Defosseux's avatar
Raphael Defosseux committed
100
101
102
103
               --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
               component/oai-amf
$ docker image prune --force
$ docker image ls
104
oai-amf                 develop             f478bafd7a06        1 minute ago          258MB
Raphael Defosseux's avatar
Raphael Defosseux committed
105
106
107
...
```

Sagar Arora's avatar
Sagar Arora committed
108
109
110
111
112
113
## 3.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-amf repository in a new folder name tmp before building the image. 

```bash
$ sudo podman build --target oai-amf --tag oai-amf:develop \
114
               --file component/oai-amf/docker/Dockerfile.amf.rhel8 \
Sagar Arora's avatar
Sagar Arora committed
115
116
117
118
119
               --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
               component/oai-amf
...
```

120
The above command is with podman, in case of docker it can be changed with its docker equivalent.
Sagar Arora's avatar
Sagar Arora committed
121
122


Raphael Defosseux's avatar
Raphael Defosseux committed
123
124
125
126
127
# 4. Build SMF Image #

## 4.1 On a Ubuntu 18.04 Host ##

```bash
128
$ docker build --target oai-smf --tag oai-smf:develop \
129
               --file component/oai-smf/docker/Dockerfile.smf.ubuntu18 \
Raphael Defosseux's avatar
Raphael Defosseux committed
130
131
132
133
               --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
               component/oai-smf
$ docker image prune --force
$ docker image ls
134
oai-smf                 develop             f478bafd7a06        1 minute ago          274MB
Raphael Defosseux's avatar
Raphael Defosseux committed
135
136
137
...
```

Sagar Arora's avatar
Sagar Arora committed
138
139
140
141
142
143
## 4.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-smf repository in a new folder name tmp before building the image. 

```bash
$ sudo podman build --target oai-smf --tag oai-smf:develop \
144
               --file component/oai-smf/docker/Dockerfile.smf.rhel8 \
Sagar Arora's avatar
Sagar Arora committed
145
146
147
148
149
               --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
               component/oai-smf
...
```

150
The above command is with podman, in case of docker it can be changed with its docker equivalent.
Sagar Arora's avatar
Sagar Arora committed
151

Sagar Arora's avatar
Sagar Arora committed
152
# 5. Build NRF Image #
Raphael Defosseux's avatar
Raphael Defosseux committed
153
154
155

## 5.1 On a Ubuntu 18.04 Host ##

Sagar Arora's avatar
Sagar Arora committed
156
```bash
157
$ docker build --target oai-nrf --tag oai-nrf:develop \
158
159
               --file component/oai-nrf/docker/Dockerfile.nrf.ubuntu18 \
               --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" component/oai-nrf
Sagar Arora's avatar
Sagar Arora committed
160
161
$ docker image prune --force
$ docker image ls
162
oai-nrf                 develop             04334b29e103        1 minute ago          280MB
Sagar Arora's avatar
Sagar Arora committed
163
164
165
...
```

Sagar Arora's avatar
Sagar Arora committed
166
167
168
169
170
171
## 5.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 name tmp before building the image. 

```bash
$ sudo podman build --target oai-nrf --tag oai-nrf:develop \
172
               --file component/oai-nrf/docker/Dockerfile.nrf.rhel8 \
Sagar Arora's avatar
Sagar Arora committed
173
174
175
176
177
               --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
               component/oai-nrf
...
```

178
The above command is with podman, in case of docker it can be changed with its docker equivalent.
Sagar Arora's avatar
Sagar Arora committed
179
180
181
182
183

# 6. Build SPGW-U Image #

## 6.1 On a Ubuntu 18.04 Host ##

Raphael Defosseux's avatar
Raphael Defosseux committed
184
```bash
185
$ docker build --target oai-spgwu-tiny --tag oai-spgwu-tiny:gtp-ext-header \
186
               --file component/oai-upf-equivalent/docker/Dockerfile.ubuntu18.04 \
Raphael Defosseux's avatar
Raphael Defosseux committed
187
188
189
               --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" component/oai-upf-equivalent
$ docker image prune --force
$ docker image ls
190
oai-spgwu-tiny          gtp-ext-header             dec6311cef3b        1 minute ago          255MB
Raphael Defosseux's avatar
Raphael Defosseux committed
191
192
193
...
```

Sagar Arora's avatar
Sagar Arora committed
194
195
196
197
198
199
200
201
202
203
204
205
## 6.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-spgwu repository in a new folder name tmp before building the image. 

```bash
$ sudo podman build --target oai-spgwu-tiny --tag oai-spgwu-tiny:develop \
               --file component/oai-spgwu-tiny/docker/Dockerfile.centos8 \
               --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
               component/oai-upf-equivalent
...
```

206
The above command is with podman, in case of docker it can be changed with its docker equivalent.
Sagar Arora's avatar
Sagar Arora committed
207
208

You are ready to [Configure the Containers](./CONFIGURE_CONTAINERS.md) or deploying the images using [helm-charts] (./DEPLOY_SA5G_HC.md)