{"id":287237,"date":"2018-08-16T13:32:37","date_gmt":"2018-08-16T09:32:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=287237"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=287237","title":{"rendered":"\u0414\u043e\u043a\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431 \u043d\u0430 R \u0438 Python"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/company\/microsoft\/blog\/420159\/\" class=\"post__text post__text-html js-mediator-article\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0441\u043b\u0443\u0436\u0431\u0430, \u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f (\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f) \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 docker-\u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 R, Python \u0438 \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/se\/lz\/8z\/selz8z-caoqs_zvjlfuv2bwkzxe.jpeg\"><a name=\"habracut\"><\/a><\/p>\n<p>  \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043a\u0430\u043a \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e \u0432 \u0432\u0438\u0434\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 (\u041e\u0421) \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0443\u0437\u043b\u0430. <a href=\"https:\/\/www.docker.com\/\">Docker <\/a>\u2014 \u044d\u0442\u043e <a href=\"https:\/\/github.com\/docker\/docker\">\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c<\/a> \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u044b\u0445, \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0438\u043b\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441\u043c. <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/standard\/microservices-architecture\/container-docker-introduction\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <a href=\"https:\/\/docs.microsoft.com\/en-us\/machine-learning-server\/what-is-machine-learning-server\">Microsoft Machine Learning Server<\/a> \u2014 \u044d\u0442\u043e \u0433\u0438\u0431\u043a\u0430\u044f \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0446\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u044f\u0437\u044b\u043a\u043e\u0432 Python \u0438 R. \u0422\u0435\u0440\u043c\u0438\u043d \u00ab<a href=\"https:\/\/docs.microsoft.com\/en-us\/machine-learning-server\/what-is-operationalization\">\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/a>\u00bb \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0430\u0445 R \u0438 Python \u043d\u0430 Microsoft Machine Learning Server \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/docs.microsoft.com\/en-us\/machine-learning-server\/operationalize\/concept-what-are-web-services\">\u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431<\/a> \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0436\u0431 \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c docker-\u043e\u0431\u0440\u0430\u0437, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 <a href=\"https:\/\/blogs.technet.microsoft.com\/machinelearning\/2018\/02\/27\/introducing-the-microsoft-machine-learning-server-9-3-release\/\">Machine Learning Server 9.3<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0439\u043b\u043e\u0432 Docker, \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439:<\/p>\n<ol>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 R.<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 Python.<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a Jupyter Notebook.<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 OneBox.<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u044b R.<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u044b Python.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/h2>\n<p>  \u041b\u044e\u0431\u0430\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 Linux c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u041f\u041e docker community edition (CE). \u041f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b <a href=\"https:\/\/portal.azure.com\/#create\/Canonical.UbuntuServer1604LTS-ARM\">Ubuntu 16.04 VM<\/a> \u0438 <a href=\"https:\/\/docs.docker.com\/install\/linux\/docker-ce\/ubuntu\/#install-docker-ce\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b docker CE<\/a>.<\/p>\n<h2>\u0428\u0430\u0433 1<\/h2>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u0440\u0430\u0437 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c mlserver \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c <a href=\"https:\/\/blogs.technet.microsoft.com\/machinelearning\/2018\/02\/27\/introducing-the-microsoft-machine-learning-server-9-3-release\/\">Machine Learning Server 9.3<\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e docker-\u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"cs\">\tFROM ubuntu:16.04 \tRUN apt-get -y update \\ \t    &amp;&amp; apt-get install -y apt-transport-https wget \\ \t    &amp;&amp; echo \"deb [arch=amd64] https:\/\/packages.microsoft.com\/repos\/azure-cli\/ xenial main\" | tee \/etc\/apt\/sources.list.d\/azure-cli.list \\ \t    &amp;&amp; wget https:\/\/packages.microsoft.com\/config\/ubuntu\/16.04\/packages-microsoft-prod.deb -O \/tmp\/prod.deb \\ \t    &amp;&amp; dpkg -i \/tmp\/prod.deb \\ \t    &amp;&amp; rm -f \/tmp\/prod.deb \\ \t    &amp;&amp; apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893 \\ \t    &amp;&amp; apt-get -y update \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-foreachiterators-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-mkl-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-mro-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-packages-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-python-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-packages-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mml-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mml-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mlm-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mlm-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y azure-cli=2.0.26-1~xenial \\ \t    &amp;&amp; apt-get install -y dotnet-runtime-2.0.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-adminutil-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-config-rserve-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-computenode-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-webnode-9.3.0 \\ \t    &amp;&amp; apt-get clean \\ \t    &amp;&amp; \/opt\/microsoft\/mlserver\/9.3.0\/bin\/R\/activate.sh<\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <a href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/build\/\">docker build<\/a>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 mlserver \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 docker-\u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"cs\">docker build -f mlserver-dockerfile -t mlserver.<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 mlserver, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"cs\">docker images<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 R<\/h2>\n<p>  <\/p>\n<pre><code class=\"cs\">docker run -it mlserver R<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7v\/xz\/fk\/7vxzfkn_cxbgfszq7-mtelkebpu.png\"><\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 Python<\/h2>\n<p>  <\/p>\n<pre><code class=\"cs\">docker run -it mlserver mlserver-python<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/de\/nh\/lj\/denhljnkq7uavavm1tcfc3bu_uy.png\"><\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a Jupyter Notebook<\/h2>\n<p>  <\/p>\n<pre><code class=\"cs\">docker run -p 8888:8888 -it mlserver \/opt\/microsoft\/mlserver\/9.3.0\/runtime\/python\/bin\/jupyter notebook --no-browser --port=8888 --ip=0.0.0.0 --allow-root<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443, \u043e\u0442\u043a\u0440\u044b\u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Jupyter Notebooks.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zz\/b8\/8l\/zzb88lx58nkjek3mxvpufewnhco.png\"><\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 OneBox<\/h2>\n<p>  Microsoft Learning Server \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u043c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u044b \u0434\u043b\u044f <a href=\"https:\/\/docs.microsoft.com\/en-us\/machine-learning-server\/operationalize\/configure-machine-learning-server-one-box\">\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<pre><code class=\"cs\">\tFROM ubuntu:16.04 \tRUN apt-get -y update \\ \t    &amp;&amp; apt-get install -y apt-transport-https wget \\ \t    &amp;&amp; echo \"deb [arch=amd64] https:\/\/packages.microsoft.com\/repos\/azure-cli\/ xenial main\" | tee \/etc\/apt\/sources.list.d\/azure-cli.list \\ \t    &amp;&amp; wget https:\/\/packages.microsoft.com\/config\/ubuntu\/16.04\/packages-microsoft-prod.deb -O \/tmp\/prod.deb \\ \t    &amp;&amp; dpkg -i \/tmp\/prod.deb \\ \t    &amp;&amp; rm -f \/tmp\/prod.deb \\ \t    &amp;&amp; apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893 \\ \t    &amp;&amp; apt-get -y update \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-foreachiterators-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-mkl-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-mro-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-packages-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-python-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-packages-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mml-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mml-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mlm-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mlm-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y azure-cli=2.0.26-1~xenial \\ \t    &amp;&amp; apt-get install -y dotnet-runtime-2.0.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-adminutil-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-config-rserve-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-computenode-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-webnode-9.3.0 \\ \t    &amp;&amp; apt-get clean \\ \t    &amp;&amp; \/opt\/microsoft\/mlserver\/9.3.0\/bin\/R\/activate.sh \t  \tRUN echo $'#!\/bin\/bash \\n\\ \tset -e \\n\\ \taz ml admin bootstrap --admin-password \"Microsoft@2018\" --confirm-password \"Microsoft@2018\" \\n\\ \texec \"$@\"' &gt; bootstrap.sh \tRUN chmod +x bootstrap.sh \tEXPOSE 12800 \tENTRYPOINT [\"\/bootstrap.sh\"] \tCMD [\"bash\"]<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0431\u0440\u0430\u0437 mlserver-onebox, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 docker-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"cs\">docker build -f mlserver-onebox-dockerfile -t mlserver-onebox.<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 mlserver-onebox, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"cs\">docker images<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 onebox \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"cs\">docker run --name mlserver-onebox-container -dit mlserver-onebox<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e:<\/p>\n<pre><code class=\"cs\">docker logs mlserver-onebox-container<\/code><\/pre>\n<p>  \u0423\u0431\u0435\u0434\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0447\u0442\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u0430\u043a one-box (\u0434\u0430\u043d\u043d\u044b\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 Docker \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443: \u00abAll Diagnostic Tests have passed\u00bb.).<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 IP-\u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"cs\">docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mlserver-onebox-container '172.17.0.3'<\/code><\/pre>\n<p>  \u0418 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u043a\u0430\u043a one-box:<\/p>\n<pre><code class=\"cs\">az login --mls --mls-endpoint \"http:\/\/172.17.0.3:12800\" --username \"admin\" --password \"Microsoft@2018\" az ml admin diagnostic run<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u044b R<\/h2>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u0441 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b \u0433\u043e\u0442\u043e\u0432 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u0430 \u0441 \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u043e\u0439 R \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/docs.microsoft.com\/en-us\/machine-learning-server\/operationalize\/how-to-deploy-web-service-publish-manage-in-r#1-r-code-and-model-are-objects\">Manual Transmission<\/a>, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e.<\/p>\n<pre><code class=\"cs\">\tFROM ubuntu:16.04 \tRUN apt-get -y update \\ \t    &amp;&amp; apt-get install -y apt-transport-https wget \\ \t    &amp;&amp; echo \"deb [arch=amd64] https:\/\/packages.microsoft.com\/repos\/azure-cli\/ xenial main\" | tee \/etc\/apt\/sources.list.d\/azure-cli.list \\ \t    &amp;&amp; wget https:\/\/packages.microsoft.com\/config\/ubuntu\/16.04\/packages-microsoft-prod.deb -O \/tmp\/prod.deb \\ \t    &amp;&amp; dpkg -i \/tmp\/prod.deb \\ \t    &amp;&amp; rm -f \/tmp\/prod.deb \\ \t    &amp;&amp; apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893 \\ \t    &amp;&amp; apt-get -y update \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-foreachiterators-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-mkl-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-mro-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-packages-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-python-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-packages-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mml-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mml-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mlm-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mlm-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y azure-cli=2.0.26-1~xenial \\ \t    &amp;&amp; apt-get install -y dotnet-runtime-2.0.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-adminutil-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-config-rserve-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-computenode-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-webnode-9.3.0 \\ \t    &amp;&amp; apt-get clean \\ \t    &amp;&amp; \/opt\/microsoft\/mlserver\/9.3.0\/bin\/R\/activate.sh \t  \tRUN echo $'library(mrsdeploy) \\n\\ \tcarsModel &lt;- glm(formula = am ~ hp + wt, data = mtcars, family = binomial) \\n\\ \tmanualTransmission &lt;- function(hp, wt) { \\n\\ \t     newdata &lt;- data.frame(hp = hp, wt = wt) \\n\\ \t     predict(carsModel, newdata, type = \"response\") \\n\\ \t} \\n\\ \tremoteLogin(\"http:\/\/localhost:12800\", username = \"admin\", password = \"Microsoft@2018\", session = FALSE) \\n\\ \tapi &lt;- publishService(\"ManualTransmissionService\", code = manualTransmission, model = carsModel, inputs = list(hp = \"numeric\", wt = \"numeric\"), outputs = list(answer = \"numeric\"), v = \"1.0.0\") \\n\\ \tresult &lt;- api$manualTransmission(120, 2.8) \\n\\ \tprint(result$output(\"answer\")) \\n\\ \tremoteLogout()' &gt; \/tmp\/ManualTransmission.R \t  \tRUN echo $'#!\/bin\/bash \\n\\ \tset -e \\n\\ \taz ml admin bootstrap --admin-password \"Microsoft@2018\" --confirm-password \"Microsoft@2018\" \\n\\ \t\/usr\/bin\/Rscript --no-save --no-restore --verbose \"\/tmp\/ManualTransmission.R\" \\n\\ \texec \"$@\"' &gt; bootstrap.sh \tRUN chmod +x bootstrap.sh \tEXPOSE 12800 \tENTRYPOINT [\"\/bootstrap.sh\"] \tCMD [\"bash\"]<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0431\u0440\u0430\u0437 rmanualtransmission, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 docker-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"cs\">docker build -f r-manualtransmission-dockerfile -t rmanualtransmission.<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 rmanualtransmission, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"cs\">docker images<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"cs\">docker run --name rmanualtransmission-container -dit rmanualtransmission<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e:<\/p>\n<pre><code class=\"cs\">docker logs rmanualtransmission-container<\/code><\/pre>\n<p>  \u0423\u0431\u0435\u0434\u0438\u0432\u0448\u0438\u0441\u044c, \u0447\u0442\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 IP-\u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"cs\">docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' rmanualtransmission-container '172.17.0.3'<\/code><\/pre>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b swagger.json \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 R \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0443\u0447\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434 curl:<\/p>\n<pre><code class=\"cs\">apt-get -y install jq  curl -s --header \"Content-Type: application\/json\" --request POST --data '{\"username\":\"admin\",\"password\":\"Microsoft@2018\"}' http:\/\/172.17.0.3:12800\/login | jq -r '.access_token' &lt;access token&gt;  curl -s --header \"Content-Type: application\/json\" --header \"Authorization: Bearer &lt;access token&gt;\" --request POST --data '{\"hp\":120,\"wt\":2.8}' http:\/\/172.17.0.3:12800\/api\/ManualTransmissionService\/1.0.0 {\"success\":true,\"errorMessage\":\"\",\"outputParameters\":{\"answer\":0.64181252840938208},\"outputFiles\":{},\"consoleOutput\":\"\",\"changedFiles\":[]}  curl -s --header \"Authorization: Bearer &lt;access token&gt;\" --request GET http:\/\/172.17.0.3:12800\/api\/ManualTransmissionService\/1.0.0\/swagger.json -o swagger.json<\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b swagger.json \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f <a href=\"https:\/\/docs.microsoft.com\/en-us\/machine-learning-server\/operationalize\/how-to-build-api-clients-from-swagger-for-app-integration#option-2-build-using-an-online-swagger-editor\">\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/a>.<\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u044b Python<\/h2>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/Microsoft\/ML-Server-Python-Samples\/blob\/master\/operationalize\/Quickstart_Publish_Python_Web_Service.ipynb\">\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u0430 \u0441 \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u043e\u0439 Python \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Manual Transmission<\/a>, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e.<\/p>\n<pre><code class=\"cs\">\tFROM ubuntu:16.04 \tRUN apt-get -y update \\ \t    &amp;&amp; apt-get install -y apt-transport-https wget \\ \t    &amp;&amp; echo \"deb [arch=amd64] https:\/\/packages.microsoft.com\/repos\/azure-cli\/ xenial main\" | tee \/etc\/apt\/sources.list.d\/azure-cli.list \\ \t    &amp;&amp; wget https:\/\/packages.microsoft.com\/config\/ubuntu\/16.04\/packages-microsoft-prod.deb -O \/tmp\/prod.deb \\ \t    &amp;&amp; dpkg -i \/tmp\/prod.deb \\ \t    &amp;&amp; rm -f \/tmp\/prod.deb \\ \t    &amp;&amp; apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893 \\ \t    &amp;&amp; apt-get -y update \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-foreachiterators-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-mkl-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-r-open-mro-3.4.3 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-packages-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-python-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-packages-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mml-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mml-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mlm-r-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-mlm-py-9.3.0 \\ \t    &amp;&amp; apt-get install -y azure-cli=2.0.26-1~xenial \\ \t    &amp;&amp; apt-get install -y dotnet-runtime-2.0.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-adminutil-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-config-rserve-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-computenode-9.3.0 \\ \t    &amp;&amp; apt-get install -y microsoft-mlserver-webnode-9.3.0 \\ \t    &amp;&amp; apt-get clean \\ \t    &amp;&amp; \/opt\/microsoft\/mlserver\/9.3.0\/bin\/R\/activate.sh \t  \tRUN echo $'from microsoftml.datasets.datasets import DataSetMtCars \\n\\ \timport pandas as pd \\n\\ \tfrom revoscalepy import rx_lin_mod, rx_predict \\n\\ \tcars_model = rx_lin_mod(formula=\"am ~ hp + wt\", data=DataSetMtCars().as_df()) \\n\\ \tmydata = pd.DataFrame({\"hp\":[120],\"wt\":[2.8]}) \\n\\ \tdef manualTransmission(hp, wt): \\n\\ \t\\timport pandas as pd \\n\\ \t\\tfrom revoscalepy import rx_predict \\n\\ \t\\tnewData = pd.DataFrame({\"hp\":[hp], \"wt\":[wt]}) \\n\\ \t\\treturn rx_predict(cars_model, newData, type=\"response\") \\n\\ \t\\n\\ \tfrom azureml.deploy import DeployClient \\n\\ \tfrom azureml.deploy.server import MLServer \\n\\ \tfrom azureml.common.configuration import Configuration \\n\\ \t\\n\\ \tHOST = \"http:\/\/localhost:12800\" \\n\\ \tcontext = (\"admin\", \"Microsoft@2018\") \\n\\ \tclient = DeployClient(HOST, use=MLServer, auth=context) \\n\\ \tservice_name = \"ManualTransmissionService\" \\n\\ \tservice_version = \"1.0.0\" \\n\\ \tservice = client.service(service_name).version(service_version).code_fn(manualTransmission).inputs(hp=float, wt=float).outputs(answer=pd.DataFrame).models(cars_model=cars_model).description(\"Man \tual Transmission Service\").deploy() \\n\\ \tres = service.manualTransmission(120, 2.8) \\n\\ \tprint(res.output(\"answer\"))' &gt; \/tmp\/ManualTransmission.py \t  \tRUN echo $'#!\/bin\/bash \\n\\ \tset -e \\n\\ \taz ml admin bootstrap --admin-password \"Microsoft@2018\" --confirm-password \"Microsoft@2018\" \\n\\ \tmlserver-python \/tmp\/ManualTransmission.py \\n\\ \texec \"$@\"' &gt; bootstrap.sh \tRUN chmod +x bootstrap.sh \tEXPOSE 12800 \tENTRYPOINT [\"\/bootstrap.sh\"] \tCMD [\"bash\"]<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0431\u0440\u0430\u0437 pymanualtransmission, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 docker-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"cs\">docker build -f py-manualtransmission-dockerfile -t pymanualtransmission.<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 pymanualtransmission, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"cs\">docker images<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"cs\">docker run --name pymanualtransmission-container -dit pymanualtransmission<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e:<\/p>\n<pre><code class=\"cs\">docker logs pymanualtransmission-container<\/code><\/pre>\n<p>  \u0423\u0431\u0435\u0434\u0438\u0432\u0448\u0438\u0441\u044c, \u0447\u0442\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 IP-\u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"cs\">docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pymanualtransmission-container '172.17.0.3'<\/code><\/pre>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b swagger.json \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 Python \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0443\u0447\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b curl:<\/p>\n<pre><code class=\"cs\">apt-get -y install jq  curl -s --header \"Content-Type: application\/json\" --request POST --data '{\"username\":\"admin\",\"password\":\"Microsoft@2018\"}' http:\/\/172.17.0.3:12800\/login | jq -r '.access_token' &lt;access token&gt;  curl -s --header \"Content-Type: application\/json\" --header \"Authorization: Bearer &lt;access token&gt;\" --request POST --data '{\"hp\":120,\"wt\":2.8}' http:\/\/172.17.0.3:12800\/api\/ManualTransmissionService\/1.0.0  {\"success\":true,\"errorMessage\":\"\",\"outputParameters\":{\"answer\":0.64181252840938208},\"outputFiles\":{},\"consoleOutput\":\"\",\"changedFiles\":[]}  curl -s --header \"Authorization: Bearer &lt;access token&gt;\" --request GET http:\/\/172.17.0.3:12800\/api\/ManualTransmissionService\/1.0.0\/swagger.json -o swagger.json<\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b swagger.json \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f <a href=\"https:\/\/docs.microsoft.com\/en-us\/machine-learning-server\/operationalize\/how-to-build-api-clients-from-swagger-for-app-integration#option-2-build-using-an-online-swagger-editor\">\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/a>.<\/p>\n<p>  <b>\u041f\u0420\u0418\u041c\u0415\u0427\u0410\u041d\u0418\u0415.<\/b> \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0435\u0431-\u0443\u0437\u043b\u0430 appsettings.json \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e docker-\u0444\u0430\u0439\u043b\u0430 magic \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c <a href=\"https:\/\/docs.microsoft.com\/en-us\/machine-learning-server\/operationalize\/configure-authentication\">\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e LDAP\/AAD<\/a>.<\/p>\n<h2>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 docker-\u043e\u0431\u0440\u0430\u0437\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432 \u0440\u0435\u0435\u0441\u0442\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 Azure (<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/container-registry\/container-registry-get-started-docker-cli\">Azure Container Registry, ACR<\/a>).<\/p>\n<p>  <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/tutorial-kubernetes-deploy-cluster\">\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432 Azure Kubernetes Service (AKS)<\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438\u0437 ACR \u043a\u043b\u0430\u0441\u0442\u0435\u0440, <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/tutorial-kubernetes-scale#autoscale-pods\">\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043a\u0430\u043f\u0441\u0443\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a> (Autoscale pods).<\/p>\n<h2>\u0421\u0421\u042b\u041b\u041a\u0418:<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/johnpaulada\/microsoftmlserver-docker\">github.com\/johnpaulada\/microsoftmlserver-docker<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/rcarmo\/docker-ml-server\">github.com\/rcarmo\/docker-ml-server<\/a><\/li>\n<li><a href=\"https:\/\/success.docker.com\/article\/use-a-script-to-initialize-stateful-container-data\">success.docker.com\/article\/use-a-script-to-initialize-stateful-container-data<\/a><\/li>\n<li><a href=\"https:\/\/docs.docker.com\/v17.09\/engine\/userguide\/eng-image\/dockerfile_best-practices\">docs.docker.com\/v17.09\/engine\/userguide\/eng-image\/dockerfile_best-practices<\/a><\/li>\n<li><a href=\"http:\/\/www.tothenew.com\/blog\/dockerizing-nginx-and-ssh-using-supervisord\">www.tothenew.com\/blog\/dockerizing-nginx-and-ssh-using-supervisord<\/a><\/li>\n<li><a href=\"https:\/\/microsoft.github.io\/deployr-api-docs\">microsoft.github.io\/deployr-api-docs<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/standard\/microservices-architecture\/container-docker-introduction\">docs.microsoft.com\/en-us\/dotnet\/standard\/microservices-architecture\/container-docker-introduction<\/a><\/li>\n<\/ul>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/420159\/\"> https:\/\/habr.com\/post\/420159\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/company\/microsoft\/blog\/420159\/\" class=\"post__text post__text-html js-mediator-article\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0441\u043b\u0443\u0436\u0431\u0430, \u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f (\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f) \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 docker-\u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 R, Python \u0438 \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/se\/lz\/8z\/selz8z-caoqs_zvjlfuv2bwkzxe.jpeg\"><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-287237","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287237"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287237\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}