[Sheepdog] changing program names (collie and shepherd)

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed May 12 09:21:34 CEST 2010


At Fri, 07 May 2010 21:26:37 +0900,
MORITA Kazutaka wrote:
> 
> Hi all.
> 
> I'm planning to send sheepdog patch to the qemu mailing list next
> week, so this may be a good time to reconsider the program names,
> collie and shepherd.  I wonder these names are not fit our prject
> name.  The reason why I named this project sheepdog is that
> distributed system controls machine nodes like sheepdog controls
> sheeps.
> 
> Currently,
> 
> sheepdog daemon     : collie
> sheepdog admin tool : shepherd
> 
> Collie is sheepdog, and shepherd is a job name to take care of sheep.
> Sheepdog daemon is running on each node, so in this case, there are
> many sheepdogs and one shepherd in the cluster.  But, if we take into
> account our project name, there should be many sheeps and one
> sheepdog?
> 
> For example,
> 
> daemon             : sheep
> administration tool: collie
> 
> Are there better names?
> 

I've changed the names.

If there are any objections, please let us know.

Regards,

Kazutaka

=
From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Subject: [PATCH] change program names

Currently, program names in Sheepdog project are:

sheepdog daemon     : collie
sheepdog admin tool : shepherd

Collie is sheepdog, and shepherd is a job name to take care of sheep.
Sheepdog daemon is running on each node, so in this case, there are
many sheepdogs and one shepherd in the cluster.  But, if we take into
account our project name, there should be many sheeps and one
sheepdog.

This patch changes the names to as follows:

sheepdog daemon     : sheep
sheepdog admin tool : collie

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 Makefile                                           |    6 ++--
 README                                             |   23 ++++++-------------
 collie/Makefile                                    |    6 ++--
 shepherd/shepherd.c => collie/collie.c             |    4 +-
 {shepherd => collie}/treeview.c                    |    0 
 {shepherd => collie}/treeview.h                    |    0 
 include/{collie.h => sheep.h}                      |   12 +++++-----
 ..._completion_shepherd => bash_completion_collie} |    4 +-
 script/start-sheepdog                              |   10 ++++----
 script/stop-sheepdog                               |    6 ++--
 {shepherd => sheep}/Makefile                       |   14 ++++++------
 {collie => sheep}/group.c                          |    8 +++---
 {collie => sheep}/net.c                            |    2 +-
 collie/collie.c => sheep/sheep.c                   |    6 ++--
 collie/collie_priv.h => sheep/sheep_priv.h         |    6 ++--
 {collie => sheep}/store.c                          |    2 +-
 {collie => sheep}/vdi.c                            |    2 +-
 {collie => sheep}/work.c                           |    0 
 {collie => sheep}/work.h                           |    0 
 19 files changed, 51 insertions(+), 60 deletions(-)
 rename shepherd/shepherd.c => collie/collie.c (99%)
 rename {shepherd => collie}/treeview.c (100%)
 rename {shepherd => collie}/treeview.h (100%)
 rename include/{collie.h => sheep.h} (97%)
 rename script/{bash_completion_shepherd => bash_completion_collie} (94%)
 rename {shepherd => sheep}/Makefile (59%)
 rename {collie => sheep}/group.c (99%)
 rename {collie => sheep}/net.c (99%)
 rename collie/collie.c => sheep/sheep.c (96%)
 rename collie/collie_priv.h => sheep/sheep_priv.h (98%)
 rename {collie => sheep}/store.c (99%)
 rename {collie => sheep}/vdi.c (99%)
 rename {collie => sheep}/work.c (100%)
 rename {collie => sheep}/work.h (100%)

diff --git a/Makefile b/Makefile
index b537145..6f4f0c3 100644
--- a/Makefile
+++ b/Makefile
@@ -9,18 +9,18 @@ export VERSION PREFIX
 
 .PHONY:all
 all:
-	$(MAKE) -C shepherd
+	$(MAKE) -C sheep
 	$(MAKE) -C collie
 
 .PHONY:clean
 clean:
-	$(MAKE) -C shepherd clean
+	$(MAKE) -C sheep clean
 	$(MAKE) -C collie clean
 	$(MAKE) -C lib clean
 
 .PHONY:install
 install:
-	$(MAKE) -C shepherd install
+	$(MAKE) -C sheep install
 	$(MAKE) -C collie install
 
 .PHONY:check
diff --git a/README b/README
index b675d0f..7a44b3f 100644
--- a/README
+++ b/README
@@ -49,7 +49,7 @@ Usage
 * Setup Sheepdog
    1. Launch sheepdog on each machines of the cluster.
 
-      $ collie /store_dir
+      $ sheep /store_dir
 
       Notes:
         /store_dir is a directory to store objects. The directory must
@@ -60,7 +60,7 @@ Usage
 
    2. Make fs
 
-      $ shepherd mkfs --copies=3
+      $ collie cluster format --copies=3
 
       --copies specifies the number of default data redundancy. In this case,
       the replicated data is stored on three machines.
@@ -69,7 +69,7 @@ Usage
 
       Following list shows that Sheepdog is running on 32 nodes.
 
-      $ shepherd info -t dog
+      $ collie node list
         Idx	Node id (FNV-1a) - Host:Port
       ------------------------------------------------
         0	0308164db75cff7e - 10.68.13.15:7000
@@ -116,7 +116,7 @@ Usage
 
    3. See Sheepdog images by the following command.
 
-      $ shepherd info -t vdi
+      $ collie vdi list
         name        id    size    used  shared    creation time  object id
       --------------------------------------------------------------------
         Bob          0  2.0 GB  1.6 GB  0.0 MB 2010-03-23 16:16      80000
@@ -129,7 +129,7 @@ Usage
 
    2. Following command checks used images.
 
-      $ shepherd info -t vm
+      $ collie vm list
       Name            |Vdi size |Allocated| Shared  | Status
       ----------------+---------+---------+---------+------------
       Bob             |   2.0 GB|   1.6 GB|   0.0 MB| running on xx.xx.xx.xx
@@ -145,7 +145,7 @@ Usage
    2. After getting snapshot, a new virtual machine images are added as a not-
       current image.
 
-      $ shepherd info -t vdi
+      $ collie vdi list
         name        id    size    used  shared    creation time  object id
       --------------------------------------------------------------------
         Bob          0  2.0 GB  1.6 GB  0.0 MB 2010-03-23 16:16      80000
@@ -163,7 +163,7 @@ Usage
 
    2. Charlie's image is added to the virtual machine list.
 
-      $ shepherd info -t vdi
+      $ collie vdi list
         name        id    size    used  shared    creation time  object id
       --------------------------------------------------------------------
         Bob          0  2.0 GB  1.6 GB  0.0 MB 2010-03-23 16:16      80000
@@ -171,15 +171,6 @@ Usage
       s Alice        1  256 GB  0.0 MB  0.0 MB 2010-03-23 16:16      40000
         Charlie      0  256 GB  0.0 MB  0.0 MB 2010-03-23 16:23     100000
 
-   3. To check parent-child relationship of the images, use tree format output.
-
-      $ shepherd info -t vdi -f tree
-      Bob---[09-10-15 16:29]-+-[09-10-18 20:51]
-                             `-(You Are Here)
-      Alice---[09-10-16 10:02]-+-[09-10-19 09:42]---(You Are Here)
-                               `-[09-10-18 20:53]---[09-10-18 23:11]
-      Charlie---(You Are Here)
-
 Test Environment
 ----------------
     - Debian squeeze amd64
diff --git a/collie/Makefile b/collie/Makefile
index c2f7eb9..98ef2b1 100644
--- a/collie/Makefile
+++ b/collie/Makefile
@@ -1,11 +1,11 @@
 sbindir ?= $(PREFIX)/sbin
 
 CFLAGS += -g -O2 -Wall -Wstrict-prototypes -I../include
-CFLAGS += -D_GNU_SOURCE -DSD_VERSION=\"$(VERSION)\"
-LIBS += -lpthread -lcpg -lcfg
+CFLAGS += -D_GNU_SOURCE
+LIBS += -lncurses
 
 PROGRAMS = collie
