You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Follow the steps below to set up your development environment.

Required Tools

See Required Tools for a list, with URLs, for the software tools required for OpenECOMP development.

Linux Foundation account setup

Follow the instructions on the identity portal to create a Linux Foundation account and get access to the OpenECOMP Gerrit instance.  Then verify that you can log in at https://gerrit.openecomp.org/ and that you can see the OpenECOMP list of repositories.

Git and Gerrit local setup

The OpenECOMP repositories are stored on Gerrit. You need a Git client to be able to pull/push code.

You also need to add a plugin to Git in order to interact with Gerrit.  The plugin is called git-review.

To install git-review on Linux (Ubuntu) :

sudo apt-get install git-review 

To install it on Windows:

Shall we make the below section a sub-section?

Follow those steps if you are a Windows user and need to interact with Gerrit; it will help you when you install git-review on your system.

Step-by-Step Guide

NOTE: it is assumed that you already have a Gerrit profile setup and you can connect to it.

Preliminary Step: Install Putty and Generate a Putty Key

NOTE: If you already have keys registered with putty, skip this section.

  1. Ensure you have the complete putty suite installed. You should have pageant.exe, plink.exe and puttygen.exe.
  2. Generate a key with puttygen. Choose a passphrase, then select "Save private key" and choose a target; also "Save public key" and select a target. It is recommended to use file names containing "private" and "public" for the keys as both will end in .ppk.
  3. Start pageant if not started, then add your newly generated private key.
  4. Under the control panel > system > advanced system properties > environment variables, add a GIT_SSH entry (if not present) and point to plink.exe.
  5. When done, start a command line (cmd.exe) and run 'env'; the newly added environment variable should appear.
  6. In your Gerrit profile, add the public key. Also, copy/paste the known_hosts entries listed, into a file named known_hosts under your .ssh profile (something like C:\Users\<ATTUID>\.ssh) (if known_hosts does not exist, create it).

Remaining Steps

  1. Download Python, based on the TSS approved version (2.7.10 at OpenECOMP Release 1):

2. Using a command line with administrative privileges, go to the folder in which the .msi file was downloaded. For example:

    • cd C:\Users\xxxxxx\Downloads (Replace xxxxx with your user name if the package was downloaded to your Downloads folder.) 

NOTE: You'll know that cmd.exe has admin privileges if the console text is green.

3. Install Python:

    • msiexec /i python-2.7.10.msi (32-bits)
    • msiexec /i python-2.7.10.amd64.msi (64-bits)

4. Now, follow the instructions at the following URL:

NOTE: You MUST select "Add python.exe to Path."

5. When installation is complete, restart a new command line (admin privileges may be needed) and run:

    • pip install git-review

NOTE: By opening a new command line you'll benefit from the %PATH% update.

6. Add your reviewer name for all future reviews:

    • git config --global --add gitreview.username "your_LF_user_name"

NOTE: Ensure that your user.name and user.email are matching what was configured for the Linux Foundation credentials: user.name should equal gitreview.username and email address should match the email  address that was configured for the Linux Foundation.


<<TODO: Should we make the section above a sub section ? >>


7. Set up your Git user email address to the one defined in your Linux Foundation account. The easiest way to do so is to run:

git config --global user.email your LF account email

git config --global --add gitreview.username your_LF_user_name


If you are using VPN, you might encounter a proxy problem while connecting to the Linux Foundation website. To avoid the problem, you should add the proxy setting in git config, using the following command:

git config --global https.proxy https://<proxy username>:<proxy password>@<proxy url> 

git config --global http.proxy http://<proxy username>:<proxy password>@<proxy url>

NOTE: When entering the proxy username, you might be required to add the domain name in front of the username.

Selecting a connection method (SSH or HTTPS)

Once Git/Gerrit is installed, you will need to select a connection method to the remote server.

We recommend using SSH in which case you need to register your public key in your account settings in Gerrit.

If you choose to use HTTP/HTTPS, you'll need to generate an access password. To do so:

In your Gerrit account settings, select HTTP Password:


The icon at the right of the generated password allows you to copy the generated password to your clipboard, it will be needed when you interact with git/gerrit.

This password may have a limited time to live, so you might get errors like this one:

Problem running 'git remote update gerrit'
Fetching gerrit
fatal: unable to access 'https://USERNAME@gerrit.openecomp.org/r/a/mso/ ': Unknown SSL protocol error in connection to gerrit.openecomp.org:443 error: Could not fetch gerrit

Regenerating a password will most likely solve the connectivity issue. Sometime, the Gerrit interface on HTTPS might be temporarily faulty, so retries might be needed.

Cloning the Repository by Using the Command Line

  1. Add a remote pointer to the Gerrit server that hosts your repository. (behind the company VPN Windows users will use the alternate command)

    Using SSH:

    git remote add origin ssh://USERNAME@gerrit.openecomp.org:29418/<REPONAME>

    Using HTTPS:

    With HTTPS, first you will need the Gerrit HTTP-generated password for each HTTPS operation with Git/Gerrit.

    git remote add origin https://USERNAME@gerrit.openecomp.org/r/a/<REPONAME>
     
  2. Now clone the remote repository (because the repo already contains a commit from the Linux Foundation team that created it). Since we clone in the current folder, it will create a sub folder with the remote copy.

    Using SSH:

    git clone ssh://USERNAME@gerrit.openecomp.org:29418/<REPONAME>

    Using HTTPS:

    With HTTPS, first you will need the Gerrit HTTP-generated password for each HTTPS operation with Git/Gerrit.

    git clone https://USERNAME@gerrit.openecomp.org/r/a/<REPONAME>

    Using an IDE : Install Gerrit plugin in IntelliJ, cloning and pushing

    Open File -> Settings -> Plugins of IntelliJ, and click on the Browse repositories... button.


    In the new window, search for Gerrit, click Install to install the plugin, and finally restart IntelliJ.


    To verify whether the Gerrit plugin is installed successfully, you can click File -> New -> Project from Version Control and verify whether Gerrit is present.



    Working with a Proxy

    For people working with a proxy, you might have proxy issues connecting to Linux Foundation website. To avoid the connection issue, you shall define the proxy setting for both IntelliJ and Git.

    To configure the proxy settings in IntelliJ, click File -> Settings -> Appearance & Behavior -> System Settings -> HTTP Proxy, enter the correct proxy settings and click Apply. In case of Manual proxy configuration, while entering the Host name, there is no need to write http:// in front of the URL. For example, if the proxy value is http://one.proxy.com, you shall putone.proxy.com as the Host name.



    To configure the proxy settings for Git, play the following command:

    git config --global https.proxy https://<proxy username>:<proxy password>@<proxy url> 
    git config --global http.proxy http://<proxy username>:<proxy password>@<proxy url>

    Note: while entering proxy username, sometimes it may require to add the domain name in front.




  • No labels