Notes from Facebook's Developer Infrastructure at Scale F8 Talk
gregoryszorc.com
gregoryszorc.com
> They appear to use code coverage to determine what tests
> to run. "We're not going to run a test unless your diff
> might actually have broken it."
This seems like such an obvious optimization in hindsight, I'm surprised it's not more common. Does anybody know of other CIs that can do this?There are lots of tweaks that can be done, but these days having automatic build+test before a commit gets into the main branch feels like it is the norm. Even open source github projects can use something like TravisCI to prevent bad changes from getting into a project.
- Get a list of source files changed.
- Use bazel query with rdeps to get a list of tests that depend on that source file.
- Run those tests.
A little less implicit than the code coverage approach, but roughly the same effect.As others have mentioned, kicking off full runs on a regular basis is important to make sure there aren't weird cases that break and aren't caught in this approach.
I have experience with using Facebook's pfff [0]. Its codegraph feature builds up a graph of code that you can query. Doing something like 'get me a list of all classes this node depends on' on Java code is as simple as executing 'Graph.use(node name)' where nodename can be a class, package, method... Pfff supports many more languages, and its built on OCaml.
Facebook has a history of open sourcing stuff, I hope they open source their tools mentioned in the talk.
Still, I think it's a great idea for giving quick, "preliminary" feedback to developers - as long as the full test suite is still run periodically.
In practice? I think it may end up selectively pruning for hard-to-find bugs, which is not a desirable feature of a test suite.
http://tenderlovemaking.com/2015/02/13/predicting-test-failu...
Here's hoping someone will make a gem for this stuff.
Even if we can imagine building a better product today, the ongoing maintenance and extension of those services quickly become full-time multi-person investments with many hundreds of dedicated machines, neither of which even our core infra teams have, much less the little tiny research org.
Yes, they are paying a high initial cost to develop these offerings. But since they tend to produce high quality products that attract nearly-free-to-Facebook labor via open source, the investment tends to pays off in the long run. It's a savvy business move. And one that can arguably only be pulled off by a talented engineer organization.
I certainly agree that for organizations who can afford these high initial costs internally this is a great development model. My challenge (as a manager at Mozilla) is that, given we don't have such resources available, how do we build partnerships with groups or other projects that do in order to ensure such offerings are built?
Of course, another interesting approach would be to say that GitHub, Travis, Heroku, etc. show that DevOps-as-company is a viable business model and really what we should be doing is spinning up companies that raise funding and build products around each of the areas that are still lacking products that serve enterprises (read: customers with money) today.
I certainly agree that it's easy to imagine better issue management or patch review than GitHub has today - like many other projects we use other systems. When I've talked with GitHub engineers, all of our issues are well understood and they have plans to address them.
My skepticism is around the strategy of building and supporting our own things vs. partnering with places like GitHub that make a living building and supporting such software. In the Mozilla-specific case, they have proven open to working with us in the past, by pony-trading enhancements to Firefox for enhancements to GitHub, and the inability to deliver has been more on our side :-/
Past that, partnering with people makes sense to me if they're flexible enough to add things when we need them. My point is simply that historically GitHub has not been adding the things we need.
If GitHub didn't have issues people would still be there. If GitHub didn't have Git people would leave. Issues are a accessory to the main event like AppleTv is to the iphone/macbook
The currently supported languages are Go, Java, Python, JavaScript, and Ruby, so this wouldn't work yet for iOS, but Objective-C and Swift are high on our priority list. Editor plugins exist for Emacs, Sublime, and Atom. Would love to hear anyone's feedback from trying it out.
I've recently given Eclipse another chance after 4 years. It has impressed me with its C, PHP and Haskell support so far. I really recommend people give it a shot. Of course I installed a half decent GTK theme to make it look nice :)
http://bsumm.net/2012/08/11/steve-yegge-and-grok.html
It's unlikely that his version will ever be open sourced or usable outside of Google though.
Long term vision is to get rid of the "my editor X doesn't support language Y" problem as well as build a lot of other multi-language analysis tools on top of it. Shameless plug: if you care about developer productivity, join us!
This would be their blog post about this: https://code.facebook.com/posts/218678814984400/scaling-merc... and the code at http://selenic.com/repo/hg/shortlog/
"So they built their own IDE. Set of plugins on top of ATOM. Not a fork. They like hackable and web-y nature of ATOM.
The demo showing iOS development looks very nice! "
Seems that they have the right idea about "optimizing for Developers"
Primary source: https://twitter.com/feross/status/459259593630433280
HN article: https://news.ycombinator.com/item?id=7648237
I would like to hear more thoughts from FB folks on their experiences.
The VM, as with Java ten years ago, is also seeing remarkable improvements.
What if there are merge conflicts? I don't know about Mercurial, but in Git there are tons of cases where rebasing cannot happen automatically.
$ cat download-facebook-f8-2015-videos.sh
#!/usr/bin/env bash
youtube-dl "https://www.facebook.com/video.php?v=10152795258318553"
youtube-dl "https://www.facebook.com/video.php?v=10152795258318553"
youtube-dl "https://www.facebook.com/video.php?v=10152795404193553"
youtube-dl "https://www.facebook.com/video.php?v=10152795420103553"
youtube-dl "https://www.facebook.com/video.php?v=10152795617423553"
youtube-dl "https://www.facebook.com/video.php?v=10152795634488553"
youtube-dl "https://www.facebook.com/video.php?v=10152795636318553"
youtube-dl "https://www.facebook.com/video.php?v=10152795737378553"
youtube-dl "https://www.facebook.com/video.php?v=10152795739268553"
youtube-dl "https://www.facebook.com/video.php?v=10152795771278553"
youtube-dl "https://www.facebook.com/video.php?v=10152795771278553"
youtube-dl "https://www.facebook.com/video.php?v=10152795779043553"
youtube-dl "https://www.facebook.com/video.php?v=10152795794003553"
youtube-dl "https://www.facebook.com/video.php?v=10152797088108553"
youtube-dl "https://www.facebook.com/video.php?v=10152797098293553"
youtube-dl "https://www.facebook.com/video.php?v=10152797107658553"
youtube-dl "https://www.facebook.com/video.php?v=10152797148263553"
youtube-dl "https://www.facebook.com/video.php?v=10152797156538553"
youtube-dl "https://www.facebook.com/video.php?v=10152797345373553"
youtube-dl "https://www.facebook.com/video.php?v=10152797350653553"
youtube-dl "https://www.facebook.com/video.php?v=10152797720553553"
youtube-dl "https://www.facebook.com/video.php?v=10152797736763553"
youtube-dl "https://www.facebook.com/video.php?v=10152800459113553"
youtube-dl "https://www.facebook.com/video.php?v=10152800485138553"
youtube-dl "https://www.facebook.com/video.php?v=10152800517193553"
youtube-dl "https://www.facebook.com/video.php?v=10152800539128553"
youtube-dl "https://www.facebook.com/video.php?v=10152800550043553"
youtube-dl "https://www.facebook.com/video.php?v=10152800554083553"
youtube-dl "https://www.facebook.com/video.php?v=10152800569888553"
youtube-dl "https://www.facebook.com/video.php?v=10152800582978553"
youtube-dl "https://www.facebook.com/video.php?v=10152800594638553"
youtube-dl "https://www.facebook.com/video.php?v=10152800597428553"
youtube-dl "https://www.facebook.com/video.php?v=10152800611948553"
youtube-dl "https://www.facebook.com/video.php?v=10152800614133553"
youtube-dl "https://www.facebook.com/video.php?v=10152800617653553"
youtube-dl "https://www.facebook.com/video.php?v=10152800624928553"
youtube-dl "https://www.facebook.com/video.php?v=10152800744793553"
youtube-dl "https://www.facebook.com/video.php?v=10152800779103553"
youtube-dl "https://www.facebook.com/video.php?v=10152800781003553"
youtube-dl "https://www.facebook.com/video.php?v=10152800789943553"
youtube-dl "https://www.facebook.com/video.php?v=10152800795178553"
youtube-dl "https://www.facebook.com/video.php?v=10152800797663553"* A DVCS that rely on a central server for merging (sandcastle) is no longer.. distributed... (and you cannot have distributed team work here, this is wrong in multiple way)
* I think i'll never let a centralized, monolithic repository to be set up in my company. All great stuffs/talent i ever learned came from differents sources, differents independant projets (from git, hg or SVN). Loose that and i think i'll get narrow minded.
* All those fancy stuffs make facebookers better "facebook developers" but less prone to share with others (we don't share the same language, culture or tools anymore, even the design of the monolithic repo cannot help here)
* This is more a lesson on "how we made X thousands lambda devs work together" than actual tools i might need to use someday.
* I'll bet that facebook "infra" developers are less likely to use the tools they describe, and that is ironic. Those tools mostly apply to some hidden mass (100k commit / week.. ) of uniform developers that I'll never meet.
Yet doing things like rebasing or merging pull requests properly, requires you have an up-to-date master, making it a centralized operation.
People seem quite happy with this.
Rebasing is a smell of bad source code management. Merging pull requests is fine whether or not you are up to date. I don't know what you mean by 'properly'.
hint: It has to merge against tip of tree again if it wants to get back to a single head.