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 \ |
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
#!/usr/bin/python | |
import sys | |
import json | |
from collections import OrderedDict | |
appSettingsFilePath = "/opt/microsoft/mlserver/9.3.0/o16n/Microsoft.MLServer.WebNode/appsettings.json" | |
data = json.loads(open(appSettingsFilePath, "r").read().replace("\r\n",""), object_pairs_hook=OrderedDict) | |
data["Authentication"]["JWTSigningCertificate"]["Enabled"] = True | |
data["Authentication"]["JWTSigningCertificate"]["StoreName"] = "Root" |
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 | |
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 \ |
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 | |
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 \ |
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 | |
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 \ |
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 | |
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 \ |
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
# ----------------------------------------------------# | |
# GENERATE CLIENT FROM SWAGGER JSON | |
# ----------------------------------------------------# | |
# Generate client in C# using the swagger json file | |
import urllib, requests, json, ssl, os | |
service_name = 'ManualTransmissionService' | |
f = open('manual-transmission-service-swagger.json', "r") | |
swagger = f.read() |
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
# ----------------------------------------------------# | |
# STEP 1 : MODEL DEVELOPMENT | |
# ----------------------------------------------------# | |
# imports | |
from microsoftml.datasets.datasets import DataSetMtCars | |
import pandas as pd | |
from revoscalepy import rx_lin_mod, rx_predict | |
# using rx_lin_mod from revoscalepy package, create glm model with `mtcars` dataset |
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
library(mrsdeploy) | |
carsModel <- glm(formula = am ~ hp + wt, data = mtcars, family = binomial) | |
manualTransmission <- function(hp, wt) { | |
newdata <- data.frame(hp = hp, wt = wt) | |
predict(carsModel, newdata, type = "response") | |
} | |
remoteLogin("http://localhost:12800", username = "admin", password = "password", session = FALSE) | |
api <- publishService( | |
"ManualTransmissionService", | |
code = manualTransmission, |
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
library(httr) | |
library(jsonlite) | |
library(curl) | |
h <- new_handle() | |
handle_setform(h, | |
"grant_type"="client_credentials", | |
"resource"="https://management.core.windows.net/", | |
"client_id"="<CLIENT ID>", | |
"client_secret"="<CLIENT SECRET>" | |
) |
NewerOlder