This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trying to fixing missing img error, supress running examples for now
- Loading branch information
1 parent
8693eb8
commit 199d634
Showing
14 changed files
with
231 additions
and
194 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
library(outsider) | ||
repo <- 'dombennett/om..hello.world' | ||
# if not installed, install | ||
installed <- module_installed() | ||
if (!repo %in% installed[['repo']]) module_install(repo) | ||
hello_world <- module_import(fname = 'hello_world', repo = repo) | ||
|
||
# control the log stream | ||
# send output to file | ||
tmpfl <- tempfile() | ||
log_set(log = 'program_out', val = tmpfl) | ||
hello_world() | ||
(readLines(con = tmpfl)) | ||
file.remove(tmpfl) | ||
# send docker and program output to console | ||
log_set(log = 'program_out', val = TRUE) | ||
log_set(log = 'docker_out', val = TRUE) | ||
hello_world() | ||
# NOT RUN | ||
# library(outsider) | ||
# repo <- 'dombennett/om..hello.world' | ||
# # install and import | ||
# module_install(repo = repo) | ||
# hello_world <- module_import(fname = 'hello_world', repo = repo) | ||
# | ||
# # control the log stream | ||
# # send output to file | ||
# tmpfl <- tempfile() | ||
# log_set(log = 'program_out', val = tmpfl) | ||
# hello_world() | ||
# (readLines(con = tmpfl)) | ||
# file.remove(tmpfl) | ||
# # send docker and program output to console | ||
# log_set(log = 'program_out', val = TRUE) | ||
# log_set(log = 'docker_out', val = TRUE) | ||
# hello_world() | ||
# | ||
# # clean-up | ||
# module_uninstall(repo) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
library(outsider) | ||
# simplest repo | ||
repo <- 'dombennett/om..hello.world' | ||
# if not installed, install | ||
installed <- module_installed() | ||
if (!repo %in% installed[['repo']]) module_install(repo) | ||
# get help | ||
module_help(repo = repo) | ||
# import function | ||
hello_world <- module_import(fname = 'hello_world', repo = repo) | ||
# run function | ||
hello_world() | ||
# NOT RUN | ||
# library(outsider) | ||
# # simplest repo | ||
# repo <- 'dombennett/om..hello.world' | ||
# # install | ||
# module_install(repo = repo) | ||
# hello_world <- module_import(fname = 'hello_world', repo = repo) | ||
# # get help | ||
# module_help(repo = repo) | ||
# # import function | ||
# hello_world <- module_import(fname = 'hello_world', repo = repo) | ||
# # run function | ||
# hello_world() | ||
# | ||
# # uninstall | ||
# module_uninstall(repo) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,51 @@ | ||
library(outsider) | ||
# Set-up: install hello.world, ships with ubuntu | ||
# we can make simple commands in bash via R | ||
repo <- 'dombennett/om..hello.world' | ||
# if not installed, install | ||
installed <- module_installed() | ||
if (!repo %in% installed[['repo']]) module_install(repo) | ||
|
||
# Run echo | ||
# create a outsider object that contains argument and Docker container details | ||
otsdr <- outsider::.outsider_init(repo = repo, cmd = 'echo', | ||
arglist = c('hello world!')) | ||
# check details | ||
print(otsdr) | ||
# run the command | ||
# NOT RUN | ||
# library(outsider) | ||
# # Set-up: install hello.world, ships with ubuntu | ||
# # we can make simple commands in bash via R | ||
# repo <- 'dombennett/om..hello.world' | ||
# # install and import | ||
# module_install(repo = repo) | ||
# hello_world <- module_import(fname = 'hello_world', repo = repo) | ||
# | ||
# # Run echo | ||
# # create a outsider object that contains argument and Docker container details | ||
# otsdr <- outsider::.outsider_init(repo = repo, cmd = 'echo', | ||
# arglist = c('hello world!')) | ||
# # check details | ||
# print(otsdr) | ||
# # run the command | ||
# # NOT RUN | ||
# # outsider::.run(otsdr) | ||
# | ||
# # Send a file | ||
# # an existing outsider object can be modified | ||
# tmppth <- tempdir() | ||
# flpth <- file.path(tmppth, 'testfile') | ||
# write(x = 'hello from within a file!', file = flpth) | ||
# otsdr$files_to_send <- flpth | ||
# otsdr$cmd <- 'cat' | ||
# otsdr$arglist <- 'testfile' | ||
# # check details | ||
# print(otsdr) | ||
# # run the command | ||
# outsider::.run(otsdr) | ||
|
||
# Send a file | ||
# an existing outsider object can be modified | ||
tmppth <- tempdir() | ||
flpth <- file.path(tmppth, 'testfile') | ||
write(x = 'hello from within a file!', file = flpth) | ||
otsdr$files_to_send <- flpth | ||
otsdr$cmd <- 'cat' | ||
otsdr$arglist <- 'testfile' | ||
# check details | ||
print(otsdr) | ||
# run the command | ||
outsider::.run(otsdr) | ||
|
||
# Return a file | ||
# an existing outsider object can be modified | ||
otsdr$files_to_send <- NULL | ||
otsdr$cmd <- 'touch' | ||
otsdr$arglist <- 'newfile' | ||
otsdr$wd <- tmppth # determines where created files are returned to | ||
# check details | ||
print(otsdr) | ||
# run the command | ||
outsider::.run(otsdr) | ||
# check if 'newfile' exists in tempdir() | ||
nwflpth <- file.path(tmppth, 'newfile') | ||
(file.exists(nwflpth)) | ||
|
||
# Clean-up | ||
rm(otsdr) | ||
file.remove(flpth) | ||
file.remove(nwflpth) | ||
# | ||
# # Return a file | ||
# # an existing outsider object can be modified | ||
# otsdr$files_to_send <- NULL | ||
# otsdr$cmd <- 'touch' | ||
# otsdr$arglist <- 'newfile' | ||
# otsdr$wd <- tmppth # determines where created files are returned to | ||
# # check details | ||
# print(otsdr) | ||
# # run the command | ||
# outsider::.run(otsdr) | ||
# # check if 'newfile' exists in tempdir() | ||
# nwflpth <- file.path(tmppth, 'newfile') | ||
# (file.exists(nwflpth)) | ||
# | ||
# # Clean-up | ||
# rm(otsdr) | ||
# file.remove(flpth) | ||
# file.remove(nwflpth) | ||
# module_uninstall(repo) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.