{"id":728,"date":"2023-06-27T16:00:51","date_gmt":"2023-06-27T16:00:51","guid":{"rendered":"https:\/\/fde.cat\/index.php\/2023\/06\/27\/meta-developer-tools-working-at-scale\/"},"modified":"2023-06-27T16:00:51","modified_gmt":"2023-06-27T16:00:51","slug":"meta-developer-tools-working-at-scale","status":"publish","type":"post","link":"https:\/\/fde.cat\/index.php\/2023\/06\/27\/meta-developer-tools-working-at-scale\/","title":{"rendered":"Meta developer tools: Working at scale"},"content":{"rendered":"<p><span>Every day, thousands of developers at Meta are working in repositories with millions of files. Those developers need tools that help them at every stage of the workflow while working at extreme scale. In this article we\u2019ll go through a few of the tools in the development process. And, as an added bonus, those we talk about below are open source so you can try them yourself.<\/span><\/p>\n<h2><span>Sapling: Scaling version control<\/span><\/h2>\n<p><a href=\"https:\/\/engineering.fb.com\/2022\/11\/15\/open-source\/sapling-source-control-scalable\/\" target=\"_blank\" rel=\"noopener\"><span>Sapling<\/span><\/a><span> is a version control system that can scale to huge sizes, but also emphasizes usability. There are three main components to Sapling \u2013 a server, a client, and a virtual file system.<\/span><\/p>\n<p><span>The server stores all the data and is a careful mix of clever storage formats, wire protocols, and algorithms, <\/span><a href=\"https:\/\/engineering.fb.com\/2021\/04\/29\/developer-tools\/rust\/\" target=\"_blank\" rel=\"noopener\"><span>mostly implemented in Rust<\/span><\/a><span> and <\/span><a href=\"https:\/\/engineering.fb.com\/2014\/01\/07\/core-data\/scaling-mercurial-at-facebook\/\" target=\"_blank\" rel=\"noopener\"><span>architected to scale<\/span><\/a><span>.<\/span><\/p>\n<p><span>The client then talks to that server, providing all the familiar operations (check out, rebase, commit, amend, etc). In addition, the client is also capable of talking to a git server, meaning that open source GitHub repositories can be worked on using our <\/span><a href=\"https:\/\/sapling-scm.com\/\" target=\"_blank\" rel=\"noopener\"><span>open-source Sapling release<\/span><\/a><span>.<\/span><\/p>\n<p><span>The final component is the virtual file system. When checking out a repository of our scale, just the disk I\/O of writing all the files can take a significant amount of time. One solution is <\/span><a href=\"https:\/\/git-scm.com\/docs\/git-sparse-checkout\" target=\"_blank\" rel=\"noopener\"><span>sparse checkouts<\/span><\/a><span>, where a developer declares what subset of the repo they wish to see in advance. A more ergonomic alternative is EdenFS, which checks out everything in a few seconds but then only actually downloads the files from the server when they are accessed.<\/span><\/p>\n<h2><span>Buck2: Build system<\/span><\/h2>\n<p><span>After making changes, many developers at Meta use <\/span><a href=\"https:\/\/engineering.fb.com\/2023\/04\/06\/open-source\/buck2-open-source-large-scale-build-system\/\" target=\"_blank\" rel=\"noopener\"><span>Buck2<\/span><\/a><span> to compile the results and test out their changes. Buck2 is designed to work at large scale, supporting remote caching and execution, so that developers can share each other\u2019s compilations and a single developer can have access to thousands of machines to run compilations in parallel. Buck2 is also designed to support multiple programming languages simultaneously \u2013 so if you want your OCaml program to depend on a Rust library that uses a C++ library whose source code was generated by Erlang, that will work just fine.<\/span><\/p>\n<p><span>Buck2 works well without Sapling, but has specific design considerations to enable Sapling and EdenFS. Buck2 uses Watchman to find out which files have changed, and Watchman supports EdenFS so that it can integrate smoothly with files that aren\u2019t on the disk. Buck2 can also use specific EdenFS operations to access the file without going via the disk, optimizing performance on systems where virtual file systems can be slower.<\/span><\/p>\n<h2><span>Infer, RacerD, and Jest: Testing and static analysis<\/span><\/h2>\n<p><span>Handwritten tests and static analysis play an important role in making sure all of our code functions as intended. Working with the quantity of code we do at Meta means that we need tools that provide a high-quality signal, and do so very quickly.<\/span><\/p>\n<p><span>For general static analysis, we use a platform called<\/span> <a href=\"https:\/\/fbinfer.com\/\" target=\"_blank\" rel=\"noopener\"><span>Infer<\/span><\/a><span>, which is<\/span> <a href=\"https:\/\/engineering.fb.com\/2017\/09\/06\/android\/finding-inter-procedural-bugs-at-scale-with-infer-static-analyzer\/\" target=\"_blank\" rel=\"noopener\"><span>interprocedural<\/span><\/a><span> and supports multiple languages, including Java and C++. We also have more tailor-made analysis tools such as<\/span> <a href=\"https:\/\/engineering.fb.com\/2017\/10\/19\/android\/open-sourcing-racerd-fast-static-race-detection-at-scale\/\" target=\"_blank\" rel=\"noopener\"><span>RacerD<\/span><\/a><span>, which detects Java concurrency bugs. RacerD played a big role in our project to<\/span> <a href=\"https:\/\/engineering.fb.com\/2017\/09\/26\/android\/multithreaded-rendering-on-android-with-litho-and-infer\/\" target=\"_blank\" rel=\"noopener\"><span>move Facebook\u2019s News Feed on Android from single-threaded to multi-threaded<\/span><\/a><span>.<\/span><\/p>\n<p><span>We also have language-specific testing frameworks. For example, <\/span><a href=\"https:\/\/jestjs.io\/\" target=\"_blank\" rel=\"noopener\"><span>Jest<\/span><\/a><span> is our Javascript testing framework. In 2022<\/span>\u00a0<a href=\"https:\/\/engineering.fb.com\/2022\/05\/11\/open-source\/jest-openjs-foundation\/\" target=\"_blank\" rel=\"noopener\"><span>we officially transferred Jest to the OpenJS Foundation<\/span><\/a><span> to further support its growth within the wider industry.<\/span><\/p>\n<p><span>Finally, there are tools that sit between static analysis and manual test cases. Our<\/span> <a href=\"https:\/\/engineering.fb.com\/2018\/05\/02\/developer-tools\/sapienz-intelligent-automated-software-testing-at-scale\/\" target=\"_blank\" rel=\"noopener\"><span>Sapienz tool<\/span><\/a><span>, for example, automatically tests mobile apps by allowing developers to simulate the user experience to seek out crashes and other potential issues.<\/span><\/p>\n<h2><span>Learn more about Meta\u2019s developer workflow<\/span><\/h2>\n<p><span>In addition to our open-source tools, our developers also use a number of proprietary tools in their day-to-day workflows as well. For example, Phabricator (Phab for short), our CI and reviewing tool, helps our developers review and submit stacks of diffs. You can find more about these tools (along with the ones covered above) in the article on <\/span><a href=\"https:\/\/developers.facebook.com\/blog\/post\/2022\/11\/15\/meta-developers-workflow-exploring-tools-used-to-code\/\" target=\"_blank\" rel=\"noopener\"><span>Meta developer\u2019s workflow<\/span><\/a><span>.<\/span><\/p>\n<p>The post <a href=\"https:\/\/engineering.fb.com\/2023\/06\/27\/developer-tools\/meta-developer-tools-open-source\/\">Meta developer tools: Working at scale<\/a> appeared first on <a href=\"https:\/\/engineering.fb.com\/\">Engineering at Meta<\/a>.<\/p>\n<p>Engineering at Meta<\/p>","protected":false},"excerpt":{"rendered":"<p>Every day, thousands of developers at Meta are working in repositories with millions of files. Those developers need tools that help them at every stage of the workflow while working at extreme scale. In this article we\u2019ll go through a few of the tools in the development process. And, as an added bonus, those we&hellip; <a class=\"more-link\" href=\"https:\/\/fde.cat\/index.php\/2023\/06\/27\/meta-developer-tools-working-at-scale\/\">Continue reading <span class=\"screen-reader-text\">Meta developer tools: Working at scale<\/span><\/a><\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-728","post","type-post","status-publish","format-standard","hentry","category-technology","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":651,"url":"https:\/\/fde.cat\/index.php\/2022\/11\/15\/sapling-source-control-thats-user-friendly-and-scalable\/","url_meta":{"origin":728,"position":0},"title":"Sapling: Source control that\u2019s user-friendly and scalable","date":"November 15, 2022","format":false,"excerpt":"Sapling is a new Git-compatible source control client. Sapling emphasizes usability while also scaling to the largest repositories in the world. ReviewStack is a demonstration code review UI for GitHub pull requests that integrates with Sapling to make reviewing stacks of commits easy. You can get started using Sapling today.\u00a0\u2026","rel":"","context":"In &quot;Technology&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":614,"url":"https:\/\/fde.cat\/index.php\/2022\/07\/27\/programming-languages-endorsed-for-server-side-use-at-meta\/","url_meta":{"origin":728,"position":1},"title":"Programming languages endorsed for server-side use at Meta","date":"July 27, 2022","format":false,"excerpt":"\u2013 Supporting a programming language at Meta is a very careful and deliberate decision. \u2013 We\u2019re sharing our internal programming language guidance that helps our engineers and developers choose the best language for their projects. \u2013 Rust is the latest addition to Meta\u2019s list of supported server-side languages. At Meta,\u2026","rel":"","context":"In &quot;Technology&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":820,"url":"https:\/\/fde.cat\/index.php\/2024\/02\/06\/dotslash-simplified-executable-deployment\/","url_meta":{"origin":728,"position":2},"title":"DotSlash: Simplified executable deployment","date":"February 6, 2024","format":false,"excerpt":"We\u2019ve open sourced DotSlash, a tool that makes large executables available in source control with a negligible impact on repository size, thus avoiding I\/O-heavy clone operations. With DotSlash, a set of platform-specific executables is replaced with a single script containing descriptors for the supported platforms. DotSlash handles transparently fetching, decompressing,\u2026","rel":"","context":"In &quot;Technology&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":597,"url":"https:\/\/fde.cat\/index.php\/2022\/06\/09\/under-the-hood-metas-cloud-gaming-infrastructure\/","url_meta":{"origin":728,"position":3},"title":"Under the hood: Meta\u2019s cloud gaming infrastructure","date":"June 9, 2022","format":false,"excerpt":"The promise of cloud gaming is a promise to democratize gaming. Anyone who loves games should be able to enjoy them and share the experience with their friends, no matter where they\u2019re located, and even if they don\u2019t have the latest, most expensive gaming hardware. Facebook launched its cloud gaming\u2026","rel":"","context":"In &quot;Technology&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":877,"url":"https:\/\/fde.cat\/index.php\/2024\/06\/11\/unlocking-the-power-of-mixed-reality-devices-with-mobileconfig\/","url_meta":{"origin":728,"position":4},"title":"Unlocking the power of mixed reality devices with MobileConfig","date":"June 11, 2024","format":false,"excerpt":"MobileConfig enables developers to centrally manage a mobile app\u2019s configuration parameters in our data centers. Once a parameter value is changed on our central server, billions of app devices automatically fetch and apply the new value without app updates. These remotely managed configuration parameters serve various purposes such as A\/B\u2026","rel":"","context":"In &quot;Technology&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":879,"url":"https:\/\/fde.cat\/index.php\/2024\/06\/12\/how-meta-trains-large-language-models-at-scale\/","url_meta":{"origin":728,"position":5},"title":"How Meta trains large language models at scale","date":"June 12, 2024","format":false,"excerpt":"As we continue to focus our AI research and development on solving increasingly complex problems, one of the most significant and challenging shifts we\u2019ve experienced is the sheer scale of computation required to train large language models (LLMs). Traditionally, our AI model training has involved a training massive number of\u2026","rel":"","context":"In &quot;Technology&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/fde.cat\/index.php\/wp-json\/wp\/v2\/posts\/728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fde.cat\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fde.cat\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/fde.cat\/index.php\/wp-json\/wp\/v2\/comments?post=728"}],"version-history":[{"count":0,"href":"https:\/\/fde.cat\/index.php\/wp-json\/wp\/v2\/posts\/728\/revisions"}],"wp:attachment":[{"href":"https:\/\/fde.cat\/index.php\/wp-json\/wp\/v2\/media?parent=728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fde.cat\/index.php\/wp-json\/wp\/v2\/categories?post=728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fde.cat\/index.php\/wp-json\/wp\/v2\/tags?post=728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}