From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waldemar Quevedo Subject: Re: Org Converge: Configuration management with Org Babel Date: Sun, 8 Jun 2014 10:02:01 +0900 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2e9cc9876fc04fb48a52b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtRV9-0003jf-St for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 21:02:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtRV8-0005Uy-6U for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 21:02:23 -0400 Received: from mail-oa0-x230.google.com ([2607:f8b0:4003:c02::230]:44972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtRV7-0005Uu-W4 for emacs-orgmode@gnu.org; Sat, 07 Jun 2014 21:02:22 -0400 Received: by mail-oa0-f48.google.com with SMTP id g18so4405022oah.21 for ; Sat, 07 Jun 2014 18:02:21 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Grant Rettke Cc: emacs-orgmode --001a11c2e9cc9876fc04fb48a52b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Grant, This is an attempt to augment the current functionality of Org mode so that we can use documentes authored with Org mode in Emacs and execute then in other environments with Ruby as the only dependency. I was mostly motivated because in the Ruby world there are tools like Chef or Puppet used to define idempotent runs of the setup from a server. For example the Chef execute resource: http://docs.opscode.com/resource_execute.html execute 'bundle install' do cwd '/myapp' not_if 'bundle check'end As you can see we are defining two commands, the command to run and one more command to check whether the first command should be run. What I have implemented so far is that you could for example express this in Org mode using literate programming as well: #+name: bundle-check #+begin_src sh :dir /myapp bundle check #+end_src #+name: bundle-install #+begin_src sh :dir /myapp :unless bundle-check bundle install #+end_src Here the second code block will only run if the first code block has a non-zero exit status, meaning that the action has not been done yet, because the exit status of each code block is being tracked. You can take a look at some of the examples here for some of the other use cases where I was thinking that this would be useful: https://github.com/wallyqs/org-converge/tree/master/spec/converge_examples Here is a more complex example of what is possible to do: https://github.com/wallyqs/org-converge/blob/master/spec/converge_examples/= multi_proc/run.org Thanks, - Wally On Sun, Jun 8, 2014 at 3:50 AM, Grant Rettke wrote: > Hi Waldemar, > > Would this be used in parallel with org-mode? Would it replace it or > complement it? > > I'm not very familiar with what you are trying to replace or augment. > > Kind regards, > > gcr > Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi > gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/ > =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates > ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) > =E2=80=9CLife has become immeasurably better since I have been forced to = stop > taking it seriously.=E2=80=9D --Thompson > > > On Sat, Jun 7, 2014 at 5:48 AM, Waldemar Quevedo > wrote: > > > > Hello Org mode users, > > > > I've had the idea for some time of using Org babel functionality > > as a method to provide configuration management > > features and the result is the following: > > > > https://github.com/wallyqs/org-converge > > > > Note that this uses the Ruby implementation of the Org mode parser > > that I've been maintaining to interop with some useful gems from Ruby, > like > > rake and foreman. > > > > The idea here is to a able to use Org Babel not only > > for reproducible research, but also for reproducible runs entirely. > > This way a local development environment could be considered to be > > a run where the processes run in parallel, or in the case > > of the configuration of a server, we rely on the tangling > > syntax from Org Babel as well defined idempotency checks > > to make sure that the configuration from a server converges. > > > > In case you have some feedback, please let me know! > > Feel free to create any issues in the tracker in case > > you think that the idea has potential :) > > > > Thanks, > > > > - Waldemar > > > --001a11c2e9cc9876fc04fb48a52b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Grant,

This is an attempt to augment= the current functionality of Org mode=C2=A0
so that we can use d= ocumentes authored with Org mode in Emacs
and execute then in oth= er environments with Ruby as the only dependency.

I was mostly motivated because in the Ruby world there= =C2=A0
are tools like Chef or Puppet used to define idempotent ru= ns=C2=A0
of the setup from a server.
For example the Ch= ef execute resource: http://docs.opscode.com/resource_execute.html


execute 'bundle install' do
  cwd '/myapp'
  not_if 'bundle check'
end

As you can see we are defining two command= s, the command to run
and one more command to check whether the f= irst command should be run.

What I have implemented so far is that you could for ex= ample express=C2=A0
this in Org mode using literate programming a= s well:

#+name: bundle-check
#+begin_src= sh :dir /myapp
bundle check
#+end_src

#+name: bund= le-install
#+begin_src sh :dir /myapp :unless bundle-check=C2=A0<= /div>
bundle install
#+end_src

Here = the second code block will only run if the first code block has a non-zero = exit status,
meaning that the action has not been done yet, because the exit status= of each code block is being tracked.

You can take= a look at some of the examples here
for some of the other use ca= ses where I was thinking that this would be useful:

Here is a more complex exampl= e of what is possible to do:

Thanks,

- Wally

<= /div>


On= Sun, Jun 8, 2014 at 3:50 AM, Grant Rettke <gcr@wisdomandwonder.com<= /a>> wrote:
Hi Waldemar,

Would this be used in parallel with org-mode? Would it replace it or
complement it?

I'm not very familiar with what you are trying to replace or augment.
Kind regards,

gcr
Grant Rettke | AAAS, ACM, AS= A, FSF, IEEE, SIAM, Sigma Xi
gcr@wisdomandwonder.com | http://www.wisd= omandwonder.com/
=E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates
((=CE=BB (x) (x x)) (=CE=BB (x) (x x)))
=E2=80=9CLife has become immeasurably better since I have been forced to st= op
taking it seriously.=E2=80=9D --Thompson


On Sat, Jun 7, 2014 at 5:48 AM, Waldemar Quevedo
<waldemar.quevedo@gmail.co= m> wrote:
>
> Hello Org mode users,
>
> I've had the idea for some time of using Org babel functionality > as a method to provide configuration management
> features and the result is the following:
>
> = https://github.com/wallyqs/org-converge
>
> Note that this uses the Ruby implementation of the Org mode parser
> that I've been maintaining to interop with some useful gems from R= uby, like
> rake and foreman.
>
> The idea here is to a able to use Org Babel not only
> for reproducible research, but also for reproducible runs entirely. > This way a local development environment could be considered to be
> a run where the processes run in parallel, or in the case
> of the configuration of a server, we rely on the tangling
> syntax from Org Babel as well defined idempotency checks
> to make sure that the configuration from a server converges.
>
> In case you have some feedback, please let me know!
> Feel free to create any issues in the tracker in case
> you think that the idea has potential :)
>
> Thanks,
>
> - Waldemar
>

--001a11c2e9cc9876fc04fb48a52b--