1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) OPNFV, Intel Corporation and others.
5 .. OPNFV SAMPLEVNF Documentation design file.
7 ====================================
8 Get started as a SampleVNF developer
9 ====================================
11 .. _SampleVNF: https://wiki.opnfv.org/samplevnf
12 .. _Gerrit: https://www.gerritcodereview.com/
13 .. _JIRA: https://jira.opnfv.org
14 .. _Technical_Briefs: https://wiki.opnfv.org/display/SAM/Technical+Briefs+of+VNFs
16 Prerequisite knowledge
17 ======================
19 Development/Contribution to SampleVNF requires knowledge of networking
20 technologies including knowledge of network protocols and hands-on experience
21 with relevant open-source software, such as Linux*, SDN, NFVI and the DPDK (if
22 VNF is based on DPDK libraries).
23 Developer needs debugging and benchmarking skills, as well as understanding of
24 NFVi infrastructure across multiple domains.
26 There are many ways to contribute to samplevnf.
28 * Develop new test cases in samplevnf
30 * Develop/contribute to existing VNFs or new VNFs
31 * Write samplevnf documentation
33 Technical Briefs of exists in VNFs in Technical_Briefs_
39 Where can I find some help to start?
41 You can also directly contact us by mail with [SampleVNF] prefix in the title
42 at opnfv-tech-discuss@lists.opnfv.org or on the IRC chan #opnfv-samplevnf.
47 How can I contribute to SampleVNF?
49 If you are already a contributor of any OPNFV project, you can contribute to
51 If you are totally new to OPNFV, you must first create your Linux Foundation
52 account, then contact us in order to declare you in the repository database.
54 We distinguish 2 levels of contributors:
55 The standard contributor can push patch and vote +1/0/-1 on any samplevnf patch
56 The committer can vote -2/-1/0/+1/+2 and merge.
57 SampleVNF committers are promoted by the samplevnf contributors.
62 OPNFV uses Gerrit_ for web based code review and repository management for the
63 Git Version Control System. You can access OPNFV Gerrit from this link.
64 Please note that you need to have Linux Foundation ID in order to use OPNFV
66 You can get one from this link.
68 OPNFV uses JIRA_ for issue management. An important principle of change
69 management is to have two-way traceability between issue management (i.e. JIRA_)and the code repository (via Gerrit).
70 In this way, individual commits can be traced to JIRA issues and we also know
71 which commits were used to resolve a JIRA issue.
72 If you want to contribute to samplevnf, you can pick a issue from SampleVNF's
73 JIRA dashboard or you can create you own issue and submit it to JIRA.
75 Submitting code to Gerrit
76 -------------------------
78 Installing and configuring Git and Git-Review is necessary in order to submit
80 The Getting to the code page will provide you with some help for that.
82 Comitting the code with Git
83 Open a terminal window and set the project's directory to the working directory
85 In this case "/home/opnfv/samplevnf" is the path to samplevnf project folder.
86 Replace this with the path of your own project.
90 cd /home/opnfv/samplevnf
92 Tell Git which files you would like to take into account for the next commit.
93 This is called 'staging' the files, by placing them into the staging area,
94 using the 'git add' command (or the synonym 'git stage' command).
98 git add samplevnf/samples/sample.yaml
101 Alternatively, you can choose to stage all files that have been modified
102 (that is the files you have worked on) since the last time you generated a
103 commit, by using the -a argument.
109 Git won't let you push (upload) any code to Gerrit if you haven't pulled
110 the latest changes first.
111 So the next step is to pull (download) the latest changes made to the project
112 by other collaborators using the 'pull' command.
119 Now that you have the latest version of the project and you have staged the
120 files you wish to push, it is time to actually commit your work to your local
125 git commit --signoff -m "Title of change
127 Test of change that describes in high level what
128 was done. There is a lot of documentation in code
129 so you do not need to repeat it here.
133 The message that is required for the commit should follow a specific set of
134 rules. This practice allows to standardize the description messages attached
135 to the commits, and eventually navigate among the latter more easily.
137 Verify your patch locally before submitting
138 Once you finish a patch, you can submit it to Gerrit for code review.
139 A developer sends a new patch to Gerrit will trigger patch verify job on
142 Pushing the code to Gerrit for review
143 Now that the code has been comitted into your local Git repository the
144 following step is to push it online to Gerrit for it to be reviewed. The
145 command we will use is 'git review'.
151 This will automatically push your local commit into Gerrit.
154 You can add Samplevnf committers and contributors to review your codes.
156 Modifying the code under review in Gerrit
157 At the same time the code is being reviewed in Gerrit, you may need to edit it to
158 make some changes and then send it back for review. The following steps go
159 through the procedure.
160 Once you have modified/edited your code files under your IDE, you will have to
162 The 'status' command is very helpful at this point as it provides an overview
163 of Git's current state.
169 The output of the command provides us with the files that have been modified
170 after the latest commit.
172 You can now stage the files that have been modified as part of the Gerrit code
173 review edition/modification/improvement using git add command.
174 It is now time to commit the newly modified files, but the objective here is
175 not to create a new commit, we simply want to inject the new changes into the
178 You can achieve that with the '--amend' option on the 'commit' command:
184 If the commit was successful, the 'status' command should not return the updated
185 files as about to be commited.
187 The final step consists in pushing the newly modified commit to Gerrit.
194 [1]: http://artifacts.opnfv.org/samplevnf/docs/testing_user_userguide_vACL/index.html