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

[WIP] Rewritten vagrant configuration #68

Merged
merged 3 commits into from
Sep 30, 2013

Conversation

norberttech
Copy link
Contributor

At the moment it is not possible to use vagrant because of #36, missing app/bootstrap.php.cache file and few others smaller issues.
I decided to use puppet in hope that such change is not a problem. Chef syntax is completly unreadable and unfriendly for me :P

@pjedrzejewski
Copy link
Member

Cool! I'm not familiar with Chef nor Puppet. So if anyone can help with reviewing this - that would be great! Thanks Norbert!

@Eponymi
Copy link
Contributor

Eponymi commented May 14, 2013

I'd like to jump into this discussion.

Chef vs. Puppet

I support using Chef for selfish reasons; I have more experience with Chef. But I also believe Chef is a much stronger utility, because Chef is pure Ruby, whereas Puppet has a special Puppet Configuration Language. People who know Ruby can jump right in. Further, while I'm admittedly ignorant on the php presence in the Puppet community, I know that there is good stuff happening for PHP in Chef (https://github.com/jolicode/chef-cookbook-php?source=c).

DevOps Approach

I've also been working on cleaning up the DevOps setup for my personal use. I'm using subtrees to separate the development and system administration concerns. (https://github.com/Eponymi/sylius-sys for sysadmin, https://github.com/Eponymi/sylius-proj for dev, then a "main" repo that bridges between the two). It is very, very messy right now, but I've put a lot of thought into it and I think it's got the makings of a great DevOps tool for any Symfony/Composer/Capifony setup.

Not only does the separation of concerns feel like "good practice", but it also enables you to have a shared folder on your local development machine that doesn't have any sysadmin stuff in it. Instead of a "/mnt/sylius" directory, you just share the host "proj/" directory with VM "/var/www" (or any web directory) and setup a vhost for Apache. No special ignore rules for Capifony, no duplication of files in the web directory of your VM; the list goes on for the separation/subtree approach.

Additionally, my efforts have been towards abstraction, so that integration with a different database engine or webserver would be trivial, and hosting concerns like portability and remote node management are trivial.

@norberttech
Copy link
Contributor Author

Changed sylius::run class to prevent executing database create command after each vagrant reload.
Added note into vagrant/Readme.md about how to run tests at virtual machine.

@norberttech
Copy link
Contributor Author

@pjedrzejewski I have made some improvements to this PR. I consider it as a finished :P What do you think about it?

@pjedrzejewski
Copy link
Member

Thanks Norbert! To be honest I'm not an expert in terms of Chef vs. Puppet, so I'd like to hear other opinions. I know that previous configuration had some little issues, so if your is working, that's for sure a big 👍. :)

Ping @jakzal - I remember you have worked with puppet & Symfony - what do you think?

@jakzal
Copy link
Contributor

jakzal commented May 19, 2013

@pjedrzejewski I'll review it tomorrow. Tell me one thing though. Why do you need a vagrant config? That's important to know to review it properly. Is the aim to have a consistent development environment or make starting with Sylius easier for newcomers? :)

@dyjo
Copy link

dyjo commented May 23, 2013

@jakzal not sure what maintainers' intentions are, but I'd answer your question by saying "both."

I'd like to have a config for devs to easily get started with a consistent environment (clone it, vagrant up). I'm also trying to use Vagrant + Chef for launching and provisioning production machines (using vagrant-aws and vagrant-rackspace plugins).

@pjedrzejewski
Copy link
Member

@dyjo @jakzal Exactly what you said, clone, vagrant up, enjoy. :)

@dyjo
Copy link

dyjo commented May 23, 2013

One point of concern though (and it's really tiny). It'd be nice to have some automation for creating and installing fixtures for test/dev when generating a sylius development environment. Don't know if it should be handled with a composer post-install script, resources within provisioning, or something else. But I do know it would get us closer to "install and go" for development environment.

@amenophis
Copy link
Contributor

I got a more or less working vagrant that I reuse for each project. Debian 7.0 based.
Configuration is done by puppet. (Apache, php 5.5 via dotdeb, mysql, phpmyadmin)

Do you want a PR for this vagrant configured for sylius application ?

@norberttech
Copy link
Contributor Author

@pjedrzejewski is there any decision about vagrant? Should I update this PR?

@ghost
Copy link

ghost commented Aug 14, 2013

I'm wondering if we should find some way to work with jtreminio and get this added as a puphpet configuration.

@pjedrzejewski
Copy link
Member

@norzechowicz As the current Chef configuration is not working properly, I'm 👍 for using puppet. Please update the PR when you find some time, I'll merge it. Thanks! :)

@marcospassos
Copy link
Contributor

Currently, I'm generating my Vagrant files using https://puphpet.com/, that works pretty well and is easy to update and extend.

@norberttech
Copy link
Contributor Author

@marcospassos https://puphpet.com/ generate ~2mb of files and I am not sure about adding them into sylius repo. Maybe we should think about devops repository for sylius based on configuration generated by https://puphpet.com/ ? @pjedrzejewski what do you think?

@amenophis
Copy link
Contributor

@marcospassos How do you upgrade your box configuration with puphpet ?

@marcospassos
Copy link
Contributor

I just edit the manifest file.

@pjedrzejewski
Copy link
Member

