nfvbenchvm: release 0.16
[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 .. _nfvbench-artefact-versioning:
18
19 Versioning
20 ----------
21 These 3 parts are versioned independently and the Dockerfile will determine the combination of versions that
22 are packaged in the container for the version associated to the Dockerfile.
23
24 The NFVbench version is controlled by the git tag that conforms to the semver version (e.g. "3.3.0").
25 This tag controls the version of the Dockerfile used for building the container.
26
27 The TRex version is controlled by the TREX_VER variable in Dockerfile (e.g. ENV TREX_VER "v2.56").
28 TRex is installed in container from https://github.com/cisco-system-traffic-generator/trex-core/releases
29
30 The Test VM version is controlled by the VM_IMAGE_VER variable in Dockerfile (e.g. ENV VM_IMAGE_VER "0.8").
31 The VM is extracted from google storage (http://artifacts.opnfv.org)
32
33 Updating the VM image
34 ---------------------
35
36 When the VM image is changed, its version must be increased in order to distinguish from previous image versions.
37 The version strings to change are located in 2 files:
38
39 - docker/Dockerfile
40 - nfvbench/nfvbenchvm/dib/build-image.sh
41
42 Building and uploading the VM image
43 -----------------------------------
44 The VM image is built on gerrit verify when the image is not present in google storage.
45 It is not uploaded yet on google storage.
46
47 The build + upload of the new VM image is done after the review is merged.
48
49 For details on how this is done, refer to ./jjb/nfvbench/nfvbench.yaml in the opnfv releng repository.
50
51 Building a new NFVbench container image
52 ---------------------------------------
53 A new container image can be built and published to Dockerhub by CI/CD by applying a new semver tag to the
54 nfvbench repository.
55
56
57 Workflow summary
58 ----------------
59
60 NFVbench code has changed:
61
62 - commit with gerrit
63 - apply a new semver tag to trigger the container image build/publication
64
65 VM code has changed:
66
67 - update VM version in the 2 locations
68 - commit VM changes with gerrit to trigger VM build and publication to google storage
69 - IMPORTANT! wait for the VM image to be pushed to google storage before going to the next step
70   (otherwise the container build will fail as it will not find the VM image)
71 - apply a new semver tag to trigger the container image build/publication
72
73 To increase the TRex version:
74
75 - change the Trex version in Dockerfile
76 - commit with gerrit
77 - apply a new semver tag to trigger the container image build/publication