OXID VM & SDK
WHO'S TALKING? Edvinas Aleksejonokas Member of OXID core team Joined two years ago
WHO'S TALKING? HONESTLY... A person who was really feed up by the fact that: Everyone had their own dev-env Everyone had their own set of problems "It runs on my machine" was the attitude ATM Later I understood that I'm not the only one who had problems with these facts
REASONING
WHY? #1 Very developer-centric: From Developers By Developers For Developers
WHY? #2 Encapsulated/OS agnostic solution Easy kick-start for new developers Common work-flow for everyone No more "It works on my machine!" Have same problems to solve/collaborate
QUICK START
HOW TO GET? git clone --recursive https://github.com/oxid-esales/oxvm_eshop.git --recursive details later
cd oxvm_eshop vagrant up HOW TO RUN?
HOW TO CHECK? open www.oxideshop.dev in browser or (for the terminal addicted ones): curl www.oxideshop.dev -I grep HTTP HTTP/1.1 200 OK
VISUAL GUIDE
Optional
WHAT'S INCLUDED?
Ubuntu 14.04 LTS subsystem Apache 2.4.7 MySQL 5.5.46 PHP 5.5.9
These are the safe default versions, feel free to experiment with newer stuff!
OXID ESHOP Latest CE edition directly from master branch Feel free to use your own PE/EE/Encoded/Patched version
OXID SDK OXID-eSales/testing_library OXID-eSales/module_skeleton_generator OXID-eSales/module_certification_tools More details later
Base php 5.5.9 Ubuntu package phpbrew/phpbrew XDebug
Base MySQL 5.5.46 Ubuntu package vrana/adminer
composer itself hirak/prestissimo
EMAIL BACKEND mailhog/mailhog sendmail integrated with mailhog
Selenium 2.47 Firefox 31 Ubuntu package Base Ubuntu packages:
xfce4 xvfb x11vnc openjdk-7-jre-headless
Varnish 4.0.3
IonCube 5.1.2
WHAT'S NEXT?
THINGS TO DO! Try out any recent OXID eshop version Try out our SDK components Use VM for OXID eshop project development Create/Develop/Test OXID eshop module Create experiments and prototypes
HOW TO CONFIG?
Type some YAML into personal.yml file!
CHANGE ESHOP VERSION eshop: source: version: b-5.3-ce It takes master by default
php: version: 7 CHANGE PHP VERSION
vagrant_local: vm: provider: lxc CHANGE VM PROVIDER Virtualbox, parallels, vmware and lxc
CHANGE SHARED FOLDER vagrant_local: vm: app_shared_folder: source: /home/oxid/documents/projects/eshop target: /var/www/eshop eshop_target_path: /var/www/eshop
USE NFS WITH SHARED FOLDER vagrant_local: vm: app_shared_folder: sync_type: nfs Use sync_type: ~ to get default for provider
CHANGE VIRTUAL HOST vagrant_local: vm: aliases: - www.myproject.dev
varnish: install: true ENABLE VARNISH
selenium: install: true ENABLE SELENIUM
php: ioncube: install: true ENABLE IONCUBE
CHANGE OS PACKAGES MIRROR server: apt_mirror: http://de.archive.ubuntu.com/ubuntu/
ADD CUSTOM PACKAGES server: personal_packages: - vim - htop - mc
PLETHORA OF CONFIG OPTIONS --- vagrant_local: vm: name: ce-410 provider: lxc base_box: ubuntu/trusty64 hostname: ce-410.dev aliases: - www.ce-410.dev ip: 192.168.123.2 memory: '512' cpus: 1 app_shared_folder: source: oxideshop target: "/var/www/oxideshop" sync_type: nfs owner: vagrant
STRUCTURE
REPOSITORIES OXID-eSales/oxvm_base LAMP, phpbrew, composer, xdebug, varnish, ioncube, adminer, mailhog... OXID-eSales/oxvm_eshop OXID eshop, SDK, selenium, varnish integration OXID-eSales/oxvm_assets Large files/binaries needed for VM
REPOSITORY SUB-MODULES \oxvm_eshop -... - base_vm -> oxvm_base Main reason why --recursive flag is used during the checkout of oxvm_eshop repository
DEFAULT CONFIGURATION VALUES oxvm_base/ansible/vars/default.yml php: install: true... oxvm_eshop/ansible/vars/oxideshop.yml eshop: config: utf_mode: 0...
ROLES ENTRY POINT oxvm_base/ansible/roles/ apache php varnish ioncube... oxvm_eshop/ansible/roles/ ox_eshop ox_selenium
ROLE TASK STRUCTURE ansible/roles/varnish/tasks/ (Just an example): main.yml (Mandatory requirement by Ansible) install.yml uninstall.yml
MERGE ORDER OF CONFIGURATION VALUES [BASE VM] oxvm_base/ansible/playbook.yml: Inherited vars/default.yml Configurable ~/.personal_ansible_vm.yml../personal.yml
MERGE ORDER OF CONFIGURATION VALUES [OXID VM] oxvm_eshop/ansible/oxid.yml: Inherited../base_vm/ansible/vars/default.yml vars/oxideshop.yml Configurable ~/.personal_ansible_vm.yml../personal.yml
SDK
ATM THREE ITEMS Module skeleton generator Module certification tools Testing library
MODULE SKELETON GENERATOR A module which is installed by default It needs to be activated manually! Use it to create new modules
VISUAL GUIDE
MODULE CERTIFICATION TOOLS Generates code quality metrics Rough estimation of price for module certification Invocation: ox_cert <vendor_name>/<module_name>
TESTING LIBRARY Collection of tools for testing: reset-shop runmetrics runtests runtests-coverage runtests-selenium
UNIT/INTEGRATION TESTS
REMINDER Don't forget to run tests before suggesting a PR
RECENT CHANGES
NEW STUFF Ubuntu 16.04 LTS support (LXC) Ansible 2.0 support Integration of IonCube prestissimo (composer) adminer config command for vagrant
CHANGES BindFS transferred to Provision part (ansible) Default backingstorage was specified (for LXC) display_errors are turned on by default
FIXES sync_type reference (for NFS) Force-less umount (for LXC)
TIPS & TRICKS
IN CASE OF PROBLEMS 95% of time blame the configuration Use new vagrant command: vagrant config This will allow to see the merged YAML configuration
SAVE TIME WITH BOX PACKAGES Use vagrant command vagrant package to produce box packages Use that box via personal.yml configuration --- vagrant_local: vm: base_box: cache.box
USE NFS Sync type Native NFS Shared folder Speed 2200 MBytes/s 320 MBytes/s 10 MBytes/s
AVOID VIRTUALBOX Use proprietary hypervisor Don't use emulated hardware
USE LXC Use it by default if you're host has a linux kernel Use it inside a hypervisor if you're planning to use several VM instances You can look at an example: rezonanc-oxid/lxc-box
PROVIDE GITHUB TOKEN --- php: composer: github_token: example_secret_token
USE LOCAL REPOSITORIES/MIRRORS --- php: phpbrew: cache: repo: http://my_custom_mirror/ composer: installer_url: http://my_custom_mirror/ mailhog: pkg_url: http://my_custom_mirror/... Reduce the provision time down-to 1 minute
USE BASE VM FOR OTHER PROJECTS Fork it Improve/Hack it Use it for your own projects: Django Rails Node.js...
FUTURE VISION
QUESTIONS/FEEDBACK
RELATED QUESTIONS?
ANY NON-RELATED QUESTIONS?
POSITIVE FEEDBACK? :)
NEGATIVE??? :/
THANK YOU!