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

Tideways with Xhgui #18

Open
wants to merge 40 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@Mte90
Copy link

Mte90 commented Jul 5, 2018

I started working on that and is not yet ready.
Right now I am only doing the bash script and I will test later.

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

Trying with vagrant provision --provision-with="utility-core-tideways"

This tickets will fix Varying-Vagrant-Vagrants/VVV#1540

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

I am using:


utilities:
  core:
    - phpmyadmin
    - mailhog
    - php56
    - php71
    - php72
    - trusted-hosts
    - tls-ca
    - tideways
utility-sources:
    core: https://github.com/mte90/vvv-utilities.git
    branch: xhgui-tideways

But seems that with that command is not executing my script @tomjn

@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jul 5, 2018

keep in mind that command will only execute the provisioner, it won't pull down updates or anything else, it just runs provision.sh for that utility if it exists

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

I downloaded inside /tmp/ my fork and switched the branch and executing directly to find issues.
I executed also the provision and not yet working in the official way.

@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jul 5, 2018

I'm not sure what you mean by that, VVV utilities live in the provision/resources/ folder, VVV won't look in the /tmp folder

If you want to update the utility, you need to do that manually beforehand with:

vagrant provision --provision-with="utility-source-core"
@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

I executed that but didn't worked with my fork.

For tmp I am testing the script on that folder in the meantime I don't find a fix for use the vagrant provision command.

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

Right now there are 3 problems:

  • few files on 7.0/7.1 are not copied
  • module tideways is not loaded
  • http://vvv.test:1337/ say 502 bad gateway

I am working on fix that issues, the rest seems working.

@Mte90 Mte90 force-pushed the Mte90:xhgui-tideways branch 2 times, most recently from 9ab7289 to b484396 Jul 5, 2018

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

The actual remaining stuff is the 502 error on nginx.

@Mte90 Mte90 force-pushed the Mte90:xhgui-tideways branch from 62aeeca to 8a922eb Jul 5, 2018

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

Xhgui is active on http://192.168.50.4/xhgui/webroot/ but with issues on connecting to mongodb.

@Mte90 Mte90 force-pushed the Mte90:xhgui-tideways branch from abd8ed6 to daf16fa Jul 5, 2018

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

Now is connecting and intercepting all the request of xhgui itself but not seems from the rest of website also if is prepended.

Also url like http://vvv.test/xhgui/webroot/run/delete_all are not working probably because there is no rule on nginx about how to handle them but I need help to udnerstand how to configure nginx for VVV.

@Mte90 Mte90 force-pushed the Mte90:xhgui-tideways branch from daf16fa to b28ee87 Jul 5, 2018

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

immagine
If @tomjn can help me to fix the rewrite issue of xhgui I will try to understand why is not profiling wordpress.
In any case my pr works with url that contain enable-tideways like domain.test?enable-tideways and use php =>7.0 as version in custom.yml file.

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

Seems that I got my issue for why is not loaded.
Actually tideways is compiled for php 7.2 and loaded only in that version but for the test site I was using one on php 7.1.
I am trying to udnerstand if I can compile for different version and add the support to mongodb to different php version too.

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

Ok now tideways is compiled against every php version and mongodb is symlinked :-)

@Mte90 Mte90 force-pushed the Mte90:xhgui-tideways branch from acfb622 to 49b574b Jul 5, 2018

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 5, 2018

Yeah, is quite finished remain the issue of the url that is not rewritten and is ready to be merged :-D
Now detect the wordpress website very easily :-)

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 6, 2018

I fixed that problem adding:

 location /xhgui/ {
        try_files $uri $uri/ /xhgui/webroot/index.php?$args;
        include        /etc/nginx/fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME         $document_root$fastcgi_script_name;
        fastcgi_pass   php;
        fastcgi_index  index.php;
    }

to /etc/nginx/default.conf but I am not sure if it is the right way.

Show resolved Hide resolved tideways/provision.sh Outdated
Show resolved Hide resolved tideways/provision.sh Outdated
Show resolved Hide resolved tideways/vvv-header.php Outdated
Show resolved Hide resolved tideways/provision.sh

@tomjn tomjn added the enhancement label Jul 6, 2018

@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jul 6, 2018

For Nginx, you can insert the nginx config as a new file directly inside the VM, it might get destroyed if the VM is recreated but that's what the provision.sh is there for :)

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jul 6, 2018

