Contribute your code to OpenStack

Source: Internet
Author: User
Tags ssh ssh account virtual environment git clone openpgp

Reprint: http://www.ibm.com/developerworks/cn/cloud/library/cl-contributecode-openstack/


With the support of OpenStack (open source cloud software), more and more individuals and businesses want to contribute to the OpenStack community. Bug reports, blueprint agreements (Blueprint engagement), and code reviews are just a few ways to contribute. This article provides step-by-steps instructions for setting up your development environment and contributing code to OpenStack.

1 reviews:

Sheng Bo Hou, software engineer, IBM

July 18, 2013 content

Develop and deploy your next application on the IBM Bluemix cloud platform.

Get started with your trial

OpenStack is an infrastructure-as-a-service (IaaS) cloud computing project that is free open source software released under the terms of the Apache license. Managed by OpenStack Foundation, the project was established in September 2012 as a non-profit, entity-based organization designed to promote, protect and empower OpenStack software and its communities.

The

Resource is managed through a dashboard that gives administrators control and gives users the right to configure resources through a WEB interface. This article describes how to set up your account, set up your development environment, and start contributing to OpenStack. Step 1th: Set up your account with online registration and key configuration to set up your Launchpad account. Launchpad is the location that OpenStack uses to host all of its projects. Please visit the Launchpad login page, register with your email address, and choose a memorable Launchpad ID for yourself. Then visit Https://launchpad.net/~LaunchpadID, set your OpenPGP key, and use the instructions on that page to upload your SSH public key. For example, my Launchpad ID is Houshengbo, so I'll go to Https://launchpad.net/~houshengbo, as shown in Figure 1. Figure 1. Set the OpenPGP key to set up your SSH account for Gerrit. OpenStack applies a code review process to ensure code quality. Please visit the  openstack Code review   page and sign in with your Launchpad account. Then go to  https://review.openstack.org/#/settings/ssh-keys  and upload your SSH public key. Figure 2. Upload SSH public key

Back to top 2nd step: Sign the CLA agreement and join OpenStack Foundation if you have not yet joined. Use the e-mail address you plan to use to contribute code. The primary email address in Foundation profile needs to match the preferred email you set up later in the Gerrit contact information. Please visit the Code Review page. Click the Sign in link located in the upper-right corner of the page. Log in to Launchpad using your Launchpad ID. Unless you are a U.S. government employee (see below), please agree to individual contributor License Agreement and provide contact information. All of your names and e-mail addresses are public. If you want, you can update this contact information later, but make sure that your primary email address always matches the email address that you set up for your OpenStack Foundation membership. Join the OpenStack Contributors group. A code change needs to be submitted as a member.

If you are working as an individual contributor, it is sufficient to perform the above steps. If you work on behalf of a company or the U.S. government, you may want to focus on some other internal approval processes that vary from company to organization. For more information, see the Contributor license agreement.

Back to top 3rd step: Setting up the local development environment setting up the Eclipse environment: Install Ubuntu 11.10 or 11.10+ with Python. Installs Git:sudo apt-get install git. Install Eclipse. Install Eclipse's PyDev plugin. On the Eclipse window, click  help > Install New software. Configure the Python interpreter for Eclipse. In the Work with field, enter  http://pydev.org/updates  and click  add. Select  pydev. Click  next until you find the Review licences window. Accept the license Terms and click  finish. Install Eclipse's EGit plugin. On the Eclipse window, click  help > Install New software. In the Work with field, enter  http://download.eclipse.org/egit/updates  and click  add. Select  eclipse EGit, which is located under Eclipse Git Team Provider. Click  next until you find the Review licences window. Accept the license Terms and click  finish. Set up the code base. Use Devstack: Open a terminal, go to the target directory, and run the following command to get the Devstack code:

git clone git://github.com/openstack-dev/devstack.git
Create a file named LOCALRC under the Devstack directory that you just created. You can find information on how to configure LOCALRC on the Devstack Web site. Run./stack.sh. The default working directory is/opt/stack, and you can change it manually. After the initial run of Devstack is successful, you can find all the code under/opt/stack. Another way is to download a specific item instead of cloning all the items. Take the Keystone project as an example: open a terminal, go to the destination directory (for example,/opt/stack) and run the following command to get the Keystone code:
git clone https://github.com/openstack/keystone.git
Import the project into eclipse: Run Eclipse and set the workspace to the directory where all projects (/opt/stack) are saved. To create a PyDev project: Click File > New > PyDev Project. Make its name the same as the item, such as Keystone, and then click Finish. Synchronize the project with Egit: In Eclipse, right-click the project (Keystone), click Team > Share Project, and then click Next and Finish. After you complete the steps above, you should see [Keystone Master] in Eclipse that is located after your project name. Run unit testsRun all unit tests on a project: Open a terminal and go to the project directory, such as Keystone. Run the./run_tests.sh command. When asked if you want to create a virtual environment, select Y or N. Test An example: open a terminal and go to the project directory, such as Keystone. Run the./run_tests.sh <file path> command, such as./run_tests.sh/opt/stack/keystone/tests/test_backend.py. Test An example: open a terminal and go to the project directory, such as Keystone. Run the./run_tests.sh <file path>:<class name> command, for example./run_tests.sh/opt/stack/keystone/tests/test_backend.py : Commonhelpertests. Test a method: Open a terminal and go to the project directory, such as Keystone. Run the./run_tests.sh <file path>:<class name>.<method name> command, for example./run_tests.sh/opt/stack/keystone/ Tests/test_backend.py:commonhelpertests.test_format_helper_raises_malformed_on_incomplete_format. Run the OpenStack serviceRun all services for Devstack: Open a terminal and go to the Devstack directory. Run the./stack.sh command. In LOCALRC, specify the services that you want to run, such as Enabled_services=key,c-api,c-vol,c-sch,mysql,rabbit. Run the./unstack.sh to close all services. First run. After the/stack.sh is successful, you can also run the./rejoin-stack.sh to run all the specified services. Run the service in Eclipse. Take Keystone as an example: Set the Debug configuration for Keystone in Eclipse. Right-click all of the contents under Script Keystone-bin, and then click Debug as > Debug configurations, as shown in Figure 3. Figure 3: Debug ConfigurationSets the Debug configuration. Click the Arguments tab, select Other as the working directory, and then enter ${workspace_loc:keystone}, as shown in Figure 4 and Figure 5. Figure 4. Main Tab Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.