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

Lando extended release notes v320 #40

Merged
merged 2 commits into from
Sep 28, 2023
Merged
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
201 changes: 201 additions & 0 deletions content/2023-09-25-v320-extended.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
---
title: Lando v3.20 Extended Notes and Development Update
byline: Docker Compose 2, Healthchecks, Lando 3 Service and Lando 4 Service Preview
blog: true

path: 2023-09-25 12:00:00
updated:
timestamp: 1695652126000

author:
name: Mike Pirog
pic: https://www.gravatar.com/avatar/dc1322b3ddd0ef682862d7f281c821bb
link: /blog/tag/mike-pirog.html
location: Washington, DC

tags:
- lando
- Mike Pirog
---

[Lando v3.20](https://github.com/lando/lando/releases/tag/v3.20.1) is one our bigger updates in recent memory. It

* _Finally_ switches over to use [Docker Compose CLI Version 2](https://docs.docker.com/compose/) for its service orchestration
* Introduces `api` as a `service` setting to prep for Lando 4 services being backported to Lando 3
* DEPRECATES the [compose service](https://docs.lando.dev/compose/) for a now-in-core `type: lando` service
* Makes the `healthcheck` a universal `service` setting
* Allows user to preview the new `L-337` Lando 4 services spec in Lando 3

It also contains the usual assortment of bug fixes and docs updates.

## 1. Docker Compose 2

Lando 3 will now use Docker Compose CLI 2 by default. This offers a noticeable speed improvement particularly for Apple Silicon users who were running Docker Compose CLI 1 under Rosetta-emulatation.

We have also made the orchestrator generally more configurable which you can read more about [here](https://docs.lando.dev/core/v3/orchestrator.html).

## 2. Service API

We've introduced an `api` setting to all `services`. This is automatically set to `3` if ommitted and you are running Lando 3.

The purpose of this setting is to allow users to try out new Lando 4 services as we backport them into Lando 3.

Consider the _currently only hypothetical_ and _functionally equivalent services_ in the example below:

**Landofile**
```yaml
services:
appserver:
api: 3
type: php:8.0
via: nginx
webroot: www
build_as_root:
- apt-get update -y
- apt install libxslt1-dev -y
- pecl install stats-2.0.3
- docker-php-ext-install xsl
- docker-php-ext-enable stats
config:
php: ./config/php.ini
runtime:
api: 4
type: "php:8.2"
webroot: www
extensions:
- "xsl"
- "stats"
config:
memory_limit: "512M"
```

## 3. Lando 3 Service

We've **DEPRECATED** the [compose service](https://docs.lando.dev/compose/) in favor of a new general purpose Lando 3 service which is built into Lando Core and can be used as such:

**Landofile**
```yaml
services:
appserver:
api: 3
type: lando
...
```

This works more or less like the `compose` service but we've more exhaustively documented [all its features](https://docs.lando.dev/core/v3/lando-service.html) which _should_ be available in _every_ `api: 3` Lando service.

It's definitely worth checking them out.

## 4. Healthcheck

The `healthcheck` was previously available to only a special subset of Lando services and was not very well documented.

Now it is available in all `api: 3` services is [very well documented](https://docs.lando.dev/core/v3/healthcheck.html)

**Landofile**
```yaml
services:
database:
api: 3
type: lando
healthcheck:
command: mysql -uroot --silent --execute "SHOW DATABASES;"
user: mysql
retry: 10
delay: 1000
services:
image: mariadb:10.4
command: docker-entrypoint.sh mysqld
```

## 5. Lando 4 Service Preview

As you may or may not know `api: 3` Lando services are basically a high level wrapper around service orchestration specificially with Docker Compose. This allows for a ton of flexibility and power but has many shortcomings as well.

For `api: 4` services Lando will continue to do service orchestration but will, crucially, build Dockerfile compatible images as well. This opens up a new world of possiblities for what Lando is capable of.

To that end we've completed the foundational `service` that will power all higher `api: 4` services. It's called the `l337` service because it implements **L**ando Specification **337** which combines service orchestration and image generation into a single config file.

It is the service that we will build the `type: lando, api: 4` service on top of, which means that by itself it does not add that "Lando Magix" but instead serves as a drop-in replacement for both Docker Compose and Dockerfiles generally. It looks something like this:

**Landofile**
```yaml
name: l337-preview
services:
my-service:
api: 4
environment:
HELLO: "there"
command: "run-command"
volumes:
- "./start.sh:/usr/local/bin/run-command"
- "my-data:/data"
image:
imagefile: |
FROM nginx:1.21.6
RUN useradd pirog
tag: "pirog/nginx:powerman-5000"
context:
- "./folder"
- "./folder:thing"
- source: "https://raw.githubusercontent.com/SeaShanties/lyrics/main/available-shanties.json"
dest: "/etc/config/available-shanties.json"
owner: pirog
groups:
- tutone: 8675309
- name: "user"
weight: 10000
user: "pirog"
steps:
- instructions: RUN echo "$LANDO_IMAGE_GROUP" > /tmp/val-jean-group
group: "user"
- instructions: |
ENV VIBES RISING
COPY my-script.sh /runme.sh
RUN chmod +x /runme.sh
RUN /runme.sh
group: tutone-4-before
volumes:
my-data:
```

Again, while it does not have that Lando Magix you can still [play around with it](https://docs.lando.dev/core/v4/services/l337.html) and check out some [example usage](https://github.com/lando/core/tree/main/examples/l337).

## What's next for Lando?

### Development Pivot

In our [previous big dev update](https://lando.dev/blog/2023/01/23/roadmap-of-2023.html) we laid out a roadmap for 2023. As you may have already guessed and as is so often the case in development the roadmap has changed.

The `tl;dr` bad news is that Lando 4 is taking longer than we, or anyone, wants. The `tl;dr` good news is that we've completely backported the new Lando 4 Services API and the foundational `l337` service into Lando 3. This means that over the coming months we are going to start rolling out `api: 4` versions of all the current Lando services.

`api: 4` services will be significantly faster and more feature rich than their current `api: 3` counterpoints. We will likely release them in this-ish order:

* `lando` - a foundational and general purpose `api: 4` service.
* `mysql/mariadb/postgres` - these next for Apple Silicon users
* `php` - our most popular runtime
* `node` - our most popular utility service and second most popular runtime
* `all other services using bitnami images` - again for better Apple Silicon support
* `all other standalone services`
* `all hosting integration services`

As we roll out the above services we will be simultaneously finshing up the Lando 4 core `runtime` and `cli`.

_Ideally_ the `api: 4` services rollout completes at the same time Lando 4 ships a `beta` and users can then easily switch over their apps to the new `runtime`.

### Docker Desktop and Docker Engine refresh

The next minor Lando release will rework our underlying support for Docker Desktop and Docker Engine so that:

* Lando can install either directly if it needs to
* Both can be removed from our installer
* Both can be managed better
* Both can be run in different configurations eg non-root mode

### Lando Update

The next next minor Lando release will finally close our loop on breaking up the Lando monorepo and introduce a `lando update` command that you can run to update `@lando/core` and any of its plugins whenever they are updated.

In this model you install Lando once and then rely on `lando update`. You no longer have to wait for a huge infrequent core Lando release to get fixes and new features in just a single plugin.