Giter Site home page Giter Site logo

wardenenv / warden Goto Github PK

View Code? Open in Web Editor NEW
383.0 23.0 165.0 9.44 MB

Warden is a CLI utility for orchestrating Docker based developer environments

Home Page: https://warden.dev

License: MIT License

Shell 97.39% Batchfile 2.61%
warden docker cli-utility linux macos magento magento1 magento2

warden's People

Contributors

alinalexandru avatar bap14 avatar davidalger avatar davidhiendl avatar den4ik avatar dependabot[bot] avatar erikhansen avatar fooman avatar ihor-sviziev avatar jerrylopez avatar lalittmohan avatar lbajsarowicz avatar leesaferite avatar lunaetic avatar navarr avatar norgeindian avatar rbouma2 avatar ryantfowler avatar samjuk avatar sebastian-ehrling avatar snowcore avatar sprankhub avatar tdgroot avatar torhoehn avatar vbuck avatar viktor-zaiets avatar vinai avatar wcrb15 avatar werfu avatar wojtekn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

warden's Issues

After bin/magento application redirects to /index.php

I set up an Magento 2 environment via composer and it was working perfectly fine, but after running bin/magento setup:upgrade I got redirected to /index.php. Are there any experiences with this?

Before bin/magento setup:upgrade
Screenshot 2019-11-26 at 21 13 02

After bin/magento setup:upgrade
Screenshot 2019-11-26 at 21 16 13

The only thing to make it work again was to run the bin/magento setup... again.

Importing DB via warden db import stalls

I see where you can run warden db import test_db.sql magento but when I run this it just stalls. I've already verified and installed pv. I ended up just importing via Sequel Pro but would like to know if my syntax is correct for future reference.

Thanks!

Check for existence of /etc/dhcp/dhclient.conf during install script

I was trying to get Warden to run inside of Manjaro/Arch Linux and by default the /etc/dhcp/dhclient.conf file does not exist. The install command should check for the existence of this file and if it doesn't exist try to create it. In this particular use case I had to also configure Network Manager to use dhclient as its DHCP backend, but that is expected since Arch isn't officially supported. I will probably write up a PR for this soon but wanted to officially open an issue about it.

Please Make Container Restart Policy Configurable

I just noticed that when I stop the primary warden containers ( traefik, dnsmasq, portainer, and the ssh tunnel ), and restart my Docker daemon, there's restart policies defined for these containers. In my opinion, this is a bit intrusive and assumes that a user of this project wants this behavior.

Is it possible to have system-level warden configurations stored in the ~/.warden directory somewhere? If so, then it would provide finer grained control over warden's behavior.

In the context of restart policies, due to these being defined here https://github.com/davidalger/warden/blob/master/docker/docker-compose.yml, it would appear to be possible to use the same logic you have in the environment docker-compose files, such as this here: https://github.com/davidalger/warden/blob/master/environments/magento2.base.yml#L5, where you have a default value if no environment variable is found.

If you're open to this addition to the project, I can open a PR with my suggested changes. I am not leading with a PR for this suggestion, as I'd prefer to get your feedback before doing work.

Thanks

Change selenium environment include to use hub/node configuration

As configured currently selenium is using an all-in-one container, this would preclude multi-browser testing. Would like to see something like the following (i.e. hub and a chrome node) supported OOTB here (allowing environments to add additional nodes as needed).

  selenium-hub:
    container_name: ${WARDEN_ENV_NAME}_selenium-hub
    image: selenium/hub:3.141.59-titanium
    ports:
      - "4444:4444"
  selenium-chrome:
    container_name: ${WARDEN_ENV_NAME}_chrome
    image: selenium/node-chrome:3.141.59-titanium
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
      - START_XVFB=false

Note this will require reform before dropping into place as it came from a sidecar stack.

cc @lbajsarowicz would be wonderful if you'd like to tackle this since you've got a working MFTM setup you could validate the changes with, otherwise I'll probably tackle it only if I have the time leading up to Warden 0.2.0 release.

Automatically trigger Xdebug when running PHP on CLI inside php-debug container

The php CLI inside the php-debug container should trigger Xdebug automatically. Currently the only way to debug CLI commands (as opposed to HTTP requests which are routed to Xdebug automatically already) is to specify a couple settings to php:

warden env exec php-debug bash

php -d xdebug.remote_autostart=on -d xdebug.remote_host=host.docker.internal ...

