{"id":21156425,"url":"https://github.com/vitroid/dish","last_synced_at":"2025-03-14T15:21:42.835Z","repository":{"id":6797202,"uuid":"8044727","full_name":"vitroid/dish","owner":"vitroid","description":"Distributed shell for make with -j option.","archived":false,"fork":false,"pushed_at":"2019-04-23T01:32:09.000Z","size":229,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T08:44:59.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitroid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-06T04:42:47.000Z","updated_at":"2019-04-23T01:32:10.000Z","dependencies_parsed_at":"2022-08-27T03:51:50.556Z","dependency_job_id":null,"html_url":"https://github.com/vitroid/dish","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fdish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fdish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fdish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitroid%2Fdish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitroid","download_url":"https://codeload.github.com/vitroid/dish/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243597805,"owners_count":20316847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T11:44:48.699Z","updated_at":"2025-03-14T15:21:42.812Z","avatar_url":"https://github.com/vitroid.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dish --- distributed shell\n\u003cimg src=\"wheel.gif\"\u003e\n\ncurrent version: 1.23\n\n----\n\nDish is a distributed shell. It is designed to replace 'sh -c' command\nused in GNU make. It enables us to execute\nmany procedures at a time over network-linked heterogeneous\nworkstation cluster.\n\nDish works just like 'sh -c' command, \u003ci\u003eie\u003c/i\u003e it gets command line \narguments and executes them as Bourne shell script. Internally\nthe arguments are given to remote shell command, executed on remote\nworkstation, and the status of the remote execution is returned.\n\nDish is useful for the jobs in which hundreds of independent tasks must be\nprocessed on the distributed hosts, e.g. making animations, converting\nmany sound files, compiling huge software like unix kernel, etc.\n\nRemote host on which the commands are executed is chosen from \ngiven list. If you intend to make binary files which depend on the\nsystem architecture, all the remote host in the list must be of the\nsame architecture.\n\nDish executes command on the remote directory where is the same with\nlocal directory. It is required that both the remote and local machine\nshares the directories and the tree topology of the directories on\nboth machine are the same. \n\n## command usage\n\n   usage:  dish [options] foo [x] [bar [y] ... ] -c cmds\n   Dish executes the specified command on one of the remote hosts.\n\tIt distributes at most x jobs to the remote host foo and y jobs to bar.\n\tDefault number of jobs is 1 if it is omitted.\n\t\n\tOptions\n\t    -h, --help         Show this message.\n\t    -i, --interactive  By default, dish ignores any input from stdin.\n\t                       With this option, dish reads from stdin.\n\t    -v, --verbose      Display debug messages\n\t    -r, --refresh      Remove lock files and go.\n\t    -s, --ssh          Use ssh instead of ersh.\n\t    -g, --group GROUP  Get host list from $(HOME)/.dish_group/GROUP file\n\t                       instead of command line arguments.\n\t    -p, --pwd PATH     Specify current directory explicitly.\n\t                       dish usually gets current path from PWD environment \n\t                       variable. However, some shells do not set PWD variable\n\t                       and dish tries to get it by pwd command, which only\n\t                       returns the absolute     path. Representation of current \n\t                       absolute path sometimes differs between local and \n\t                       remote host when the current path involves symbolic \n\t                       link. \n\t    -c     Terminator symbol of host list.\n\t    cmds   Bourne shell commands to be executed.\n\n## Replacement of standard shell in Makefile\n\nGNU make usually executes only one rule at a time. While specifying `-j`\noption enables the parallel execution.\nWe utilize this facility of GNU make for cluster-wide command\nexecution.\nWith `-j` option, GNU make analyses the dependencies of the rules and\nexecutes independent rules by standard shells in parallel manner. Each \nshell treats short \"thread\" of rules in the Makefile and return result\nstatus code to GNU make.\n\nWe replace the standard shell with dish, which performs just like\n`sh -c` command.\nWhen `SHELL` variable in the Makefile is defined, each\nrule-descripting line is executed by SHELL instead of `/bin/sh -c`.\nDish exports each threads to one of remote hosts and\nreport the result status to GNU make.\n\nMax number of parallel jobs (which is specified with `-j` option) should \nbe greater than sum of x (specified at the argument of dish). \nDish controls the number of jobs by itself when it is invoked multiply.\n\nTo distribute \"make\" processes onto multiple hosts, type\n\n    make -j 10 SHELL=\"dish host1 2 host2 host3 4\"\n\nMake executes 10 independent rules at a time. 2 of them are exported\nto host1, 1 to host2, 4 to host3, and the rest 3 rules are suspended.\n\nDish works on the host workstation where GNU make command is\ninvoked. It is unsecessary to install anything on the remote\nworkstations.\n\n(v1.21)When a `-g` option is given, dish looks up host list from `~/.dish_group/GROUPFILE` (`GROUPFILE` is the argument given with a `-g` option) instead of command line arguments. It is useful when you run dish on large-scale cluster.\n\nFor example, put the following text to the file ~/.dish_group/clients,\n\n\tc001 2\n\tc002 2\n\tc003 2\n\nand run \"make\" using dish with -g option.\n\n\tmake -j 6 all SHELL=\"dish -g clients\"\n\n## Note\n\nStandard remote shell command ('rsh') does not return the status of\nremote execution. In dish, ersh is used in place of standard rsh. Ersh \nis written by Maarten Litmaath in 1994. With -s option, dish also uses ssh(secure shell).\nIn this case, ssh server must be installed in the remote host.\n\nThis limitation will be avoided by using ssh in version 1.22.\n\nOn linux, make is GNU make. While in general make is not GNU\nmake. Please consult administrator whether your machine has GNU make\ncommand.\n\nDish creates a work directory named .dish in your home directory for exclusive process control.\n\nDish behaves as \"on\" command when it is aliased.\n## Bugs\n\nDish sometimes fails when the command line includes many quotation\nmarks. It will be limitation of shell script and I could not avoid\nthis. Rewrinting dish by C-language will solve this problem.\n\n## Analogs\n\n\u003ca href=\"http://www3.informatik.tu-muenchen.de/~zimmerms/ppmake/\"\u003ePVM Parallel Make (ppmake)\u003c/a\u003e\n\n## Change Log\n\u003cdl\u003e\n\u003cdt\u003ev1.22 Feb.6, 2013\n\u003cdd\u003eMoved to GitHub. \n\u003cdt\u003ev1.21 Feb.19, 2003\n\u003cdd\u003e-g|--group option is added.\n\u003c/dl\u003e\n\u003ch2\u003eAcknowledgment\u003c/h2\u003e\nI'd like to thank to the following people who gave me a lot of valuable opinions, patches, and contributions.\n\u003cul\u003e\n\u003cli\u003eSeisei Yamaguchi\n\u003c/ul\u003e\nAny comments and questions to \u003ca\nhref=\"mailto:vitroid@gmail.com\"\u003evitroid@gmail.com\u003c/a\u003e.\n\n----\n\n# dish --- 分散シェル\n\u003cimg src=\"wheel.gif\"\u003e\n\ncurrent version: 1.23\n\n---- \n\ndishはGNU makeの内部で使用されている`sh -c`の代わりとして設計されまし\nた。dishを使えば、ネットワークで結合された不均質なワークステーションク\nラスタ上で、たくさんの手続きを同時にこなすことができます。\n\ndishはまるで`sh -c`コマンドのように動作します、つまり、コマンドライン\n引数を読み込み、それをBourneシェルスクリプトと解釈して実行します。内部\nでは、引数は遠隔シェルコマンドrshに渡され、遠隔のワークステーションで\n実行され、その結果をステータスとして返します。\n\nアニメーションの製作や多数の音声ファイルの変換、巨大なソフトウェアの翻\n訳などのように、数百の独立な処理を分散的に行わなければならない場合に役\nに立ちます。\n\nコマンドを実行する遠隔ホストは、与えられたリストの中から選択されます。\nもし、システムのアーキテクチャに依存するようなバイナリファイルを作りた\nい場合は、リストに含める遠隔ホストは同一のアーキテクチャでなければいけ\nません。\n\ndishは、ローカルディレクトリと同一の遠隔ディレクトリでコマンドを実行し\nます。遠隔ホストとローカルホストがディレクトリを共有し、かつディレクト\nリ樹の構造が同一である必要があります。\n\n## コマンドの使い方\n\n\tusage:  dish [options] foo [x] [bar [y] ... ] -c cmds\n\ndishは、与えられたホスト表のうちから1つを選んでcmdsを実行します。\n最大x個のジョブがホストfooに、y個のジョブがホストbarに投入されます。\nジョブの数を省略した場合のデフォルトは1となります。\n\t\n### オプション\n\t\n\t-h, --help         ヘルプを表示します。\n\t-i, --interactive  標準入力から読みこみます。\n\t                   通常dishは標準入力を無視します。\n\t-v, --verbose      デバッグメッセージを表示します。\n\t-r, --refresh      ロックファイルを消去してから実行します。\n\t-s, --ssh          ershの代わりにsshを使用する。\n\t-g, --group FILE   ホスト表をファイルから読みこみます。\n\t-p, --pwd PATH     現在のディレクトリを明示的に指定します。\n\t          通常、dishはPWD環境変数から現在のディレクトリを知りますが、\n\t          PWDシェル変数を設定しないシェルを使用している場合には、\n\t          dishはpwdコマンドを使用して現在のディレクトリの絶対パスを\n\t          入手します。しかし、現在のパスがシンボリックリンクを含む\n\t          場合には、現在の絶対パスの表現の仕方がローカルとリモートで異なる\n\t          ことがあります。\n\t-c     ホスト名リストの終わりを表わす。\n\tcmds   実行したいBourne shellコマンド.\n\n## Makefileの中の標準シェルを置き換える\n\nGNU makeは通常一度に1つの規則のみを解釈します。一方、`-j`オプションを与\nえると、並列に実行します。私達は、このGNU makeの並列機能を、ワークステー\nションクラスタ全体でコマンドを実行するのに利用します。`-j`オプションがあ\nると、GNU makeは規則の依存性を解析し、独立な規則を標準シェルを使って並\n列に実行します。それぞれのシェルはMakefile中の規則の短いスレッドを扱い、\n終了ステータスコードをGNU makeに返します。\n\n我々は標準シェルをdishでおきかえます。dishは`sh -c`とそっくりにふりま\nいます。予約変数SHELLがMakefile内で定義された場合、それぞれの規則定義\n行は`/bin/sh -c`の代わりにdishで実行されます。dishはそれぞれのスレッド\nを遠隔ホストの一つに送り出し、終了ステータスをGNU makeに報告します。\n\n`-j`オプションで指定される、並列ジョブの最大数は、dishの引数で指定される\nxの総和よりもおおきくなくてはいけません。dishは、複数同時に起動された\n場合には、自らジョブの個数を制御します。\n\nmakeプロセスを複数のホスト上に分散するには、次のようにタイプして下さい。\n\n\tmake -j 10 SHELL=\"dish host1 2 host2 host3 4\"\n\nmakeは10個の独立な規則を同時に実行しようとします。2つはhost1に、1つは\nhost2に、4つはhost4に送り出され、残り3つは待ち状態になります。\n\ndishはgmakeコマンドを実行しているホスト上で動作します。遠隔ホスト側に\nは特に何もインストールする必要はありません。\n\n(v1.21)-gオプションを与えた場合には、ホスト表をコマンドラインから読みこむかわりに、所定のファイル(`~/.dish_group/`以下に置く)から読みこみます。大規模クラスタでdishを使う場合に便利です。\n\nたとえば、`~/.dish_group/clients`に以下のような内容を書いておき、\n\n\tc001 2\n\tc002 2\n\tc003 2\n\n次のようなコマンドを実行すると、ホスト`c001`上で2つ、`c002`上で2つ、`c003`上で2つの計6つのプロセスを使って`all`をmakeすることができます。\n\n\tmake -j 6 all SHELL=\"dish -g clients\"\n\n## 注意\u003c\n\n標準の遠隔シェルコマンド('rsh')は遠隔で実行した終了ステータスを正しく\n返しません。dishでは、Maarten Litmaathによって1994年に書かれたershを代\nわりに利用します。-sオプションを与えると、dishはershの代わりにsshを使いますが、この場合\n遠隔ホストにsshのサーバが走っている必要があります。\n\nLinuxでは、makeはGNU makeを意味しますが、一般にはmakeはGNU makeのこと\nではありません。あなたの計算機にGNU makeコマンドがあるかどうか管理者に\n相談して下さい。\n\ndishは、排他的プロセス制御のためにホームディレクトリに.dishという名前のワーク\nディレクトリを作成します。\n\nおまけの機能として、dishをonという名前で実行すると、onコマンドの代わり\nになります。\n\n## Bugs\n\nコマンドラインに引用符がたくさんある場合に、dishが上手く動かない場合が\nあります。これはdishがシェルスクリプトで書かれていることに起因しており、\nうまく回避するためにはc言語などでdishを書き直すしかないと思われます。\n\n## 似たもの\n\u003ca href=\"http://www3.informatik.tu-muenchen.de/~zimmerms/ppmake/\"\u003ePVM Parallel Make (ppmake)\u003c/a\u003e\n\n## 謝辞\n以下の方々から有用な意見やpatch、貢献などをいただきました。ありがとうございました。(敬称略)\n\n* 山口青星\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitroid%2Fdish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitroid%2Fdish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitroid%2Fdish/lists"}