Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opinion about continuous installation #22

Closed
zhengle-advantaseeds opened this issue Sep 13, 2017 · 10 comments
Closed

Opinion about continuous installation #22

zhengle-advantaseeds opened this issue Sep 13, 2017 · 10 comments
Assignees
Projects

Comments

@zhengle-advantaseeds
Copy link

The package(v.0.1.0) did a great job. In the continuous installation option, it would be useful that the app sync to the online repository when the internet available. Otherwise, the app will start without updating if the internet unavailable. Thanks

@zhengle-advantaseeds
Copy link
Author

Here is the solution I proposed for it:
In ./utils/package_manager.R
add "RCurl" to init_pkgs

In ./utils/get_app_from_app_url.R
modify the get_remote_version by adding:
get_remote_version = function(...){ if(!RCurl::url.exists('www.bitbucket.org'))return('none') ... }

In ./utils/ensure.R
modify the cran_pkg_version by adding:
cran_pkg_version = function(pkg, cran_url){ if(RCurl::url.exists(cran_url)){ ... } else { packageVersion(pkg) } }

@Dripdrop12
Copy link
Member

What do you think about this simple ping wrapper?

ping_site <- function(site_url) {
  !as.logical(system(paste("ping -n 1", site_url)))
}

I am thinking we can just ping "www.google.com" once. If the ping fails, don't install anything and just load packages. I'll push a commit tonight.

@Dripdrop12
Copy link
Member

I'd like to reduce the number of package dependencies, and there is a catch-22 here. If we use RCurl to test our internet connection, we still have to install it from the internet. ping is always available to us ;)

@Dripdrop12
Copy link
Member

Check out commit 1dd34f0

@rareaquaticbadger
Copy link

Hi there,

Really liking this package! Currently though, I can't run the example_app as I'm getting a "Please connect to the internet and try again" message.

I'm not 100% sure, but I think this may be to be due to our company firewall not allowing pings, and it's something I can't seem change without admin privileges. Is there a logical option to ignore your ping_site() wrapper?

zhengle-advantaseeds RCurl solution works for me: RCurl::url.exists('www.google.com') returns TRUE, but ping_site("www.google.com") is returning FALSE.

@Dripdrop12
Copy link
Member

Dripdrop12 commented Nov 30, 2017

@zhengle-advantaseeds is pretty smart, so I'm not surprised ;). How about we add an option to ping or use RCurl for the internet connection check? Would you like that solution?

@Dripdrop12 Dripdrop12 reopened this Nov 30, 2017
@rareaquaticbadger
Copy link

Hi @Dripdrop12, yes, that would be great! Either an option to use RCurl or just to disable the ping check would be useful for those of us with overly restrictive firewall settings.

Thanks!

@Dripdrop12 Dripdrop12 added this to To Do in RInno Dec 14, 2017
@zhengle-advantaseeds
Copy link
Author

I think @Dripdrop12's ping_site is faster; because it does not require another package. Maybe we can dig into the RCurl package to extract the url.exists function and integrate into the RInno package.

@Dripdrop12
Copy link
Member

@rareaquaticbadger does !httr::http_error("www.google.com") work for you? We are already using httr, and it seems to accomplish what we need from ping_site

@Dripdrop12 Dripdrop12 moved this from To Do to In progress in RInno Dec 20, 2017
@Dripdrop12
Copy link
Member

Dripdrop12 commented Dec 26, 2017

@rareaquaticbadger Please re-open the issue if httr::http_error is not going to work for you; we've switched it over, and I hope that works!

RInno automation moved this from In progress to Done Dec 26, 2017
Dripdrop12 pushed a commit that referenced this issue Dec 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
RInno
  
Done
Development

No branches or pull requests

3 participants