Skip to content

Commit 6716270

Browse files
committed
udpat binder/holepunch directions
1 parent 8dfe4b6 commit 6716270

File tree

4 files changed

+57
-40
lines changed

4 files changed

+57
-40
lines changed

docs/index.html

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,38 +2162,38 @@ <h4 id="set-up-git-and-manage-github-credentials">set-up git and manage GitHub c
21622162
</div>
21632163
<h3 id="next-level">Next Level…</h3>
21642164
<p>Take your reproducibility to the next level. <a href="https://guides.github.com/activities/citable-code/">Make your code citable</a> by connecting your GitHub repo and your <a href="https://orcid.org/register">ORCID</a> (unique author ID) through to the <a href="https://zenodo.org/">Zenodo</a> archival repository. Now, every time you commit a milestone release, you also mint a DOI.</p>
2165-
<p>Containerize your repository with binder.org using the <a href="https://karthik.github.io/holepunch/"><code>holepunch</code> package</a>.</p>
2166-
<h4 id="quick_publish-your-code-in-a-binder.org-container">Quick_Publish your code in a binder.org container</h4>
2167-
<p>Use the <a href="https://karthik.github.io/holepunch/"><code>holepunch</code> package</a></p>
2165+
<h4 id="share-a-zero-install-compute-environment">Share a zero-install compute environment</h4>
2166+
<!-- Containerize your repository with binder.org using the [`holepunch` package](https://karthik.github.io/holepunch/) -->
2167+
<p>Publish your code in a binder.org container</p>
2168+
<!-- Use the [`holepunch` package](https://karthik.github.io/holepunch/) -->
21682169
<div class="layout-chunk" data-layout="l-body">
2169-
<div class="sourceCode">
2170-
<pre class="sourceCode r"><code class="sourceCode r"><span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'>holepunch</span><span class='op'>)</span>
21712170

2172-
<span class='fu'>write_compendium_description</span><span class='op'>(</span><span class='op'>)</span>
2173-
<span class='fu'>write_dockerfile</span><span class='op'>(</span><span class='op'>)</span>
2174-
<span class='fu'>generate_badge</span><span class='op'>(</span><span class='op'>)</span>
2175-
<span class='fu'>build_binder</span><span class='op'>(</span><span class='op'>)</span>
2176-
</code></pre>
2177-
</div>
21782171
</div>
2179-
<h4 id="bespoke_publish-your-code-in-a-binder">Bespoke_Publish your code in a binder</h4>
2180-
<p>I recently found my QuickPublish approach <em>didn’t quite work</em>. So I RTFMed the binder.org docs and it seemed to imply a preference for NOT using a <code>.binder/Dockerfile</code>. Therefore, here is an approach that is slightly less automated but more bulletproof.</p>
2172+
<!-- #### Bespoke_Publish your code in a binder -->
2173+
<!-- I recently found my QuickPublish approach _didn't quite work_. So I RTFMed the binder.org docs and it seemed to imply a preference for NOT using a `.binder/Dockerfile`. Therefore, here is an approach that is slightly less automated but more bulletproof. -->
2174+
<p>Everything you need is exemplified in binder-example for R that you can <a href="https://github.com/binder-examples/r">find on github</a></p>
2175+
<p>The key elements are an <code>install.R</code> and <code>runtime.txt</code> files. The content and format of each file is demonstrated properly at the GitHub repo. Browse and you will see.</p>
21812176
<p><strong>Step 1</strong></p>
21822177
<div class="layout-chunk" data-layout="l-body">
2183-
<div class="sourceCode">
2184-
<pre class="sourceCode r"><code class="sourceCode r"><span class='fu'>holepunch</span><span class='fu'>::</span><span class='fu'>write_compendium_description</span><span class='op'>(</span><span class='op'>)</span> <span class='co'># output is a DESCRIPTION file in the project root</span>
2185-
<span class='fu'>holepunch</span><span class='fu'>::</span><span class='fu'>write_runtime</span><span class='op'>(</span><span class='op'>)</span> <span class='co'># output is .binder/runtime.txt</span>
2186-
<span class='fu'>holepunch</span><span class='fu'>::</span><span class='fu'>write_install</span><span class='op'>(</span><span class='op'>)</span> <span class='co'># output is .binder/install.R</span>
2187-
<span class='fu'>holepunch</span><span class='fu'>::</span><span class='fu'>generate_badge</span><span class='op'>(</span><span class='op'>)</span> <span class='co'># output is a badge to be found in the README file(s)</span>
2188-
</code></pre>
2189-
</div>
2178+
21902179
</div>
2191-
<p><strong>Step 2</strong></p>
21922180
<ol type="a">
2193-
<li>Edit the <code>.binder/install.R</code> file using the following <a href="https://github.com/binder-examples/r/blob/master/install.R">model</a>.</li>
2194-
<li>Edit the <code>binder/install.R</code> file based on this <a href="https://github.com/binder-examples/r/blob/master/runtime.txt">model</a> or the <a href="https://github.com/jupyterhub/repo2docker/pull/772#issue-313426641">documentation</a></li>
2195-
<li>Edit the <code>DESCRIPTION</code> file using this basic <a href="https://github.com/libjohn/workshop_twitter_analysis/blob/main/DESCRIPTION">model</a>. <strong>Modify all the fields</strong>. You may want to base the <code>Depends</code> and <code>Remotes</code> sections on your <code>.binder/install.R</code> file</li>
2181+
<li>Create an <code>install.R</code> file and store it in the RStudio Project’s root directory.<br> Follow the example at <a href="https://github.com/binder-examples/r" class="uri">https://github.com/binder-examples/r</a> <br></li>
21962182
</ol>
2183+
<blockquote>
2184+
<p>This file should consist of install functions for each package used in your R code. If you’re not sure what packages you’re using, try running <code>holepunch::write_compendium_description()</code> and you will find the details listed in the DESCRIPTION file under the ‘Depends’ and ‘Remotes’ sections. <strong>IMPORTANT</strong>: Delete the <code>DESCRIPTION</code> file Before launching the binder build. In my experience the DESCRIPTION file will conflict with the binder’s build process. <br> For non-CRAN packages – specifically packages installed from GitHub – I recommend using the format: <code>remotes::install_github("gadenbuie/countdown")</code> for each package that is not on CRAN. CRAN packages can follow the format: <code>install.packages("dplyr")</code></p>
2185+
</blockquote>
2186+
<ol start="2" type="a">
2187+
<li>Create a <code>runtime.txt</code> file and store it in the RStudio Project’s root directory<br> Follow the example at <a href="https://github.com/binder-examples/r" class="uri">https://github.com/binder-examples/r</a> <br></li>
2188+
</ol>
2189+
<blockquote>
2190+
<p>Note: If you try using <code>holepunch</code>, it will store these files in a <code>.binder</code> subdirectory. In my experience this will cause the binder build to fail. For this reason, I don’t recommend using holepunch and I do recommend storing the two files in the Project root directory.</p>
2191+
</blockquote>
2192+
<p><strong>Step 2</strong></p>
2193+
<p>Generate a binder badge with <code>holepunch::generate_badge()</code>. This should store the badge in your GitHub’s project <code>README.md</code> file. Then <code>commit</code> and <code>push</code> your changes to GitHub; go to the README on GitHub, launch the build and wait for the long launch/build time.</p>
2194+
<!-- a. Edit the `.binder/install.R` file using the following [model](https://github.com/binder-examples/r/blob/master/install.R). -->
2195+
<!-- b. Edit the `binder/install.R` file based on this [model](https://github.com/binder-examples/r/blob/master/runtime.txt) or the [documentation](https://github.com/jupyterhub/repo2docker/pull/772#issue-313426641) -->
2196+
<!-- b. Edit the `DESCRIPTION` file using this basic [model](https://github.com/libjohn/workshop_twitter_analysis/blob/main/DESCRIPTION). **Modify all the fields**. You may want to base the `Depends` and `Remotes` sections on your `.binder/install.R` file -->
21972197
<hr />
21982198
<p><em>The old documentation from this site can be found in the <a href="https://github.com/data-and-visualization/git-tutorial/releases/tag/v0.9.2019">v.0.2019 release</a> on GitHub</em>.</p>
21992199
<div class="sourceCode" id="cb1"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>

docs/search.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"title": "Git, GitHub & RStudio",
66
"description": "RStudio users can leverage git Version control to enhance reproducibility.",
77
"author": [],
8-
"contents": "\r\nThe usethis package and the RStudio IDE will help you orchestrate your version control repositories as RStudio projects.\r\n\r\n\r\n\r\n\r\n\r\nSetup\r\nTo get started, make a free GitHub.com account. Make sure you have the latest versions of R, RStudio, and usethis. Then, setup your RStudio configuration using two key documents: Setup, and Managing Git(Hub) Credentials.\r\nTips\r\nClone or fork from GitHub\r\n\r\n\r\nusethis::create_from_github(\"https://github.com/data-and-visualization/git-tutorial\")\r\n\r\n\r\n\r\nCreate the GitHub repo from local\r\n\r\n\r\nlibrary(usethis)\r\nuse_git() # initialize a git repo\r\nuse_git_ignore()\r\nuse_readme.Rmd()\r\nuse_ccby_license()\r\n# Before next step → stage & commit changes\r\nuse_github() # Connect local repo to GitHub\r\n\r\n\r\n\r\nRename default branch\r\n\r\n\r\nlibrary(usethis)\r\ngit_default_branch()\r\ngit_default_branch_rename()\r\ngit_default_branch_rediscover()\r\n\r\n\r\n\r\nset-up git and manage GitHub credentials\r\n\r\n\r\n# Sign-in to your GitHub account\r\n# Read: https://usethis.r-lib.org/articles/articles/git-credentials.html\r\n# Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html\r\nusethis::create_github_token()\r\ngitcreds::gitcreds_set()\r\ngh::gh_whoami()\r\nusethis::git_sitrep()\r\nusethis::use_git_config(user.name = \"Jane Doe\", user.email = \"[email protected]\")\r\nusethis::git_sitrep()\r\n\r\n\r\n\r\nNext Level…\r\nTake your reproducibility to the next level. Make your code citable by connecting your GitHub repo and your ORCID (unique author ID) through to the Zenodo archival repository. Now, every time you commit a milestone release, you also mint a DOI.\r\nContainerize your repository with binder.org using the holepunch package.\r\nQuick_Publish your code in a binder.org container\r\nUse the holepunch package\r\n\r\n\r\nlibrary(holepunch)\r\n\r\nwrite_compendium_description()\r\nwrite_dockerfile()\r\ngenerate_badge()\r\nbuild_binder()\r\n\r\n\r\n\r\nBespoke_Publish your code in a binder\r\nI recently found my QuickPublish approach didn’t quite work. So I RTFMed the binder.org docs and it seemed to imply a preference for NOT using a .binder/Dockerfile. Therefore, here is an approach that is slightly less automated but more bulletproof.\r\nStep 1\r\n\r\n\r\nholepunch::write_compendium_description() # output is a DESCRIPTION file in the project root\r\nholepunch::write_runtime() # output is .binder/runtime.txt\r\nholepunch::write_install() # output is .binder/install.R\r\nholepunch::generate_badge() # output is a badge to be found in the README file(s)\r\n\r\n\r\n\r\nStep 2\r\nEdit the .binder/install.R file using the following model.\r\nEdit the binder/install.R file based on this model or the documentation\r\nEdit the DESCRIPTION file using this basic model. Modify all the fields. You may want to base the Depends and Remotes sections on your .binder/install.R file\r\nThe old documentation from this site can be found in the v.0.2019 release on GitHub.\r\n\r\n\r\n\r\n",
9-
"last_modified": "2022-04-05T11:39:25-04:00"
8+
"contents": "\r\nThe usethis package and the RStudio IDE will help you orchestrate your version control repositories as RStudio projects.\r\n\r\n\r\n\r\n\r\n\r\nSetup\r\nTo get started, make a free GitHub.com account. Make sure you have the latest versions of R, RStudio, and usethis. Then, setup your RStudio configuration using two key documents: Setup, and Managing Git(Hub) Credentials.\r\nTips\r\nClone or fork from GitHub\r\n\r\n\r\nusethis::create_from_github(\"https://github.com/data-and-visualization/git-tutorial\")\r\n\r\n\r\n\r\nCreate the GitHub repo from local\r\n\r\n\r\nlibrary(usethis)\r\nuse_git() # initialize a git repo\r\nuse_git_ignore()\r\nuse_readme.Rmd()\r\nuse_ccby_license()\r\n# Before next step → stage & commit changes\r\nuse_github() # Connect local repo to GitHub\r\n\r\n\r\n\r\nRename default branch\r\n\r\n\r\nlibrary(usethis)\r\ngit_default_branch()\r\ngit_default_branch_rename()\r\ngit_default_branch_rediscover()\r\n\r\n\r\n\r\nset-up git and manage GitHub credentials\r\n\r\n\r\n# Sign-in to your GitHub account\r\n# Read: https://usethis.r-lib.org/articles/articles/git-credentials.html\r\n# Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html\r\nusethis::create_github_token()\r\ngitcreds::gitcreds_set()\r\ngh::gh_whoami()\r\nusethis::git_sitrep()\r\nusethis::use_git_config(user.name = \"Jane Doe\", user.email = \"[email protected]\")\r\nusethis::git_sitrep()\r\n\r\n\r\n\r\nNext Level…\r\nTake your reproducibility to the next level. Make your code citable by connecting your GitHub repo and your ORCID (unique author ID) through to the Zenodo archival repository. Now, every time you commit a milestone release, you also mint a DOI.\r\nShare a zero-install compute environment\r\n\r\nPublish your code in a binder.org container\r\n\r\n\r\n\r\n\r\n\r\n\r\nEverything you need is exemplified in binder-example for R that you can find on github\r\nThe key elements are an install.R and runtime.txt files. The content and format of each file is demonstrated properly at the GitHub repo. Browse and you will see.\r\nStep 1\r\n\r\n\r\n\r\nCreate an install.R file and store it in the RStudio Project’s root directory. Follow the example at https://github.com/binder-examples/r \r\n\r\nThis file should consist of install functions for each package used in your R code. If you’re not sure what packages you’re using, try running holepunch::write_compendium_description() and you will find the details listed in the DESCRIPTION file under the ‘Depends’ and ‘Remotes’ sections. IMPORTANT: Delete the DESCRIPTION file Before launching the binder build. In my experience the DESCRIPTION file will conflict with the binder’s build process. For non-CRAN packages – specifically packages installed from GitHub – I recommend using the format: remotes::install_github(\"gadenbuie/countdown\") for each package that is not on CRAN. CRAN packages can follow the format: install.packages(\"dplyr\")\r\n\r\nCreate a runtime.txt file and store it in the RStudio Project’s root directory Follow the example at https://github.com/binder-examples/r \r\n\r\nNote: If you try using holepunch, it will store these files in a .binder subdirectory. In my experience this will cause the binder build to fail. For this reason, I don’t recommend using holepunch and I do recommend storing the two files in the Project root directory.\r\n\r\nStep 2\r\nGenerate a binder badge with holepunch::generate_badge(). This should store the badge in your GitHub’s project README.md file. Then commit and push your changes to GitHub; go to the README on GitHub, launch the build and wait for the long launch/build time.\r\n\r\n\r\n\r\nThe old documentation from this site can be found in the v.0.2019 release on GitHub.\r\n\r\n\r\n\r\n",
9+
"last_modified": "2022-04-08T14:55:24-04:00"
1010
},
1111
{
1212
"path": "resources.html",
1313
"title": "Resources",
1414
"author": [],
1515
"contents": "\r\nSlides\r\nResearch Reproducibility, 2021\r\nSocial Coding Sites\r\nhttps://github.com\r\nhttps://gitlab.com\r\nhttps://bitbucket.org\r\nDuke’s GitLab Instance\r\nManaging SSH keys\r\n\r\nGUI Git Clients\r\nRStudio – Free. Great for useRs\r\nSublime’s Merge – Downloaded and evaluated for free. $100 / 3-years of upgrades.\r\nGitKracken – Free if you have the GitHub Student Pack or the GitHub Teacher toolbox\r\nSourceTree – Free. (defaults to use with BitBucket)\r\nPackages\r\nhttps://usethis.r-lib.org/\r\nholepunch to make your reproducible code a container on binder.org\r\nFree Book\r\nHappy Git and GitHub for the useR\r\nHandy Article\r\n10 Common Problems / Solutions\r\nReproducibility\r\nWriting clear code: Tools for Reproducible Research\r\nInitial Steps Toward Reproducible Research\r\nMaking your research reproducible with TIER + R + GitHub Slides. Cetinkaya-Rundel, M. (2016). Open Science Framework. Retrieved from https://osf.io/phyau\r\n\r\n\r\n\r\n",
16-
"last_modified": "2022-04-05T11:39:25-04:00"
16+
"last_modified": "2022-04-08T14:55:24-04:00"
1717
}
1818
],
1919
"collections": []

docs/sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" version="1.0">
33
<url>
44
<loc>https://rfun.library.duke.edu/</loc>
5-
<lastmod>2022-04-05T11:39:20-04:00</lastmod>
5+
<lastmod>2022-04-08T14:55:21-04:00</lastmod>
66
</url>
77
<url>
88
<loc>https://rfun.library.duke.edu/resources.html</loc>

0 commit comments

Comments
 (0)