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

Added n98-magerun2 command to CLI containers #346

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

MagicLegend
Copy link

@MagicLegend MagicLegend commented Apr 22, 2022

Description

This PR adds the N98-Magerun2 binary to the CLI containers to be used during development. Magerun can be ran in a similar fashion as the other commands.

Fixed Issues (if relevant)

  1. Resolves Add built-in support for n98-Magerun2 in the deploy container #345

Manual testing scenarios

E.g. in the images/php/7.4-cli folder:

  1. docker build --tag magento/magento-cloud-docker-php:7.4-cli-1.3.2-magerun .
  2. docker run --rm magento/magento-cloud-docker-php:7.4-cli-1.3.2-magerun magerun2 list

It should output the list of possible commands. I have noticed that for me it was required to force ANSI output with the --ansi flag; is this only on my machine, or reproducible across the board? If the latter we should consider updating the magerun2 command to always pass the --ansi flag.

I have tested the 7.2-cli, 7.3-cli and 7.4-cli containers. I might have missed some incompatibility somewhere.

Release notes

For user-facing changes, add a meaningful release note. For examples, see Magento Cloud Docker release notes.

Added N98-Magerun2 binary to CLI containers.

Associated documentation updates

Add link to Magento DevDocs PR or Issue, if needed.

If this change will be accepted I will do the digging in the DevDocs to add references to this functionality to it.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • Pull request introduces user-facing changes and includes meaningful release notes and documentation
  • All commits are accompanied by meaningful commit messages

@MagicLegend
Copy link
Author

MagicLegend commented Apr 22, 2022

Potential issues I've found during usage:

magerun is an alias for docker-compose run --rm deploy magerun2

Here I had left query logging enabled:

magerun sys:cron:list
Creating <project>-docker_deploy_run ... done

In Write.php line 62:
                                                     
  The path "/app/var/debug/db.log" is not writable.  
                                                     

sys:cron:list [--format [FORMAT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--root-dir [ROOT-DIR]] [--skip-config] [--skip-root-check] [--skip-core-commands] [--skip-magento-compatibility-check] [--] <command>

ERROR: 1

Disabling query logging fixed the issue.


This appeared to happen after a cache flush and before a setup:di:compile:

magerun sys:cron:list
Creating <project>-docker_deploy_run ... done                                                                                                                                          
                                                                                                                                                                                    
In ClassReader.php line 28:                                                                                                                                                         
                                                                                                                                                                                    
  Class Magento\Cron\Model\ResourceModel\Schedule\Collection\Interceptor does not exist                                                                                             
                                                                                                                                                                                    
                                                                                                                                                                                    
sys:cron:list [--format [FORMAT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--root-dir [ROOT-DIR]] [--skip-config] [--skip-root-check] [--skip-core-commands] [--skip-magento-compatibility-check] [--] <command>                                                                                        
                                                                                                                                                                                    
ERROR: 1

Manually running setup:di:compile fixed the issue.


Due to the container executing magerun as www-data it cannot write log files:

Xdebug: [Log Files] File '/app/var/log/xdebug-deploy.log' could not be opened

Can we do something about the permissions this user has on the var/log directory?

@magento-cloud-ft-jenkins-svc

Functional Acceptance Test Results

✅  All functional acceptance tests have passed.

PHP 7.2

  • ✅  Elasticsearch72Cest
  • ✅  Acceptance72Cest
  • ✅  Services72Cest

PHP 7.3

  • ✅  Elasticsearch73Cest
  • ✅  Acceptance73Cest
  • ✅  ServicesCest

PHP 7.4

  • ✅  Elasticsearch74Cest
  • ✅  Acceptance74Cest

PHP 8.1

  • ✅  AcceptanceCest
  • ✅  DeveloperCest
  • ✅  ElasticsearchCest
  • ✅  OpensearchCest
  • ✅  MailHogCest

This comment was generated by Jenkins job magento-cloud-docker/functional build 126.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add built-in support for n98-Magerun2 in the deploy container
2 participants