deep dive into the rocks - events.static.linuxfound.org · a technical problem ! lessons i should...
TRANSCRIPT
CCC 2014 DENVER
! Background
! Community development
! A technical problem
! Lessons I should have learned
DEEP DIVE INTO THE ROCKS
CCC 2014 DENVER
! Work @ Schuberg Philis since 1.8 years
! Hobby: triathlon http://myfirstnorseman.onecht.net/ Also as a jury, coach and some others
! Email: [email protected] Twitter: SambalTriathlon (don’t use) Facebook: +/- 3 accounts (lurked@best) plus.google: DaanHoogland (hardly used)
ABOUT ME
CCC 2014 DENVER
! This presentation is aimed at beginning open source or cloudstack developer whether proficient in programming or not.
! It might be interesting to cloudstack veterans that are looking to improve development process of the community, be it by improving their own way of contributing or adjusting the processes we use.
AUDIENCE
CCC 2014 DENVER
HOW TO GET INVOLVED
CCC 2014 DENVER
HOW GETTING A PATCH ACCEPTED IN THE COMMUNITY
IS SIMILAR TO GETTING YOU ACCEPTED
CCC 2014 DENVER
HOW NOT TO GET INVOLVED
CCC 2014 DENVER
PICK A GREAT REFACTORING JOB THAT IS EXTENDING
INTO THE ENTIRE SYSTEM AND TRY TO TELL PEOPLE
HOW TO DO IT
CCC 2014 DENVER
\\EBI\DAAN:~> LS -LTRA DOWNLOADS/0001-SDN-HOSTED-VPC-GATEWAYS-USING-LSWITCH.PATCH -RW-R--R--@ 1 DAAN STAFF 347998 MAR 26 11:12 DOWNLOADS/0001-SDN-HOSTED-VPC-GATEWAYS-USING-
LSWITCH.PATCH .
CCC 2014 DENVER
IMPORTANT THINGS TO CONTRIBUTE WHEN GETTING INVOLVED
CCC 2014 DENVER
# CODE # MAIL THE LIST # CODE # INTERACTION THROUGH THE REVIEW BOARD # FS ON THE WIKI (FS BUT ALSO TS!) # GOOD CODE # RAT CHECKSTYLE FINDBUGS # CODE # JIRA # DOCS # (SELFDOCUMENTING) CODE.
CCC 2014 DENVER
# CODE # MAIL THE LIST # CODE # INTERACTION THROUGH THE REVIEW BOARD # FS ON THE WIKI (FS BUT ALSO TS!) # GOOD CODE # RAT CHECKSTYLE FINDBUGS # CODE # JIRA # DOCS # (SELFDOCUMENTING) CODE
CCC 2014 DENVER
# CODE # MAIL THE LIST # CODE # INTERACTION THROUGH THE REVIEW BOARD # FS ON THE WIKI (FS BUT ALSO TS!) # GOOD CODE # RAT CHECKSTYLE FINDBUGS # CODE # JIRA # DOCS # (SELFDOCUMENTING) CODE
CCC 2014 DENVER
THE CUSTOMER PROBLEM
CCC 2014 DENVER
THE CUSTOMER REQUEST
MENU
Add the possibility to leverage the new Nicira NVP functionality
to hook the private-gateway of VPC routers on to each other
CCC 2014 DENVER
THE ENVISIONED SOLUTION
CCC 2014 DENVER
THE CORE CODE
http://localhost:8080/client/api? command=createPrivateGateway &response=json &sessionkey=xxx &physicalnetworkid=c71e08e7-c01d-4840-bd74-ffab517053fc &vpcid=be9acb3c-20eb-4e34-ab4c-3275185a9028 &ipaddress=10.10.10.2 &gateway=10.10.10.1 &netmask=255.255.255.0 &vlan=lswitch%3A%2F%2F3
CCC 2014 DENVER
A cross cutting concern:
!vlan and vlanid are encoded all over and used interchangably
! originally only numbers but also as uri
! 123 equals vlan://123
PROBLEM ANALYSIS
CCC 2014 DENVER
SOLUTIONS enum versus registration of types
CCC 2014 DENVER
! no uuid à id mapping available
A THOUGHT
CCC 2014 DENVER
WHY THIS IS A PROBLEM
isolation types/uris and broadcast types where designed into the system but there was no way to map a vlan on one of them and the
meaning of the two was lost so only BroadcastDomainType got my attention
CCC 2014 DENVER
stt (nicira nvp) networks where added next came midonet
then a whole lot more how they did it
CCC 2014 DENVER
Lswitch("lswitch", String.class) { @Override public <T> URI toUri(T value) { try { return new URI("lswitch", value.toString(), null, null); } catch (URISyntaxException e) { throw new CloudRuntimeException("Unable to convert to broadcast URI: " + value); } } /** * gets scheme specific part instead of host */ @Override public String getValueFrom(URI uri) { return uri.getSchemeSpecificPart(); } },
CCC 2014 DENVER
vlan vlanid vlannumber vlanuri broadcastDomainUri broadcastDomainId
CCC 2014 DENVER
- public String getVlanId() { - return vlanId; + public String getBroadcastUri() { + return broadcastUri;
CCC 2014 DENVER
BroadcastDomainType Vs
IsolationType
CCC 2014 DENVER
- nic.setIsolationUri(IsolationType.Vlan.toUri(ip.getVlanTag())); - nic.setBroadcastUri(IsolationType.Vlan.toUri(ip.getVlanTag())); + nic.setIsolationUri(IsolationType.Vlan.toUri(ip.getBroadcastUri())); + nic.setBroadcastUri(IsolationType.Vlan.toUri(ip.getBroadcastUri()));
CCC 2014 DENVER
long vnetId = Long.parseLong(BroadcastDomainType.getValue(uri)); long vlan = Long.parseLong(broadcastUri.getHost()); long vlan = Long.parseLong(BroadcastDomainType.getValue(uri));
CCC 2014 DENVER
HOW TO PROCEED NEXT make uuid à id mapping?
register uri types including format instead of enum
CCC 2014 DENVER
WORK TO BE DONE the result of this work is not ideal, so I am hoping to get feedback
on possible improvements
CCC 2014 DENVER
CONCLUSIONS
CCC 2014 DENVER
CCC 2014 DENVER
introduce yourself by proving you can do one thing good at a time
introduce your change by making the small
preliminaries that pave the way
CCC 2014 DENVER
work on a branch and do it publicly
submit a lot of parts to master
ACS should find a way to make this possible for non committers in a gerrit or github way
CCC 2014 DENVER
SIMILARITIES
PATCH PERSON small changes that build on each other
bring one thing to a good conclusion before you start another
communicate both the immediate and the end goal
be true to your ideals but pragmatic about the work to be done
not everybody that doesn’t say it is a good idea hates it
in general: you are accepted unless.. not if..
don’t break other code you’re right. that doesn’t mean others are wrong