Re: [ruote:4077] Using workitem data in process definition?

25 views
Skip to first unread message

John Mettraux

unread,
Apr 26, 2013, 9:54:15 AM4/26/13
to openwfe...@googlegroups.com

On Fri, Apr 26, 2013 at 05:39:55AM -0700, Lukas Loesche wrote:
>
> (...)
>
> Now instead of specifying 'srv1, srv2, srv3' I'd like to iterate over the
> array of systems that I build in get_destination_systems and supply the
> name of the system as an argument to package_upload. Is there a way to do
> that? Or am I using it wrong and shouldn't have that as part of the pdef at
> all? What is a proper way to achieve this?

Hello Lukas,

welcome to the ruote mailing list.

Would that help:

https://gist.github.com/anonymous/5467499

?

Instead of downloading a Git repository and then uploading it to other systems,
I'd rather clone/pull the repository from the other systems directly. I guess
your environment doesn't let you do that.


Have a nice week-end,

--
John Mettraux - http://lambda.io/jmettraux

Lukas Loesche

unread,
Apr 26, 2013, 10:49:12 AM4/26/13
to openwfe...@googlegroups.com
Hi John,
perfect! That's exactly what I was looking for.
 
Instead of downloading a Git repository and then uploading it to other systems,
I'd rather clone/pull the repository from the other systems directly. I guess
your environment doesn't let you do that.

Indeed, I dumbed down the problem a bit to make the question shorter. In our actual system instead of a Git repo I'm downloading from a Sonatype Nexus repository and have to perform several steps of figuring out which package and for which environment to download, generate config files and enrich them with DB settings and passwords. Tasks that for security reasons must not be done on the destination nodes directly. Until now we've been using puppet and mcollective to do so, but as possible workflows got more complex and now require human intervention (i.e. a team lead to confirm deployment on production systems) I figured a proper workflow engine makes more sense than hundreds more if-then-else clauses.

Anyway, thank you again for demonstrating the use of workitem data in process definitions. Very much appreciated!

Best,
-- Lukas

John Mettraux

unread,
Apr 26, 2013, 8:46:37 PM4/26/13
to openwfe...@googlegroups.com

On Fri, Apr 26, 2013 at 07:49:12AM -0700, Lukas Loesche wrote:
>
> Would that help:
> >
> > https://gist.github.com/anonymous/5467499 <https://gist.github.com/anonymous/5467499>
> >
> >
>
> perfect! That's exactly what I was looking for.

Hello,

forgot to mention that the concurrent-iterator could also be written as

citerator :on_f => 'systems', :to_f => 'system' do

instead of

citerator :on => '$f:systems', :to_f => 'system' do


> > Instead of downloading a Git repository and then uploading it to other
> > systems,
> > I'd rather clone/pull the repository from the other systems directly. I
> > guess
> > your environment doesn't let you do that.
> >
>
> Indeed, I dumbed down the problem a bit to make the question shorter. In
> our actual system instead of a Git repo I'm downloading from a Sonatype
> Nexus repository and have to perform several steps of figuring out which
> package and for which environment to download, generate config files and
> enrich them with DB settings and passwords. Tasks that for security reasons
> must not be done on the destination nodes directly. Until now we've been
> using puppet and mcollective to do so, but as possible workflows got more
> complex and now require human intervention (i.e. a team lead to confirm
> deployment on production systems) I figured a proper workflow engine makes
> more sense than hundreds more if-then-else clauses.

OK, got it.


Best regards!

Lukas Loesche

unread,
Apr 28, 2013, 7:02:16 AM4/28/13
to openwfe...@googlegroups.com

forgot to mention that the concurrent-iterator could also be written as

  citerator :on_f => 'systems', :to_f => 'system' do

I changed my code a bit so it won't update all systems at once but instead work with chunks so that the app stays available during the deployment and am now using the following in my process definition:
    iterator :on => '$f:systems', :to_var => 'chunk' do
      citerator :on => '$v:chunk', :to => 'system' do
        deploy_package_on_server
      end
    end

How would I write this using the Radial DSL? I can't seem to find documentation on that but maybe I'm looking in the wrong places.

John Mettraux

unread,
Apr 28, 2013, 7:16:58 AM4/28/13
to openwfe...@googlegroups.com

On Sun, Apr 28, 2013 at 04:02:16AM -0700, Lukas Loesche wrote:
>
> I changed my code a bit so it won't update all systems at once but instead
> work with chunks so that the app stays available during the deployment and
> am now using the following in my process definition:
>
> iterator :on => '$f:systems', :to_var => 'chunk' do
> citerator :on => '$v:chunk', :to => 'system' do
> deploy_package_on_server
> end
> end
>
> How would I write this using the Radial DSL? I can't seem to find
> documentation on that but maybe I'm looking in the wrong places.

Hello,

sorry, I haven't had no time to write any real radial documentation.

```
iterator :on => '$f:systems', :to_var => 'chunk' do
citerator :on => '$v:chunk', :to => 'system' do
deploy_package_on_server
end
end
```

becomes

```
iterator on: '$f:systems', to_var: 'chunk'
citerator on: '$v:chunk', to: 'system'
deploy_package_on_server
```

or

```
iterator on: '$f:systems', to_var: chunk
citerator on: '$v:chunk', to: system
deploy_package_on_server
```

Best regards,

Lukas Loesche

unread,
Apr 28, 2013, 11:41:20 AM4/28/13
to openwfe...@googlegroups.com

```
iterator on: '$f:systems', to_var: chunk
  citerator on: '$v:chunk', to: system
    deploy_package_on_server
```

Thank you John! I just found out from your release post about v2.3.0 that I can start ruote in noisy mode and it will output Radial syntax in the debug information. I'm using that to now to get correct Radial syntax.

I'm really starting to love ruote. It's an amazing system that simplifies my work tremendously.
Thank you for all the work you've put into it!
Reply all
Reply to author
Forward
0 new messages