NFVBENCH-161 NFVbench --force-cleanup deletes more ports than needed
[nfvbench.git] / docs / development / building / build.rst
1
2 .. This work is licensed under a Creative Commons Attribution 4.0 International
3 .. License.
4 .. http://creativecommons.org/licenses/by/4.0
5 .. (c) Cisco Systems, Inc
6
7 Building containers and VM images
8 =================================
9
10 NFVbench is delivered as Docker container which is built using the Dockerfile under the docker directory.
11 This container includes the following parts:
12
13 - TRex traffic generator
14 - NFVbench orchestration
15 - NFVbench test VM (qcow2)
16
17 Versioning
18 ----------
19 These 3 parts are versioned independently and the Dockerfile will determine the combination of versions that
20 are packaged in the container for the version associated to the Dockerfile.
21
22 The NFVbench version is controlled by the git tag that conforms to the semver version (e.g. "3.3.0").
23 This tag controls the version of the Dockerfile used for building the container.
24
25 The TRex version is controlled by the TREX_VER variable in Dockerfile (e.g. ENV TREX_VER "v2.56").
26 TRex is installed in container from https://github.com/cisco-system-traffic-generator/trex-core/releases
27
28 The Test VM version is controlled by the VM_IMAGE_VER variable in Dockerfile (e.g. ENV VM_IMAGE_VER "0.8").
29 The VM is extracted from google storage (http://artifacts.opnfv.org)
30
31 Updating the VM image
32 ---------------------
33
34 When the VM image is changed, its version must be increased in order to distinguish from previous image versions.
35 The version strings to change are located in 2 files:
36
37 - docker/Dockerfile
38 - nfvbench/nfvbenchvm/dib/build-image.sh
39
40 Building and uploading the VM image
41 -----------------------------------
42 The VM image is built on gerrit verify when the image is not present in google storage.
43 It is not uploaded yet on google storage.
44
45 The build + upload of the new VM image is done after the review is merged.
46
47 For details on how this is done, refer to ./jjb/nfvbench/nfvbench.yaml in the opnfv releng repository.
48
49 Building a new NFVbench container image
50 ---------------------------------------
51 A new container image can be built and published to Dockerhub by CI/CD by applying a new semver tag to the
52 nfvbench repository.
53
54
55 Workflow summary
56 ----------------
57
58 NFVbench code has changed:
59
60 - commit with gerrit
61 - apply a new semver tag to trigger the container image build/publication
62
63 VM code has changed:
64
65 - update VM version in the 2 locations
66 - commit VM changes with gerrit to trigger VM build and publication to google storage
67 - IMPORTANT! wait for the VM image to be pushed to google storage before going to the next step
68   (otherwise the container build will fail as it will not find the VM image)
69 - apply a new semver tag to trigger the container image build/publication
70
71 To increase the TRex version:
72
73 - change the Trex version in Dockerfile
74 - commit with gerrit
75 - apply a new semver tag to trigger the container image build/publication