From 7cf6c9bc39fe709149a24fa521320bc7193605fa Mon Sep 17 00:00:00 2001 From: Alec Reynolds Date: Tue, 22 Oct 2024 10:35:04 -0700 Subject: [PATCH 01/25] #244: Variable for setting the network limit. --- docs/config/networking.md | 6 ++++++ plugins/networking/index.js | 2 +- utils/get-config-defaults.js | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/config/networking.md b/docs/config/networking.md index b40f0c281..25a836934 100644 --- a/docs/config/networking.md +++ b/docs/config/networking.md @@ -58,3 +58,9 @@ You can also use the environment variable `LANDO_HOST_IP`. ```sh lando exec my-service -- ping "\$LANDO_HOST_IP" -c 3 ``` + +## Network Limits + +By default Docker has a limit of 32 networks. If you're running a large number of sites, you'll see a message `Lando has detected you are at Docker's network limit`, after which Lando will attempt to clean up unused networks to put you below the network limit. + +If you've [modified your Docker daemon](https://discussion.fedoraproject.org/t/increase-limit-of-30-docker-networks-in-a-clean-way/96622/4) to allow more networks, you can set Lando's network limit to a higher number by setting the `networkLimit` variable in [Lando's global config](./global.html). diff --git a/plugins/networking/index.js b/plugins/networking/index.js index 8fd7c51b4..2e8f218a3 100644 --- a/plugins/networking/index.js +++ b/plugins/networking/index.js @@ -10,7 +10,7 @@ const getDockerDesktopBin = require('../../utils/get-docker-desktop-x'); */ const cleanNetworks = lando => lando.engine.getNetworks() .then(networks => { - if (_.size(networks) >= 32) { + if (_.size(networks) >= lando.config.networkLimit) { // Warn user about this action lando.log.warn('Lando has detected you are at Docker\'s network limit!'); lando.log.warn('Give us a moment as we try to make space by cleaning up old networks...'); diff --git a/utils/get-config-defaults.js b/utils/get-config-defaults.js index e30b64e30..cc9b3803b 100644 --- a/utils/get-config-defaults.js +++ b/utils/get-config-defaults.js @@ -31,6 +31,7 @@ const defaultConfig = options => ({ home: os.homedir(), isArmed: _.includes(['arm64', 'aarch64'], process.arch), logLevel: 'debug', + networkLimit: 32, node: process.version, os: { type: os.type(), From 3f1a0b0142302ee1c4851645435946c38e34964d Mon Sep 17 00:00:00 2001 From: Alec Reynolds <1153738+reynoldsalec@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:38:33 -0800 Subject: [PATCH 02/25] #244: Add test for the networkLimit config var. --- examples/networking/README.md | 7 +++++++ examples/networking/config.yml | 1 + 2 files changed, 8 insertions(+) create mode 100644 examples/networking/config.yml diff --git a/examples/networking/README.md b/examples/networking/README.md index 5b4e507e9..5b639135f 100644 --- a/examples/networking/README.md +++ b/examples/networking/README.md @@ -22,6 +22,10 @@ cp -rf index.php lemp/index.php cp -rf nginx.conf lemp/nginx.conf cp -rf .lando.lemp.yml lemp/.lando.yml cd lemp && lando start + +# Should copy .config.yml to ~/.lando/config.yml +cp config.yml ~/.lando/config.yml +lando --clear ``` ## Verification commands @@ -63,6 +67,9 @@ lando exec appserver_nginx -- curl https://appserver.landolamp.internal # Should even be able to connect to a database in a different app cd lamp lando exec database -- mysql -uroot -h database.landolemp.internal -e "quit" + +# Should see the correct network limit +lando config | grep "networkLimit: 64" ``` ## Destroy tests diff --git a/examples/networking/config.yml b/examples/networking/config.yml new file mode 100644 index 000000000..558339625 --- /dev/null +++ b/examples/networking/config.yml @@ -0,0 +1 @@ +networkLimit: 64 From b38ea0a08de77169cda95e30c1d9840677098698 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 17 Dec 2024 17:27:07 -0500 Subject: [PATCH 03/25] #297: fixed incorrect -EncodedCommand fallback detection for powershell.exe script execution --- CHANGELOG.md | 5 +++++ utils/run-powershell-script.js | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c9ab0839..ded551b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Added ability to customize `networkLimit` [#245](https://github.com/lando/core/pull/245) +* Fixed incorrect `-EncodedCommand` fallback detection for `powershell.exe` script execution [#297](https://github.com/lando/core/issues/297) + +[#297](https://github.com/lando/core/issues/297) + ## v3.23.21 - [December 14, 2024](https://github.com/lando/core/releases/tag/v3.23.21) * Fixed `powershell` scripts from failing when user cannot set `-ExecutionPolicy` to `Bypass` for `Process` scope [#297](https://github.com/lando/core/issues/297) diff --git a/utils/run-powershell-script.js b/utils/run-powershell-script.js index 820ee8977..dfbdb9dd0 100644 --- a/utils/run-powershell-script.js +++ b/utils/run-powershell-script.js @@ -24,9 +24,9 @@ module.exports = (script, args = [], options = {}, stdout = '', stderr = '', car // if encode is not explicitly set then we need to pick a good value if (options.encode === undefined) { - const bargs = ['Set-ExecutionPolicy', '-Scope', 'UserPolicy', '-ExecutionPolicy', 'Bypass']; + const bargs = ['Set-ExecutionPolicy', '-Scope', 'Process', '-ExecutionPolicy', 'Bypass']; const {status} = spawnSync('powershell.exe', bargs, options); - options.encode === status !== 0; + options.encode = status !== 0; } // if encode is true we need to do a bunch of other stuff From a6f1d5c3929d82d24df9443234a2243e391b0588 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 17 Dec 2024 17:45:13 -0500 Subject: [PATCH 04/25] cl --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ded551b7a..e824dd149 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,6 @@ * Added ability to customize `networkLimit` [#245](https://github.com/lando/core/pull/245) * Fixed incorrect `-EncodedCommand` fallback detection for `powershell.exe` script execution [#297](https://github.com/lando/core/issues/297) -[#297](https://github.com/lando/core/issues/297) - ## v3.23.21 - [December 14, 2024](https://github.com/lando/core/releases/tag/v3.23.21) * Fixed `powershell` scripts from failing when user cannot set `-ExecutionPolicy` to `Bypass` for `Process` scope [#297](https://github.com/lando/core/issues/297) From 7fe60464d72eef4b34ccfa5622827328960c83a5 Mon Sep 17 00:00:00 2001 From: rtfm-47 Date: Tue, 17 Dec 2024 23:05:05 +0000 Subject: [PATCH 05/25] release v3.23.22 generated by @lando/prepare-release-action --- CHANGELOG.md | 2 ++ package-lock.json | 2 +- package.json | 2 +- release-aliases/3-STABLE | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e824dd149..1e6f5ec94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +## v3.23.22 - [December 17, 2024](https://github.com/lando/core/releases/tag/v3.23.22) + * Added ability to customize `networkLimit` [#245](https://github.com/lando/core/pull/245) * Fixed incorrect `-EncodedCommand` fallback detection for `powershell.exe` script execution [#297](https://github.com/lando/core/issues/297) diff --git a/package-lock.json b/package-lock.json index 27386d283..5a5bfa0a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@lando/core", - "version": "3.23.21", + "version": "3.23.22", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index c1c5b7cd3..58a0e4b69 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@lando/core", "description": "The libraries that power all of Lando.", - "version": "3.23.21", + "version": "3.23.22", "author": "Mike Pirog @pirog", "license": "GPL-3.0", "repository": "lando/core", diff --git a/release-aliases/3-STABLE b/release-aliases/3-STABLE index ba4bef1ab..71f6f0f88 100644 --- a/release-aliases/3-STABLE +++ b/release-aliases/3-STABLE @@ -1 +1 @@ -v3.23.21 +v3.23.22 From e4b56760ec6d89a1f979e9ed05a2ec00ee1e9462 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 7 Jan 2025 12:56:08 -0500 Subject: [PATCH 06/25] remove lingering dev files --- .gitignore | 1 + checksums.txt | 0 hooks/lando-setup-build-engine-linux.js | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 checksums.txt diff --git a/.gitignore b/.gitignore index 91b9cfece..31677f555 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ coverage/ # lando .lando/id +checksums.txt plugins/* !plugins/.gitkeep FATCORE diff --git a/checksums.txt b/checksums.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/hooks/lando-setup-build-engine-linux.js b/hooks/lando-setup-build-engine-linux.js index 670ed5478..8086b0ddb 100644 --- a/hooks/lando-setup-build-engine-linux.js +++ b/hooks/lando-setup-build-engine-linux.js @@ -24,7 +24,6 @@ const downloadDockerEngine = (url = 'https://get.docker.com', {debug, task}) => }); }); - module.exports = async (lando, options) => { const debug = require('../utils/debug-shim')(lando.log); // if build engine is set to false allow it to be skipped From b2dff58a0fde57f302dc965d08199517644bbf67 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 7 Jan 2025 12:58:23 -0500 Subject: [PATCH 07/25] test docker desktop cli commands in headless situation --- .github/workflows/pr-setup-macos-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pr-setup-macos-tests.yml b/.github/workflows/pr-setup-macos-tests.yml index 901d14b7f..28021035d 100644 --- a/.github/workflows/pr-setup-macos-tests.yml +++ b/.github/workflows/pr-setup-macos-tests.yml @@ -61,3 +61,9 @@ jobs: cleanup-header: "Destroy tests" shell: bash stdin: true + - name: docker desktop cli tests + run: | + docker desktop status || true + docker desktop start || true + docker desktop status || true + lando setup -y --debug From 10b27a8d9ffdebc00f75b09de1dc0b691ceadcc9 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 7 Jan 2025 13:15:25 -0500 Subject: [PATCH 08/25] test docker desktop cli commands in headless situation part 2 --- .github/workflows/pr-setup-macos-tests.yml | 10 +++++++--- config.yml | 4 ++-- examples/setup-macos/README.md | 1 + hooks/lando-setup-build-engine-darwin.js | 2 ++ hooks/lando-setup-build-engine-win32.js | 2 ++ hooks/lando-setup-build-engine-wsl.js | 2 ++ utils/get-config-defaults.js | 6 +++--- 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-setup-macos-tests.yml b/.github/workflows/pr-setup-macos-tests.yml index 28021035d..6db03c486 100644 --- a/.github/workflows/pr-setup-macos-tests.yml +++ b/.github/workflows/pr-setup-macos-tests.yml @@ -63,7 +63,11 @@ jobs: stdin: true - name: docker desktop cli tests run: | + lando setup -y --debug --skip-networking --skip-common-plugins + docker desktop version || true + /Applications/Docker.app/Contents/Resources/bin/docker desktop version || true + /Applications/Docker.app/Contents/Resources/bin/docker desktop status || true + /Applications/Docker.app/Contents/Resources/bin/docker desktop start || true + /Applications/Docker.app/Contents/Resources/bin/docker desktop status || true docker desktop status || true - docker desktop start || true - docker desktop status || true - lando setup -y --debug + lando setup -y --debug --skip-common-plugins diff --git a/config.yml b/config.yml index abbb1be3b..57a530fcc 100644 --- a/config.yml +++ b/config.yml @@ -20,8 +20,8 @@ dockerSupportedVersions: win32: https://docs.docker.com/desktop/install/windows-install/ desktop: satisfies: ">=4.0.0 <5" - tested: "<=4.36.99" - recommendUpdate: "<=4.34.0" + tested: "<=4.37.99" + recommendUpdate: "<=4.36.0" link: darwin: https://docs.docker.com/desktop/install/mac-install/ win32: https://docs.docker.com/desktop/install/windows-install/ diff --git a/examples/setup-macos/README.md b/examples/setup-macos/README.md index 894e5a066..afe0b1bb1 100644 --- a/examples/setup-macos/README.md +++ b/examples/setup-macos/README.md @@ -15,6 +15,7 @@ lando plugin-add "@lando/core@file:../.." # Should be able to uninstall docker desktop succesfully brew uninstall --force --ignore-dependencies docker-desktop brew list --versions docker-desktop || echo $? | grep 1 +``` # Should be able to run lando setup lando setup -y --skip-networking --skip-common-plugins diff --git a/hooks/lando-setup-build-engine-darwin.js b/hooks/lando-setup-build-engine-darwin.js index e416e6a81..960f9a66e 100644 --- a/hooks/lando-setup-build-engine-darwin.js +++ b/hooks/lando-setup-build-engine-darwin.js @@ -10,6 +10,8 @@ const semver = require('semver'); const {color} = require('listr2'); const buildIds = { + '4.37.1': '178610', + '4.37.0': '178034', '4.36.0': '175267', '4.35.1': '173168', '4.35.0': '172550', diff --git a/hooks/lando-setup-build-engine-win32.js b/hooks/lando-setup-build-engine-win32.js index 710e8a458..18f73078a 100644 --- a/hooks/lando-setup-build-engine-win32.js +++ b/hooks/lando-setup-build-engine-win32.js @@ -10,6 +10,8 @@ const {color} = require('listr2'); const {nanoid} = require('nanoid'); const buildIds = { + '4.37.1': '178610', + '4.37.0': '178034', '4.36.0': '175267', '4.35.1': '173168', '4.35.0': '172550', diff --git a/hooks/lando-setup-build-engine-wsl.js b/hooks/lando-setup-build-engine-wsl.js index 9b6882ef0..bdc85b59d 100644 --- a/hooks/lando-setup-build-engine-wsl.js +++ b/hooks/lando-setup-build-engine-wsl.js @@ -12,6 +12,8 @@ const {color} = require('listr2'); const {nanoid} = require('nanoid'); const buildIds = { + '4.37.1': '178610', + '4.37.0': '178034', '4.36.0': '175267', '4.35.1': '173168', '4.35.0': '172550', diff --git a/utils/get-config-defaults.js b/utils/get-config-defaults.js index edfa639de..85301e03c 100644 --- a/utils/get-config-defaults.js +++ b/utils/get-config-defaults.js @@ -8,13 +8,13 @@ const os = require('os'); const getBuildEngineVersion = (platform = process.landoPlatform ?? process.platform) => { switch (platform) { case 'darwin': - return '4.36.0'; + return '4.37.1'; case 'linux': return '27.3.1'; case 'win32': - return '4.36.0'; + return '4.37.1'; case 'wsl': - return '4.36.0'; + return '4.37.1'; } }; From 8d3ee17799f469a6200150495a857c343d84fb60 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 8 Jan 2025 13:34:23 -0500 Subject: [PATCH 09/25] rework daemon to accomodate new docker desktop cli commands --- .github/workflows/pr-setup-macos-tests.yml | 10 +-- .github/workflows/pr-setup-windows-tests.yml | 7 ++ examples/setup-windows/README.md | 2 +- lib/daemon.js | 87 ++++++++++++-------- 4 files changed, 64 insertions(+), 42 deletions(-) diff --git a/.github/workflows/pr-setup-macos-tests.yml b/.github/workflows/pr-setup-macos-tests.yml index 6db03c486..324dba8c0 100644 --- a/.github/workflows/pr-setup-macos-tests.yml +++ b/.github/workflows/pr-setup-macos-tests.yml @@ -63,11 +63,7 @@ jobs: stdin: true - name: docker desktop cli tests run: | - lando setup -y --debug --skip-networking --skip-common-plugins - docker desktop version || true - /Applications/Docker.app/Contents/Resources/bin/docker desktop version || true - /Applications/Docker.app/Contents/Resources/bin/docker desktop status || true - /Applications/Docker.app/Contents/Resources/bin/docker desktop start || true - /Applications/Docker.app/Contents/Resources/bin/docker desktop status || true - docker desktop status || true lando setup -y --debug --skip-common-plugins + # docker desktop start --timeout 60 + # docker desktop status + # lando setup -y --debug --skip-common-plugins diff --git a/.github/workflows/pr-setup-windows-tests.yml b/.github/workflows/pr-setup-windows-tests.yml index 208fd5b6c..f14a0783a 100644 --- a/.github/workflows/pr-setup-windows-tests.yml +++ b/.github/workflows/pr-setup-windows-tests.yml @@ -60,3 +60,10 @@ jobs: shell: powershell stdin: true debug: true + - name: docker desktop cli tests + shell: powershell + run: | + lando setup -y --debug --skip-common-plugins + # docker desktop start --timeout 60 + # docker desktop status + # lando setup -y --debug --skip-common-plugins diff --git a/examples/setup-windows/README.md b/examples/setup-windows/README.md index 65255c6d0..9209df890 100644 --- a/examples/setup-windows/README.md +++ b/examples/setup-windows/README.md @@ -11,6 +11,7 @@ Run the following commands to validate things are rolling as they should. ```bash # Should dogfood the core plugin we are testing against lando plugin-add "@lando/core@file:../.." +``` # Should be able to run lando setup lando setup -y --skip-networking --skip-common-plugins @@ -27,4 +28,3 @@ Test-Path "$HOME/.lando/certs/LandoCA.crt" # Should have installed the Lando Development CA certutil -store Root | findstr /C:"Lando Development CA" -``` diff --git a/lib/daemon.js b/lib/daemon.js index b877960ea..845f5ac23 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -6,6 +6,7 @@ const fs = require('fs'); const getDockerBinPath = require('../utils/get-docker-bin-path'); const os = require('os'); const path = require('path'); +const semver = require('semver'); const Cache = require('./cache'); const Events = require('./events'); @@ -77,7 +78,7 @@ module.exports = class LandoDaemon { * @fires post_engine_up * @return {Promise} A Promise. */ - up(retry = true, password) { + async up(retry = true, password) { const debug = require('../utils/debug-shim')(this.log); // backwards compat @@ -91,48 +92,66 @@ module.exports = class LandoDaemon { * @since 3.0.0 * @event pre_engine_up */ - return this.events.emit('pre-engine-up').then(() => { - // Automatically return true if we are in the GUI and on linux because - // this requires SUDO and because the daemon should always be running on nix - if (this.context !== 'node' && this.platform === 'linux') return Promise.resolve(true); + await this.events.emit('pre-engine-up'); + + // Automatically return true if we are in the GUI and on linux because + // this requires SUDO and because the daemon should always be running on nix + if (this.context !== 'node' && this.platform === 'linux') return Promise.resolve(true); + + // retry func + const starter = async () => { + return await this.isUp().then(async isUp => { + // if we are already up then we are done + if (isUp) return Promise.resolve(); - // retry func - const starter = async () => { - return await this.isUp().then(async isUp => { - if (isUp) return Promise.resolve(); + try { + switch (this.platform) { + // docker engine + case 'linux': { + const lscript = path.join(this.scriptsDir, 'docker-engine-start.sh'); + if (password) await require('../utils/run-elevated')([lscript], {debug, password}); + else await require('../utils/run-command')(lscript, {debug}); + break; + } + + // docker desktop + case 'darwin': + case 'win32': + case 'wsl': { + // get version information + const {desktop} = await this.getVersions(); - try { - switch (this.platform) { - case 'darwin': + // if desktop version is >=4.37.1 then use docker desktop cli + if (semver.gte(desktop, '4.37.0', {includePrerelease: true, loose: true})) { + await require('../utils/run-command')('docker', ['desktop', 'start'], {debug: this.debug}); + + // otherwise mac fallback + } else if (this.platform === 'darwin') { await require('../utils/run-command')('open', [MACOS_BASE], {debug: this.debug}); - break; - case 'linux': { - const lscript = path.join(this.scriptsDir, 'docker-engine-start.sh'); - if (password) await require('../utils/run-elevated')([lscript], {debug, password}); - else await require('../utils/run-command')(lscript, {debug}); - break; - } - case 'win32': - case 'wsl': { + + // otherwise windows/wsl fallback + } else { const wscript = path.join(this.scriptsDir, 'docker-desktop-start.ps1'); await require('../utils/run-powershell-script')(wscript, undefined, {debug: this.debug}); await require('delay')(2000); - break; } - } - this.debug('build engine started but waiting to connect...'); - return Promise.reject(); - } catch (error) { - this.debug('could not start build engine with %o', error?.message); - this.debug('%j', error); - return Promise.reject(error); + break; + } } - }); - }; - return Promise.retry(starter, retry); - }) + this.debug('build engine started but waiting to connect...'); + return Promise.reject(); + } catch (error) { + this.debug('could not start build engine with %o', error?.message); + this.debug('%j', error); + return Promise.reject(error); + } + }); + }; + + // try to start + await Promise.retry(starter, retry); /* * Not officially documented event that allows you to do some things after @@ -141,7 +160,7 @@ module.exports = class LandoDaemon { * @since 3.0.0 * @event post_engine_up */ - .then(() => this.events.emit('post-engine-up')); + await this.events.emit('post-engine-up'); } down() { From 15ecb50de2fda27c284ee1f2983593c80597f955 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 8 Jan 2025 13:41:25 -0500 Subject: [PATCH 10/25] add a timeout for docker desktop start for 5 minutes --- lib/daemon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/daemon.js b/lib/daemon.js index 845f5ac23..dc1d77fe4 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -123,7 +123,7 @@ module.exports = class LandoDaemon { // if desktop version is >=4.37.1 then use docker desktop cli if (semver.gte(desktop, '4.37.0', {includePrerelease: true, loose: true})) { - await require('../utils/run-command')('docker', ['desktop', 'start'], {debug: this.debug}); + await require('../utils/run-command')('docker', ['desktop', 'start', '--timeout', '300'], {debug: this.debug}); // otherwise mac fallback } else if (this.platform === 'darwin') { From 3bf0538af90ba7d1df1f9de15fa29929ebb4ebb1 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 8 Jan 2025 14:05:35 -0500 Subject: [PATCH 11/25] use docker desktop specific docker binary --- lib/daemon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/daemon.js b/lib/daemon.js index dc1d77fe4..82aae4bf7 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -123,7 +123,7 @@ module.exports = class LandoDaemon { // if desktop version is >=4.37.1 then use docker desktop cli if (semver.gte(desktop, '4.37.0', {includePrerelease: true, loose: true})) { - await require('../utils/run-command')('docker', ['desktop', 'start', '--timeout', '300'], {debug: this.debug}); + await require('../utils/run-command')(this.docker, ['desktop', 'start', '--timeout', '300'], {debug: this.debug}); // otherwise mac fallback } else if (this.platform === 'darwin') { From 31efd22edc90a81e3fe418516812ef5d1e1f3e0e Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 8 Jan 2025 14:27:52 -0500 Subject: [PATCH 12/25] bump timeout to 10 minutes --- lib/daemon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/daemon.js b/lib/daemon.js index 82aae4bf7..1ab713a09 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -123,7 +123,7 @@ module.exports = class LandoDaemon { // if desktop version is >=4.37.1 then use docker desktop cli if (semver.gte(desktop, '4.37.0', {includePrerelease: true, loose: true})) { - await require('../utils/run-command')(this.docker, ['desktop', 'start', '--timeout', '300'], {debug: this.debug}); + await require('../utils/run-command')(this.docker, ['desktop', 'start', '--timeout', '600'], {debug: this.debug}); // otherwise mac fallback } else if (this.platform === 'darwin') { From a83199e130baadb702df6de72183e4c89ba9ab4c Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 8 Jan 2025 14:31:26 -0500 Subject: [PATCH 13/25] better uninstall of docker desktop on macos --- examples/setup-macos/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/setup-macos/README.md b/examples/setup-macos/README.md index afe0b1bb1..77d2f8b5d 100644 --- a/examples/setup-macos/README.md +++ b/examples/setup-macos/README.md @@ -15,6 +15,8 @@ lando plugin-add "@lando/core@file:../.." # Should be able to uninstall docker desktop succesfully brew uninstall --force --ignore-dependencies docker-desktop brew list --versions docker-desktop || echo $? | grep 1 +rm -rf ~/.docker +rm -rf ~/Library/Containers/com.docker.docker ``` # Should be able to run lando setup From a1c4570d12096b73e4b4668454336057cc267178 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 8 Jan 2025 15:18:31 -0500 Subject: [PATCH 14/25] fix --accept-license bug in macos docker desktop installer script and cast a wider net on gha runner compat --- .github/workflows/pr-setup-macos-tests.yml | 2 ++ .github/workflows/pr-setup-windows-tests.yml | 1 + scripts/install-docker-desktop.sh | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-setup-macos-tests.yml b/.github/workflows/pr-setup-macos-tests.yml index 324dba8c0..071df575c 100644 --- a/.github/workflows/pr-setup-macos-tests.yml +++ b/.github/workflows/pr-setup-macos-tests.yml @@ -18,6 +18,8 @@ jobs: os: - macos-13 - macos-14 + - macos-15 + - macos-15-xlarge steps: - name: Checkout code diff --git a/.github/workflows/pr-setup-windows-tests.yml b/.github/workflows/pr-setup-windows-tests.yml index f14a0783a..04f55989c 100644 --- a/.github/workflows/pr-setup-windows-tests.yml +++ b/.github/workflows/pr-setup-windows-tests.yml @@ -17,6 +17,7 @@ jobs: - "20" os: - windows-2022 + - windows-2025 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/scripts/install-docker-desktop.sh b/scripts/install-docker-desktop.sh index 50fcb2dd7..80440abbf 100755 --- a/scripts/install-docker-desktop.sh +++ b/scripts/install-docker-desktop.sh @@ -59,7 +59,7 @@ debug "INSTALLER: $INSTALLER" debug "USER: $USER" # add accept license if set -if [ "${DEBUG}" == 1 ]; then OPTS="$OPTS --accept-license"; fi +if [ "${ACCEPT_LICENSE}" == 1 ]; then OPTS="$OPTS --accept-license"; fi # run hdiutil attach "$INSTALLER" From 1fc050cbdfd7f27cb34312eab68758f6200d7def Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 8 Jan 2025 15:45:31 -0500 Subject: [PATCH 15/25] attempt different runners --- .github/workflows/pr-setup-macos-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-setup-macos-tests.yml b/.github/workflows/pr-setup-macos-tests.yml index 071df575c..9affde07a 100644 --- a/.github/workflows/pr-setup-macos-tests.yml +++ b/.github/workflows/pr-setup-macos-tests.yml @@ -17,9 +17,9 @@ jobs: - "20" os: - macos-13 - - macos-14 - - macos-15 - - macos-15-xlarge + - macos-14-large + # - macos-15 + # - macos-15-xlarge steps: - name: Checkout code From 4317ef1558c7021235a6517d69699ccc0f95caa7 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 8 Jan 2025 15:57:58 -0500 Subject: [PATCH 16/25] attempt different runners part 2 --- .github/workflows/pr-setup-macos-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-setup-macos-tests.yml b/.github/workflows/pr-setup-macos-tests.yml index 9affde07a..bcc42d4f0 100644 --- a/.github/workflows/pr-setup-macos-tests.yml +++ b/.github/workflows/pr-setup-macos-tests.yml @@ -17,7 +17,7 @@ jobs: - "20" os: - macos-13 - - macos-14-large + - macos-14-xlarge # - macos-15 # - macos-15-xlarge From 20d2ba57d56b680d6f21a5861c8c7b74d621e729 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 14 Jan 2025 10:33:20 -0500 Subject: [PATCH 17/25] fix bug causing service script loading collisions --- CHANGELOG.md | 2 ++ builders/_lando.js | 23 +++++++++++++++++------ examples/tooling/.lando.yml | 14 ++++++++++++++ examples/tooling/README.md | 4 ++++ examples/tooling/scripts/args.sh | 3 +++ 5 files changed, 40 insertions(+), 6 deletions(-) create mode 100755 examples/tooling/scripts/args.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e6f5ec94..d1ea18609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Fixed bug causing service script loading collisions + ## v3.23.22 - [December 17, 2024](https://github.com/lando/core/releases/tag/v3.23.22) * Added ability to customize `networkLimit` [#245](https://github.com/lando/core/pull/245) diff --git a/builders/_lando.js b/builders/_lando.js index 8556de70e..e1f21cdf4 100644 --- a/builders/_lando.js +++ b/builders/_lando.js @@ -41,6 +41,7 @@ module.exports = { refreshCerts = false, remoteFiles = {}, scripts = [], + scriptsDir = '', sport = '443', ssl = false, sslExpose = true, @@ -66,16 +67,23 @@ module.exports = { console.error(color.yellow(`${type} version ${version} is a legacy version! We recommend upgrading.`)); } + // normalize scripts dir if needed + if (!path.isAbsolute(scriptsDir)) scriptsDir = path.resolve(root, scriptsDir); + + // Get some basic locations + const globalScriptsDir = path.join(userConfRoot, 'scripts'); + const serviceScriptsDir = path.join(userConfRoot, 'helpers', project, type, name); + const entrypointScript = path.join(globalScriptsDir, 'lando-entrypoint.sh'); + const addCertsScript = path.join(globalScriptsDir, 'add-cert.sh'); + const refreshCertsScript = path.join(globalScriptsDir, 'refresh-certs.sh'); + // Move our config into the userconfroot if we have some // NOTE: we need to do this because on macOS and Windows not all host files // are shared into the docker vm if (fs.existsSync(confSrc)) require('../utils/move-config')(confSrc, confDest); - // Get some basic locations - const scriptsDir = path.join(userConfRoot, 'scripts'); - const entrypointScript = path.join(scriptsDir, 'lando-entrypoint.sh'); - const addCertsScript = path.join(scriptsDir, 'add-cert.sh'); - const refreshCertsScript = path.join(scriptsDir, 'refresh-certs.sh'); + // ditto for service helpers + if (fs.existsSync(scriptsDir)) require('../utils/move-config')(scriptsDir, serviceScriptsDir); // Handle Environment const environment = { @@ -94,11 +102,14 @@ module.exports = { // Handle volumes const volumes = [ `${userConfRoot}:/lando:cached`, - `${scriptsDir}:/helpers`, + `${globalScriptsDir}:/helpers`, `${entrypointScript}:/lando-entrypoint.sh`, `${dataHome}:/var/www`, ]; + // add in service helpers if we have them + if (fs.existsSync(serviceScriptsDir)) volumes.push(`${serviceScriptsDir}:/etc/lando/service/helpers`); + // Handle ssl if (ssl) { // also expose the sport diff --git a/examples/tooling/.lando.yml b/examples/tooling/.lando.yml index 66d5d8c74..399f16275 100644 --- a/examples/tooling/.lando.yml +++ b/examples/tooling/.lando.yml @@ -10,6 +10,7 @@ services: api: 3 type: lando meUser: node + scriptsDir: scripts services: image: node:16 command: docker-entrypoint.sh tail -f /dev/null @@ -261,6 +262,19 @@ tooling: arg2: describe: Uses arg2 type: string + sdargs: + cmd: /etc/lando/service/helpers/args.sh + service: node + positionals: + arg1: + describe: Uses arg1 + type: string + choices: + - thing + - stuff + arg2: + describe: Uses arg2 + type: string plugins: "@lando/core": "../.." diff --git a/examples/tooling/README.md b/examples/tooling/README.md index e8991e604..44de5792c 100644 --- a/examples/tooling/README.md +++ b/examples/tooling/README.md @@ -159,6 +159,10 @@ lando everything --help | grep "lando everything \[arg1\] \[arg2\] MORETHINGS" # Should allow for example pasthru in task definition lando everything --help | grep "lando this is just for testing" +# Should be able to access scriptsDir from the landofile +lando exec node -- stat /etc/lando/service/helpers/args.sh +lando sdargs hello there | grep "hello there" + # Should be able to run even if options are empty lando emptyopter diff --git a/examples/tooling/scripts/args.sh b/examples/tooling/scripts/args.sh new file mode 100755 index 000000000..b00e31206 --- /dev/null +++ b/examples/tooling/scripts/args.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "$1 $2" From e3c448eded9be109b768a27a48fb4d7d0c01c70a Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 14 Jan 2025 10:38:42 -0500 Subject: [PATCH 18/25] todo https://www.drupal.org/community/events --- netlify.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/netlify.toml b/netlify.toml index 554d1debf..1c79b4c45 100644 --- a/netlify.toml +++ b/netlify.toml @@ -20,6 +20,7 @@ "https://docs.google.com/document", "https://docs.google.com/forms", "https://github.com", + "https://www.drupal.org/community/events", "/v/" ] skipPatterns = [ From 5c88ea6234d8e822635294bc523d3b29c4934149 Mon Sep 17 00:00:00 2001 From: rtfm-47 Date: Tue, 14 Jan 2025 16:19:05 +0000 Subject: [PATCH 19/25] release v3.23.23 generated by @lando/prepare-release-action --- CHANGELOG.md | 2 ++ package-lock.json | 2 +- package.json | 2 +- release-aliases/3-STABLE | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1ea18609..e4a3a12c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +## v3.23.23 - [January 14, 2025](https://github.com/lando/core/releases/tag/v3.23.23) + * Fixed bug causing service script loading collisions ## v3.23.22 - [December 17, 2024](https://github.com/lando/core/releases/tag/v3.23.22) diff --git a/package-lock.json b/package-lock.json index 5a5bfa0a1..b837e2841 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@lando/core", - "version": "3.23.22", + "version": "3.23.23", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 58a0e4b69..1ecbf4448 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@lando/core", "description": "The libraries that power all of Lando.", - "version": "3.23.22", + "version": "3.23.23", "author": "Mike Pirog @pirog", "license": "GPL-3.0", "repository": "lando/core", diff --git a/release-aliases/3-STABLE b/release-aliases/3-STABLE index 71f6f0f88..ca6ec96f5 100644 --- a/release-aliases/3-STABLE +++ b/release-aliases/3-STABLE @@ -1 +1 @@ -v3.23.22 +v3.23.23 From cd77ea216ca2fcaa6bc8080d911fa4f81fb36789 Mon Sep 17 00:00:00 2001 From: rtfm-47 Date: Tue, 14 Jan 2025 16:56:02 +0000 Subject: [PATCH 20/25] Update edge release alias to v3.24.0-beta.9 triggered by @rtfm-47 --- release-aliases/3-EDGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-aliases/3-EDGE b/release-aliases/3-EDGE index 2b4687a7e..0a778a578 100644 --- a/release-aliases/3-EDGE +++ b/release-aliases/3-EDGE @@ -1 +1 @@ -v3.24.0-beta.8 +v3.24.0-beta.9 From 2069b2b9509e385ece905ac3ab794db8dd608e90 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 14 Jan 2025 14:05:45 -0500 Subject: [PATCH 21/25] fixed bug causing service script moving to fail when receiving non-stringy inputs --- CHANGELOG.md | 2 ++ builders/_lando.js | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4a3a12c0..ca9b5deaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Fixed bug causing service script moving to fail when receiving non-stringy inputs + ## v3.23.23 - [January 14, 2025](https://github.com/lando/core/releases/tag/v3.23.23) * Fixed bug causing service script loading collisions diff --git a/builders/_lando.js b/builders/_lando.js index e1f21cdf4..3fbd1b496 100644 --- a/builders/_lando.js +++ b/builders/_lando.js @@ -41,7 +41,7 @@ module.exports = { refreshCerts = false, remoteFiles = {}, scripts = [], - scriptsDir = '', + scriptsDir = false, sport = '443', ssl = false, sslExpose = true, @@ -68,7 +68,7 @@ module.exports = { } // normalize scripts dir if needed - if (!path.isAbsolute(scriptsDir)) scriptsDir = path.resolve(root, scriptsDir); + if (typeof scriptsDir === 'string' && !path.isAbsolute(scriptsDir)) scriptsDir = path.resolve(root, scriptsDir); // Get some basic locations const globalScriptsDir = path.join(userConfRoot, 'scripts'); @@ -83,7 +83,9 @@ module.exports = { if (fs.existsSync(confSrc)) require('../utils/move-config')(confSrc, confDest); // ditto for service helpers - if (fs.existsSync(scriptsDir)) require('../utils/move-config')(scriptsDir, serviceScriptsDir); + if (!require('../utils/is-disabled')(scriptsDir) && typeof scriptsDir === 'string' && fs.existsSync(scriptsDir)) { + require('../utils/move-config')(scriptsDir, serviceScriptsDir); + } // Handle Environment const environment = { From 0575fa32e5eff561c40724429fd941cdaa80ea27 Mon Sep 17 00:00:00 2001 From: rtfm-47 Date: Tue, 14 Jan 2025 19:54:38 +0000 Subject: [PATCH 22/25] release v3.23.24 generated by @lando/prepare-release-action --- CHANGELOG.md | 2 ++ package-lock.json | 2 +- package.json | 2 +- release-aliases/3-STABLE | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca9b5deaa..1678f643d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +## v3.23.24 - [January 14, 2025](https://github.com/lando/core/releases/tag/v3.23.24) + * Fixed bug causing service script moving to fail when receiving non-stringy inputs ## v3.23.23 - [January 14, 2025](https://github.com/lando/core/releases/tag/v3.23.23) diff --git a/package-lock.json b/package-lock.json index b837e2841..f0dea8b69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@lando/core", - "version": "3.23.23", + "version": "3.23.24", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 1ecbf4448..af9e0ba6a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@lando/core", "description": "The libraries that power all of Lando.", - "version": "3.23.23", + "version": "3.23.24", "author": "Mike Pirog @pirog", "license": "GPL-3.0", "repository": "lando/core", diff --git a/release-aliases/3-STABLE b/release-aliases/3-STABLE index ca6ec96f5..27a6879bb 100644 --- a/release-aliases/3-STABLE +++ b/release-aliases/3-STABLE @@ -1 +1 @@ -v3.23.23 +v3.23.24 From 7fdd669305fba61c64a9b3e1e9dd1109167045e7 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 15 Jan 2025 12:20:02 -0500 Subject: [PATCH 23/25] bump docker versions --- .github/workflows/pr-setup-macos-tests.yml | 10 +--------- .github/workflows/pr-setup-windows-tests.yml | 8 -------- CHANGELOG.md | 7 +++++++ config.yml | 6 +++--- examples/setup-macos/README.md | 4 +--- examples/setup-windows/README.md | 2 +- hooks/lando-setup-build-engine-darwin.js | 1 + hooks/lando-setup-orchestrator.js | 4 ++-- lib/daemon.js | 2 +- scripts/install-docker-engine.sh | 2 +- utils/get-compose-x.js | 2 +- utils/get-config-defaults.js | 6 +++--- 12 files changed, 22 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pr-setup-macos-tests.yml b/.github/workflows/pr-setup-macos-tests.yml index bcc42d4f0..901d14b7f 100644 --- a/.github/workflows/pr-setup-macos-tests.yml +++ b/.github/workflows/pr-setup-macos-tests.yml @@ -17,9 +17,7 @@ jobs: - "20" os: - macos-13 - - macos-14-xlarge - # - macos-15 - # - macos-15-xlarge + - macos-14 steps: - name: Checkout code @@ -63,9 +61,3 @@ jobs: cleanup-header: "Destroy tests" shell: bash stdin: true - - name: docker desktop cli tests - run: | - lando setup -y --debug --skip-common-plugins - # docker desktop start --timeout 60 - # docker desktop status - # lando setup -y --debug --skip-common-plugins diff --git a/.github/workflows/pr-setup-windows-tests.yml b/.github/workflows/pr-setup-windows-tests.yml index 04f55989c..208fd5b6c 100644 --- a/.github/workflows/pr-setup-windows-tests.yml +++ b/.github/workflows/pr-setup-windows-tests.yml @@ -17,7 +17,6 @@ jobs: - "20" os: - windows-2022 - - windows-2025 steps: - name: Checkout code uses: actions/checkout@v4 @@ -61,10 +60,3 @@ jobs: shell: powershell stdin: true debug: true - - name: docker desktop cli tests - shell: powershell - run: | - lando setup -y --debug --skip-common-plugins - # docker desktop start --timeout 60 - # docker desktop status - # lando setup -y --debug --skip-common-plugins diff --git a/CHANGELOG.md b/CHANGELOG.md index 89f96bf3c..eb132c070 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Improved Docker Destkop autostart to use new `docker desktop start` if available * Merged in improvements from `@lando/core@v3.23.24` +* Updated default Docker Desktop version to `4.37.1|2` +* Updated default Docker Engine version to `27.5.0` +* Updated default Docker Compose version to `2.31.0` +* Updated recommended Docker Desktop range to `>=4.37.0` +* Updated tested Docker Desktop range to `<=4.37` +* Updated tested Docker Compose range to `<=2.32` ## v3.24.0-beta.9 - [January 14, 2025](https://github.com/lando/core/releases/tag/v3.24.0-beta.9) diff --git a/config.yml b/config.yml index 57a530fcc..9d25a6bac 100644 --- a/config.yml +++ b/config.yml @@ -13,7 +13,7 @@ dockerSupportedVersions: compose: satisfies: "1.x.x || 2.x.x" recommendUpdate: "<=2.24.6" - tested: "<=2.30.99" + tested: "<=2.32.99" link: linux: https://docs.docker.com/compose/install/#install-compose-on-linux-systems darwin: https://docs.docker.com/desktop/install/mac-install/ @@ -21,13 +21,13 @@ dockerSupportedVersions: desktop: satisfies: ">=4.0.0 <5" tested: "<=4.37.99" - recommendUpdate: "<=4.36.0" + recommendUpdate: "<=4.36" link: darwin: https://docs.docker.com/desktop/install/mac-install/ win32: https://docs.docker.com/desktop/install/windows-install/ wsl: https://docs.docker.com/desktop/install/windows-install/ engine: satisfies: ">=18 <28" - tested: "<=27.3.1" + tested: "<=27.5.99" link: linux: https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script diff --git a/examples/setup-macos/README.md b/examples/setup-macos/README.md index 77d2f8b5d..320a09faf 100644 --- a/examples/setup-macos/README.md +++ b/examples/setup-macos/README.md @@ -15,9 +15,6 @@ lando plugin-add "@lando/core@file:../.." # Should be able to uninstall docker desktop succesfully brew uninstall --force --ignore-dependencies docker-desktop brew list --versions docker-desktop || echo $? | grep 1 -rm -rf ~/.docker -rm -rf ~/Library/Containers/com.docker.docker -``` # Should be able to run lando setup lando setup -y --skip-networking --skip-common-plugins @@ -34,3 +31,4 @@ stat ~/.lando/certs/LandoCA.crt # Should have installed the Lando Development CA security find-certificate -a -c "Lando Development CA" -p ~/Library/Keychains/login.keychain-db +``` diff --git a/examples/setup-windows/README.md b/examples/setup-windows/README.md index 9209df890..65255c6d0 100644 --- a/examples/setup-windows/README.md +++ b/examples/setup-windows/README.md @@ -11,7 +11,6 @@ Run the following commands to validate things are rolling as they should. ```bash # Should dogfood the core plugin we are testing against lando plugin-add "@lando/core@file:../.." -``` # Should be able to run lando setup lando setup -y --skip-networking --skip-common-plugins @@ -28,3 +27,4 @@ Test-Path "$HOME/.lando/certs/LandoCA.crt" # Should have installed the Lando Development CA certutil -store Root | findstr /C:"Lando Development CA" +``` diff --git a/hooks/lando-setup-build-engine-darwin.js b/hooks/lando-setup-build-engine-darwin.js index 960f9a66e..6e1c0d256 100644 --- a/hooks/lando-setup-build-engine-darwin.js +++ b/hooks/lando-setup-build-engine-darwin.js @@ -10,6 +10,7 @@ const semver = require('semver'); const {color} = require('listr2'); const buildIds = { + '4.37.2': '179585', '4.37.1': '178610', '4.37.0': '178034', '4.36.0': '175267', diff --git a/hooks/lando-setup-orchestrator.js b/hooks/lando-setup-orchestrator.js index 7d6144780..d01dc7735 100644 --- a/hooks/lando-setup-orchestrator.js +++ b/hooks/lando-setup-orchestrator.js @@ -7,7 +7,7 @@ const path = require('path'); /* * Helper to get docker compose v2 download url */ -const getComposeDownloadUrl = (version = '2.30.3') => { +const getComposeDownloadUrl = (version = '2.31.0') => { const mv = version.split('.')[0] > 1 ? '2' : '1'; const arch = process.arch === 'arm64' ? 'aarch64' : 'x86_64'; const toggle = `${process.platform}-${mv}`; @@ -31,7 +31,7 @@ const getComposeDownloadUrl = (version = '2.30.3') => { /* * Helper to get docker compose v2 download destination */ -const getComposeDownloadDest = (base, version = '2.30.3') => { +const getComposeDownloadDest = (base, version = '2.31.0') => { switch (process.platform) { case 'linux': case 'darwin': diff --git a/lib/daemon.js b/lib/daemon.js index 1ab713a09..aa7315c58 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -54,7 +54,7 @@ module.exports = class LandoDaemon { log = new Log(), context = 'node', compose = require('../utils/get-compose-x')(), - orchestratorVersion = '2.30.3', + orchestratorVersion = '2.31.0', userConfRoot = path.join(os.homedir(), '.lando'), ) { this.cache = cache; diff --git a/scripts/install-docker-engine.sh b/scripts/install-docker-engine.sh index f94aaad47..3aa19f69b 100755 --- a/scripts/install-docker-engine.sh +++ b/scripts/install-docker-engine.sh @@ -3,7 +3,7 @@ set -eo pipefail DEBUG=0 INSTALLER="get-docker.sh" -VERSION="27.3.1" +VERSION="27.5.0" OPTS= debug() { diff --git a/utils/get-compose-x.js b/utils/get-compose-x.js index 5a37f2756..ace77eda6 100644 --- a/utils/get-compose-x.js +++ b/utils/get-compose-x.js @@ -27,7 +27,7 @@ const getDockerBin = (bin, base, pathFallback = true) => { } }; -module.exports = ({orchestratorVersion = '2.30.3', userConfRoot = os.tmpdir()} = {}) => { +module.exports = ({orchestratorVersion = '2.31.0', userConfRoot = os.tmpdir()} = {}) => { const orchestratorBin = `docker-compose-v${orchestratorVersion}`; switch (process.platform) { case 'darwin': diff --git a/utils/get-config-defaults.js b/utils/get-config-defaults.js index 0b4b0b236..99915172c 100644 --- a/utils/get-config-defaults.js +++ b/utils/get-config-defaults.js @@ -8,9 +8,9 @@ const os = require('os'); const getBuildEngineVersion = (platform = process.landoPlatform ?? process.platform) => { switch (platform) { case 'darwin': - return '4.37.1'; + return '4.37.2'; case 'linux': - return '27.3.1'; + return '27.5.0'; case 'win32': return '4.37.1'; case 'wsl': @@ -21,7 +21,7 @@ const getBuildEngineVersion = (platform = process.landoPlatform ?? process.platf // Default config const defaultConfig = options => ({ orchestratorSeparator: '_', - orchestratorVersion: '2.30.3', + orchestratorVersion: '2.31.0', configSources: [], coreBase: path.resolve(__dirname, '..'), disablePlugins: [], From 8ff9b4365975cfd5c742f80259d0dccc1da31ee5 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 15 Jan 2025 13:14:09 -0500 Subject: [PATCH 24/25] remove docker desktop cli stuff from winstuff 4 now --- lib/daemon.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/daemon.js b/lib/daemon.js index aa7315c58..938beff03 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -115,27 +115,25 @@ module.exports = class LandoDaemon { } // docker desktop - case 'darwin': - case 'win32': - case 'wsl': { + case 'darwin': { // get version information const {desktop} = await this.getVersions(); // if desktop version is >=4.37.1 then use docker desktop cli if (semver.gte(desktop, '4.37.0', {includePrerelease: true, loose: true})) { - await require('../utils/run-command')(this.docker, ['desktop', 'start', '--timeout', '600'], {debug: this.debug}); + await require('../utils/run-command')(this.docker, ['desktop', 'start', '--timeout', '300'], {debug: this.debug}); // otherwise mac fallback - } else if (this.platform === 'darwin') { - await require('../utils/run-command')('open', [MACOS_BASE], {debug: this.debug}); - - // otherwise windows/wsl fallback } else { - const wscript = path.join(this.scriptsDir, 'docker-desktop-start.ps1'); - await require('../utils/run-powershell-script')(wscript, undefined, {debug: this.debug}); - await require('delay')(2000); + await require('../utils/run-command')('open', [MACOS_BASE], {debug: this.debug}); } - + break; + } + case 'win32': + case 'wsl': { + const wscript = path.join(this.scriptsDir, 'docker-desktop-start.ps1'); + await require('../utils/run-powershell-script')(wscript, undefined, {debug: this.debug}); + await require('delay')(2000); break; } } From 930c4d7bcedf7485c8bfb8a7ae096e383917a26c Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 15 Jan 2025 13:17:13 -0500 Subject: [PATCH 25/25] cl --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb132c070..fbb63df89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,16 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +### New Features + * Improved Docker Destkop autostart to use new `docker desktop start` if available * Merged in improvements from `@lando/core@v3.23.24` + +### Bug Fixes + +* Fixed bug causing `--accept-license` flag to not work when installing Docker Desktop on macOS + +### Internal + * Updated default Docker Desktop version to `4.37.1|2` * Updated default Docker Engine version to `27.5.0` * Updated default Docker Compose version to `2.31.0`