-COLLIE_OBJS = collie.o net.o vdi.o group.o store.o work.o ../lib/event.o ../lib/net.o ../lib/logger.o
+COLLIE_OBJS = collie.o treeview.o ../lib/event.o ../lib/net.o ../lib/logger.o
 COLLIE_DEP = $(COLLIE_OBJS:.o=.d)
 
 .PHONY:all
diff --git a/shepherd/shepherd.c b/collie/collie.c
similarity index 99%
rename from shepherd/shepherd.c
rename to collie/collie.c
index d3bbc50..18e49a7 100644
--- a/shepherd/shepherd.c
+++ b/collie/collie.c
@@ -28,11 +28,11 @@
 #include <curses.h>
 
 #include "sheepdog_proto.h"
-#include "collie.h"
+#include "sheep.h"
 #include "net.h"
 #include "treeview.h"
 
-static char program_name[] = "shepherd";
+static char program_name[] = "collie";
 static int sdport = SD_LISTEN_PORT;
 static int highlight = 1;
 
diff --git a/shepherd/treeview.c b/collie/treeview.c
similarity index 100%
rename from shepherd/treeview.c
rename to collie/treeview.c
diff --git a/shepherd/treeview.h b/collie/treeview.h
similarity index 100%
rename from shepherd/treeview.h
rename to collie/treeview.h
diff --git a/include/collie.h b/include/sheep.h
similarity index 97%
rename from include/collie.h
rename to include/sheep.h
index ee07ebd..18e8a6c 100644
--- a/include/collie.h
+++ b/include/sheep.h
@@ -8,19 +8,19 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef __COLLIE_H__
-#define __COLLIE_H__
+#ifndef __SHEEP_H__
+#define __SHEEP_H__
 
 #include <stdint.h>
 #include "util.h"
 #include "list.h"
 
-#define SD_COLLIE_PROTO_VER 0x01
+#define SD_SHEEP_PROTO_VER 0x01
 
 #define SD_MAX_NODES 1024
 #define SD_MAX_VMS   4096 /* FIXME: should be removed */
 
-#define SD_OP_COLLIE         0x80
+#define SD_OP_SHEEP         0x80
 #define SD_OP_DEL_VDI        0x81
 #define SD_OP_GET_NODE_LIST  0x82
 #define SD_OP_GET_VM_LIST    0x83
@@ -174,9 +174,9 @@ static inline void print_node_list_entry(struct sheepdog_node_list_entry *e,
 		 e->addr[14], e->addr[15], e->port);
 }
 
-static inline int is_collie_op(uint8_t op)
+static inline int is_sheep_op(uint8_t op)
 {
-	return op & SD_OP_COLLIE;
+	return op & SD_OP_SHEEP;
 }
 
 static inline const char *sd_strerror(int err)
diff --git a/script/bash_completion_shepherd b/script/bash_completion_collie
similarity index 94%
rename from script/bash_completion_shepherd
rename to script/bash_completion_collie
index 08ae082..6fc60ff 100644
--- a/script/bash_completion_shepherd
+++ b/script/bash_completion_collie
@@ -1,6 +1,6 @@
 #!bash
 
-_shepherd()
+_collie()
 {
 	local opts cur prev
 	opts="cluster node vdi vm"
@@ -44,4 +44,4 @@ _shepherd()
 	COMPREPLY=( $( compgen -W "${opts}" ${cur} ) )
 }
 
-complete -F _shepherd shepherd
+complete -F _collie collie
diff --git a/script/start-sheepdog b/script/start-sheepdog
index 8f4b09a..956aaeb 100755
--- a/script/start-sheepdog
+++ b/script/start-sheepdog
@@ -2,7 +2,7 @@
 
 # Examples
 #
-# run-dogs.pl -n=5 -d=/tmp/1203
+# start-sheepdog -n=5 -d=/tmp/1203
 
 $port = 7000;
 $nr = 1;
