Last active
September 17, 2018 16:27
-
-
Save ramnov/ffdb9306612f0716b6c480987352e12f to your computer and use it in GitHub Desktop.
Dockerfile to run onebox in Kubernetes cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
# Install Machine Learning Server | |
RUN apt-get -y update \ | |
&& apt-get install -y apt-transport-https wget \ | |
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ xenial main" | tee /etc/apt/sources.list.d/azure-cli.list \ | |
&& wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O /tmp/prod.deb \ | |
&& dpkg -i /tmp/prod.deb \ | |
&& rm -f /tmp/prod.deb \ | |
&& apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893 \ | |
&& apt-get -y update \ | |
&& apt-get install -y microsoft-r-open-foreachiterators-3.4.3 \ | |
&& apt-get install -y microsoft-r-open-mkl-3.4.3 \ | |
&& apt-get install -y microsoft-r-open-mro-3.4.3 \ | |
&& apt-get install -y microsoft-mlserver-packages-r-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-python-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-packages-py-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-mml-r-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-mml-py-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-mlm-r-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-mlm-py-9.3.0 \ | |
&& apt-get install -y azure-cli=2.0.26-1~xenial \ | |
&& apt-get install -y dotnet-runtime-2.0.0 \ | |
&& apt-get install -y microsoft-mlserver-adminutil-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-config-rserve-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-computenode-9.3.0 \ | |
&& apt-get install -y microsoft-mlserver-webnode-9.3.0 \ | |
&& apt-get clean \ | |
&& /opt/microsoft/mlserver/9.3.0/bin/R/activate.sh | |
# Extra steps required to run onebox in Kubernetes | |
RUN sed -i 's/grep docker/grep "kubepods\\|docker"/g' /opt/microsoft/mlserver/9.3.0/o16n/Microsoft.MLServer.*Node/autoStartScriptsLinux/*.sh \ | |
&& mkdir -p /home/webnode_usr/.dotnet/corefx/cryptography/x509stores/root \ | |
&& wget https://github.com/Microsoft/microsoft-r/raw/master/mlserver-arm-templates/enterprise-configuration/linux-postgresql/25706AA4612FC42476B8E6C72A97F58D4BB5721B.pfx -O /home/webnode_usr/.dotnet/corefx/cryptography/x509stores/root/25706AA4612FC42476B8E6C72A97F58D4BB5721B.pfx \ | |
&& chmod 666 /home/webnode_usr/.dotnet/corefx/cryptography/x509stores/root/*.pfx \ | |
&& wget https://gist.githubusercontent.com/ramnov/82772b762cc6c54e71fad041de02a3b1/raw/7e5451b175611341c899fc4c3be08b5f356e0d80/configure-jwt-cert.py -O /tmp/configure-jwt-cert.py \ | |
&& python /tmp/configure-jwt-cert.py \ | |
&& rm -f /tmp/configure-jwt-cert.py | |
# Configure Onebox | |
RUN echo $'#!/bin/bash \n\ | |
set -e \n\ | |
az ml admin bootstrap --admin-password "Microsoft@2018" --confirm-password "Microsoft@2018" \n\ | |
sleep infinity' > bootstrap.sh | |
RUN chmod +x bootstrap.sh | |
EXPOSE 12800 | |
ENTRYPOINT ["/bootstrap.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment