|
13 | 13 | }, |
14 | 14 | { |
15 | 15 | "cell_type": "code", |
16 | | - "execution_count": 1, |
17 | | - "metadata": {}, |
| 16 | + "execution_count": null, |
| 17 | + "metadata": { |
| 18 | + "tags": [ |
| 19 | + "hide_cell" |
| 20 | + ] |
| 21 | + }, |
18 | 22 | "outputs": [], |
19 | 23 | "source": [ |
20 | 24 | "! rm -rf /tmp/dds/tut_collab" |
21 | 25 | ] |
22 | 26 | }, |
| 27 | + { |
| 28 | + "cell_type": "markdown", |
| 29 | + "metadata": {}, |
| 30 | + "source": [ |
| 31 | + "We will mimic the switch between branches and computers with the two following functions. This assumes that at least the `internal_dir` of the stores are shared between all the collaborators. This is naturally the case when using a shared system such as Databricks' `DBFS` store or mounting a share drive such as NFS or even Microsoft SharePoint, Dropbox, .." |
| 32 | + ] |
| 33 | + }, |
23 | 34 | { |
24 | 35 | "cell_type": "code", |
25 | | - "execution_count": 2, |
| 36 | + "execution_count": null, |
26 | 37 | "metadata": {}, |
27 | 38 | "outputs": [], |
28 | 39 | "source": [ |
|
37 | 48 | "store_main()" |
38 | 49 | ] |
39 | 50 | }, |
| 51 | + { |
| 52 | + "cell_type": "markdown", |
| 53 | + "metadata": {}, |
| 54 | + "source": [ |
| 55 | + "This is the code that we have in the main branch. Let's run it once to ensure that the content is in the store and is available to everyone." |
| 56 | + ] |
| 57 | + }, |
40 | 58 | { |
41 | 59 | "cell_type": "code", |
42 | | - "execution_count": 3, |
| 60 | + "execution_count": null, |
43 | 61 | "metadata": {}, |
44 | | - "outputs": [ |
45 | | - { |
46 | | - "name": "stdout", |
47 | | - "output_type": "stream", |
48 | | - "text": [ |
49 | | - "calculating my_data\n" |
50 | | - ] |
51 | | - }, |
52 | | - { |
53 | | - "data": { |
54 | | - "text/plain": [ |
55 | | - "'Alice'" |
56 | | - ] |
57 | | - }, |
58 | | - "execution_count": 3, |
59 | | - "metadata": {}, |
60 | | - "output_type": "execute_result" |
61 | | - } |
62 | | - ], |
| 62 | + "outputs": [], |
63 | 63 | "source": [ |
64 | 64 | "# main branch\n", |
65 | 65 | "@dds.data_function(\"/my_data\")\n", |
|
79 | 79 | }, |
80 | 80 | { |
81 | 81 | "cell_type": "code", |
82 | | - "execution_count": 4, |
| 82 | + "execution_count": null, |
83 | 83 | "metadata": {}, |
84 | 84 | "outputs": [], |
85 | 85 | "source": [ |
|
88 | 88 | }, |
89 | 89 | { |
90 | 90 | "cell_type": "code", |
91 | | - "execution_count": 5, |
| 91 | + "execution_count": null, |
92 | 92 | "metadata": {}, |
93 | | - "outputs": [ |
94 | | - { |
95 | | - "data": { |
96 | | - "text/plain": [ |
97 | | - "'Alice'" |
98 | | - ] |
99 | | - }, |
100 | | - "execution_count": 5, |
101 | | - "metadata": {}, |
102 | | - "output_type": "execute_result" |
103 | | - } |
104 | | - ], |
| 93 | + "outputs": [], |
105 | 94 | "source": [ |
106 | 95 | "# fork branch\n", |
107 | 96 | "\n", |
|
117 | 106 | }, |
118 | 107 | { |
119 | 108 | "cell_type": "code", |
120 | | - "execution_count": 6, |
| 109 | + "execution_count": null, |
121 | 110 | "metadata": {}, |
122 | | - "outputs": [ |
123 | | - { |
124 | | - "name": "stdout", |
125 | | - "output_type": "stream", |
126 | | - "text": [ |
127 | | - "calculating my_data\n" |
128 | | - ] |
129 | | - }, |
130 | | - { |
131 | | - "data": { |
132 | | - "text/plain": [ |
133 | | - "'Alice, Bob'" |
134 | | - ] |
135 | | - }, |
136 | | - "execution_count": 6, |
137 | | - "metadata": {}, |
138 | | - "output_type": "execute_result" |
139 | | - } |
140 | | - ], |
| 111 | + "outputs": [], |
141 | 112 | "source": [ |
142 | 113 | "# fork branch\n", |
143 | 114 | "\n", |
|
158 | 129 | }, |
159 | 130 | { |
160 | 131 | "cell_type": "code", |
161 | | - "execution_count": 7, |
| 132 | + "execution_count": null, |
162 | 133 | "metadata": {}, |
163 | | - "outputs": [ |
164 | | - { |
165 | | - "name": "stdout", |
166 | | - "output_type": "stream", |
167 | | - "text": [ |
168 | | - "728433a6899b293d14157e4a321431a59a66f85109086851f58bcd53ba984c8b\r\n", |
169 | | - "ecf06a7b7943cda9620d652393d2067887ce53c816ea7f0a08de94bee2fa0290\r\n" |
170 | | - ] |
171 | | - } |
172 | | - ], |
| 134 | + "outputs": [], |
173 | 135 | "source": [ |
174 | 136 | "! ls /tmp/dds/tut_collab/internal/blobs | grep -v meta" |
175 | 137 | ] |
|
183 | 145 | }, |
184 | 146 | { |
185 | 147 | "cell_type": "code", |
186 | | - "execution_count": 8, |
| 148 | + "execution_count": null, |
187 | 149 | "metadata": {}, |
188 | | - "outputs": [ |
189 | | - { |
190 | | - "name": "stdout", |
191 | | - "output_type": "stream", |
192 | | - "text": [ |
193 | | - "Alice" |
194 | | - ] |
195 | | - } |
196 | | - ], |
| 150 | + "outputs": [], |
197 | 151 | "source": [ |
198 | 152 | "! cat /tmp/dds/tut_collab/data_main/my_data" |
199 | 153 | ] |
|
207 | 161 | }, |
208 | 162 | { |
209 | 163 | "cell_type": "code", |
210 | | - "execution_count": 9, |
| 164 | + "execution_count": null, |
211 | 165 | "metadata": {}, |
212 | | - "outputs": [ |
213 | | - { |
214 | | - "name": "stdout", |
215 | | - "output_type": "stream", |
216 | | - "text": [ |
217 | | - "Alice, Bob" |
218 | | - ] |
219 | | - } |
220 | | - ], |
| 166 | + "outputs": [], |
221 | 167 | "source": [ |
222 | 168 | "! cat /tmp/dds/tut_collab/data_fork/my_data" |
223 | 169 | ] |
|
231 | 177 | }, |
232 | 178 | { |
233 | 179 | "cell_type": "code", |
234 | | - "execution_count": 10, |
| 180 | + "execution_count": null, |
235 | 181 | "metadata": {}, |
236 | 182 | "outputs": [], |
237 | 183 | "source": [ |
|
251 | 197 | }, |
252 | 198 | { |
253 | 199 | "cell_type": "code", |
254 | | - "execution_count": 11, |
| 200 | + "execution_count": null, |
255 | 201 | "metadata": {}, |
256 | | - "outputs": [ |
257 | | - { |
258 | | - "data": { |
259 | | - "text/plain": [ |
260 | | - "'Alice, Bob'" |
261 | | - ] |
262 | | - }, |
263 | | - "execution_count": 11, |
264 | | - "metadata": {}, |
265 | | - "output_type": "execute_result" |
266 | | - } |
267 | | - ], |
| 202 | + "outputs": [], |
268 | 203 | "source": [ |
269 | 204 | "# main branch\n", |
270 | 205 | "my_data()" |
|
289 | 224 | "source": [ |
290 | 225 | "To conclude, `dds`'s philosophy of _data is code_ makes it easy to share and update data in a collaborative environment:\n", |
291 | 226 | "* data is tracked in each branch\n", |
292 | | - "* switching between code branches to retrieve code and views of the corresponding data\n", |
| 227 | + "* switching between code branches works just like normal code to retrieve views of the corresponding data\n", |
293 | 228 | "* all the data can be pre-calculated before merging the code, making a code+data checkout always a fast operation for the target branch" |
294 | 229 | ] |
295 | 230 | }, |
296 | 231 | { |
297 | 232 | "cell_type": "code", |
298 | | - "execution_count": 13, |
| 233 | + "execution_count": null, |
299 | 234 | "metadata": {}, |
300 | | - "outputs": [ |
301 | | - { |
302 | | - "name": "stdout", |
303 | | - "output_type": "stream", |
304 | | - "text": [ |
305 | | - "728433a6899b293d14157e4a321431a59a66f85109086851f58bcd53ba984c8b\r\n", |
306 | | - "ecf06a7b7943cda9620d652393d2067887ce53c816ea7f0a08de94bee2fa0290\r\n" |
307 | | - ] |
308 | | - } |
309 | | - ], |
| 235 | + "outputs": [], |
310 | 236 | "source": [ |
311 | 237 | "! ls /tmp/dds/tut_collab/internal/blobs | grep -v meta" |
312 | 238 | ] |
313 | 239 | } |
314 | 240 | ], |
315 | 241 | "metadata": { |
| 242 | + "celltoolbar": "Tags", |
316 | 243 | "kernelspec": { |
317 | 244 | "display_name": "Python 3", |
318 | 245 | "language": "python", |
|
0 commit comments