At minimum remote_autostart should be set on CLI by default, and ideally the remote_host as well. That one will require a little work to get right on both macOS and Linux.

rsync: command not found in Magento2 environment

Following the README file to have a magento2 env set, inside the PHP container, after downloaded Magento2 on /tmp/exampleproject folder, there is a problem on rsync.

www-data@php-fpm:08:16 AM:/var/www/html$ rsync -a /tmp/exampleproject/ /var/www/html/
bash: rsync: command not found

Space in parent folder breaks .warden/warden-env.yml

I haven't been able to work out yet exactly where it happens but thought I document it here. I came across this while trying out .warden/warden-env.yml. After creating this file all warden env commands failed with a command not found. And the command would show from the last space in the full path, ie this
/Users/name/Projects/With Space/magento2/.warden/warden-env.yml
would have split at Space.

Unable to install in Ubuntu 16.04

I am getting the following error after executing

warden up
```
> ERROR: Command `docker-compose -p warden -f docker/docker-compose.yml up -d "${WARDEN_PARAMS[@]}" "$@"` on line 23 failed with exit code 1

Support using magento-cloud ece-tools within the fpm container

Opened by request from @talesh:

  1. Add magento-cloud ece-tools to the fpm container
    ref: https://twitter.com/_talesh/status/1182757729313517568

Additional Notes:

  • This could be as simple or as complicated as adding the appropriate vendor location to $PATH
  • ece-tools is published under OSL-3.0 publicly on Github, so including this in a publicly distributed image shouldn't pose any licensing issues if it is decided to bundle them with the image: https://github.com/magento/ece-tools/
  • More research is likely required on this to determine direction prior to implementation.

unable to warden sync start

Just updated to Catalina and am no longer able to get my environment to start because I am receiving the following error when running warden sync start. warden up and warden start are working fine, but sync start is throwing this error:

Warning: TOML-based configuration files are deprecated, please migrate to YAML
Connecting to agent (POSIX)...
Error: create failed: unable to connect to beta: unable to connect to endpoint: unable to dial agent endpoint: unable to create agent command: unable to probe container: container probing failed under POSIX hypothesis (exit status 1) and Windows hypothesis (exit status 1)

ERROR: Command mutagen create -c "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.mutagen.toml" --label "warden-sync=${WARDEN_ENV_NAME}" "${WARDEN_ENV_PATH}${WARDEN_WEB_ROOT:-}" "docker://$(warden env ps -q php-fpm)/var/www/html" on line 32 failed with exit code 1

xDebug not activated

Followed the steps like it stated here and here is the screenshot of how it looks like

xdebug-settings

From chrome after enabling the debugging profile through xdebug helper chrome extension I can see the Cookie like below

cookie

Environment:
os

All containers and every other service is working,
docker_containers

But not able to use xdebug with PHPStorm
phpstorm

This is something am newly trying with docker based xdebug in phpstorm, the valet+ xdebug works ok with phpstorm.

Magento 1 blackfire

magento1.blackfire.yml

needs to be renamed to

magento1.blackfire.base.yml

in environment directory

Feature request/support for Windows Containers

@davidalger In one of the current M2 project some of our team has to work on Windows and they don't have way for ubuntu or not even in WSL. So I tried gathering "davidalger/warden" magento images and created environment for Magento 2 as attached here.

m2_env.zip

The issues it's having

  • It's very slow [Even in same ubuntu machine warden containers are really fast but this containers are very slow] => Are you able to spot what should be added/changed in this to make it work faster just with this images?
  • How can I add SSL certificates or enable way for https to these local development environment

This will be really great option if the same lib. can work in Windows also

Admin login impossible when using url rewrites

After running setup:install with --use-rewrites=1 or when switching web/seo/use_rewrites to 1 in the admin or using the cli, all admin sessions redirect to the login screen and all further login attempts fail without an error message.

Consider Adding Ubuntu Alternatives

First, thanks for the time put towards this tooling. Next, the current php containers are based on Centos, which isn't as prevalent as it once was. Currently, most servers are based on Ubuntu, and even Magento Cloud is based on Debian. What are your thoughts @davidalger on offering up alternative containers?

Thanks

Setup base environment for Laravel

The docker Nginx image has had a working configuration file for Laravel since September:
davidalger/docker-images-warden@b7215c0

Laravel support has been tested via an in-house project using a local project level configuration. This configuration should be adapted and published as a laravel env type available for use by running warden env-init <project_name> laravel.

Create magento_integration_tests DB by default

In order to run integration tests, it would be helpful to pre-create an empty database magento_integration_tests and give the magento user access to it.

$ mysql -hdb -uroot -pmagento
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 397
Server version: 10.3.18-MariaDB-1:10.3.18+maria~bionic mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database magento_integration_tests;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on magento_integration_tests.* to 'magento'@'%' identified by 'magento';
Query OK, 0 rows affected (0.00 sec)

I'm not sure how best to accomplish this with this setup, otherwise I'd be happy to create a PR.

Support BYPASS_VARNISH flag to route requests directly to Nginx

The magento2 environment type (the only one making use of Varnish currently) sends requests to varnish which passes them on to Nginx. There are use-cases where it is desired to send requests directly to Nginx (such as when the Redis backend is used for full page cache) or simply when needing to eliminate Varnish from the mix when debugging tricky issues.

In order to simplify this such that users will no longer be required to setup custom labeling on containers used by the project, a BYPASS_VARNISH flag should be set such that when BYPASS_VARNISH=true or BYPASS_VARNISH=1 is found in the project's .env file Traefik routes to the Varnish container in an environment will be disabled allowing requests to pass to directly to Nginx.

Selenium Instructions are Incorrect

The instructions listed for selenium (in the README) are incorrect.

The selenium host should be just selenium with the current Warden setup. I would submit a PR but I cannot currently create screenshots of a VNC with SSH tunnel

Can't connect to tunnel.warden.test

Note: After writing most of this up, I figured out what was going on, but I'm creating and then closing this issue in case it's helpful for anyone coming after me.

I'm running macOS Mojave (10.14.6). After installing warden and using it for a few days (really like it), I had the need to setup a database GUI.

I couldn't get either PhpStorm or SequelPro to connect until I explicitly added user as the "SSH User":

Sequel Pro 2019-10-24 16-49-18

Likewise, I this command works in Terminal:

ssh [email protected]
Welcome to the Warden SSH tunnel!

But this doesn't:

ssh tunnel.warden.test
[email protected]'s password:

I realized the reason why this was happening (thanks to the ssh -vvv flag):

  1. Warden adds this to the /etc/ssh/ssh_config file:

    ## WARDEN START ##
    Host tunnel.warden.test
      HostName 127.0.0.1
      User user
      Port 2222
      IdentityFile ~/.warden/tunnel/ssh_key
    ## WARDEN END ##
    
  2. However at the bottom of my ~/.ssh/config file, I had this entry:

    Host *
        User ehansen
    
  3. Due to the load order of the config files, my configuration was overriding the Warden configuration when I ran ssh tunnel.warden.test: SSH was attempting to use my ehansen username (it did use the correct Port and IdentityFile).

My solution was to remove the entry from my ~/.ssh/config file.

Consider using NVM

The version of Node that ships with this solution is set at v6, which is outdated, but is expected due to use of Centos and no external source repo for Node.js. With the use of something like NVM ( https://github.com/nvm-sh/nvm ), then someone could pass in an environment variable to set the version for their specific project. This would be the same as the current behavior with PHP/Mariadb/Traefic/etc.

For instance, if someone wished to use Mage2tv's cache clean tool, it requires at least Node.js v8.

Accessing Warden sites from Windows VirtualBox VMs

I'd like to test a local app.example.test site using a Windows VM running in VirtualBox.

I've added this entry to the c:\Windows\System32\Drivers\etc\hosts file:

127.0.0.1 app.example.test

However I'm not able to get the site to load within the VM:

image

I also tried this entry (172.21.0.21 was the IP reported by Traefik), to no avail:

172.21.0.21 app.example.test

Could you give me a pointer on what I need to put in my hosts file, to get this working?

File based sessions do not work as they should

Although it is recommended to use redis (and used in the example install) for session storage, file based sessions should work. The /var/lib/php/fpm/session directory does not exist in the fpm images, and the /var/lib/php/fpm appears to have a wrong group. These two issues need to be corrected, and then this should resolve itself.

1 exception(s):
Exception #0 (Exception): Warning: SessionHandler::read(): open(/var/lib/php/fpm/session/sess_o02fipeq95citdo4dr83qlj67h, O_RDWR) failed: Permission denied (13) in /var/www/html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22

Exception #0 (Exception): Warning: SessionHandler::read(): open(/var/lib/php/fpm/session/sess_o02fipeq95citdo4dr83qlj67h, O_RDWR) failed: Permission denied (13) in /var/www/html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'SessionHandler:...', '/var/www/html/v...', 22, Array)
#1 /var/www/html/vendor/magento/framework/Session/SaveHandler/Native.php(22): SessionHandler->read('o02fipeq95citdo...')
#2 /var/www/html/vendor/magento/framework/Session/SaveHandler.php(80): Magento\Framework\Session\SaveHandler\Native->read('o02fipeq95citdo...')
#3 [internal function]: Magento\Framework\Session\SaveHandler->read('o02fipeq95citdo...')
#4 /var/www/html/vendor/magento/framework/Session/SessionManager.php(191): session_start()
#5 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\Session\SessionManager->start()
#6 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Session\Generic\Interceptor->___callParent('start', Array)
#7 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\Session\Generic\Interceptor->Magento\Framework\Interception\{closure}()
#8 /var/www/html/generated/code/Magento/Framework/Session/Generic/Interceptor.php(52): Magento\Framework\Session\Generic\Interceptor->___callPlugins('start', Array, Array)
#9 /var/www/html/vendor/magento/framework/Session/SessionManager.php(127): Magento\Framework\Session\Generic\Interceptor->start()
#10 /var/www/html/generated/code/Magento/Framework/Session/Generic/Interceptor.php(14): Magento\Framework\Session\SessionManager->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State\Interceptor))
#11 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(116): Magento\Framework\Session\Generic\Interceptor->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State\Interceptor))
#12 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#13 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#14 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#15 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'session', 'Magento\\Framewo...')
#16 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#17 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#18 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#19 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#20 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'formKey', 'Magento\\Framewo...')
#21 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#22 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#23 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#24 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#25 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'formKeyValidato...', 'CsrfRequestVali...')
#26 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('CsrfRequestVali...', Array, Array)
#27 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('CsrfRequestVali...', Array, Array)
#28 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('CsrfRequestVali...')
#29 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(196): Magento\Framework\ObjectManager\ObjectManager->get('CsrfRequestVali...')
#30 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(172): Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray(Array)
#31 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, NULL, NULL, 'validators', 'RequestValidato...')
#32 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('RequestValidato...', Array, Array)
#33 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('RequestValidato...', Array, Array)
#34 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('RequestValidato...')
#35 /var/www/html/vendor/magento/framework/App/FrontController.php(71): Magento\Framework\ObjectManager\ObjectManager->get('RequestValidato...')
#36 /var/www/html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(14): Magento\Framework\App\FrontController->__construct(Object(Magento\Framework\App\RouterList), Object(Magento\Framework\App\Response\Http\Interceptor), NULL, NULL, NULL)
#37 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(116): Magento\Framework\App\FrontController\Interceptor->__construct(Object(Magento\Framework\App\RouterList), Object(Magento\Framework\App\Response\Http\Interceptor), NULL, NULL, NULL)
#38 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#39 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#40 /var/www/html/vendor/magento/framework/App/Http.php(134): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#41 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#42 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()
#43 /var/www/html/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#44 {main}

Sourcemaps not working

Does anyone know how to get sourcemaps working on Warden, I have it working in my vagrant environment but whenever I run grunt exec:site && grunt less:site && grunt watch it still doesn't show the files. Sourcemaps are on in the browser.

Mutagen sync sessions for "local" environment type

Hello!

I have a small issue making the mutagen working on macOS using the local environment.
When I try to run the warden sync start I get this:
image
Is there any way I can fix this for local environments?

Best Regards,
Rafael

Elastic Search Server Setting - Magento 2

When loading a site locally that uses elastic search I receive the error `

