slides/modules/data-transport.html

212 lines
8.6 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<title>Data Transport</title>
<meta name="description" content="FILLIN">
<meta name="author" content="FILLIN">
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- Original reveal JS stylesheets-->
<link rel="stylesheet" href="../reveal.js/dist/reset.css">
<link rel="stylesheet" href="../reveal.js/dist/reveal.css">
<link rel="stylesheet" href="../reveal.js/dist/theme/beige.css">
<!-- custom styles, e.g., imgcredit -->
<link rel="stylesheet" href="../custom/css/main.css" id="theme">
<script src="../custom/js/printpdf.js"></script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>Consuming datasets<br><small>Data Transport</small></h1>
</section>
<section>
<section>
<h2>Explore an existing dataset</h2>
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">
datalad clone https://hub.datalad.org/edu/penguins.git </code></pre>
<ul>
<li>Open a terminal and "clone" an existing dataset.</li>
<li>Explore the different files and directories in your terminal.
<ul>
<li>Does anything seem "off"? </li>
<li>What's the difference between "LICENSE.txt" and "adelie/manifest.txt"?</li></li>
<li>Can you obtain the content of "examples/adelie.jpg", and also drop it again?</li>
<li>Can you find a content identifier of "examples/adelie.jpg"?</li>
</ul>
</ul>
</section>
<section>
<h2>Explore an existing dataset</h2>
Clone the dataset and change into it:
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">
datalad clone https://hub.datalad.org/edu/penguins.git </code></pre>
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">
cd penguins </code></pre>
Find the identifier:<br>
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">
git-annex lookupkey examples/adelie.jpg </code></pre>
Get and drop file content:
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">
datalad get examples/adelie.jpg</code></pre>
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">
datalad drop examples/adelie.jpg</code></pre>
</section>
<section data-transition="None">
<h2>Content identifiers</h2>
<ul><li>Files in datasets have content-based identifiers</li>
<ul><li>The internal data organization based on identity hash:</li></ul>
<pre><code class="bash">$ md5sum adelie.jpg
96d64a3ce9491ec4a8e277bcb31bb016 adelie.jpg
</code></pre>
<ul><li>File identity rather than (potentially large/sensitive) file content is committed - version controlling files without checking contents into Git</li></ul></ul>
</section>
<section data-transition="None">
<h2>Content identifiers</h2>
<ul><li>git-annex tracks location information of files:</li>
<ul><li>File availability information is stored to
record a decentral network of file content.
A file can exist in multiple different locations.</li></ul></ul>
<pre><code class="language-bash" >$ git annex whereis adelie.jpg
whereis adelie.jpg (3 copies)
41726d7d-6e14-4e23-936b-89452c0dccf8 -- [uncurl]
83f2736d-70a7-412a-89df-01ee16326913 -- jsheunis@bnbmac48.local:~/Documents/psyinf/edu/palmerpenguins
9948e337-6ea4-4df5-81a6-ef4709b6121f -- git@2f026f1d3470:/var/lib/gitea/git/repositories/jsheunis/palmerpenguins.git [origin]
uncurl: https://upload.wikimedia.org/wikipedia/commons/e/e8/Adeliepinguin-01.jpg
ok
</code></pre>
</section>
<section data-transition="None">
<h3>Transport logistics: Lots of data, little disk-usage</h3>
<ul>
<li>
Cloned datasets are lean.
"Meta data" (file names, availability) are present, but <b>no file content</b>:</li>
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">$ datalad clone git@github.com:psychoinformatics-de/studyforrest-data-phase2.git
install(ok): /tmp/studyforrest-data-phase2 (dataset)
$ cd studyforrest-data-phase2 && du -sh
18M .</code></pre>
<li>
Files' contents can be retrieved on demand:
</li>
</ul>
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">$ datalad get sub-01/ses-movie/func/sub-01_ses-movie_task-movie_run-1_bold.nii.gz
get(ok): /tmp/studyforrest-data-phase2/sub-01/ses-movie/func/sub-01_ses-movie_task-movie_run-1_bold.nii.gz (file) [from mddatasrc...]</code></pre>
<li>Have access to more data on your computer than you have disk-space:</li>
<pre><code># eNKI dataset (1.5TB, 34k files):
$ du -sh
1.5G .
# HCP dataset (~200TB, >15 million files)
$ du -sh
48G . </code></pre>
</section>
<section data-markdown data-transition="None"> <script type="text/template">
## Plenty of data, but little disk-usage
Drop file content that is not needed:
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">$ datalad drop sub-01/ses-movie/func/sub-01_ses-movie_task-movie_run-1_bold.nii.gz
drop(ok): /tmp/studyforrest-data-phase2/sub-01/ses-movie/func/sub-01_ses-movie_task-movie_run-1_bold.nii.gz (file) [checking https://arxiv.org/pdf/0904.3664v1.pdf...]</code></pre>
When files are dropped, only "meta data" stays behind, and they can be re-obtained on demand.
<pre><code class="python">dl.get('input/tons-of-data')
[really complex analysis]
dl.drop('input/tons-of-data')
</code></pre>
</script></section>
</section>
<section>
<section data-transition="None">
<ul>
<li>Modify the file "LICENSE.txt".</li>
<li>Obtain the file contents for "adelie/manifest.txt". Modify the file.
<ul>
<li>Does anything seem "off"? </li>
<li>What is your operating system? Compare behaviors with neighbours using a different one</li></li>
</ul>
</ul>
</section>
<section>
<h2>A look under the hood</h2>
<a href="./annex-basics.html" target="_blank">Git-annex Basics</a>
</section>
<section>
Remove the dataset:
<pre><code data-trim class="language-bash" onmousemove="showHover(event)" onmousedown="clickCopy(event)" onmouseleave="leaveElement(event)">
cd ..
datalad drop -d penguins --reckless kill --what all -r
</code></pre>
</section>
</section>
</div> <!-- /.slides -->
</div> <!-- /.reveal -->
<script src="../reveal.js/dist/reveal.js"></script>
<script src="../reveal.js/plugin/notes/notes.js"></script>
<script src="../reveal.js/plugin/markdown/markdown.js"></script>
<script src="../reveal.js/plugin/highlight/highlight.js"></script>
<script src="../custom/js/copy-code.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 1280,
height: 960,
// Factor of the display size that should remain empty around the content
margin: 0.1,
// Bounds for smallest/largest possible scale to apply to content
minScale: 0.2,
maxScale: 1.0,
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
});
</script>
<!-- A footer with a "1" and "home" button to get back to the first slide and the index page -->
<div id="hidden" style="display:none;">
<div id="header">
<div id="footer-left"><a href="#0">1️⃣</a></div>
<div id="footer-right"><a href="../workshops/2025-DKZ.2R.html">🏠</a></div>
<!-- <div id="footer-right"><a href="../index.html">🏠</a></div>-->
</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="../custom/js/headerandfooter.js"></script>
</body>
</html>