C&I Wiki Portal/ToolsDevelopmentGuideline
Jump to navigation
Jump to search
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
fill this in!
== Basics == This section will cover some of the basics for contributing to the code for these tools. This is a general overview, more specific information can be found on line at the links below. === Bazaar === ==== About Bazaar ==== Bazaar is a version control system that helps you track project history over time and to collaborate easily with others. Whether you're a single developer, a co-located team or a community of developers scattered across the world, Bazaar scales and adapts to meet your needs. Part of the GNU Project, Bazaar is free software sponsored by Canonical You can learn more at http://bazaar.canonical.com/en/ ==== Obtaining Bazaar ==== To install Bazaar on a debian or ubuntu system: <code>sudo apt-get install bazaar</code> For other Operating Systems, including Windows, Red Hat, SuSE, OSX and more, please see http://wiki.bazaar.canonical.com/Download ==== Learning Bazaar ==== Bazaar is easy to learn. There is an excellent [http://doc.bazaar.canonical.com/latest/en/mini-tutorial/ 5 Minute Tutorial] that should get you started. Beyond that, bzr has a fairly well developed man page and in-program help system. Please read and do the 5 Minute Tutorial now, which will teach you the basics like creating branches, logging into LP, pushing and merging. ===== Trees, Branches, Trunks? ===== The basic top level of a codebase is called the Trunk. The Trunk is the mainline code that all branches are a part of. Branches are localized copies of Trunk. Branches are where you make changes for submission and merge consideration. Once accepted, Branches are merged into Trunk and become part of the mainline codebase. ===== Basic Commands ===== * The most basic command is: <code>bzr</code> * To get a local copy of a project: <code>bzr branch lp:opencompute/opencompute-testing</code> * To review a change summary: <code>bzr status</code> * To add new files that are not yet managed: <code>bzr add path/to/filename</code> ** Note that /path/to/filename needs to be a path INSIDE your branch. When adding files not in the branch, you need to copy those files into the branch before adding them. * To see a diff of changes: <code>bzr diff path/to/filename</code> * To commit your changes to a new revision <code>bzr commit -m "Some descriptive summary of your changes"</code> * To push your changes to launchpad in preparation for a Merge Request: <code>bzr push lp:~<Your Launchpad Username>/opencompute/<Your Branch Name></code> ** for example: <code>bzr push lp:~bladernr/opencompute/ocp-testing-job-updates</code> There are many MANY more commands but those are the ones you'll likely use most frequently. ===== Learning More ===== * http://doc.bazaar.canonical.com/en/ * http://wiki.bazaar.canonical.com/Tutorials * https://yade-dem.org/wiki/Quick_Bazaar_tutorial * http://wiki.bazaar.canonical.com/Tutorials === Practices === ==== Languages to use ==== ===== Main Tooling ===== Plainbox, Checkbox, the providers and such are all written in Python3. ===== Job Files and Whitelists ===== Job Files are the same as they were in Checkbox, that is RFC822 compliant text files. See any file in the <code>jobs/</code> directory for examples. Whitelists are also simply text files, HOWEVER, you can also use regular expressions in job naming to pattern match jobs. ===== Test Scripts ===== These are scripts that perform actual testing. For example, a storage IO test, or a network performance test. Scripts can be written in pretty much anything that is compiled or has a valid interpreter installed on the System Under Test. The following are just a few examples of the languages you can write test scripts in: * Python3 * Bash * Ruby * Perl And some more complex ones * C/C++ * Go 'Please note that compiled languages will need special consideration and handling in order to get the packages to build properly. Packages are built for AMD64 and i386 for now. We have the capability to also compile them for OpenPower, ARM and ARM64, but that will require some porting work. In general, we advise the following for test scripts: * Python 3 for pretty much everything * BASH for one-liners and short simple scripts. Generally, if it starts feeling complex, it's time to re-write in Python3 * If you MUST use compiled languages, C but this is exceedingly rare and should only be done when something easier to maintain is not appropriate ==== Translations ==== We currently do not have any Translations for the tooling, nor are there plans to enable this. ==== Style Guide ==== The general rule is Python code should adhere to [https://www.python.org/dev/peps/pep-0008/ Python Foundation's PEP-8]. There are several tools to help you check your code for adherence such as [https://pypi.python.org/pypi/pep8/1.6.2 pep8] and [http://www.pylint.org/ Pylint] and many others.
Please note that all contributions to OpenCompute may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Do not submit copyrighted work without permission!
(opens in new window)
Retrieved from "
Not logged in
Help about MediaWiki
What links here