Skip to content

Commit

Permalink
deploy: 40b767b
Browse files Browse the repository at this point in the history
  • Loading branch information
houstonhaynes committed Feb 20, 2025
0 parents commit ac861d9
Show file tree
Hide file tree
Showing 187 changed files with 191,056 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
85 changes: 85 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
FROM jupyter/base-notebook:latest

# Install .NET CLI dependencies

ARG NB_USER=fsdocs-user
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}

WORKDIR ${HOME}

USER root

ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# Opt out of telemetry until after we install jupyter when building the image, this prevents caching of machine id
DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT=true \
DOTNET_SDK_VERSION=5.0.202

# Install .NET CLI dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu66 \
libssl1.1 \
libstdc++6 \
zlib1g \
curl \
git \
&& rm -rf /var/lib/apt/lists/*

# When updating the SDK version, the sha512 value a few lines down must also be updated.
# Install .NET SDK
RUN curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
&& dotnet_sha512='01ed59f236184987405673d24940d55ce29d830e7dbbc19556fdc03893039e6046712de6f901dc9911047a0dee4fd15319b7e94f8a31df6b981fa35bd93d9838' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
# Trigger first run experience by running arbitrary cmd
&& dotnet help

# Copy notebooks
COPY ./ ${HOME}/notebooks/

# Copy package sources
# COPY ./NuGet.config ${HOME}/nuget.config

RUN chown -R ${NB_UID} ${HOME}
USER ${USER}

# Clone and build Furnace-cpu bundle to get the latest TorchSharp and libtorch-cpu packages downloaded and cached by nuget within the Docker image
# This the makes user experience faster when running #r "nuget: Furnace-cpu
RUN git clone --depth 1 https://github.com/Furnace/Furnace.git \
&& dotnet build Furnace/bundles/Furnace-cpu

#Install nteract
RUN pip install nteract_on_jupyter

# Install lastest build from master branch of Microsoft.DotNet.Interactive
RUN dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-interactive

#latest stable from nuget.org
#RUN dotnet tool install -g Microsoft.dotnet-interactive --add-source "https://api.nuget.org/v3/index.json"

ENV PATH="${PATH}:${HOME}/.dotnet/tools"
RUN echo "$PATH"

# Install kernel specs
RUN dotnet interactive jupyter install

# Enable telemetry once we install jupyter for the image
ENV DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT=false

# Set root to notebooks
WORKDIR ${HOME}/notebooks/
14 changes: 14 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet3-dev" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json" />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="PSGallery" value="https://www.powershellgallery.com/api/v2/" />
</packageSources>
</configuration>
40 changes: 40 additions & 0 deletions README.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
(**
# Running notebooks in MyBinder
The `Dockerfile` and `NuGet.config` allow us to run generated notebooks in [MyBinder](https://mybinder.org)
* `master` branch of fsprojects/Furnace: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/fsprojects/Furnace/master)
# Generating docs
To iterate on docs (requires evaluation off since DLLs get locked)
dotnet fsdocs watch
To use a local build of FSharp.Formatting:
git clone https://github.com/fsprojects/FSharp.Formatting ../FSharp.Formatting
pushd ..\FSharp.Formatting
.\build
popd
pop
Then:
..\FSharp.Formatting\src\FSharp.Formatting.CommandTool\bin\Debug\net6.0\fsdocs.exe watch
..\FSharp.Formatting\src\FSharp.Formatting.CommandTool\bin\Debug\net6.0\fsdocs.exe build --clean --eval
## Generated Notebooks
Notebooks are generated for all .md and .fsx files under docs as part of the build.
* Dockerfile - see [https://github.com/dotnet/interactive/blob/master/docs/CreateBinder.md](https://github.com/dotnet/interactive/blob/master/docs/CreateBinder.md)
* NuGet.config - likewise
See MyBinder for creating URLs
*)

157 changes: 157 additions & 0 deletions README.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Running notebooks in MyBinder
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta name="author" content="Atılım Güneş Baydin, Don Syme, Barak A. Pearlmutter, Jeffrey Siskind, and Furnace contributors">
<meta name="description" content="Furnace is a tensor library with support for differentiable programming. It is designed for use in machine learning, probabilistic programming, optimization and other domains.">
<!-- Opengraph properties (https://ogp.me/) -->
<meta property="og:site_name" content="Furnace">
<meta property="og:title" content="Running notebooks in MyBinder
" />
<meta property="og:image" content="https://fsprojects.github.io/Furnace/img/Furnace-logo.png" />
<meta property="og:url" content="https://fsprojects.github.io/Furnace/README.html">
<meta property="og:type" content="website" />
<!-- Twitter cards (https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image) -->
<meta name="twitter:card" content="summary_image">
<meta name="twitter:site" content="https://fsprojects.github.io/Furnace/">
<meta name="twitter:title" content="Running notebooks in MyBinder
">
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">

<link type="text/css" rel="stylesheet" href="https://fsprojects.github.io/Furnace/content/fsdocs-default.css" />
<script src="https://fsprojects.github.io/Furnace/content/fsdocs-tips.js" type="text/javascript"></script>

<!-- BEGIN SEARCH BOX: this adds support for the search box -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />
<!-- END SEARCH BOX: this adds support for the search box -->
</head>
<body>
<div class="container">
<!-- <div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://fsharp.org">fsharp.org</a></li>
</ul>
<h3 class="muted">Furnace</h3>
</div> -->
<!-- <hr /> -->
<div class="row">
<div class="col-xs-12" style="height:10px;"></div>
</div>
<div class="row">
<div class="span3" id="fsdocs-nav">
<a href="index.html"><img class="logo" src="https://fsprojects.github.io/Furnace/img/Furnace-logo-text.png"/></a>

<!-- BEGIN SEARCH BOX: this adds support for the search box -->
<div id="header">
<div class="searchbox">
<label for="search-by">
<i class="fas fa-search"></i>
</label>
<input data-search-input="" id="search-by" type="search" placeholder="Search..." />
<span data-search-clear="">
<i class="fas fa-times"></i>
</span>
</div>
</div>
<!-- END SEARCH BOX: this adds support for the search box -->

<ul class="nav nav-list" id="menu">
<!-- <li class="nav-header">Furnace</li> -->
<!-- <li class="divider"></li> -->
<li><a href="https://fsprojects.github.io/Furnace/index.html">Home</a></li>
<li><a href="https://github.com/fsprojects/Furnace/">GitHub</a></li>
<li><a href="https://github.com/fsprojects/Furnace/blob/dev/LICENSE">License (BSD)</a></li>

<li class="nav-header">Getting Started</li>
<!-- <li class="divider"></li> -->
<li><a href="https://fsprojects.github.io/Furnace/install.html">Install</a></li>
<li><a href="https://fsprojects.github.io/Furnace/quickstart.html">Quickstart</a></li>
<!-- <li><a href="https://fsprojects.github.io/Furnace/tensors.html">Tensors</a></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/differentiable-programming.html">Differentiable Programming</a></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/nested-derivatives.html">Nested Derivatives</a></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/models.html">Models</a></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/optimization.html">Optimization</a></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/probability-distributions.html">Probability Distributions</a></li> -->

<li class="nav-header">Tutorials</li>
<!-- <li class="divider"></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/tutorial-classifier.html">Classifier</a></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/tutorial-gan.html">GAN</a></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/tutorial-vae.html">VAE</a></li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/tutorial-language.html">Language Models</a></li> -->
<li><a href="https://github.com/fsprojects/Furnace/tree/dev/examples">More Examples</a></li>

<li class="nav-header">API Documentation</li>
<li><a href="https://fsprojects.github.io/Furnace/reference/index.html">API Reference</a></li>
<li><a href="https://fsprojects.github.io/Furnace/extensions.html">Extensions</a></li>

<!-- <li class="nav-header">Examples</li> -->
<!-- <li class="divider"></li> -->
<!-- <li class="nav-header">Machine Learning</li> -->
<!-- <li><a href="https://fsprojects.github.io/Furnace/examples-topic1.html">Topic 1</a></li> -->

<!-- <li class="divider"></li>
<li class="nav-header">Authors</li>
<li><a href="http://www.robots.ox.ac.uk/~gunes/">Atılım Güneş Baydin</a></li>
<li><a href="http://www.bcl.hamilton.ie/~barak/">Barak A. Pearlmutter</a></li>
<li><a href="https://www.microsoft.com/en-us/research/people/dsyme/">Don Syme</a></li> -->
</ul>
</div>
<div class="span9" id="fsdocs-content">
<h1><a name="Running-notebooks-in-MyBinder" class="anchor" href="#Running-notebooks-in-MyBinder">Running notebooks in MyBinder</a></h1>
<p>The <code>Dockerfile</code> and <code>NuGet.config</code> allow us to run generated notebooks in <a href="https://mybinder.org">MyBinder</a></p>
<ul>
<li><code>master</code> branch of fsprojects/Furnace: <a href="https://mybinder.org/v2/gh/fsprojects/Furnace/master"><img src="https://mybinder.org/badge_logo.svg" alt="Binder" /></a></li>
</ul>
<h1><a name="Generating-docs" class="anchor" href="#Generating-docs">Generating docs</a></h1>
<p>To iterate on docs (requires evaluation off since DLLs get locked)</p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="id">dotnet</span> <span class="id">fsdocs</span> <span class="id">watch</span>
</code></pre>
<p>To use a local build of FSharp.Formatting:</p>
<pre class="fssnip highlighted"><code lang="fsharp"> <span class="id">git</span> <span class="id">clone</span> <span class="id">https</span><span class="pn">:</span><span class="c">//github.com/fsprojects/FSharp.Formatting ../FSharp.Formatting</span>
<span class="id">pushd</span> <span class="o">..</span>
<span class="pn">.</span>
<span class="id">popd</span>
<span class="id">pop</span>
</code></pre>
<p>Then:</p>
<pre class="fssnip highlighted"><code lang="fsharp"> <span class="o">..</span>
<span class="o">..</span>
</code></pre>
<h2><a name="Generated-Notebooks" class="anchor" href="#Generated-Notebooks">Generated Notebooks</a></h2>
<p>Notebooks are generated for all .md and .fsx files under docs as part of the build.</p>
<ul>
<li><p>Dockerfile - see <a href="https://github.com/dotnet/interactive/blob/master/docs/CreateBinder.md">https://github.com/dotnet/interactive/blob/master/docs/CreateBinder.md</a></p></li>
<li>NuGet.config - likewise</li>
</ul>
<p>See MyBinder for creating URLs</p>


</div>
</div>
<div class="row">
<div class="span3"></div>
<div class="span9">
<hr>
<p style="height:50px; display: table-cell; vertical-align: bottom;">© Copyright 2025, Furnace Contributors.</p>
<br>
</div>
</div>
</div>
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />
<script type="text/javascript">var fsdocs_search_baseurl = 'https://fsprojects.github.io/Furnace/'</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.8/lunr.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.min.js"></script>
<script type="text/javascript" src="https://fsprojects.github.io/Furnace/content/fsdocs-search.js"></script>
<!-- END SEARCH BOX: this adds support for the search box -->
</body>
</html>
77 changes: 77 additions & 0 deletions README.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},

"source": [
"# Running notebooks in MyBinder\n",
"\n",
"The `Dockerfile` and `NuGet.config` allow us to run generated notebooks in [MyBinder](https://mybinder.org)\n",
"\n",
"* `master` branch of fsprojects/Furnace: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/fsprojects/Furnace/master)\n",
"\n",
"# Generating docs\n",
"\n",
"To iterate on docs (requires evaluation off since DLLs get locked)\n",
"\n",
" dotnet fsdocs watch \n",
"\n",
"To use a local build of FSharp.Formatting:\n",
"\n",
" git clone https://github.com/fsprojects/FSharp.Formatting ../FSharp.Formatting\n",
" pushd ..\\FSharp.Formatting\n",
" .\\build\n",
" popd\n",
" pop\n",
"\n",
"Then:\n",
"\n",
" ..\\FSharp.Formatting\\src\\FSharp.Formatting.CommandTool\\bin\\Debug\\net6.0\\fsdocs.exe watch\n",
" ..\\FSharp.Formatting\\src\\FSharp.Formatting.CommandTool\\bin\\Debug\\net6.0\\fsdocs.exe build --clean --eval\n",
"\n",
"## Generated Notebooks\n",
"\n",
"Notebooks are generated for all .md and .fsx files under docs as part of the build.\n",
"\n",
"* Dockerfile - see [https://github.com/dotnet/interactive/blob/master/docs/CreateBinder.md](https://github.com/dotnet/interactive/blob/master/docs/CreateBinder.md)\n",
" \n",
"\n",
"* NuGet.config - likewise\n",
" \n",
"\n",
"See MyBinder for creating URLs\n",
"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".NET (F#)",
"language": "F#",
"name": ".net-fsharp"
},
"language_info": {
"file_extension": ".fs",
"mimetype": "text/x-fsharp",
"name": "polyglot-notebook",
"pygments_lexer": "fsharp"
},
"polyglot_notebook": {
"kernelInfo": {
"defaultKernelName": "fsharp",
"items": [
{
"aliases": [],
"languageName": "fsharp",
"name": "fsharp"
}
]
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}

5 changes: 5 additions & 0 deletions content/fsdocs-custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

/*--------------------------------------------------------------------------
Customize your CSS here
/*--------------------------------------------------------------------------*/

Loading

0 comments on commit ac861d9

Please sign in to comment.