Vagrant for real codemotion (moar tips! ;-))
-
Upload
michele-orselli -
Category
Software
-
view
671 -
download
3
Transcript of Vagrant for real codemotion (moar tips! ;-))
![Page 1: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/1.jpg)
Vagrant for Real
Michele OrselliCTOIdeato
_orso_
micheleorselli ideatosrl
moideatoit
httpmitchellhcomthe-tao-of-vagrant
1) clone repo
2) vagrant up
3) therersquos no 3
1) clone repo
2) vagrant up
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 2: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/2.jpg)
Michele OrselliCTOIdeato
_orso_
micheleorselli ideatosrl
moideatoit
httpmitchellhcomthe-tao-of-vagrant
1) clone repo
2) vagrant up
3) therersquos no 3
1) clone repo
2) vagrant up
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 3: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/3.jpg)
httpmitchellhcomthe-tao-of-vagrant
1) clone repo
2) vagrant up
3) therersquos no 3
1) clone repo
2) vagrant up
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 4: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/4.jpg)
1) clone repo
2) vagrant up
3) therersquos no 3
1) clone repo
2) vagrant up
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 5: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/5.jpg)
1) clone repo
2) vagrant up
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 6: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/6.jpg)
tips
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 7: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/7.jpg)
vagrantfile configs vm performance
app config tips provisionpackaging
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 8: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/8.jpg)
Portable configuration tips
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 9: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/9.jpg)
Donrsquot use local names for your boxes
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 10: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/10.jpg)
cvmbox = hashicorpprecise64
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 11: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/11.jpg)
cvmbox_url = httpyour_box
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 12: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/12.jpg)
Avoid absolute paths
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 13: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/13.jpg)
cvmsynced_folder ldquomyProjvarwwwmyProj
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 14: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/14.jpg)
configvmsynced_folder varwwwmyProj
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 15: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/15.jpg)
Move host specific configuration outside
Vagrantfile
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 16: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/16.jpg)
ram 2048 cpus 2 ipaddress 10101010
vagrantfile-local-configyml
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 17: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/17.jpg)
require lsquoyaml
_config = YAMLload(Fileopen(Filejoin(Filedirname(__FILE__) ldquovagrantfile-local-configymlrdquo) FileRDONLY)read) CONF = _config
configvmprovider virtualbox do |vb| vbcustomize[modifyvmidldquo--memory CONF[ram]] vbcustomize [modifyvmid--cpus CONF[ldquocpus]] hellip end
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 18: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/18.jpg)
As rule of thumb you could assign the half cpus and a quarter of the memory based on your host machine
httpsstefanwrobelcomhow-to-make-vagrant-performance-not-suck
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 19: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/19.jpg)
Force a specific provider
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 20: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/20.jpg)
ENV[VAGRANT_DEFAULT_PROVIDER] = virtualbox
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 21: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/21.jpg)
Support multiple providers
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 22: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/22.jpg)
configvmprovider virtualbox do |vb| vbcustomize [modifyvmid --memory CONF[ram]] vbcustomize [modifyvmid --cpus CONF[cpus]] end configvmprovider vmware_fusion do |v| vvmx[memsize] = CONF[ram] vvmx[numvcpus] = CONF[cpus] end
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 23: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/23.jpg)
Projectrsquos directories organization
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 24: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/24.jpg)
myproject -- hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquordquordquovarwwwmyproject
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 25: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/25.jpg)
myproject -- project --hellip -- vagrant -- Vagrantfile
single git repository
cvmsynced_folder ldquoprojectrdquordquovarwwwprojectrdquo
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 26: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/26.jpg)
myproject -- vagrant -- www -- project1 -- project2 -- Vagrantfile
singlemultiple git repositories
cvmsynced_folder ldquowwwrdquordquovarwwwrdquo
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 27: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/27.jpg)
vagrant plugin install HostsUpdater
(or HostManager)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 28: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/28.jpg)
etchosts
10101040 host1lo VAGRANT e2bca7c8bf6d76cbcf6ee48998c16f
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 29: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/29.jpg)
if Vagranthas_plugin(HostsUpdater) confighostsupdateraliases = [host1lo] else puts --- WARNING --- puts ldquoYou should install HostsUpdaterrdquo end
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 30: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/30.jpg)
Multi-VM Configuration
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 31: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/31.jpg)
configvmdefine web do |web| webvmnetwork private_network ip 10002 webvmprovider virtualbox do |v| vcustomize [modifyvm id --memory 2048] end webvmsynced_folder ldquovarwww end configvmdefine db do |db| dbvmnetwork private_network ip 10003 dbvmprovision shell path =gt vagrantdbsh end
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 32: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/32.jpg)
Dealing with shared folders
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 33: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/33.jpg)
no share
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 34: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/34.jpg)
native share- slow - os indipendent-ish
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 35: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/35.jpg)
nfs- fast - win support -(
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 36: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/36.jpg)
rsync- no real share - update
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 37: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/37.jpg)
VM Performance
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 38: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/38.jpg)
run testshellip
still runninghellip
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 39: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/39.jpg)
mitchellhcomcomparing-filesystem-performance-in-virtual-machines
Virtualbox vs VmWare
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 40: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/40.jpg)
Virtualbox 22 min
VmWare 15 min
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 41: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/41.jpg)
Virtualbox 22 mi
VmWare 15 min+30
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 42: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/42.jpg)
use VmWare if you can(it will cost you a few $)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 43: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/43.jpg)
use nfs if you can
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 44: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/44.jpg)
vagrant plugin install vbguest
keeps guest addition updated
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 45: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/45.jpg)
unless Vagranthas_plugin(ldquovagrant-vbguest) raise rdquoplease install vagrant-vbguestrdquo end
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 46: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/46.jpg)
On VM IO is the bottleneck
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 47: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/47.jpg)
loading webpages running testsuites are READ heavy
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 48: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/48.jpg)
move IO outside shared folders
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 49: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/49.jpg)
Default provider virtualbox
3 PHP test suites with unit functional integration mix
small (sf1) build runs in ~25 sec
medium (zf2) build runs in ~2 mins
large (sf2) build runs ~ 20 mins
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 50: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/50.jpg)
IO logs cache
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 51: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/51.jpg)
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 52: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/52.jpg)
class AppKernel extends Kernel public function getCacheDir() if (in_array($this-gtenvironment array(dev test))) return devshmappnamecache $this-gtenvironment
return parentgetCacheDir()
public function getLogDir() if (in_array($this-gtenvironment array(dev lsquotest))) return devshmappnamelogs
return parentgetLogDir()
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 53: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/53.jpg)
class public function
public function
+13-16
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 54: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/54.jpg)
IO increase realpath cache
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 55: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/55.jpg)
realpath_cache_size = 4096k realpath_cache_ttl = 7200
phpini
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 56: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/56.jpg)
realpath_cache_size realpath_cache_ttl
phpini
+7
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 57: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/57.jpg)
IO move DB on RAMif you use sqlite move it on devshm
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 58: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/58.jpg)
vagrant plugin install vagrantcachier
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 59: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/59.jpg)
if Vagranthas_plugin(vagrant-cachier) configcachescope = box
configcachesynced_folder_opts = type nfs mount_options [rwvers=3tcpnolock] end
Vagrantfile
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 60: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/60.jpg)
if
configcachesynced_folder_opts type mount_options [ end
Vagrantfile
+30for reprovisioning a box with git php apache mysql
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 61: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/61.jpg)
use cachefilesd for nfs
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 62: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/62.jpg)
- name Install cachefilesd apt pkg=cachefilesd state=present
- name Enable cachefilesd lineinfile dest=etcdefaultcachefilesd line=ldquoRUN=yesrdquo
- name Start cachefilesd service service name=cachefilesd state=restarted
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 63: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/63.jpg)
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [rwvers=3tcpfsc]
Vagrantfile
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 64: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/64.jpg)
configvmsynced_folder mount_options [
Vagrantfile
-15+10
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 65: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/65.jpg)
should you trust these numbers
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 66: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/66.jpg)
Application Management
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 67: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/67.jpg)
How to access mysql
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 68: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/68.jpg)
- name add mysql user mysql_user name=ideato host= password=ideato priv=ALLGRANT login_user=root login_password=
- name config bind address to allow remote remote connections lineinfile dest=etcmysqlmycnf state=present regexp=bind-address = 127001 line=bind-address = 0000 backup=yes
- name restart mysql service name=mysql state=restarted
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 69: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/69.jpg)
- name Install phpmyadmin apt pkg=phpmyadmin state=present
- name Include phpmyadmin in Apache config lineinfile dest=etcapache2apache2conf line=Include etcphpmyadmin apacheconf notify restart apache
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 70: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/70.jpg)
- name adminer clone git repo=httpsgithubcomvranaadminergit dest=varwwwadminer version=v421 accept_hostkey=true
- name adminer compile command php compilephp chdir=varwwwadminer creates=varwwwadmineradminer-421php
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 71: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/71.jpg)
Permissions management in shared folders
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 72: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/72.jpg)
configvmsynced_folder varwww id vagrant-root owner vagrant group vagrant mount_options [dmode=777fmode=777]
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 73: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/73.jpg)
Use host ssh keys
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 74: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/74.jpg)
configsshforward_agent = true
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 75: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/75.jpg)
ForwardAgent yes
check ssh config file in your host machine
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 76: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/76.jpg)
gruntgulp watch
httpwwwsebastien-hanfrblog20121218noac-performance-impact-on-web-applications
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 77: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/77.jpg)
configvmsynced_folder varwww id ldquovagrant-rootrdquo type ldquonfsrdquo mount_options [lsquorwrsquovers=3tcpfsc actimeo=1]
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 78: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/78.jpg)
Provisioning
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 79: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/79.jpg)
to phansible or not to phansible
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 80: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/80.jpg)
quick and easy way to start
theyrsquore general
old platforms are not supported
a lot of a good ideas you can steal from
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 81: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/81.jpg)
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 82: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/82.jpg)
can you assume everyone in your team have the same version
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 83: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/83.jpg)
if which(ansible-playbook) configvmprovision ansible do |ansible| ansibleplaybook = ansibleplaybookyml ansibleinventory_path = ansibleinventoriesdev ansiblelimit = all ansibleextra_vars = private_interface 1921683399 hostname default end else configvmprovision shell path ansiblewindowssh args [default] end
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 84: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/84.jpg)
the provisioning tool is a moving part wanna update be careful
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 85: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/85.jpg)
create Vagrant indipendent provision
scripts
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 86: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/86.jpg)
configvmprovision shell path =gt scriptsbootstrapsh args =gt varwww
configvmprovision shell path =gt ldquoscriptsprovisionsh args =gt varwww
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 87: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/87.jpg)
create your own template
httpsgithubcomideatosrlvagrant-php-template
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 88: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/88.jpg)
yoursquore in control of provisioning command
you can perform additional checks on host machine
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 89: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/89.jpg)
Distributing VMs
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 90: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/90.jpg)
provisioning does not create immutable vm by default
eg package update on LTS
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 91: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/91.jpg)
live on the edge and fix provision script
use stable package repositories
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 92: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/92.jpg)
httpsspeakerdeckcommitchellhvagrant-usage-patterns
Create and distribute your own VM
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 93: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/93.jpg)
Golden image
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 94: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/94.jpg)
vagrant package - -name myboxbox
publish it somewhere (http atlas)
cvmbox_url = ldquohttpmyboxboxrdquo
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 95: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/95.jpg)
Keep it simple
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit
![Page 96: Vagrant for real codemotion (moar tips! ;-))](https://reader031.fdocuments.in/reader031/viewer/2022030312/58edadb31a28aba22a8b46c3/html5/thumbnails/96.jpg)
Thank youhttpsjoindin16312
_orso_
micheleorselli ideatosrl
moideatoit