@@ -37,11 +37,11 @@ foreach $host (grep {!$count{$_}++} @hosts) {
 for ($i = 0; $i < $nr; $i++, $port++) {
     $_dir = $dir.$i;
     if ($hosts[$i]) {
-	print("ssh $hosts[$i] $home/collie/collie --port $port $_dir -d\n");
-	system("ssh $hosts[$i] $home/collie/collie --port $port $_dir -d");
+	print("ssh $hosts[$i] $home/sheep/sheep --port $port $_dir -d\n");
+	system("ssh $hosts[$i] $home/sheep/sheep --port $port $_dir -d");
     } else {
-	print("$home/collie/collie --port $port $_dir -d\n");
-	system("$home/collie/collie --port $port $_dir -d");
+	print("$home/sheep/sheep --port $port $_dir -d\n");
+	system("$home/sheep/sheep --port $port $_dir -d");
     }
 }
 
diff --git a/script/stop-sheepdog b/script/stop-sheepdog
index 2ba286c..ad1b8a0 100755
--- a/script/stop-sheepdog
+++ b/script/stop-sheepdog
@@ -2,8 +2,8 @@
 
 # Examples
 #
-# stop-dogs.pl 0 3 4
-# stop-dogs.pl [0-100]
+# stop-sheepdog 0 3 4
+# stop-sheepdog [0-100]
 
 @index_list = @ARGV;
 if (@index_list == 0) {
@@ -12,7 +12,7 @@ if (@index_list == 0) {
 
 $dport = 7000;
 
-foreach $proc (`ps -o pid,args -C collie`) {
+foreach $proc (`ps -o pid,args -C sheep`) {
     foreach $i (@index_list) {
 	if ($i =~ /\[(\d+)-(\d+)\]/) {
 	    &stop_dog($dport + $_) foreach ($1..$2);
diff --git a/shepherd/Makefile b/sheep/Makefile
similarity index 59%
rename from shepherd/Makefile
rename to sheep/Makefile
index 11e4a47..089bb7d 100644
--- a/shepherd/Makefile
+++ b/sheep/Makefile
@@ -1,20 +1,20 @@
 sbindir ?= $(PREFIX)/sbin
 
 CFLAGS += -g -O2 -Wall -Wstrict-prototypes -I../include
-CFLAGS += -D_GNU_SOURCE
-LIBS += -lncurses
+CFLAGS += -D_GNU_SOURCE -DSD_VERSION=\"$(VERSION)\"
+LIBS += -lpthread -lcpg -lcfg
 
-PROGRAMS = shepherd
-SHEPHERD_OBJS = shepherd.o treeview.o ../lib/event.o ../lib/net.o ../lib/logger.o
-SHEPHERD_DEP = $(SHEPHERD_OBJS:.o=.d)
+PROGRAMS = sheep
+SHEEP_OBJS = sheep.o net.o vdi.o group.o store.o work.o ../lib/event.o ../lib/net.o ../lib/logger.o
+SHEEP_DEP = $(SHEEP_OBJS:.o=.d)
 
 .PHONY:all
 all: $(PROGRAMS)
 
-shepherd: $(SHEPHERD_OBJS)
+sheep: $(SHEEP_OBJS)
 	$(CC) $^ -o $@ $(LIBS)
 
--include $(SHEPHERD_DEP)
+-include $(SHEEP_DEP)
 
 %.o: %.c
 	$(CC) -c $(CFLAGS) $*.c -o $*.o
diff --git a/collie/group.c b/sheep/group.c
similarity index 99%
rename from collie/group.c
rename to sheep/group.c
index fe6a06d..3313b10 100644
--- a/collie/group.c
+++ b/sheep/group.c
@@ -18,7 +18,7 @@
 #include <corosync/cfg.h>
 
 #include "sheepdog_proto.h"
-#include "collie_priv.h"
+#include "sheep_priv.h"
 #include "list.h"
 #include "util.h"
 #include "logger.h"
@@ -474,7 +474,7 @@ static void join(struct join_message *msg)
 	struct sheepdog_node_list_entry entry[SD_MAX_NODES];
 	int i;
 
-	if (msg->header.proto_ver != SD_COLLIE_PROTO_VER) {
+	if (msg->header.proto_ver != SD_SHEEP_PROTO_VER) {
 		eprintf("joining node send a wrong version message\n");
 		msg->result = SD_RES_VER_MISMATCH;
 		return;
@@ -1148,7 +1148,7 @@ static void __sd_confchg(struct cpg_event *cevent)
 		uint32_t epoch;
 
 		/*
-		 * If I'm the first collie joins in colosync, I
+		 * If I'm the first sheep joins in colosync, I
 		 * becomes the master without sending JOIN.
 		 */
 
@@ -1188,7 +1188,7 @@ static void send_join_request(struct cpg_address *addr, struct work_confchg *w)
 	if (!is_my_cpg_addr(addr))
 		return;
 
-	msg.header.proto_ver = SD_COLLIE_PROTO_VER;
+	msg.header.proto_ver = SD_SHEEP_PROTO_VER;
 	msg.header.op = SD_MSG_JOIN;
 	msg.header.state = DM_INIT;
 	msg.header.msg_length = sizeof(msg);
diff --git a/collie/net.c b/sheep/net.c
similarity index 99%
rename from collie/net.c
rename to sheep/net.c
index 7ba2456..56532e8 100644
--- a/collie/net.c
+++ b/sheep/net.c
@@ -14,7 +14,7 @@
 #include <netinet/tcp.h>
 #include <sys/epoll.h>
 
-#include "collie_priv.h"
+#include "sheep_priv.h"
 
 int is_io_request(unsigned op)
 {
diff --git a/collie/collie.c b/sheep/sheep.c
similarity index 96%
rename from collie/collie.c
rename to sheep/sheep.c
index 03cf990..b14c5c6 100644
--- a/collie/collie.c
+++ b/sheep/sheep.c
@@ -16,13 +16,13 @@
 #include <linux/limits.h>
 #include <sys/syslog.h>
 
-#include "collie_priv.h"
+#include "sheep_priv.h"
 
 #define EPOLL_SIZE 4096
 #define DEFAULT_OBJECT_DIR "/tmp"
-#define LOG_FILE_NAME "collie.log"
+#define LOG_FILE_NAME "sheep.log"
 
-static char program_name[] = "collie";
+static char program_name[] = "sheep";
 
 static struct option const long_options[] = {
 	{"port", required_argument, NULL, 'p'},
diff --git a/collie/collie_priv.h b/sheep/sheep_priv.h
similarity index 98%
rename from collie/collie_priv.h
rename to sheep/sheep_priv.h
index b0cff8b..338ba5a 100644
--- a/collie/collie_priv.h
+++ b/sheep/sheep_priv.h
@@ -8,8 +8,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef __COLLIE_PRIV_H__
-#define __COLLIE_PRIV_H__
+#ifndef __SHEEP_PRIV_H__
+#define __SHEEP_PRIV_H__
 
 #include <inttypes.h>
 #include <corosync/cpg.h>
@@ -19,7 +19,7 @@
 #include "logger.h"
 #include "work.h"
 #include "net.h"
-#include "collie.h"
+#include "sheep.h"
 
 #define SD_DEFAULT_REDUNDANCY 3
 #define SD_MAX_REDUNDANCY 8
diff --git a/collie/store.c b/sheep/store.c
similarity index 99%
rename from collie/store.c
rename to sheep/store.c
index 1edb3b2..c5552bb 100644
--- a/collie/store.c
+++ b/sheep/store.c
@@ -19,7 +19,7 @@
 #include <sys/xattr.h>
 #include <sys/statvfs.h>
 
-#include "collie_priv.h"
+#include "sheep_priv.h"
 
 #define ANAME_CTIME "user.sheepdog.ctime"
 #define ANAME_COPIES "user.sheepdog.copies"
diff --git a/collie/vdi.c b/sheep/vdi.c
similarity index 99%
rename from collie/vdi.c
rename to sheep/vdi.c
index 150af9e..7a894a3 100644
--- a/collie/vdi.c
+++ b/sheep/vdi.c
@@ -13,7 +13,7 @@
 #include <sys/time.h>
 
 #include "sheepdog_proto.h"
-#include "collie_priv.h"
+#include "sheep_priv.h"
 
 
 /* TODO: should be performed atomically */
diff --git a/collie/work.c b/sheep/work.c
similarity index 100%
rename from collie/work.c
rename to sheep/work.c
diff --git a/collie/work.h b/sheep/work.h
similarity index 100%
rename from collie/work.h
rename to sheep/work.h
-- 
1.5.6.5




More information about the sheepdog mailing list