Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Problems when installing package devtools and AzureML #123

Open
ActuarialPaul opened this issue Mar 7, 2017 · 10 comments
Open

Problems when installing package devtools and AzureML #123

ActuarialPaul opened this issue Mar 7, 2017 · 10 comments
Assignees
Labels

Comments

@ActuarialPaul
Copy link

ActuarialPaul commented Mar 7, 2017

Dear friends,

In R 3.3.2 I ran the following code:

if(!require("devtools")) install.packages("devtools")
devtools::install_github("RevolutionAnalytics/azureml")

And this generated the following error:

devtools::install_github("RevolutionAnalytics/azureml")
Error in curl::curl_fetch_disk(url, x$path, handle = handle) :
Couldn't connect to server

When trying the same in R 3.1.0 and R 3.1.3, the following error is generated:

Installing AzureML
Error in _digest(c(list(repos, type), lapply(_additional, function(x) eval(x[[2L]], :
object 'digest_impl' not found

I really don´t know what is going on.

Can somebody give me some help with this?

Best regards.

@andrie
Copy link
Contributor

andrie commented Mar 7, 2017

I don't know the answer to your question, but is there a reason you're not installing from CRAN?

@akzaidi
Copy link

akzaidi commented Mar 7, 2017

The initial error seems to be from curl. I'd update curl and httr and try again. But you should just try and use the CRAN version, since the latest version is on CRAN anyway.

@singlis
Copy link
Contributor

singlis commented Mar 7, 2017

That sounds like an issue with either curl installation or the way the proxy is setup for R.
Can you also try the devtools github sync on another project to see if it repros?

@ActuarialPaul
Copy link
Author

ActuarialPaul commented Mar 7, 2017 via email

@ActuarialPaul
Copy link
Author

ActuarialPaul commented Mar 7, 2017 via email

@ActuarialPaul
Copy link
Author

ActuarialPaul commented Mar 7, 2017 via email

@singlis
Copy link
Contributor

singlis commented Mar 7, 2017

Hello Paul,

I will try to repro your script. As a side note, I noticed the auth token in the code example above. I highly recommend changing your authentication token at the azure portal since this is a public forum.

As for the proxy setting, you can check to see if the following is set:

Sys.getenv("http_proxy")
Sys.getenv("https_proxy")

If any of those are set, then you are using a proxy server. They can be changed with Sys.setenv:
Sys.setenv(http_proxy="url or blank")

As for the settings file, you will need to create this. If you look in the documentation, "Using a settings.json" it gives an example for setting up the workspace. However, I pulled this from the example_datasets.R:

  # Use the default config file ~/azureml/settings.json with format:
  #   {"workspace":{
  #     "id":"test_id",
  #     "authorization_token": "test_token",
  #     "api_endpoint":"api_endpoint",
  #     "management_endpoint":"management_endpoint"
  #    }}
  # or, optionally set the `id` and `auth` parameters in the workspace
  # function.

  ws <- workspace()

Calling workspace() should load from that default location.

@ActuarialPaul
Copy link
Author

ActuarialPaul commented Mar 7, 2017 via email

@singlis
Copy link
Contributor

singlis commented Mar 7, 2017

  1. Login to azure.microsoft.com and find you Azure ML resource. When you select this, it will expand to three options.
  2. Select "Launch Azure Machine Learning Studio". This will navigate to a new site.
  3. Click "Sign In".
  4. On the left side, click "Settings" then the "Authorization Token" tab.
  5. Click "Regenerate" for each of the tokens.

These tokens you will now need to use in your script (really the first one should be fine, both are not needed for your script).

@singlis
Copy link
Contributor

singlis commented Mar 28, 2017

Hi Paul,

Very sorry for the delay in response. I had a chance to run through the scenario on a clean windows machine.

So I see you are trying out the example from the Getting Started - which is great. publishWebService is the correct call to be using (not PublishWebService).

Couple things that I noticed:

  1. I would not use the blank ws, use the one that you created with your id and token. The example in the documentation creates a default one (ws <- workspace()), which assumes you have this configuration saved to disk.
  2. I was missing zip on my machine. I had to install RTools (separate install from install.packages) that I downloaded from here:
    https://cran.r-project.org/bin/windows/Rtools

Make sure that you add RTools to your path through the install.

Here is what I ran, note (enter workspace id and enter workspace auth) need to be replaced.

> Sys.which('zip')
                       zip 
"c:\\Rtools\\bin\\zip.exe" 
> library(AzureML)
> ws <- workspace('<enter workspace id>', '<enter workspace auth token>')
> add <- function(x, y) {
+     x + y
+ }
> api <- publishWebService(
+     ws,
+     fun = add, 
+     name = "AzureML-vignette-silly",
+     inputSchema = list(
+         x = "numeric", 
+         y = "numeric"
+     ), 
+     outputSchema = list(
+         ans = "numeric"
+     )
+ )
> class(api)
[1] "Endpoint"   "data.frame"
> names(api)
 [1] "Name"                  "Description"           "CreationTime"          "WorkspaceId"           "WebServiceId"         
 [6] "HelpLocation"          "PrimaryKey"            "SecondaryKey"          "ApiLocation"           "GlobalParameters"     
[11] "MaxConcurrentCalls"    "DiagnosticsTraceLevel" "ThrottleLevel"  

Let me know how this works out. If I don't hear from you in the next couple of days, I'll close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants