Skip to content

Commit

Permalink
Draft to check
Browse files Browse the repository at this point in the history
  • Loading branch information
msali123 committed Jan 20, 2024
1 parent 4d1d9d2 commit 6db7c4b
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
121 changes: 121 additions & 0 deletions blog/_posts/2024-01-25-earthly-v0-8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
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.

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/v/earthly-0.8/docs/caching/caching-in-earthfiles#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/v/earthly-0.8/docs/earthfile#let) and [`SET`](https://docs.earthly.dev/v/earthly-0.8/docs/earthfile#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 added 2xlarge, 3xlarge, and 4xlarge 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).

## 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, upgrade soon.

## Renaming COMMAND to FUNCTION

Earthly has had the functionality for users to create reusable functions in their Earthfiles, previously 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.

## 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 0.8, read the [Earthly 0.8 release notes](https://github.com/earthly/earthly/releases/tag/v0.8.0).

## 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](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 0.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.

0 comments on commit 6db7c4b

Please sign in to comment.