Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog - Announcing Earthly v0.8 #762

Merged
merged 8 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions blog/_posts/2024-01-23-earthly-v0-8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
title: "Announcing Earthly v0.8"
categories:
- News
toc: true
author: Gavin

internal-links:
- announcement
- new earthly
- earthly new and better
- announcing earthly v0.8
- new earthly v0.8
excerpt: |
Announcing Earthly v0.8. This release brings several 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.
---

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.

![New]({{site.images}}{{page.slug}}/new.png)\

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](https://earthly.dev/blog/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](https://docs.earthly.dev/docs/caching/caching-in-earthfiles#id-3.-auto-skip).

## 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`

~~~{.dockerfile caption="Earthfile"}
VERSION 0.8
FROM 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
BUILD ./ui+image --mode "$mode"
END

LET frontend = "$frontend_host"
LET proxy = "$proxy_host"
LET port_args = "--publish ${tls_port}:4043 \
--publish ${certbot_port}:8000"
LET server_scheme = "https"
IF [ "$mode" != "production" ]
SET frontend = localhost
SET proxy = localhost
SET port_args = "--publish ${tls_port}:8000"
SET server_scheme = "http"
END
BUILD +start-ui-internal --mode "$mode" --frontend \
"$frontend" --proxy "$proxy" --server_scheme "$server_scheme" \
--autocert_dir "$autocert_dir" --port_args "$port_args"

~~~

For more details, visit the [`LET`](https://docs.earthly.dev/docs/earthfile#let) and [`SET`](https://docs.earthly.dev/docs/earthfile#set) documentation.

## Improved Performance for Remote Runners

![Performance]({{site.images}}{{page.slug}}/performance.png)\

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](https://earthly.dev/pricing).

## 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:

1. If you are still using `VERSION 0.5` in your Earthfiles, upgrade to `VERSION 0.6` or `VERSION 0.7`.
2. Upgrade your Earthly binary to v0.8 in CI and locally, across your team. The v0.8 binary can run both `VERSION 0.6` and `VERSION 0.7` Earthfiles.
3. 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 of `VERSION 0.6`, `VERSION 0.7`, and `VERSION 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](https://github.com/earthly/earthly/releases/tag/v0.8.0), [v0.7](https://github.com/earthly/earthly/releases/tag/v0.7.0), [v0.6](https://github.com/earthly/earthly/releases/tag/v0.6.0), [v0.5](https://github.com/earthly/earthly/releases/tag/v0.5.0).

## 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.](https://docs.earthly.dev/docs/earthfile/features)

For more detailed information on Earthly v0.8, read the [Earthly v0.8 release notes](https://github.com/earthly/earthly/releases/tag/v0.8.0).

## Thank You to the Earthly Community

![Thank You]({{site.images}}{{page.slug}}/thank.png)\

Huge thank you to the Earthly community! From the 1,500+ developers that have signed up for [Earthly Cloud](https://cloud.earthly.dev/login) to the 10K+ that have starred us on [GitHub](https://github.com/earthly/earthly) to our 1,200+ member community Slack ([click to join](https://earthly.dev/slack)), 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.

{% include_html cta/bottom-cta.html %}
Binary file added blog/assets/images/earthly-v0-8/header.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blog/assets/images/earthly-v0-8/new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blog/assets/images/earthly-v0-8/performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blog/assets/images/earthly-v0-8/thank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading