-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from ospanovalen/getting_started_dev
getting_started file updated
- Loading branch information
Showing
1 changed file
with
91 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Getting Started as a Developer | ||
Getting started as a developer | ||
============================== | ||
|
||
This brief note would serve as a reference for a developer looking to | ||
|
@@ -8,227 +8,181 @@ PLEASE NOTE: Until 2018, Tungsten Fabric was named “OpenContrail”. There | |
are still several references to the old name in the code and other | ||
utilities. | ||
|
||
A new developer can refer to the Tungsten Fabric Architecture document | ||
at | ||
https://tungstenfabric.github.io/website/Tungsten-Fabric-Architecture.html. | ||
|
||
To get information about latest releases and schedule, please refer to: | ||
https://jira.tungsten.io | ||
1. OS installation and configuration | ||
------------------------------------ | ||
|
||
1. Registration and User Creation | ||
--------------------------------- | ||
|
||
a. A new developer should register on Tungsten Fabric development/user | ||
mailing lists and Slack on this link: https://tungsten.io/community/ | ||
|
||
b. In order to submit blueprints for a new feature or to raise bugs on | ||
existing features, create a Linux Foundation ID: | ||
http://identity.linuxfoundation.org | ||
Install Centos 7 for a stable installation of Tungsten Fabric. | ||
|
||
c. Have a look at the blueprints and bugs in our Jira: | ||
https://jira.tungsten.io | ||
You can also use Ubuntu 20.04 (In case of problems, check https://github.com/tungstenfabric/tf-devstack) | ||
|
||
d. Create a GitHub account by signing up on https://github.com/ (if | ||
you’re not already registered) | ||
1.1 Relevant packages for the Tungsten Fabric installation | ||
---------------------------------------------------------- | ||
|
||
e. Confirm you can log into the Gerrit with your Linux Foundation ID: | ||
https://gerrit.tungsten.io | ||
:: | ||
|
||
2. Ubuntu installation and configuration | ||
----------------------------------------- | ||
sudo yum update | ||
sudo yum install git | ||
sudo yum install git-core | ||
sudo yum install openssh-server | ||
|
||
Install Ubuntu version 16.04 trusty for the Tungsten Fabric stable | ||
installation. | ||
|
||
2.1 Relevant packages for the Tungsten Fabric installation. | ||
----------------------------------------------------------- | ||
|
||
:: | ||
|
||
sudo apt-get update | ||
sudo apt-get install git | ||
sudo apt-get install git-core | ||
sudo apt-get install ant | ||
sudo apt-get install aptitude | ||
sudo aptitude install build-essential | ||
sudo apt-get install libev4 libev-dev | ||
|
||
2.2 Generate SSH key and add it to local SSH-agent | ||
1.2 Generate SSH key and add it to local SSH-agent | ||
-------------------------------------------------- | ||
|
||
Ref: | ||
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account | ||
|
||
:: | ||
|
||
ssh-keygen -t rsa -b 4096 -C "<[email protected]>" | ||
eval $(ssh-agent -s) | ||
ssh-add ~/.ssh/id_rsa | ||
sudo apt-get install xclip | ||
xclip -sel clip < ~/.ssh/id_rsa.pub | ||
|
||
2.3 Add SSH key to GitHub account | ||
--------------------------------- | ||
|
||
a. Go to profile and select settings | ||
ssh-keygen -t rsa -b 4096 -C "<[email protected]>" //press "Enter" every time you see question | ||
eval $(ssh-agent -s) | ||
ssh-add ~/.ssh/id_rsa | ||
cat ~/.ssh/id_rsa.pub | ||
|
||
b. Choose SSH and GPG keys -> New SSH key | ||
|
||
c. Give a title for the key | ||
|
||
d. Paste the key generated above ( xclip command will copy the key from | ||
.pub file to your clipboard) | ||
|
||
e. Add SSH key. | ||
|
||
3. Tungsten Fabric + Devstack setup | ||
----------------------------------- | ||
|
||
Ref: https://github.com/Juniper/contrail-installer/blob/master/README.md | ||
|
||
3.1 Clone Contrail-installer and devstack Repositories | ||
------------------------------------------------------ | ||
|
||
:: | ||
Copy the entire output line(your public ssh id) | ||
|
||
git clone https://github.com/juniper/contrail-installer.git | ||
git clone https://github.com/openstack-dev/devstack -b stable/newton | ||
|
||
3.2 Set up Tungsten Fabric (formerly known as OpenContrail) | ||
----------------------------------------------------------- | ||
1.3 Add SSH key to GitHub account | ||
--------------------------------- | ||
|
||
a. Copy the localrc file from samples to the current directory and edit | ||
it as required. | ||
1. Go to profile and select settings | ||
|
||
:: | ||
2. Choose SSH and GPG keys -> New SSH key | ||
|
||
cd contrail-installer cp samples/localrc-all localrc | ||
3. Give a title for the key | ||
|
||
change eth interface: default is eth0 #CONTRAIL_BRANCH=R3.2 | ||
//Commented means code will be checked out from Trunk. //Else specify | ||
the branch and uncomment it. | ||
4. Paste the key copied in step 1.2 | ||
|
||
b. Execute contrail.sh | ||
5. Add SSH key | ||
|
||
:: | ||
2. Tungsten Fabric + Devstack setup(Ansible Deployer) | ||
----------------------------------------------------- | ||
|
||
./contrail.sh | ||
Ref: https://github.com/tungstenfabric/tf-devstack | ||
|
||
3.3 Set up DevStack | ||
------------------- | ||
If you have any questions, you can see more detailed instructions in this README: | ||
|
||
a. Copy the opencontrail plugin to devstack neutron_plugins directory | ||
https://github.com/tungstenfabric/tf-devstack/tree/master/ansible | ||
|
||
:: | ||
2.1 Create a nonroot user and add it to the wheel group | ||
------------------------------------------------------- | ||
|
||
cp ../contrail-installer/devstack/lib/neutron_plugins/opencontrail | ||
lib/neutron_plugins/ | ||
:: | ||
sudo useradd <username> | ||
sudo passwd <username> | ||
sudo usermod -aG wheel <username> | ||
|
||
b. Prepare localrc for devstack: | ||
|
||
:: | ||
Modify user rigths configuration. Open the sudoers file | ||
|
||
cp ../contrail-installer/devstack/samples/localrc-all localrc | ||
:: | ||
sudo visudo | ||
|
||
Update “PHYSICAL_INTERFACE” as applicable. | ||
In the opened file, locate the line | ||
|
||
Add following to localrc file: | ||
:: | ||
%wheel ALL=(ALL) ALL | ||
|
||
NOVNC_BRANCH=v0.6.0 | ||
Change it to | ||
|
||
c. Run stack.sh | ||
:: | ||
%wheel ALL=(ALL) NOPASSWD: ALL | ||
|
||
:: | ||
Switch to the new user and navigate to the home directory | ||
|
||
./stack.sh | ||
:: | ||
su <username> | ||
cd | ||
|
||
d. The installation shall fail once. Once it fails, do the following | ||
change | ||
|
||
Edit the file | ||
“/usr/local/lib/python2.7/dist-packages/openstack/session.py” at line | ||
29 and replace “openstack.version” with “openstack” | ||
2.1 Clone Contrail-installer and devstack Repositories | ||
------------------------------------------------------ | ||
|
||
Line 29: DEFAULT_USER_AGENT = “openstacksdk/%s” % openstack | ||
:: | ||
|
||
e. Now do a restack. For this Tungsten Fabric needs to be restarted as | ||
well, i.e. | ||
git clone http://github.com/tungstenfabric/tf-devstack | ||
|
||
:: | ||
2.2 Set up Tungsten Fabric | ||
-------------------------- | ||
|
||
./unstack.sh cd ../contrail_installer ./contrail.sh restart cd - | ||
./stack.sh | ||
Execute script and wait for installation: | ||
:: | ||
|
||
3.4. Accessing Openstack and Tungsten Fabric GUIs | ||
------------------------------------------------- | ||
./tf-devstack/ansible/run.sh // | ||
|
||
2.3 Accessing Openstack and Tungsten Fabric GUIs | ||
------------------------------------------------ | ||
Openstack and contrail GUIs can be accessed as follows:- | ||
|
||
a. Openstack GUI: :code:`http://localhost/dashboard/` | ||
1. Tungsten Fabric GUI: :code:`http://localhost:8143/` | ||
|
||
2. Openstack GUI: :code:`http://localhost/dashboard/` (only if you have installed with the openstack orchestrator) | ||
|
||
b. Tungsten Fabric GUI: :code:`http://localhost:8080/` | ||
|
||
4. Setting up Gerrit for committing code-changes for review | ||
3. Setting up Gerrit for committing code-changes for review | ||
----------------------------------------------------------- | ||
|
||
Ref: https://gerrit.tungsten.io/r/Documentation/index.html | ||
https://gerrit-review.googlesource.com/Documentation/user-notify.html | ||
|
||
4.1 Setup SSH access | ||
3.1 Setup SSH access | ||
-------------------- | ||
|
||
a. Log into your account at gerrit.tungsten.io | ||
1. Log into your account at https://tf-gerrit.gz1.progmaticlab.com (also via GitHub) | ||
|
||
b. Go to top-right corner -> settings | ||
2. Go to top-right corner -> settings | ||
|
||
c. Left panel -> SSH public keys -> Add key | ||
3. Left panel: SSH Keys -> New SSH key | ||
|
||
d. Follow the instruction under heading “How to generate an SSH key” | ||
4. Copy ssh key from step 1.2 | ||
|
||
e. Test the SSH access | ||
5. Test the SSH access | ||
|
||
:: | ||
|
||
$ ssh -p 29418 sshusername@gerrit.tungsten.io | ||
$ ssh -p 29418 sshusername@tf-gerrit.gz1.progmaticlab.com | ||
|
||
\***\* Welcome to Gerrit Code Review \***\* | ||
**** Welcome to Gerrit Code Review **** | ||
|
||
Hi John Doe, you have successfully connected over SSH. | ||
Hi <sshusername>, you have successfully connected over SSH. | ||
|
||
Unfortunately, interactive shells are disabled. To clone a hosted Git | ||
repository, use: | ||
Unfortunately, interactive shells are disabled. | ||
To clone a hosted Git repository, use: | ||
|
||
:: | ||
|
||
git clone | ||
ssh://[email protected]:29418/REPOSITORY_NAME.git | ||
git clone ssh://[email protected]:29418/REPOSITORY_NAME.git | ||
|
||
Connection to hostname closed. | ||
|
||
4.2 Pushing code-changes for review | ||
3.2 Pushing code-changes for review | ||
----------------------------------- | ||
|
||
a. Install git-review | ||
|
||
1. Install git-review | ||
|
||
:: | ||
|
||
sudo apt-get install git-review | ||
sudo yum install git-review | ||
|
||
b. Configure Gerrit | ||
2. Configure Gerrit | ||
|
||
:: | ||
|
||
git config –global user.email [email protected] gitdir=$(git | ||
rev-parse –git-dir); scp -p -P 29418 | ||
username@gerrit.tungsten.io:hooks/commit-msg ${gitdir}/hooks/ | ||
username@tf-gerrit.gz1.progmaticlab.com:hooks/commit-msg ${gitdir}/hooks/ | ||
|
||
c. Clone the repo where changes need to be committed | ||
3. Clone the repo where changes need to be committed | ||
|
||
:: | ||
|
||
git clone | ||
ssh://sshusername@gerrit.tungsten.io:29418/REPOSITORY_NAME.git | ||
ssh://sshusername@tf-gerrit.gz1.progmaticlab.com:29418/REPOSITORY_NAME.git | ||
|
||
d. Commit the changes | ||
4. Commit the changes | ||
|
||
:: | ||
|
||
|
@@ -237,10 +191,12 @@ d. Commit the changes | |
Note: please ensure that any change being committed should have a corresponding | ||
launch-pad bug-id mentioned in the commit message, i.e. "Bug #1679466" | ||
|
||
e. Push the locally committed changes up for review | ||
5. Push the locally committed changes up for review | ||
|
||
:: | ||
|
||
git push ssh://username@gerrit.tungsten.io:29418/REPOSITORY_NAME \ | ||
git push ssh://username@tf-gerrit.gz1.progmaticlab.com:29418/REPOSITORY_NAME \ | ||
HEAD:refs/for/<branch>%topic=<few-words-describing-the-change>, \ | ||
[email protected], [email protected] | ||
|
||
NOTE. If any of the steps above have raised questions, you can read the documentation at the link above |