1 exception(s):
Exception #0 (Elasticsearch\Common\Exceptions\NoNodesAvailableException): No alive nodes found in your cluster

Exception #0 (Elasticsearch\Common\Exceptions\NoNodesAvailableException): No alive nodes found in your cluster

On Magento StackExchange someone suggests to change the server setting to localhost. For warden, what would be the localhost setting?

How to switch store views - Magento 2

For a project that I'm working on this is how we switch from store to store within the vagrant local env. that uses a docker container.

Within the index.php file:
$params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'extranet'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store'; $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params); /** @var \Magento\Framework\App\Http $app */ $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class); $bootstrap->run($app);

By doing this we're able to maintain the same url but switch themes based on the store code. This works in the vagrant env. however this doesn't seem to work in the warden env.

Any ideas why?

Thanks!

Mutagen configuration does not exist for environment type "magento1"

Replication steps:

  1. Create a new Warden environment (warden env-init premigrate magento1)
  2. Sign the certificate, spin up the containers (warden env up -d)
  3. Start Mutagen sync (warden sync start)

Expected result:
Mutagen to start and files to be synching

Observed result:
Error 'Mutagen configuration does not exist for environment type "magento1"'

I think the problem is that a .toml file is missing for Mutagen, but I can't find the Magento 2 one to figure out where to make a version for Magento 1.

