Announcing Earthly v0.8
Table of Contents
Today, we’re announcing the release of Earthly v0.8. Earthly v0.8 introduces new features and improvements, such as Auto-skip (in Beta) for improved performance in monorepos, enhanced ARG handling, improved performance for outputting images from remote runners, new Earthly Satellites instance sizes, and more.
We do not take major or minor releases lightly at Earthly. We’ve never had a major release, and our last minor release was almost a year ago, in February 2023 (read about it in Announcing Earthly v0.7). That’s because we know that the reliability and stability of your build and CI/CD processes are of the utmost importance. In every minor release of Earthly (and also eventually when we have a major release), all features promoted to General Availability (GA) have finalized APIs and have been through thorough testing. That’s why we are comfortable enabling all features promoted to GA by default.
Auto-Skip: Faster Monorepo Builds (Beta)
Auto-skip, now in Beta, enhances build efficiency, particularly in monorepos where multiple projects are built simultaneously. Auto-skip utilizes a global cache stored in a cloud database and allows Earthly to skip large parts of a build in certain situations. It requires an Earthly Cloud account and can be activated for an entire run, by using earthly --auto-skip
in the CLI, or specific targets, by using BUILD --auto-skip
in your Earthfile. Auto-skip operates on an all-or-nothing basis, entirely skipping a target or not, falling back on other caching methods if not skipped. For more details, visit the Auto-skip documentation.
Enhanced ARG Handling with LET
/SET
and ARG Scoping
Earthly v0.8 brings a new level of control and flexibility to build arguments. It introduces the LET
and SET
commands, allowing for the declaration of local variables (LET
) and the ability to change their values (SET
). This version also includes ARG scoping, meaning LET
takes precedence over ARG
and ARG
takes precedence over ARG --global
. These additions provide more precise control over variables in your builds.
Example Using LET
and SET
VERSION 0.8FROM golang:1.21-alpine
WORKDIR /go-workdir
…
# start-ui runs a frontend container to handle browser traffic.
start-ui:# mode sets the build mode for the UI. In development mode,
# it will only listen on HTTP port 8000. In production mode,
# it will listen on TLS and HTTP, using common HTTP and TLS
# ports, and handle TLS certificates using certbot.
ARG mode = "production"
# frontend_host sets the hostname that the frontend listens on.
# Ignored if
# $mode != production.
ARG frontend_host = ignored
# proxy_host sets the hostname that the frontend connects to in order
# to proxy requests to the backend. Ignored if $mode != production.
ARG proxy_host = ignored
# autocert_dir sets the directory that will be mounted for caching
# autocert certificates. Ignored if $mode != production.
ARG autocert_dir = ignored
BUILD +require-ca
WAIT"$mode"
BUILD ./ui+image --mode
END
"$frontend_host"
LET frontend = "$proxy_host"
LET proxy = "--publish ${tls_port}:4043 \
LET port_args = --publish ${certbot_port}:8000"
"https"
LET server_scheme = "$mode" != "production" ]
IF [
SET frontend = localhost
SET proxy = localhost"--publish ${tls_port}:8000"
SET port_args = "http"
SET server_scheme =
END"$mode" --frontend \
BUILD +start-ui-internal --mode "$frontend" --proxy "$proxy" --server_scheme "$server_scheme" \
"$autocert_dir" --port_args "$port_args"
--autocert_dir
…
For more details, visit the LET
and SET
documentation.
Improved Performance for Remote Runners
Outputting images from a remote runner, such as Earthly Satellites, has improved performance as it no longer transfers layers that are already present locally. Previously a full tar.gz was transferred which contained all layers in the image. Now, Earthly performs a docker pull which only downloads required image layers.
New Earthly Satellites Instance Sizes
In response to growing scalability needs, we’re introducing larger Earthly Satellites instance sizes. We previously offered x-small, small, medium, large, and x-large instances. We are now adding 2x-large, 3x-large, and 4x-large instances. These new options offer more powerful resources for your builds. You can find more details about compute sizing and pricing on our Pricing page.
Renaming COMMAND to FUNCTION
Earthly supports creating reusable functions in Earthfiles. Previously, these were named User-defined commands (UDCs). In an effort to enhance clarity around this functionality, we are renaming UDCs to Functions. Correspondingly the COMMAND
keyword has been renamed to FUNCTION
and should be updated in your Earthfiles.
Farewell to v0.5
Earthly v0.5 was released on February 1, 2021, and after nearly 3 years, support for it is being phased out. If you are still using Earthly v0.5 or VERSION 0.5
in your Earthfiles, upgrade soon.
Upgrading To Earthly v0.8
Follow these steps to upgrade to Earthly v0.8 safely:
- If you are still using
VERSION 0.5
in your Earthfiles, upgrade toVERSION 0.6
orVERSION 0.7
. - Upgrade your Earthly binary to v0.8 in CI and locally, across your team. The v0.8 binary can run both
VERSION 0.6
andVERSION 0.7
Earthfiles. - Once everyone is using the Earthly v0.8 binary, upgrade your Earthfiles one-by-one to
VERSION 0.8
. It is ok to have a mix ofVERSION 0.6
,VERSION 0.7
, andVERSION 0.8
Earthfiles in the same project.
Note that when upgrading between versions, you may encounter backwards-incompatible changes. Check out the change log of each version for more information: v0.8, v0.7, v0.6, v0.5.
All Features Promoted to GA in v0.8
Feature Flag | Description |
---|---|
–no-network | Allow the use of RUN --network=none commands |
–arg-scope-and-set | Enable the LET / SET commands and nested ARG scoping |
–use-docker-ignore | Enable the use of .dockerignore files in FROM DOCKERFILE targets |
–pass-args | Enable the optional --pass-args flag for the BUILD , FROM , COPY , and WITH DOCKER --load commands |
–global-cache | Enable global caches (shared across different Earthfiles), for cache mounts and CACHE commands having an ID |
–cache-persist-option | Adds CACHE --persist option to persist cache content in images, Changes default CACHE behaviour to not persist |
–use-function-keyword | Enable using FUNCTION instead of COMMAND when declaring a function |
–use-visited-upfront-hash-collection | Switches to a newer target parallelization algorithm |
For more information on the individual Earthfile feature flags see the Earthfile version-specific features page.
For more detailed information on Earthly v0.8, read the Earthly v0.8 release notes.
Thank You to the Earthly Community
Huge thank you to the Earthly community! From the 1,500+ developers that have signed up for Earthly Cloud to the 10K+ that have starred us on GitHub to our 1,200+ member community Slack (click to join), you all have played an instrumental role in the development of Earthly v0.8. Your code contributions, feature requests, and feedback made this release possible. We are so grateful to have such a dedicated and supportive community of developers from all over the world that believe in Earthly and want to make it better.
Earthly Cloud: Consistent, Fast Builds, Any CI
Consistent, repeatable builds across all environments. Advanced caching for faster builds. Easy integration with any CI. 6,000 build minutes per month included.