@norzechowicz @Djuki Can we somehow merge our efforts towards working vagrant setup? 👍 (https://github.com/Djuki/sylius-vagrant)

@Djuki
Copy link

Djuki commented Sep 25, 2013

@pjedrzejewski I wanted to test how MongoDB server works with Sylius. Jets chat on #sylius-dev :)

I will send you PR soon.

@norberttech
Copy link
Contributor Author

It looks like https://github.com/Djuki/sylius-vagrant is something more than stack of dev tools, its full environment that even clone Sylius for you.
IMHO https://github.com/vagrantee/sandbox-symfony or https://github.com/fsi-open/vagrant-box are better choice.

@Djuki
Copy link

Djuki commented Sep 25, 2013

@norzechowicz I will create PR that don't clone Sylius because there is no need for it. It will be in Sylius repo already.

@Djuki
Copy link

Djuki commented Sep 25, 2013

@norzechowicz @pjedrzejewski Sylius need specific vagrant because of mongodb extension, and mongodb server, and few php libraryes.

sandbox-symofiny is build on puppet not chef. I can try make this vagrant works as sandbox-symfony. (Speed up cache for dev)

Also we need to use 64bit VM because Mongo have it's limits on 32bit machines.
http://blog.mongodb.org/post/137788967/32-bit-limitations

Your second choice have:
-Xdebug
-Java
-Selenium
-Firefox24

I do not think that Sylius need this. sandbox symfony remove xdebug to improve speed. I think you should set list of components you need, and we can create them in chef. I am familiar with puppet too, but it looks like you chose chef to go with.

@norberttech
Copy link
Contributor Author

@Djuki additional selenium software is installed only if you change $install_selenium variable value in default.pp manifest (this is disabled by default configuration).
I just dont get why mongo must be installed? Is there anything in sylius that require mongo to work with sylius as a developer?

@Djuki
Copy link

Djuki commented Sep 25, 2013

@norzechowicz I am still novice in Sylius but I see that sylius Require mongo php extension, and that some bundles can work with mongo collections. To work with mongodb mongo server is required. I think that as sylius dev you will need mongo server at some point for sure.

I just think that is much better that Sylius build environment for self then use other over-builded vagrants.

I am very agree with symofny-sandbox approach and we should build vagrant with speed up features. But once when Sylius chose chef for provision we should stick with chef.

As I said I am new in Sylius and I have to learn more about this application, so I will do as you and @pjedrzejewski suggest.

@norberttech
Copy link
Contributor Author

@Djuki actually I choose puppet (not chef) because I think that syntax is more readable for somebody who dont know both tools (and beacuse I know it better than chef :P).
Give me few hours I will update this PR with better vagrant configuration.

@Djuki
Copy link

Djuki commented Sep 25, 2013

@norzechowicz ok. If you go with puppet you should use symfony-sandbox speed up options. I also work with puppet, so if I can help ping me.

@norberttech
Copy link
Contributor Author

PR is updated but this is still WIP, I must check why test are failing. @Djuki @pjedrzejewski what do you think guys about using submodules?

@Djuki
Copy link

Djuki commented Sep 26, 2013

@norzechowicz I have nothing against using submodules.

@stloyd
Copy link
Contributor

stloyd commented Sep 26, 2013

I would say that this can be a little bit problematic (git modules) as to setup vagrant you would need to call git that would download all the stuff (i.e. errors with travis, btw. @norzechowicz you should probably use http urls not git ones there) to be able to use it.

@norberttech
Copy link
Contributor Author

@stloyd right, http urls woudl be better 👍 anyway I think that vagrant configuration can be separated into standalone repo.

@norberttech
Copy link
Contributor Author

Its green ;)

@norberttech
Copy link
Contributor Author

@pjedrzejewski any decisions about this PR? It would be nice to not leave it for another few months :P

@pjedrzejewski
Copy link
Member

I'll be happy to merge it, but it seems that the change to logs and cache paths (kernel) broke the build on travis. It tries to use the /shm.

@norberttech
Copy link
Contributor Author

My bad, sorry I thought it is good becuase there is a green success ico at last commit. Anyway now its green and all tests pass

pjedrzejewski pushed a commit that referenced this pull request Sep 30, 2013
[WIP] Rewritten vagrant configuration
@pjedrzejewski pjedrzejewski merged commit 41ca1ea into Sylius:master Sep 30, 2013
@pjedrzejewski
Copy link
Member

Great, thanks for your work Norbert. I think there is some more work to do in the Vagrant support area (like moving the whole config to another repo, maybe, not sure about that yet), but its great to have a working solution now. Kudos!

@Djuki
Copy link

Djuki commented Sep 30, 2013

@norzechowicz What is a password for MySQL root user ? You can update Readme with this information.

Now I see it is empty string .. ok :)

I think you should add phpmyadmin, what do you think ?

@norberttech
Copy link
Contributor Author

@Djuki its empty just like in parameters.yml.dist file so you dont have to change anything during composer installation.
Personally I prefer console for mysql but if this is what community want, why not :)

@ManInTheBox
Copy link

i think there's no need for having phpmyadmin here as its fairly simple to configure it from host machine ;P
but if people want it, why not like you said @norzechowicz ? :)
anyways thanks guys, good work!
🍰

@stloyd stloyd mentioned this pull request Oct 15, 2013
CoderMaggie pushed a commit to CoderMaggie/Sylius that referenced this pull request Jun 1, 2016
[CJMAX-59] Changed logic to depend on taxon's code instead of name
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.

None yet

10 participants