Test Project Browser on Amazee

Created on 10 June 2024, 8 months ago

Problem/Motivation

We need to make sure Project Browser is working on the major hosting providers. This issue is focused on Amazee.

Steps to install

Proposed resolution

  1. Write Drupal install notes above
  2. Go through Drupal install
  3. Enable and test Project Browser
  4. Note any extra steps to make it work
  5. Note any problems
  6. Make follow up issues as needed
📌 Task
Status

Active

Version

2.0

Component

Other

Created by

🇺🇸United States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Kristen Pol
  • 🇩🇰Denmark ressa Copenhagen

    Add "Make sure to actually install a few modules" step, add link.

  • 🇩🇰Denmark ressa Copenhagen

    Update Issue Summary "Remaining tasks", linking to parent issue.

  • 🇩🇰Denmark ressa Copenhagen
  • 🇦🇺Australia tobybellwood

    I'll post an update on this next week - but there are several technical hurdles to overcome here:
    * no writeable filesystem (container default)
    * composer no available to the UI (runs in a CLI container currently)
    * use of composer-scaffold in a default amazeeio/drupal-integrations install (workaround-able)

    Any work we do to enable Project Browser/Automated updates (if we wanted to) would have to be on a specialised template.

  • Assigned to tobybellwood
  • Status changed to Needs work about 2 months ago
  • 🇦🇺Australia tobybellwood

    Initial position:
    Project Browser is not supported in production workloads on amazee.io or Lagoon
    This is primarily because the filesystems are read-only, but there are other gotchas.

    Nuanced position:
    Project Browser (and by extension, Automatic Updates) can be enabled locally for Lagoon projects (but they probably shouldn't)

    Note that these steps pertain to the default local environment install (https://github.com/pygmystack/pygmy). Success may vary on other local development tools (Lando, DDEV)

    Steps:
    1. Download the https://github.com/lagoon-examples/drupal-base project locally.
    2. Bring the project up
    docker compose up -d --build
    3. Install Drupal and the modules (this is needed as the /app directory is mounted from the host)
    docker compose exec cli bash -c "composer install"
    4. Install a standard Drupal site via the UI at http://drupal-base.docker.amazee.io
    5. Install and enable the project browser module
    composer require 'drupal/project_browser’
    composer require 'drupal/automatic_updates’
    drush en project_browser automatic_updates
    6, Ensure that the "Allow Installing via the UI" box is ticked at http://drupal-base.docker.amazee.io/admin/config/development/project_bro...
    7. In your browser visit the status report to see the errors http://drupal-base.docker.amazee.io/admin/reports/status
    8. To address these errors:
    Here are some of the errors we've encountered and their resolutions. Note that it might require a few reruns of the readiness checks to get it all to pass:

    Composer was not found

    Composer is by default only installed in the cli image, but for PB/AU to work, it needs to be in the php image too.
    Add the following lines to the lagoon/php.Dockerfile

    COPY --from=cli /usr/local/bin/composer /usr/local/bin/composer
    RUN apk add --no-cache rsync
    

    Then perform a docker compose build php && docker compose up -d

    Any packages other than the implicitly allowed packages are not allowed to scaffold files.

    amazee.io and Lagoon use a package to scaffold necessary files on composer install - and this is a known issue ( https://www.drupal.org/project/automatic_updates/issues/3350172 📌 Support any package to scaffold files Active )

    docker compose exec cli bash -c "composer config extra.drupal-scaffold.allowed-packages --unset"
    docker compose exec cli bash -c "composer config extra.drupal-scaffold.file-mapping --unset"
    docker compose exec cli bash -c "composer update --no-install --lock"    
    
    Problems detected related to the Composer plugin cweagans/composer-patches.

    This may be resolved in later versions of the Lagoon templates, but can be easily fixed.

    docker compose exec cli bash -c "composer config extra.composer-exit-on-patch-failure true" 
    docker compose exec cli bash -c "composer update --no-install --lock"    
    

    9. Once all of the above have been resolved, any module can be installed with Project Browser, and updated with Automatic Updates. As the changes are reflected in the composer.json/lock, all updates can be pushed up with git. Note that unless config is exported, the modules may still need manually enabling.
    10. To re-enable the amazeeio/drupal_integrations functionality, the missing blocks will need to be re-added to the extra.drupal-scaffold section in composer.json

    Notes on this process

    Because of the need to disable the amazeeio/drupal_integrations scaffold tooling, and the strong requirement for gitOps based workflows we don't currently recommend this path for users.

  • 🇦🇺Australia pameeela

    Thanks for this info @tobybellwood! This seems like it should be a won't fix. It is possible to use PB to find modules and copy the Composer commands but not viable to use it for adding modules from the UI, along with the other hosting providers that don't have writeable file systems.

Production build 0.71.5 2024