Euan Harris

Euan Harris


Talk Details

Title

Swift to the cloud in a single step

Description

As a server-side engineer today, it’s not enough to build a stand-alone executable for your service. You need to wrap it in a container image, ready to run on any standard public or private cloud infrastructure.

In this talk we’ll see that building a container image for your Swift project can be as quick and easy as building a native executable. Using Swift Package Manager plugins and Swift SDKs, we can extend Swift Package Manager, adding a new command tailor-made for wrapping Swift programs in container images:

  • Swift SDKs let us build Linux binaries directly on macOS. Builds are as fast as your native compiler, with no virtualisation overhead.
  • A Swift Package Manager command plugin can build any target in Package.swift, wrap it in a container and upload it to the cloud. A Dockerfile isn’t needed because the plugin already knows what to do.

We’ll see how Swift SDKs can help us to build binaries for several popular Linux distributions, and even build statically-linked binaries with no runtime dependencies. We’ll take a quick look at the contents of the generated container image.Finally, we’ll show how a command plugin ties the whole process together into a single command.

🧑‍💻 Check out Swift Container Plugin on GitHub. Contributions welcome! - https://github.com/apple/swift-container-plugin


About the Speaker

Position

Software Engineer at Apple

Bio

Euan builds cloud services and infrastructure using Swift at Apple. He enjoys working with containers, virtual machines, networks and interesting programming languages. Previously, Euan helped maintain Docker Swarm’s overlay networking and HTTP ingress and contributed to XenServer’s open-source XenAPI control plane, the Xen hypervisor and OpenStack.