is a relatively messy note that needs to be sorted out
How to become an OpenStack contributor
OpenStack is just a technical framework
OpenStack Foundation
Technical Committee code management, Quality assurance
The Board of Directors determines the future direction of OpenStack Platinum members, gold members, individual members
User Committee collects the needs of different users for OpenStack
开发流程、版本发布管理开发者、用户、社区生态体系管理收集用户需求商标管理社区事务管理(summit meetup )法律问题
OpenStack contributors need to know
Register Https://launchpad.net
Foundation Https://www.openstack.org/join
Sign Contributor Agreement
Subscribe to mailing list [email protected]
[Email Protected]/join
Gerrit Developing code auditing Tools
https://review.openstack.org
Select a unique user name
Upload ssh Key
Development process
Bug Management
Https://bugs.launchpad.net
1. Confirm the new bug
2. Resolving inconsistencies
3. Bugs with incomplete information
4. Detect bugs in the fix
管理新功能 ProjectName-spacs EG. openstack/nova-specs Github 生命周期(先提出功能定义 --> 提交代码 --> 分配开发任务 --> 开发 --> 审批) 有specs的项目跟没有specs的项目不一样。前者更加严格。 注册新功能 --> Buleprint描述功能 --> 设定任务分配者 --> 设定完成时间 --> 审批
Git
Setting up local git
git config–global user.name "Jmilkfan"
git config–global user.email "[Email protected]"
Detection:
1. Git config–list
2. Cat $HOME/.gitconfig
安装Git Review将代码上传到Gerrit(Review system)。 yum install git-review -y
Get the source code for OpenStack
git clone Https://github.com/openstack/projectname–branch=stable/juno
OpenStack Development Specification
Flow of OpenStack Code submissions
1. Get project code from the library to local–> git clone
2. Create a new branch
3. Local unit tests (unit test) –> git commmit Create a commit
4. Submit your code to gerrit–> git review
5. Get developer review and check Queue in Gerrit (unit test, etc.)
+1
-1 Re-modify the code –> git-commit-amend–> resubmit and ensure that the same commit (commit) branch
+2 Entering Gate Queue
6. Jenkins in Gate queue helps complete integrity testing
7. function contribution to Master
Developing an OpenStack IDE
Pycharm
Pycharm supports VIM simulator
Common shortcut keys
Advantages
Jump function
Integrated VIM
Friendly interface
Used by programmers for eclipse habits
Disadvantages
Not easy to debug
VIM 快速跳转到其他文件 主题颜色 语法高亮 静态代码分析 自动完成 跳转 Plug-ins vnndle YouCompleteMe Jedi ctrlp git clone https://github.com/xiaoquqi/dotfiles 优点 开发效率高 调试便捷 适合分布式系统软件开发 缺点 学习成本高 配置复杂
Devstack-ubuntu 14.04
Quick Start
Types of Virtualization
Qemu–> consumes a lot of resources
Kvm–> faster
Apt-get install git git clone https://github.com/openstack-dev/devstack adduser stack apt-get install sudo-y echo "Stack all= (All) nopasswd:all" >>/etc/sudoers sudu su-stack git clone https://git.opnstack.org/open Stack-dev/devstack CD devstack &&./stack.sh devstack LOCALRC configuration Admin_password=fanguiju Databa se_password= $ADMIN _password rabbit_password= $ADMIN _password service_password= $ADMIN _password service_ TOKEN=SADASD-ASDASDASD-ASDASDASD-ASDASDASD #安装Keystone时的临时Token, define FIXED_RANGE=172.31.1.0/24 #内部管理网络FIX Ed_ip floating_range=192.168.20.0/25 #外部Floating_ip dest=/opt/stack.kilo #安装路径, default path/opt/stack LO gfile= $DEST/logs/stack.sh.log #Openstack运行日志路径 verbose=true screen_logodir= $DEST/logs #Devstack以SCREEN方 Operation, when the actual content will be written to the log file after screen full enable_service n-novnc n-cauth #打开两个服务, the default devstack will not be used to turn off the service neutron service dis Able_server n-net #关闭NetWork, with neutron conflict enabled_serverces+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron Enabled_services+=,q-lbaas,q-vpn, Q-fwaas fixed_range=10.0.0.0/24 host_ip=200.21.1.61 floating_range=200.21.50.1/24 PUBLIC_NETWO rk_getway=200.21.50.2 q_floating_allocation_pool=start=200.21.50.100,end=200.21.50.150 Network Adapter configuration: Eth1 becomes the export of Br-ex access to the extranet. Bridging sudo ovs-vsctl add-port br-ex eth1 detection: sudo ovs-vsctl show uninstall Environment CD Devstack. /unstack.sh Devstack provides scripting support for 1. Load environment variable source OPENRC [username] [tenantname] eg. SOURCE OPENRC Admin Admin 2. exercise.sh the integrity of the test environment to perform the script under exercise/How to use screen screen-list to get a list of the screens window Screen-x stack goes to scree Environment of N next:ctrl+a+n previous:ctrl+a+p list:ctrl+a+ ' detach:ctrl+a+d acceleration devstack installation: Over Process: Load profile Install database, Message Queuing install OpenStack component Download image openstack necessary configuration complete Install and output results Installed Resources devstack/files/apts update PIP uses a domestic source to get OpenStack source code using PIP for Requiremen TS Install download image How to increase the speed of installation using the domestic mirror server Ubuntu Deb http://mirrors.16 3.com/ubuntu/trusty Main Building cache source locally use regoin-start.sh to avoid duplicate installations
OpenStack Basic Architecture
Horizon does not have a direct connection to the database. All operations are done through RESTFULAPI.
Neutron SDN
Cellometer Monitor to collect information about OpenStack components through the queue.
Heat batch, automated operation. Automate a task by invoking the RESTful API of a module, for example: Create a VPN, DB cluster.
大多数组件的框架设计都分为API层、服务层程序入口:使用setupTools console_scripts的方式来实现(好处:在各个操作系统平台上都可以找到合适的脚本程序去执行) eg. /opt/stack.kilo/nova/setup.cfg配置文件: eg. /etc/nova/nova.confPEP8测试: tox -v -epep8 --> 1. virtualenv创建虚拟化环境 2. flake8 指令检测pep8单元测试: tox -v -epy27如何调试Openstack代码 1. Print 2. Debugger 3. Remote Debugger ipbd tools 支持Tab补全
Git
git commit-a-amend submit to Gerrit for the preparation work.
Rebase(垫底) 和 Merge(合并) 的区别: 如果在Local分支上有修改 但是在Master上的代码被人更早一步的提交并修改了,这是我们无法提交代码,需要先Merge(合并)一下。 Merge:如果Master在我提交之前已经被修改了,可以直接pull将Master修改的部分拉到本地合并,生成一个新的合并提交。那么Mywork就会变成合并之后的模样。 Rebase:如果希望拉下来后,Mywork看起来并没有发生改变的话,可以使用git Rebase,会将mywork里面的commit取消并转换成一些临时的补丁文件,然后将Mywork同步成为Origin的样子,最后再将这些补丁文件应用到Mywork中。这样来实现合并自己的Commit和别人更早提交的代码。那么就可以将Mywoark中的旧的Commint回收掉。 区别: Merge:直接将Origin和Mywork合并 Rebase:先将Mywork的Commit取消并转换为补丁,再将Origin合并本地,最后Commit的时候将补丁的内容更新到Mywork(此时Mywork已经是Origin的样子了)。
PEP8 Python Code specification
1. Do not tab,4 a space
2. No more than 79 characters per line (preferably 73)
3. Two lines between class definitions and the first function of a class
4. The functions of the class are separated by a blank line
5. Use \ n line break
6. Longer lines, wrapping in spaces, not using \ Continuation characters
7. Todo format: # todo (first name) –> Todo tips for what to do when the next developer looks at the code
8. Primary ordering when importing imports (built-in, external third-party, module (custom) that the component code itself needs to import) is a blank line interval
文档规范""" Document """ 1. 不以空格开头 2. 多行文档,以新行结束 3. 多行文档,之前不包含新行 4.多行文档,第一行为简短描述,空一行,接着是对第一行的详细解析。缩进规范 1. 如果函数内的参数过长需要换行,要么对齐上一行的,要么缩进8个空格。注意不能与紧挨着的代码块的缩进一致,容易混淆。Other: 1. 多行赋值语句紧挨时,不以 = 号对齐 2. 普通的算术运算符赋值表达式中,算术运算符以空格与变量和参数隔开 3. 参数内的赋值语句应该不将=号和变量、数值隔开 4. 不以;合并多条 语句 5. :后面不跟语句,应该换行缩进
How to become a learning note for OpenStack contributors (memo, pending)