ä»æ¥ã¯ãæ°ããParallels Desktop 10ã®æ©èœã®1ã€ã§ãããéçºè ãŠãŒã¶ãŒããæãå€ãã®è³ªåãšãã£ãŒãããã¯ãåããVagrantãšã®çµ±åã«ã€ããŠã話ããŸãã æ£çŽãªãšãããããã¯Parallels Desktopã®éçºè èªèº«ã«ãšã£ãŠæããæ°ã«å ¥ãã®æ©èœã®1ã€ã§ãã
Webéçºã§Vagrantãå¿ èŠãªçç±ããŸã åãããªãå ŽåããŸãã¯Vagrantã®åºç€ãšããŠMacã§VirtualBoxä»®æ³ãã·ã³ã䜿çšããŠããå Žåã¯ã次ã®ãšããã§ãã
ããŒã¿ããŒã¹ããæ°ã«å ¥ãã®ãã¬ãŒã ã¯ãŒã¯ãnginxãredisãªã©ãäœæ¥ãã·ã³ã«Webéçºç°å¢ããããã€ããããšããããšãããå Žåãããããã»ããã¢ããããµã€ãã®åäœãšã¯éåžžã«ç°ãªããšããäºå®ã«åºããããŸããçç£äžã 䜿çšãããŠããããã±ãŒãžã®ããŒãžã§ã³ã¯äžèŽãããäžéšã¯OSã§ãŸã£ããé ä¿¡ã§ããªãããã代æ¿åãæ¢ãå¿ èŠããããŸãã
1ã€ã®æ¹æ³ã¯ãä»®æ³ãã·ã³ã®ç°å¢ãäžããããšã§ãããããã¯åžæã©ããã«ã¯æ©èœããŸãããä»®æ³ãµãŒããŒãå²ãåœãŠãå Žåãšã»ãŒåãæ¹æ³ã§ããã¹ãŠãæåã§è¡ãå¿ èŠããããŸãã
Parallelsã§ã¯ãçŽ1幎åã«ç€Ÿå éçºããŒã ãæ¡å€§ãå§ãããšãã«åæ§ã®åé¡ã«çŽé¢ããŸãããããŒã å ã§ç©æ¥µçãªå ±åäœæ¥ã確ç«ããããã«å®éšããå¿ èŠãããããšãæããã«ãªããŸããã ãããŠãããã§ã¯ãã¹ãŠãéåžžã«åçŽã§ããããæè¡ã«ã觊ãããå¿ èŠããããã§ããã ãæ©ããããè¡ãäœè£ããªãå Žåãæ¯æ¥ã®ã¿ã¹ã¯ã®ãã¬ãã·ã£ãŒã®äžã§ã¯æ±ºããŠãããè¡ããŸããã ãããŠãLinuxãšWindowsããã³Macã®äž¡æ¹ã§ãµããŒããããŠããã€ã³ãã©ã¹ãã©ã¯ãã£ããããšããäºå®ã«é¢é£ããç¹ç°æ§ããŸã ãããŸãã ããã«ã€ããŠã¯è©³ãã説æããŸããã ãŠãŒã¹ã±ãŒã¹ã«èå³ããã人ã¯èª°ã§ããããã«é¢ããã¬ããŒããããããªãèŠãããšãã§ããŸãã
ãœãªã¥ãŒã·ã§ã³ã®æ€çŽ¢ã¯ã Vagrantã«ã€ãªãããŸããã ããã¯ãã³ãã³ãã©ã€ã³ã€ã³ã¿ãŒãã§ã€ã¹ãåããUNIXåããŠãŒãã£ãªãã£ã§ãã æäœã®åçã¯éåžžã«ç°¡åã§ããå¿ èŠãªä»®æ³ãã·ã³ïŒããã»ããµã³ã¢ã®æ°ãã¡ã¢ãªãµã€ãºããã£ã¹ã¯ãµã€ãºãOSãã£ã¹ããªãã¥ãŒã·ã§ã³ãªã©ïŒã説æããããã¹ããã¡ã€ã«ããããŸãã ãã®ãã¡ã€ã«ã«åºã¥ããŠãvagrant upã³ãã³ããå ¥åãããšãæ°ããä»®æ³ãã·ã³ãäœæããã䜿çšå¯èœãªç¶æ ã«ãªããŸãã ããã«é²ãã§ãå¿ èŠã«å¿ããŠãä»®æ³ãã·ã³ããæ§æããã¹ã¯ãªããããã®ãã¡ã€ã«ã«æ·»ä»ã§ããŸããMySQLãDjangoãnginxãªã©ãã€ã³ã¹ããŒã«ããŸãã ãŸãããããã¯ãã¹ãŠãæ§ææã«èªåçã«è¡ãããŸãã çµæã«æºè¶³ããŠããããšãç解ãããããããã®ãã¡ã€ã«ãgitã«å ¥ããŠååã«éä¿¡ã§ããŸãã ãã®ç°¡åãªæ¹æ³ã§ãæšæºåãããäœæ¥ç°å¢ãåŸãããŸãã
Vagrantã®ãã1ã€ã®äŸ¿å©ãªããããã£ã¯ããä»®æ³ãã·ã³ãå ã®ã³ãŒãã§äœæ¥ãã£ã¬ã¯ããªãããã¹ãã§ããããšã§ãã ããã«ãããæåã§åæããå¿ èŠããªããªãããã¡ã€ã«ãä¿åãããšããã«ä»®æ³ãã·ã³ã«å³åº§ã«è¡šç€ºããããã©ãŠã¶ã§å€æŽãããã«ç¢ºèªã§ããŸãã
åœæãVagrantã¯VirtualBoxã§ã®ã¿æ©èœããŠããããšããŸãã¯å ã®èè ã®ãã¬ãã¢ã ãã©ã°ã€ã³ã®å©ããåããŠVMwareã«æ¥ç¶ã§ããããšãèšåãã䟡å€ããããŸãã ç§ãã¡ã ãã§ãªãã åžå Žã§ã¯ãã§ã« Macäžã®ã©ã®ä»®æ³åãœãªã¥ãŒã·ã§ã³ãæé©ãšèŠãªããããã決å®ããŠãããããParallels Desktopãšã®ç¬èªã®çµ±åãè¡ãããšã決å®ãããŸããã ãããŠä»ã1幎ã®éçºã®åŸãVagrantçšã®ãªãŒãã³ãã©ã°ã€ã³ããªãªãŒã¹ããŸãããããã®å質ã¯å ¬åŒã®çµ±åã«å£ããŸããã Vagrantã®äœè ã¯ããã¡ãããVMwareãšã®çµ±åã販売ããããšã§ãéã皌ãããã®ã§ãVagrantã®ã¡ã€ã³ããŒãžã«ã¯ç¡æãœãªã¥ãŒã·ã§ã³ãžã®ãªã³ã¯ã¯ä»ã®ãšãããããŸããã ãŸããäžéšã®ãŠãŒã¶ãŒã«ãšã£ãŠã¯ãVagrantã®äžéšã®çµ±åãŸãã¯ãã©ã°ã€ã³ã®ååšããã¥ãŒã¹ã«ãªãå¯èœæ§ããããããParallels DesktopãéããŠVirtualboxãèµ·åããŸãã次ã«ããã®å Žåã®éåžžã«ç°¡åãªæé ã説æããŸãã
䜿çšäŸ
ä»å°ãç·Žç¿ã Macã§LinuxãšDjangoã䜿çšããŠäœæ¥ç°å¢ãæŽããæ¹æ³ã«ã€ããŠèª¬æããŸãã
æåã«ãVagrantãå¿ èŠã§ããVagrantã¯ã å ¬åŒãµã€ã ã Parallels Desktop 10ããã³vagrant-parallelsãã©ã°ã€ã³ããããŠã³ããŒãã§ãã次ã®ããã«ã€ã³ã¹ããŒã«ã§ããŸãã
vagrant plugin install vagrant-parallels
æºåæžã¿ã®ãªããžããªãããŠã³ããŒãããŸãã
git clone https://github.com/Parallels/vagrant-django-example.git cd vagrant-django-example
ãããŠãä»®æ³ãã·ã³ã®æºåãéå§ããŸãã
vagrant up --provider=parallels
ããã»ã¹ãå®äºãããšãæ°åã§ä»®æ³ãã·ã³ãå®å šã«äœ¿çšã§ããç¶æ ã«ãªããŸãã sshã䜿çšããŠå åŽã«ããžã£ã³ããããDjangoãããžã§ã¯ããäœæããã ãã§ãã
vagrant ssh # ( ) django-admin.py startproject vagrant_django . nohup python manage.py runserver [::]:8000 >&/dev/null &
ãã¹ãŠãããã§ä»®æ³ãã·ã³ãçµäºã§ããŸãã
exit
ãã©ãŠã¶ã§httpïŒ// localhostïŒ8000ãæå®ãããšããµã€ãã衚瀺ãããŸãã ãããŠããã®ã³ãŒãã¯ãããªããvagrantãå®è¡ããçŸåšã®ãã©ã«ããŒã§å©çšå¯èœã«ãªããŸãã
ç°å¢ã³ã³ã¹ãã©ã¯ã¿ãŒ
äžèšã§è¡ã£ãããšã¯ã誰ãããœãããŠã§ã¢ã®èšå®æ¹æ³ã説æããVagrantfileãæžãããšãæå³ããŸãã åã«å®éšãããå Žåã¯ãã¹ãŒããŒããŒã±ããã®ããã«ãä»®æ³ãã·ã³æ§æãã³ã³ããŒãã³ãã«ãå ¥åãã§ããåªããPuPHPetãããžã§ã¯ãããããŸãã PuPHPetã¯vagrant-parallelsããµããŒãããŠãããããå¿ èŠãªèšå®ããæ°åã¯ãªãã¯ããã ãã§ãã åºåæã«ããã®ã·ã¹ãã ã¯ãå¿ èŠãªæºåæžã¿ãã¡ã€ã«ãã¹ãŠãå«ãå°ããªã¢ãŒã«ã€ããããŠã³ããŒãããããšãææ¡ããŸãã äžèšã®ããŒã«ä»¥å€ã§äœæ¥ããå¿ èŠã¯ãããŸããã
Vagrantã§ä»ã«ã§ããããš
å®éãVagrantã®é©çšç¯å²ã¯éçºç°å¢ã«éå®ãããŸããã ããšãã°ãèªå® ã§ã¯ãC ++ããã³Objective-Cã§èšè¿°ããããã€ãã£ãã³ã³ããŒãã³ãã®ã¢ã»ã³ããªããã¹ãããããã«äœ¿çšããŸãã ä»ã«ã§ããããšã®äŸïŒ
- çãããœãããŠã§ã¢ãè©Šãå¿ èŠããããŸããïŒ æµ®æµªè ; ã€ã³ã¹ããŒã«æžã¿ã å®éšãã; æŸæµªè ã¯ç Žå£ãã ã
- ç¶ç¶çã€ã³ãã°ã¬ãŒã·ã§ã³ïŒJenkinsããä»®æ³ãã·ã³ãèµ·åãïŒããã«ã€ããŠã¯ã404Festã«ã³ãã¡ã¬ã³ã¹ã§Samaraã§ã¬ããŒããäœæããŸãïŒãã³ã³ããŒãã³ããçµã¿ç«ãŠãŠãããã·ã³ãæãããã¿ãŸã
- Webãããžã§ã¯ãã®ãã¹ããã³ãŒããžã®æ°ããã³ãããã«åŸã£ãŠãVagrantã§æºåãããä»®æ³ãã·ã³ã«ãµã€ããèªåçã«éä¿¡ãããŸãã
- ãã¶ã€ããŒãšQAãšã³ãžãã¢åãã«ãããµã³ãããã¯ã¹ããååŸãã
- ãããŠãã¡ãããChefãPuppetãªã©ã®é«åºŠãªæ§æ管çããŒã«ã䜿çšããŠããå ŽåãVagrantã¯ã¬ã·ããšãããã§ã¹ãã®å€æŽãå®è¡ããå¯äžã®ã¹ããŒããªæ¹æ³ã§ã
ãªã10çªç®ã§ããïŒ
å®éã«ããã§ã«vagrant-parallelsãè©Šãã人ã¯ãParallels Desktop 8ããã³9ã®ããŒãžã§ã³ã§ãã§ã«ããããŠããŸãããªãæçš¿ã§10çªç®ã«ã€ããŠè©±ããŠããã®ã§ããïŒ åœŒå¥³ã®åã¯ããã®ãããžã§ã¯ãã¯GitHubã§ã®ç¡æéçºã§ããã Parallels Desktop 10ã§ã¯ãVagrant Parallels Providerã®ãµããŒããæ£åŒã«çºè¡šãããã ãã§ãªããã¡ã€ã³æ©èœä»¥å€ã®ã»ãŒãã¹ãŠã®æ©èœããµããŒãããŠããŸãã ãããšå ±æãã©ã«ããŒããŒã«ã®äœ¿çšãããã³ãããã¯ãŒã¯ã®åŸ®èª¿æŽã¯ãäžè¬ã«ãéåžžã®ã·ã§ã«ã¹ã¯ãªããã§ã¯VMã§å®è¡ã§ããªãããšã§ãã æåŸã«ãåŸ æã®ããŒããã©ã¯ãŒãã£ã³ã°æ©èœã¯ãã°ã©ãã£ã«ã«ã€ã³ã¿ãŒãã§ã€ã¹ã§ã¯ãªãã 'prlctl'ãŠãŒãã£ãªãã£ãä»ããŠç»å ŽããŸããã ããã«ãããTCPããã³UDPãä»ããŠãMacäžã®ç¹å®ã®ããŒãããä»®æ³ãã·ã³ããŒãã«ããŒã¿ã転éã§ããŸãã ããšãã°ãä»®æ³ãã·ã³ã§WebãµãŒããŒãèµ·åãããããŒã§ããŒã«ã«localhostïŒ8080ãéããŠããã¹ãæžã¿ã®ãµã€ãã«ã¢ã¯ã»ã¹ã§ããŸãã çè«çã«ã¯ã现å¿ã®æ³šæãæã£ãŠã1024æªæºã®ããŒãã転éããããšãã§ããŸãïŒããŒããéãããã»ã¹ã¯Macã§rootãšããŠå®è¡ãããããïŒã
VirtualBoxã¯ã©ãã§ããïŒ
圌ãã¯ãParallels DesktopãšVirtualBoxãåæã«èµ·åããããšã¯ã§ãããäœããã¯ã©ãã·ã¥ããããšãç§ãã¡ã«ããããæžããŸããã å€ãã®ãŠãŒã¶ãŒã«ãšã£ãŠããã¯è°è«ã§ã¯ãããŸããããå ¬å¹³ã«ã¯ãç°ãªããã¯ãããžãŒã«åºã¥ãã2ã€ã®ä»®æ³åã·ã¹ãã ã¯ããŸãæ©èœããŸããã Twitterã§ãã®ãããªåé¡ãæ±ããŠãã人ãç¹ã«æ¢ãã浮浪è ã®é¡äŒŒã䜿çšããããšãæšå¥šããããã«ãªããŸããã çŸåšããã®åé¡ã¯è§£æ±ºãããŠãããäž¡æ¹ã®è£œåãåæã«èµ·åã§ããŸãã Macã®ãªãœãŒã¹ã§èš±å¯ãããŠããå ŽåãæŠéæ©ã®1人ãæ»äº¡ããããšãªããã·ã£ããããŠã³ããã«ãããã«Parallelsã«ã¬ããŒããéä¿¡ããå¿ èŠãªããåæäœæ¥ãè¡ãããŸãã
ãããã«
æããã«ãVagrantã®äœ¿çšã¯ç°¡åã§é«éã§ãã ããããæãéèŠãªããšã¯ãéåžžã«è¿ éã«ãé«ãé¢å¿ããã£ãŠãæè³ãããæè³ãšãªãœãŒã¹ãååããããŒã«ã§ãã ãããã£ãŠãæ°ãããã¬ãŒã ã¯ãŒã¯ãéçºæè¡ããŸãã¯ããŒã«ã®ç 究ã«æéãæè³ããéžæè¢ãããã°ãééããªãVagrantã«ã¢ããã€ã¹ããŸãã
ããŠãParallels Desktopãæ¢ã«äœ¿çšããŠããéçºè ã«ãšã£ãŠãéå§ã¯å®å šã«ç°¡åã§ãã
ãŸã 質åãããå Žåã¯ãVagrantã®äœ¿çšäºäŸãæåäºäŸãå ±æããŠãã ãããã³ã¡ã³ããæè¿ããŸãã
Vagrantã®ãã©ã°ã€ã³ã¯å ¬éãããŠãããããæ©èœããã°ã®ãªã¯ãšã¹ãã¯GitHubã§github.com/parallelsã«éä¿¡ã§ããŸãã
twitter.com/legal_90ãtwitter.com / racktearã®ãªãªãŒã¹ããã©ããŒããŠãTwitterã§è³ªåããããšãã§ããŸãã
ãããŠä»ãç§ãã¡ã®ãã¹ãŠã®ãµããŒãã¯ãVagrantãããã³éçºè ããããã©ã®ããã«äœ¿çšãããã«ã€ããŠãååãªç¥èããããŸãã ç§ãã¡ã¯è³ªåã«çããŠã人ã ãåé¡ã解決ããã®ãæäŒããŸãã ããªãã«ãšã£ãŠããããã¯å€§ããªãã©ã¹ã«ãªããŸãã