lando / pantheon

The Official Lando Pantheon plugin.
https://docs.lando.dev/pantheon
GNU General Public License v3.0
11 stars 18 forks source link

Pantheon recipe version 2 proposal #10

Open pirog opened 4 years ago

pirog commented 4 years ago

We have two other integrations rolling now. These both use their own images and have baked in tooling that is very useful for local dev (eg pulling down data and files).

The current Pantheon recipe does not really work like this. Instead we maintain our own mock images and some wrapper scripts around terminus to achieve similar results. This definitely works OK but is significantly disadvantaged from the way the other two integrations work in the following ways:

  1. We spend a lot of time maintaining and updating the Pantheon images as new php versions, tooling, external libraries, php extensions, etc are rolled out. This means less time working on Lando specific stuff and more time on trying to "reinvent the wheel".
  2. Making any of the above changes is usually REACTIVE since it is prohibitively expensive for us to track ALL upcoming changes to Pantheon and to roll those in BEFORE they are a problem. Generally, we react and update when a user reports a bug or error. This means that the other integrations are less brittle and receive "upstream" updates proactively while also providing a better overall experience to users.

It would be so cool to update the current or create a new Pantheon v2 recipe that worked in a similar way to the amazee and platform.sh recipes. This would provide a a more reliable and truer integration and also allow us to focus on more Lando-centric features eg PLD instead of platform parity.

Roughly, i think the two biggest things to do here would be to:

1. Use Pantheon images if possible

Have Lando use Pantheon Docker images if applicable.

The biggest engineering concern here would be making sure Lando has awareness of Fedora/RHEL/Centos containers. Currently Lando only knows how to handle debian and alpine containers. This likely would not be a significant undertaking but its definitely something we would have to handle.

2. Improve terminus for local considerations

Grabbing the Database

It would be awesome for terminus to have a way to stream a sql dump like how drush sql-dump works with a Pantheon alias.

Currently Lando uses drush sql-dump if it can but falls back to the mysql_command provided by terminus connection:info if it needs to.

We do it this way because connecting via terminus connection:info $SITE.$DATABASE --field=mysql_command and running mysqldump directly is significantly slower than using drush sql-dump. Our users demand speed so in this case we try to give it to them, however, we sacrifice a bit of stability by having complex database pull logic. It would be awesome if terminus could stream the database dump as fast as drush does so we have ONE DB DUMP command we could use across frameworks.

Here is some data on using both on a vanilla D7 database.

# mysqldump
time mysqldump --no-autocommit --single-transaction --opt -Q -u pantheon -pMYPASSWORD -h dbserver.dev.SITEID.drush.in -P 17242 pantheon

real    0m53.512s
user    0m0.057s
sys 0m0.201s

# drush sql-dump
time drush @pantheon.landobot-drupal8.dev --extra-dump=--column-statistics=0 sql-dump

real    0m12.732s
user    0m0.570s
sys 0m2.048s

# terminus remote:drush
time terminus remote:drush -- sql-dump --extra=--column-statistics=0

real    0m4.939s
user    0m0.233s
sys 0m0.082s

This difference grows as the database size increases and it also means that all wordpress frameworks are slow by default.

@dustinleblanc after having revisited this after a year or so we might want to consider switching to that last terminus remote:thing method. I feel like that might be both more stable and faster.

Pulling files

It would also be great if terminus had a wrapper for rsyncing files to/from Pantheon although this is not nearly as a big a problem as the database.

dustinleblanc commented 4 years ago

Re drushy sql dump for WP, we might be able to leverage https://developer.wordpress.org/cli/commands/db/export/ to see if it is any faster than straight Terminus

pirog commented 4 years ago

@dustinleblanc i did try that out and terminus remote:wp -- db export is def faster so i think generally we want to be using terminus to remote execute the dump commands

dalin- commented 4 years ago

Do Pantheon even share their images publicly? Would getting that sorted out be a pre-req' for anything else?

dustinleblanc commented 4 years ago

We're working on that

On Wed, Jun 24, 2020 at 3:27 PM Dave Hansen-Lange notifications@github.com wrote:

Do Pantheon even share their images publicly? Would getting that sorted out be a pre-req' for anything else?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lando/lando/issues/2371#issuecomment-649020486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6ECCBTKZEBUXHFGAUQTVTRYJHRPANCNFSM4NYRDV2A .

uberhacker commented 4 years ago

Terminus does have a wrapper for rsync. See https://github.com/pantheon-systems/terminus-rsync-plugin. That said, this would need to be installed as a plugin.

pirog commented 4 years ago

@uberhacker good to know.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

GuyPaddock commented 2 years ago

Not stale.

reynoldsalec commented 2 years ago

@pirog should we close this out in favor of more current v2 planning?

ccharlton commented 2 months ago

To move forward on this would you want to dust this ticket off, or start a fresh-for-2024 and close this out again?

pirog commented 2 months ago

I think we will want to spin up a new ticket. We have Lando 4 service stuff coming out VERY soon which will allow us to start updating all current v3 services.