commands.tex 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. \section{Commands}
  2. Synrc mad has a simple interface as follows:
  3. \vspace{1\baselineskip}
  4. \begin{lstlisting}
  5. MAD Container Tool version b547fa
  6. invoke = mad params
  7. params = [] | command [ options ] params
  8. command = app | deps | clean | compile | up
  9. | release [ beam | ling | script | runc ]
  10. | deploy | start | stop | attach | sh
  11. \end{lstlisting}
  12. \vspace{1\baselineskip}
  13. It seems to us more natural, you can specify random
  14. commands set with different specifiers (options).
  15. \subsection{deps, dep}
  16. In rebar-like managers we are selecting deps from rebar.config:
  17. \vspace{1\baselineskip}
  18. \begin{lstlisting}
  19. {sub_dirs,["apps"]}.
  20. {deps_dir,"deps"}.
  21. {deps, [active,{nitro,"2.9"},{n2o,"2.9"}]}.
  22. \end{lstlisting}
  23. \vspace{1\baselineskip}
  24. The search sequence for dependecies is follows. First mad will try to
  25. reach global package repository at \footahref{http://synrc.com/apps/index.txt}{http://synrc.com/apps/index.txt},
  26. this address is configurable. No application server is required for mad
  27. package management, only static files with OTP application format.
  28. \vspace{1\baselineskip}
  29. \begin{lstlisting}
  30. {application,bpe,
  31. [{description,"BPE SRC Business Process Engine"},
  32. {vsn,"1.9"},
  33. {registered,[]},
  34. {applications,[kernel,stdlib,kvs,n2o]},
  35. {dependencies,[kernel,stdlib,fs,ranch,crypto,mnesia,
  36. gproc,cowlib,kvs,cowboy,n2o,active,
  37. jsone,mad,nitro,sh,bpe]},
  38. {mod,{bpe_app,[]}},
  39. {env,[]},
  40. {modules,[bpe,bpe_app,bpe_date,bpe_event,bpe_metainfo,bpe_proc,
  41. bpe_sup,bpe_task,default_railing,log_allow,routes,
  42. sampleproc,sampleproc_process]}]}.
  43. \end{lstlisting}
  44. \vspace{1\baselineskip}
  45. If no file is found or server is unavailable then application registry will
  46. be taken from mad built-in index.txt. If no luck then the name of application,
  47. e.g. "spawnproc/rete" will be interpreted as github repository address.
  48. \vspace{1\baselineskip}
  49. \begin{lstlisting}
  50. $ mad dep active n2o kvs ling "spawnproc/rete"
  51. \end{lstlisting}
  52. \vspace{1\baselineskip}
  53. \subsection{compile, com}
  54. Performs compilation of all known compilations backends in complilation profile of mad:
  55. \vspace{1\baselineskip}
  56. \begin{lstlisting}
  57. app — app.src erlang templating
  58. dtl — DTL compiler
  59. erl — BEAM compiler
  60. c/c++ — for gcc cland and other native compilation
  61. script — .script file used in projects like gproc
  62. yrl/xrl — DSL language parser compilers
  63. upl — UPL compiler
  64. \end{lstlisting}
  65. \vspace{1\baselineskip}
  66. \subsection{release, rel, bundle, bun}
  67. Taking all dependecies and resolve boot sequence according to dependecy order.
  68. Storing this value in .applist. If release type is not defined ({\bf beam} in following example),
  69. then {\bf script} release will be taken as a default.
  70. \vspace{1\baselineskip}
  71. \begin{lstlisting}
  72. $ mad release beam sample
  73. Ordered: [kernel,stdlib,fs,ranch,crypto,compiler,syntax_tools,
  74. gproc,cowlib,cowboy,n2o,sample,active,erlydtl,jsone,
  75. mad,nitro,sh]
  76. *WARNING* : Missing application sasl. Can not upgrade with this release
  77. sample.boot: ok
  78. OK: "sample"
  79. $ mad rel mad
  80. Ordered: [kernel,stdlib,inets,sh,mad]
  81. OK: "mad"
  82. \end{lstlisting}
  83. \vspace{1\baselineskip}
  84. MAD supports several releasing backends:
  85. \vspace{1\baselineskip}
  86. \begin{lstlisting}
  87. script — script bundles, like mad itself
  88. beam — ERTS releases with systools
  89. ling — LING portable unikernels
  90. runc — Docker-compatible containers
  91. \end{lstlisting}
  92. \vspace{1\baselineskip}
  93. \subsection{sh, repl, rep}
  94. Start REPL shell session.