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

Commit

Permalink
update docs to include github auth feature (#75)
Browse files Browse the repository at this point in the history
* update docs to include github auth feature

* pr feedback for more verbose context

* move github auth instructions to pacakge management document

* remove github specific link from readme
  • Loading branch information
paselem authored Aug 25, 2017
1 parent 53b8058 commit 0f03d17
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ Use your pool configuration JSON file to define your pool in Azure.
},
"rPackages": {
"cran": ["some_cran_package", "some_other_cran_package"],
"github": ["username/some_github_package", "another_username/some_other_github_package"]
"github": ["username/some_github_package", "another_username/some_other_github_package"],
"githubAuthenticationToken": {}
},
"commandLine": []
}
Expand Down
36 changes: 36 additions & 0 deletions docs/20-package-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,41 @@ You can install packages by specifying the package(s) in your JSON pool configur
}
```

## Installing packages from a private GitHub repository

Clusters can be configured to install packages from a private GitHub repository by setting the __githubAuthenticationToken__ property. If this property is blank only public repositories can be used. If a token is added then public and the private github repo can be used together.

When the cluster is created the token is passed in as an environment variable called GITHUB\_PAT on start-up which lasts the life of the cluster and is looked up whenever devtools::install_github is called.

```json
{
{
"name": <your pool name>,
"vmSize": <your pool VM size name>,
"maxTasksPerNode": <num tasks to allocate to each node>,
"poolSize": {
"dedicatedNodes": {
"min": 2,
"max": 2
},
"lowPriorityNodes": {
"min": 1,
"max": 10
},
"autoscaleFormula": "QUEUE"
},
"rPackages": {
"cran": [],
"github": ["<project/some_private_repository>"],
"githubAuthenticationToken": "<github_authentication_token>"
},
"commandLine": []
}
}
```

_More information regarding github authentication tokens can be found [here](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)_

## Installing Packages per-*foreach* Loop
You can also install packages by using the **.packages** option in the *foreach* loop. Instead of installing packages during pool creation, packages (and it's dependencies) can be installed before each iteration in the loop is run on your Azure cluster.

Expand All @@ -35,5 +70,6 @@ results <- foreach(i = 1:number_of_iterations, .packages=c('package_1', 'package

Installing packages from github using this method is not yet supported.


## Uninstalling packages
Uninstalling packages from your pool is not supported. However, you may consider rebuilding your pool.
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This section will provide information about how Azure works, how best to take ad

4. **Package Management** [(link)](./20-package-management.md)

Best practices for managing your R packages across your Azure pool
Best practices for managing your R packages in code. This includes installation at the cluster or job level as well as how to use different package providers.

5. **Distributing your Data** [(link)](./21-distributing-data.md)

Expand All @@ -36,3 +36,4 @@ This section will provide information about how Azure works, how best to take ad
8. **Customize Cluster** [(link)](./30-customize-cluster.md)

Setting up your cluster to user's specific needs

0 comments on commit 0f03d17

Please sign in to comment.