SSH Configuration for tunnel container vanishes on macOS updates

macOS Catalina initial upgrade wiped out customization to the /etc/ssh/ssh_config file, and it appears that minor version updates can wipe out changes to this file as well leaving the tunnel in a broken state since the configuration is only placed on Warden installation (initial and/or after updating Warden).

In order to mitigate this, Warden should check for the presence of the tunnel configuration when asserting installation has been completed (this assertion is currently run on up, start and restart).

Could not start env

On my Mac I created a Magento 2 environment with the Magento 2 GitHub repository and installed the Sample Data directly from GitHub. Everything was running fine.

After stopping the environment I'm not able to start it again, because the initial synchronisation does not complete. The Docker engine already has 6 GB of RAM available. Do you know any solution for this?
Screenshot 2019-10-22 at 07 03 55

See list of running warden environments

Every time I run warden down it fails with the following output:

Leto:warden vinai$ warden down
Stopping traefik   ... done
Stopping tunnel    ... done
Stopping portainer ... done
Stopping dnsmasq   ... done
Removing traefik   ... done
Removing tunnel    ... done
Removing portainer ... done
Removing dnsmasq   ... done
Removing network warden
ERROR: error while removing network: network warden id 83313fb38e7e4594bb91dcf81c2f73282235196a52c9cc3e6312dc6df4145d0d has active endpoints

