Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
utilib [TODO1] - OMUD
08-06-2017, 02:01 PM
Post: #11
RE: utilib - OMUD
(02-15-2017 01:24 PM)zma Wrote:  What `make install` does:
Code:
ips ?= /thinker/etc/ips.cfg

install:
    if $ips does not exist {
        rsync -avz ./util /thinker/local/forest/
        if return code is 0 {
            print succ
        } else {
            print error and exit
        }
    } else {
        for ip in $ips {
            rsync -avz ./util $ip:/thinker/local/forest/
            if return code is 0 {
                print succ
            } else {
                print error and exit
            }
        }
    }

This "cluster wide" installation does not follow the DECENT methodology. I suggest we use a convar to control whether the branch of 'for ip in $ips' is executed. The default behavior should be just to install on one node.

@xinjie
Find all posts by this user
Quote this message in a reply
08-07-2017, 02:47 PM
Post: #12
RE: utilib - OMUD
(08-06-2017 02:01 PM)lingu Wrote:  This "cluster wide" installation does not follow the DECENT methodology. I suggest we use a convar to control whether the branch of 'for ip in $ips' is executed. The default behavior should be just to install on one node.

@xinjie

Good to me.
Find all posts by this user
Quote this message in a reply
08-11-2017, 10:18 AM (This post was last modified: 08-11-2017 10:19 AM by YU_Xinjie.)
Post: #13
RE: utilib [TODO1] - OMUD
@Zhiqiang

Driving example: http://tab.d-thinker.org/showthread.php?...http://tab.d-thinker.org/showthread.php?tid=7758&pid=4669

Please review.
Code:
((->cluster_install ?= False))
ips ?= /thinker/etc/ips.cfg

install:
    ((if $ips does not exist { -> if $cluster_install = False))
        rsync -avz ./util /thinker/local/forest/
        if return code is 0 {
            print succ
        } else {
            print error and exit
        }
    } else {
        ((-> if $ips does not exist, print error and exit))
        for ip in $ips {
            rsync -avz ./util $ip:/thinker/local/forest/
            if return code is 0 {
                print succ
            } else {
                print error and exit
            }
        }
    }
Find all posts by this user
Quote this message in a reply
08-11-2017, 11:36 AM
Post: #14
RE: utilib [TODO1] - OMUD
(08-11-2017 10:18 AM)YU_Xinjie Wrote:  @Zhiqiang

Driving example: http://tab.d-thinker.org/showthread.php?...http://tab.d-thinker.org/showthread.php?tid=7758&pid=4669

Please review.
Code:
((->cluster_install ?= False))
ips ?= /thinker/etc/ips.cfg

install:
    ((if $ips does not exist { -> if $cluster_install = False))
        rsync -avz ./util /thinker/local/forest/
        if return code is 0 {
            print succ
        } else {
            print error and exit
        }
    } else {
        ((-> if $ips does not exist, print error and exit))
        for ip in $ips {
            rsync -avz ./util $ip:/thinker/local/forest/
            if return code is 0 {
                print succ
            } else {
                print error and exit
            }
        }
    }

Looks good to me.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: