Lando v3.20 Extended Notes and Development Update

Mike PirogMike Pirog|Mon, Sep 25, 2023

Lando v3.20open in new window is one our bigger updates in recent memory. It

  • Finally switches over to use Docker Compose CLI Version 2open in new window for its service orchestration
  • Introduces api as a service setting to prep for Lando 4 services being backported to Lando 3
  • DEPRECATES the compose serviceopen in new window 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-emulation.

We have also made the orchestrator generally more configurable which you can read more about hereopen in new window.

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

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 serviceopen in new window in favor of a new general purpose Lando 3 service which is built into Lando Core and can be used as such:

Landofile

services:
  appserver:
    api: 3
    type: lando
    ...

This works more or less like the compose service but we've more exhaustively documented all its featuresopen in new window 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 documentedopen in new window

Landofile

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 Lando 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

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 itopen in new window and check out some example usageopen in new window.

What's next for Lando?

Development Pivot

In our previous big dev update 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 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.