I had problems on adding a new nginx file because I was trying to add a port to access to xhgui without success.
Now with adding stuff to that nginx file seems that everything works without problems.
I am not sure about what is the best way to add tools in VVV.

@tomjn tomjn referenced this pull request Jan 14, 2019

Merged

Support the Tideways subdomain addition to hosts #1711

4 of 4 tasks complete

tomjn added some commits Jan 14, 2019

Show resolved Hide resolved tideways/provision.sh Outdated
@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jan 15, 2019

I had issues checking this out on an existing install with the test instructions provided, so I did it naming it as a new utility source:

utilities:
  core: # The core VVV utility
    - memcached-admin # Object cache management
    - opcache-status # opcache management
    - phpmyadmin # Web based database client
    - webgrind # PHP Debugging
    - trusted-hosts # GitHub etc
    - tls-ca # SSL/TLS certificates
  mte90:
    - tideways
    #- php56
    #- php70
    #- php71
    #- php72
    #- php73

utility-sources:
    mte90:
      repo: https://github.com/mte90/vvv-utilities.git
      branch: xhgui-tideways
@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jan 15, 2019

Testing failed to provision, here's the log:

https://gist.github.com/tomjn/194136e3ecbe693cf1749c4622ea00a3

Fixed the DIR variable, the 0 parameter is always what was being ran,…
… hence this script, so use dirname, pwd lead to errors with /home/vagrant being the folder
@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jan 15, 2019

Once that's done, the following command will update the utility:

vagrant provision --provision-with=utility-source-mte90

and this one will run it:

vagrant provision --provision-with=utility-mte90-tideways
@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jan 15, 2019

@Mte90 So some notes:

  • A change to the vagrant file is needed, it seems the hostsupdater aliases is set before the utility modifies the hosts array, super easy fix but meh I wish it'd been found before the 2.5.1 release ( see Varying-Vagrant-Vagrants/VVV#1719 )
  • It always adds the apt-key even if it's already been added
  • The apt-key should be added from a file not a keyserver, so that it doesn't rely on the network. This has been an issue in the past, which is why all the keys got put in a subfolder of provision for VVV core
  • Installation of tideways and mongodb only happen if the UI has not been cloned into /srv/www/default/xhgui, so if the git clone works, but installation fails, the whole thing gets stuck, these need logically separating
  • The mongodb install routine needs to check if mongodb is already installed, perhaps something similar to this?
if [[ ! `command -v mongo` ]]; then
    install_mongodb
fi
echo "Installing Tideways & XHgui"
etc..

The main VVV provisioner can take care of updating the mongodb package

@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jan 15, 2019

Also, I got the UI working at tideways.vvv.test but none of the sites worked, so I did a vagrant provision which fixed the sites but broke the Tideways UI. Yet after all of that, it worked just fine at http://vvv.test/xhgui/webroot/

PHP Info indicated that the tideways_xhprof extension was loaded, but I wasn't sure how to get it to profile anything

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jan 15, 2019

I will check everything during the week.
Thanks for the fix and the feedback!

done

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jan 18, 2019

I am testing it but to let tideways to track the page the code is on https://github.com/Varying-Vagrant-Vagrants/vvv-utilities/pull/18/files#diff-a4760a2906d5dcb4b4d5060091055b8f
The url of the page require to add a parameter in get like demo.test/?enable-tideways=1 in that way tideways execute the profile, like for xDebug.

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jan 18, 2019

vagrant provision --provision-with=utility-mte90-tideways
This command for me is not executing the provision for that utilities.

@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jan 18, 2019

This command for me is not executing the provision for that utilities.

Is your vvv-custom.yml set up the same as mine with a utility source named mte90? If it's still how you originally had it replacing core then it would be utility-core-tideways

@tomjn

This comment has been minimized.

Copy link
Member

tomjn commented Jan 18, 2019

also now I see why you chose xhgui.vvv.test instead of tideways.vvv.test, might be worth switching it back

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jan 18, 2019

I added like your vvv-custom.yml but I will try on another pc.
For the other point of the domain I think that right now is better tp have everything works and later we can evaluate what is the best domain to avoid a lot of changes.

Show resolved Hide resolved tideways/provision.sh Outdated
Show resolved Hide resolved tideways/provision.sh Outdated
@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jan 18, 2019

I am testing but seems that mongodb is running but xhgui cannot connect to that.
I will do other tests in the next days but seems that now the installation works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment