CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Google Summer of Code »
  • [GSoC 2016] Virtual Machine Templates (Appliances/Boxes)
Pages: [1]

Author Topic: [GSoC 2016] Virtual Machine Templates (Appliances/Boxes)  (Read 603 times)

tahteche

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.7.5
  • CMS version: Worpress 4.3.1
  • MySQL version: 5.5.44
  • PHP version: 5.6
[GSoC 2016] Virtual Machine Templates (Appliances/Boxes)
March 16, 2016, 06:53:08 am
Hello, I am Tah Teche a Geology student with 4 years of web dev experience using HTML/PHP/ JS and 2 years experience with AWS and Google Cloud Platform. I will like to work on the CiviCRM GSoC 2016 project "Virtual Machine Templates (Appliances/Boxes)" for the Google Summer of code.

I will love to be assigned some micro-tasks by the project's mentors (@totten, @nganivet, @bgm and @ergonlogic ) to prove my dedication/ability.

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: [GSoC 2016] Virtual Machine Templates (Appliances/Boxes)
March 20, 2016, 06:31:39 pm
Hello, Tah Teche! Thanks for posting.

You should take a look at these two projects:

1. https://github.com/civicrm/civicrm-buildkit (esp https://github.com/civicrm/civicrm-buildkit/blob/master/doc/civibuild.md ) -- A set of build-scripts and dev-tools. These are able to install Drupal/WordPress with CiviCRM, but generally don't cover initial installation of system services (such as Apache and MySQL). In principle, the scripts are portable to different environments (e.g. local Ubuntu, local OSX, vagrant, VPS).

2. https://github.com/civicrm/civicrm-buildkit-vagrant -- A Vagrant box based on civicrm-buildkit, intended to help developers (esp. Windows/OSX devs).

A good exercise would be to install one or the other and get it working.

  • If you have trouble with it, don't be too surprised. There's a good chance you can figure out problems (with your background), but it's pretty common for people to hit some stumbling block, so feel free to follow-up with pointed questions.
  • If you get through it easily, then consider going to the next level. For example:
    • You might notice there's a lot of downloading involved. That's a bit brittle (high odds that one of the downloads will fail). It would be great to have a binary image that we can use which doesn't require as much downloading.
    • You might notice that the command "civibuild" is mentioned. It would be great to have a small integration test for "civibuild create". Basically, this would be a PHPUnit test ( http://phpunit.de/ ) which calls system("civibuild create...") and checks to see if the resulting website is online.


If you want some material to think on for drafting a project plan, here's a few areas that could use improvements. (There's no need to overload project trying to tackle all of them. I mention in case one or two pops out at you.)

  • Providing binary images can simplify installation, but then they're liable to grow stale over time. How would one publish updated images, and how would consumers load the updated images? What kind of scripts or infrastructure would be needed?
  • The current Vagrant box is focused on developers (and, eg, can be used to spin up several permutations of Civi within the VM). However, for end-users, it's more helpful to have an appliance with a full build and a specific version. Of course, CiviCRM can be provided in different permutations (e.g. Civi v4.6.10 + Drupal 7; Civi v4.6.10 + WordPress; Civi v4.7.2 + Drupal 7; Civi v4.7.2 + WordPress). But then the issues about updates become even more important.
  • Vagrant is obviously one system for virtualization/appliances. Extending support to others (eg AMI, Google Cloud) could be quite useful.

tahteche

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.7.5
  • CMS version: Worpress 4.3.1
  • MySQL version: 5.5.44
  • PHP version: 5.6
Re: [GSoC 2016] Virtual Machine Templates (Appliances/Boxes)
March 24, 2016, 08:10:58 am
Hello Totten,

Sorry for the delay. I was at work on the tasks. I successfully installed the buildkit (using the first method - without vagrant) and successfully created a  local CiviCRM with WordPress instance.

Also I have written the integration test for civibuild create ... though its not as complete as I would want it to be, it showcases the core of the test. One limitation is that it does not destroy the test instance created when running the civibuild create ... command within the test. Below is the link to the integration test code on a feature branch in my fork of the builtkit repo:
https://github.com/tahteche/civicrm-buildkit/commit/7967217b762e29ed190c3a028fc351165d987deb

Testing civibuild destroy or getting it to destroy the created test instance is not implemented yet because its an interactive command (it ask if you are sure you want to destroy the instance and waits for a reply) so the test pauses forever since interactions can't be done via system(). I am looking into alternatives including directly deleting the folder of the test instance (not good as the test will by-pass civibuild destroy) hence civibuild destroy will not be tested along civibuild create ...)

My proposal is on the way wherein I will further explain the implementation details for the project.

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: [GSoC 2016] Virtual Machine Templates (Appliances/Boxes)
March 24, 2016, 04:12:06 pm
Thanks, that's good progress.

Agree that civibuild destroy is a bit interactive. Fortunately, it only takes one input (yes/no), so you may be able to resolve that by piping the necessary input ("y"). For example, this works on the bash command line without any extra typing:

Code: [Select]
echo y | civibuild destroy mytestbuild

PHP has a few variations on how to invoke a command (e.g. http://php.net/system, http://php.net/manual/en/function.exec.php, http://php.net/proc_open, http://symfony.com/doc/current/components/process.html ), and I don't recall off the top of my head if system() supports piping like that. Easiest to try that way. If it doesn't work, then maybe try Symfony Process. (I find it less cryptic than proc_open(), but that's personal taste.)

Look forward to seeing your proposal. (I'm not yet sure how to see it... the GSOC UI is new this year...)

tahteche

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.7.5
  • CMS version: Worpress 4.3.1
  • MySQL version: 5.5.44
  • PHP version: 5.6
Re: [GSoC 2016] Virtual Machine Templates (Appliances/Boxes)
March 24, 2016, 06:28:36 pm
Thanks. I will continue looking into the task.

I have submitted my draft proposal for review on the GSoC site but in the mean time you can find the same link to my draft proposal below:
https://docs.google.com/document/d/1aFvhZuYv9eN6oxmWqAqwGivvOrnzzV7lMi6_VQQXSpA/edit?usp=sharing

I look forward to getting your feedback on the doc.

Kind regards.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: [GSoC 2016] Virtual Machine Templates (Appliances/Boxes)
March 25, 2016, 09:21:44 am
don't forget to validate (if not done already) before the deadline
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Google Summer of Code »
  • [GSoC 2016] Virtual Machine Templates (Appliances/Boxes)

This forum was archived on 2017-11-26.