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 -----------------------
18 Development/Contribution to SampleVNF requires knowledge of networking technologies including
19 knowledge of network protocols and hands-on experience with relevant open-source
20 software, such as Linux*, SDN, NFVI and the DPDK (if VNF is based on DPDK libraries).
21 Developer needs debugging and benchmarking skils, as well as understanding of NFVi
22 infrastructure across multiple domains.
24 There are many ways to contribute to samplevnf.
25 * Develop new test cases in samplevnf
27 * Develop/contribute to existing VNFs or new VNFs
28 * Write samplevnf documentation
30 Techical Briefs of existsin VNFs in Technical_Briefs_
35 Where can I find some help to start?
36 You can also directly contact us by mail with [SampleVNF] prefix in the title at
37 opnfv-tech-discuss@lists.opnfv.org or on the IRC chan #opnfv-samplevnf.
40 How can I contribute to SampleVNF?
41 If you are already a contributor of any OPNFV project, you can contribute to samplevnf.
42 If you are totally new to OPNFV, you must first create your Linux Foundation account,
43 then contact us in order to declare you in the repository database.
45 We distinguish 2 levels of contributors:
46 the standard contributor can push patch and vote +1/0/-1 on any samplevnf patch
47 The commitor can vote -2/-1/0/+1/+2 and merge
48 SampleVNF commitors are promoted by the samplevnf contributors.
51 OPNFV uses Gerrit_ for web based code review and repository management for the
52 Git Version Control System. You can access OPNFV Gerrit from this link.
53 Please note that you need to have Linux Foundation ID in order to use OPNFV Gerrit.
54 You can get one from this link.
56 OPNFV uses JIRA_ for issue management. An important principle of change management
57 is to have two-way trace-ability between issue management (i.e. JIRA_) and the code repository (via Gerrit).
58 In this way, individual commits can be traced to JIRA issues and we also know which
59 commits were used to resolve a JIRA issue.
60 If you want to contribute to samplevnf, you can pick a issue from SampleVNF's
61 JIRA dashboard or you can create you own issue and submit it to JIRA.
63 Submitting code to Gerrit
64 Installing and configuring Git and Git-Review is necessary in order to submit code to Gerrit.
65 The Getting to the code page will provide you with some help for that.
67 Comitting the code with Git
68 Open a terminal window and set the project's directory to the working directory using the cd command.
69 In this case "/home/opnfv/samplevnf" is the path to the samplevnf project folder on my computer.
70 Replace this with the path of your own project.
73 cd /home/opnfv/samplevnf
75 Tell Git which files you would like to take into account for the next commit.
76 This is called 'staging' the files, by placing them into the staging area,
77 using the 'git add' command (or the synonym 'git stage' command).
80 git add samplevnf/samples/sample.yaml
83 Alternatively, you can choose to stage all files that have been modified
84 (that is the files you have worked on) since the last time you generated a commit, by using the -a argument.
89 Git won't let you push (upload) any code to Gerrit if you haven't pulled the latest changes first.
90 So the next step is to pull (download) the latest changes made to the project by other collaborators using the 'pull' command.
95 Now that you have the latest version of the project and you have staged the files you wish to push,
96 it is time to actually commit your work to your local Git repository.
99 git commit --signoff -m "Title of change
101 Test of change that describes in high level what
102 was done. There is a lot of documentation in code
103 so you do not need to repeat it here.
107 The message that is required for the commit should follow a specific set of rules.
108 This practice allows to standardize the description messages attached to the commits,
109 and eventually navigate among the latter more easily.
111 Verify your patch locally before submitting
112 Once you finish a patch, you can submit it to Gerrit for code review.
113 A developer sends a new patch to Gerrit will trigger patch verify job on Jenkins CI.
115 Pushing the code to Gerrit for review
116 Now that the code has been comitted into your local Git repository the following
117 step is to push it online to Gerrit for it to be reviewed. The command we will use is 'git review'.
121 This will automatically push your local commit into Gerrit.
124 You can add Samplevnf committers and contributors to review your codes.
126 Modifying the code under review in Gerrit
127 At the same time the code is being reviewed in Gerrit, you may need to edit it to
128 make some changes and then send it back for review. The following steps go through the procedure.
129 Once you have modified/edited your code files under your IDE, you will have to stage them.
130 The 'status' command is very helpful at this point as it provides an overview of Git's current state.
134 The output of the command provides us with the files that have been modified after the latest commit.
136 You can now stage the files that have been modified as part of the Gerrit code review
137 edition/modification/improvement using git add command.
138 It is now time to commit the newly modified files, but the objective here is not to
139 create a new commit, we simply want to inject the new changes into the previous commit.
140 You can achieve that with the '--amend' option on the 'commit' command:
145 If the commit was successful, the 'status' command should not return the updated
146 files as about to be commited.
148 The final step consists in pushing the newly modified commit to Gerrit.
154 [1]: http://artifacts.opnfv.org/samplevnf/docs/testing_user_userguide_vACL/index.html