{"id":238101,"date":"2019-10-07T07:58:00","date_gmt":"2019-10-07T11:58:00","guid":{"rendered":"https:\/\/wordpress-756359-3782526.cloudwaysapps.com\/?p=238101"},"modified":"2024-09-21T04:53:27","modified_gmt":"2024-09-21T04:53:27","slug":"2019-10-07-multi-cpu-architecture-support","status":"publish","type":"post","link":"https:\/\/www.travis-ci.com\/blog\/2019-10-07-multi-cpu-architecture-support\/","title":{"rendered":"Multi-CPU architecture support for your builds"},"content":{"rendered":"\n<p>We\u2019re excited to share that you can now test your open source software on multiple CPU architectures at Travis CI.<\/p>\n\n\n\n<p>For the past few months, we\u2019ve been working closely with the Travis CI community, the LXD team from&nbsp;<a href=\"https:\/\/blog.travis-ci.com\/canonical.com\">Canonical<\/a>,&nbsp;<a href=\"https:\/\/www.arm.com\/\">Arm<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/www.packet.com\/\">Packet<\/a>.<\/p>\n\n\n\n<p>Thanks to this partnership,&nbsp;<code>Arm<\/code>-based builds are now available to you, for free, for your open source projects.&nbsp;<code>Arm<\/code>-based builds are the first ones to use&nbsp;<a href=\"https:\/\/linuxcontainers.org\/lxd\/\">LXD powered containerization<\/a>&nbsp;to run your builds.<\/p>\n\n\n\n<p>If your public projects are targeted for Linux and Arm CPU Architecture, get started with Arm builds today!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"alpha-release\">Alpha Release<\/h2>\n\n\n\n<p><a href=\"https:\/\/travis-ci.com\">OpenSSL<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/travis-ci.com\">Fluent Bit<\/a>&nbsp;are already testing the multi-CPU feature, so if you are looking for examples, check out their respective&nbsp;<code>.travis.yml<\/code>&nbsp;files&nbsp;and the&nbsp;<a href=\"https:\/\/docs.travis-ci.com\/user\/multi-cpu-architectures\/\">Travis CI docs<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-you-can-expect-from-this-alpha-release\">What you can expect from this alpha release:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can only test your open source projects at the moment. Packet infrastructure and Travis CI builds are provided to you for free. However, if you\u2019d like to test private projects, please&nbsp;<a href=\"https:\/\/travis-ci.community\/t\/about-the-arm-cpu-architecture-category\/5336\">send us a message in the forum<\/a>.<\/li>\n\n\n\n<li>Only a limited capacity is available and we will build it up based on what we hear back from you. Initial testing capacity starts at around 60 concurrent jobs so please keep this in mind while testing&nbsp;<code>Arm<\/code>-based builds.<\/li>\n\n\n\n<li>Packet is delivering the&nbsp;<code>Arm64<\/code>&nbsp;(<code>Armv8<\/code>&nbsp;compliant) infrastructure and it has been adjusted to ensure stable build times. Please grant us additional time to react when increasing capacity as it requires both companies to align.<\/li>\n\n\n\n<li>The initial&nbsp;<code>.travis.yml<\/code>&nbsp;arch key may be adapted or extended later on. Stay tuned as we share more updates.<\/li>\n<\/ul>\n\n\n\n<p>We\u2019re excited to keep working on the multi-CPU feature and work with you to improve it. We heartily invite you to test out the new multi-CPU architecture and share your findings in the&nbsp;<a href=\"https:\/\/travis-ci.community\/t\/about-the-arm-cpu-architecture-category\/5336\">forum<\/a>. We\u2019re looking forward to hearing how you use it and your experience with the new feature!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-does-arm-support-work\">How does Arm support work?<\/h2>\n\n\n\n<p>As a first step, modify your&nbsp;<code>.travis.yml<\/code>&nbsp;file by adding the arch key.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>arch:\n  - amd64\n  - arm64<\/code><\/pre>\n\n\n\n<p>Using these two&nbsp;<code>arch:<\/code>&nbsp;keys will trigger a&nbsp;<a href=\"https:\/\/docs.travis-ci.com\/user\/customizing-the-build\/#build-matrix\">build matrix<\/a>&nbsp;composed by a set of jobs with amd64 and arm64 based OS images. Please keep in mind, that for matrix.include only single key: value is valid, so<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>matrix:\n  include:\n   - os: linux\n     arch: amd64\n   - os: linux\n     arch: arm64<\/code><\/pre>\n\n\n\n<p>is a valid approach when you want to test a specific combination of OS and CPU. This is possible only with Linux at the moment. LXD is a Linux container daemon, see&nbsp;<a href=\"https:\/\/linuxcontainers.org\/\">linuxcontainers.org<\/a>&nbsp;for more information.<\/p>\n\n\n\n<p>You can identify when your job runs on the Arm-based LXD containers by checking the hostname of the worker: lxd-arm64, for example:&nbsp;<a href=\"https:\/\/travis-ci.com\">https:\/\/travis-ci.org\/openssl\/openssl\/jobs\/591020146#L2<\/a>. See the&nbsp;<a href=\"https:\/\/docs.travis-ci.com\/user\/multi-cpu-architectures\/\">multi-CPU docs<\/a>&nbsp;for more details on usage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-lxd-docker-vs-lxd\">Why LXD? Docker vs LXD<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/lxc\/lxc\">LXC<\/a>, the LinuX Container runtime focuses on creating and running multiple (and isolated) Linux system containers on a single control host. Docker, as an application container, originated from LXC but grew independent from it over time and became a virtualization solution to run processes.<\/p>\n\n\n\n<p>LXD is also based on LXC, but it allows for system containers or a \u2018lightweight vm-like container\u2019. The main difference here is LXD runs upstart\/systemd like process inside the container. While you can achieve similar capability with Docker, you need to enable specific systems processes each time when a docker image is run, which adds complexity and increases execution times for CI environments.<\/p>\n\n\n\n<p>LXD, on the other hand, gives you a \u201cfull OS\u201d inside a container and provides VM-like semantics around system containers so it can be easily operated and managed. LXD is significantly faster thanks to it all being done through containers on Linux and it\u2019s also very light on CPU and memory at the same time.<\/p>\n\n\n\n<p>In the past, we used Docker containers as containers for build machines at Travis CI, or&nbsp;<a href=\"https:\/\/hub.docker.com\/_\/docker\">Docker in docker<\/a>, yet the constraints and workarounds that had to be introduced caused inconsistent build times and a lot of confusion. So&nbsp;<a href=\"https:\/\/travis-ci.com\/blog\/\">we reverted back to using Docker as an app container only<\/a>, and we love it!<\/p>\n\n\n\n<p>Given that Travis CI runs your builds and tests in virtual machines that are really close to actual production servers and LXD provides a type of containers that allows doing that a bit faster, this is why we finally picked up LXD for containerization process of Linux builds instead of Docker used in unintended ways.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"whats-next\">What\u2019s next<\/h2>\n\n\n\n<p>Given the fast startup time and the benefits of using LXD outlined above, we are looking at expanding our usage of LXD containers for the existing build setups at Travis CI.<\/p>\n\n\n\n<p>Stay tuned for updates as this is only the beginning of supporting multi-CPU architectures!<\/p>\n\n\n\n<p>When you test out Arm builds in your public projects, please share your feedback with us in the&nbsp;<a href=\"https:\/\/travis-ci.community\/t\/about-the-arm-cpu-architecture-category\/5336\">community forum<\/a>. We\u2019re looking forward to hearing about your experience with multi-CPU architecture support of your builds!<\/p>\n","protected":false},"excerpt":{"rendered":"<p> Now, you can test your open source software on multiple CPU architectures at Travis CI.  <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_breakdance_hide_in_design_set":false,"_breakdance_tags":"","footnotes":""},"categories":[16],"tags":[7,19,18],"class_list":["post-238101","post","type-post","status-publish","format-standard","hentry","category-news","tag-community","tag-feature","tag-support"],"_links":{"self":[{"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/posts\/238101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/comments?post=238101"}],"version-history":[{"count":1,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/posts\/238101\/revisions"}],"predecessor-version":[{"id":242661,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/posts\/238101\/revisions\/242661"}],"wp:attachment":[{"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/media?parent=238101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/categories?post=238101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/tags?post=238101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}