ERROR: Command `docker-compose -p warden -f docker/docker-compose.yml down "${WARDEN_PARAMS[@]}" "$@"` on line 5 failed with exit code 1

I'm just starting to dig into warden so I might be overlooking something obvious, but at the moment this is the first obstacle, so I thought I'd report.

PHPStorm remote docker-compose based PHP interpreter configuration for integration testing

In order to develop Magento extensions and core patches efficiently I want to be able to run integration tests in PHPStorm.

PHPStorm allows configuration of remote, docker-compose based, PHP interpreters.
Here is what I've done so far:

  • Service: php-debug
  • docker-compose files:
    • /usr/local/Cellar/warden/0.1.10/environments/magento2.base.yml
    • /usr/local/Cellar/warden/0.1.10/environments/magento2.darwin.yml
  • environment variables from .env:
    • WARDEN_ENV_NAME
    • WARDEN_ENV_TYPE
    • TRAEFIK_DOMAIN
    • TRAEFIK_SUBDOMAIN
    • WARDEN_WEB_ROOT (this one isn't from .env but I thought it might help)

With this configuration PHPStorm allows saving the interpreter even though it says it's unable to parse the validation script output.

Nevertheless, PHPStorm allows me to continue, even though PHPStorm can not determine the PHP version.

Then I add a path mapping to the interpreter configuration from <Project root> -> /var/www/html manually, however, PHPStorm also read an invalid mapping from the yaml:
/usr/local/Cellar/warden/0.1.10/environments/.${WARDEN_WEB_ROOT:-}/pub/media -> /var/www/html/pub/media
It seems PHPStorm doesn't like the config in magento2.darwin.yaml:
.${WARDEN_WEB_ROOT:-}/pub/media:/var/www/html/pub/media:delegated

Next I changed .${WARDEN_WEB_ROOT:-} to ${WARDEN_WEB_ROOT:-} (removed the leading .) and it indeed allowed PHPStorm to find the PHP interpreter correctly.
I'm not sure why the . is here, I'll test shortly if warden seems to work without it, too.

When I then try to set up a PHPUnit configuration with this remote interpreter, I get the message:

Can not parse PHPUnit version output: Could not open input file: vendor/phpunit/phpunit/phpunit`

I tried setting the composer autoload.php file path to

  • vendor/autoload.php
  • /var/www/html/vendor/autoload.php
  • /Volumes/CaseSensitive/Workspace/php-sites/m2-training/vendor/autoload.pnp (my local path because of the path mapping config)

No luck. This might be an issue with PHPStorm, I don't know, but it would be wonderful to get integration tests working in the IDE.

"Killed" during Updating dependencies

Hello,

I'm running into an issue on step 7. Whenever I run

composer create-project --repository-url=https://repo.magento.com/ \
    magento/project-community-edition /tmp/exampleproject 2.3.x

Once it gets to Updating dependencies (including require-dev) it gets stuck for awhile and then says Killed

After doing some research, this looks like its due to the php memory limit needing to be increased. Is there a way to do that so it can finish downloading the project?

Updated default php-fpm version to 7.3 for magento2 environments

Magento 2.3.3 added support for PHP 7.3 and it is now enabled by default for magento2 environments.

If older versions of PHP 7.2 is still needed for your project, please ensure PHP_VERSION=7.2 is placed in the project's .env file to ensure that version is used now and into the future.

Warden 0.2.0 and later will begin including version variables such as this one in the .env file when written by env-init command to ensure future updates to default versions don't alter existing project service major versions.

Support Live Reload routing natively on Magento 2 environment

Magento 2 can be rather simply configured to serve the Live Reload script by including the following bit in the env.php file and running bin/magento app:config:import:

    'system' => [
        'default' => [
            'design' => [
                'footer' => [
                    'absolute_footer' => '<script src="/livereload.js?port=443"></script>'
                ]
            ]
        ]
    ]

Routing requests to this has previously required using per-project configuration in .warden/warden-env.yml to label the php-fpm container as required to serve the Live Reload JS file and process Web Socket requests when grunt watch is running.

In the upcoming Warden 0.2.0 release Live Reload should require nothing more than adding the script tag to the env.php file or including it via design configuration in the admin.

Documentation on how to leverage Live Reload

Please see the corresponding docs page: https://docs.warden.dev/configuration/livereload.html

Extend env-init command to include all customizable values in .env file

Opened by request from @talesh:

  1. Add a flags to warden env-init to define things like PHP version so it'll automatically add PHP_VERSION=7.1 to the .env file
    ref: https://twitter.com/_talesh/status/1182758060546088962

Additional Notes:

  • This seems like a very good idea, and can be easily implemented in a BC fashion as env-init is not generally run beyond the initial execution to setup a project.
  • May require some work on argument parsing logic to support this.
  • This would allow for changing the default versions of things in subsequent releases of Warden without breaking a project's reliance on a particular version since they would all be frozen in .env
  • Ideally would include all relevant customizable variables as noted here: https://github.com/davidalger/warden#customizing-an-environment

M2 Setup:upgrade keep executing db_schema every time

Not sure if this is only in my environment but any time I run mr setup:upgrade keep executing db_schema every time and this is causing fatal error because it tried creating the foreign key again.
Eg.

<table name="custom_table" resource="default" engine="innodb" comment="custom Table">
        <column xsi:type="int" name="ct_id" padding="10" unsigned="false" nullable="false" identity="true"
                comment="ID"/>
        <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false"
                comment="Customer Id"/>
        <column xsi:type="varchar" name="phone_number" nullable="false" length="255" comment="Phone Number"/>
        <column xsi:type="varchar" name="contact_pref" nullable="false" length="255" comment="Contact Preference"/>
        <column xsi:type="varchar" name="verification_token" nullable="false" length="255"
                comment="Verification Token"/>
        
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="ct_id"/>
        </constraint>

 <constraint xsi:type="foreign" referenceId="custom_table_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
                    table="custom_table"
                    column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id"
                    onDelete="CASCADE"/>
</table>

And this yields

SQLSTATE[HY000]: General error: 1826 Duplicate FOREIGN KEY constraint name 'mvp_dev_dec/modulegroup_custom_table_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID', query was: ALTER TABLE ....

The same code just works fine from direct ubuntu dev environment.

Mailhog is missing a sendmail binary

The current php configures the following sendmail

$ cat /etc/php.d/05-additions.ini
sendmail_path = /usr/sbin/sendmail -S mailhog:1025

but the image does not include it:

www-data@php-fpm:12:51 AM:/var/www/html$ ls -ll /usr/sbin/sendmail
ls: cannot access /usr/sbin/sendmail: No such file or directory

Using https://github.com/mailhog/mhsendmail/ and then using the below:

$ cat /etc/php.d/05-additions.ini
sendmail_path = "/path/to/mhsendmail --smtp-addr=mailhog:1025"

works for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.