Repository for public analyses.
Перейти к файлу
Frank Bertsch 339ec519b8 Change active experiments format in Experiments ETL 2017-02-09 15:52:17 -04:00
addons/AMO-data-request.kp Add AMO API example 2017-01-20 15:51:15 +00:00
e10s_analyses/beta/51 Add e10s_experiment beta 51 week 6 2017-01-20 15:49:57 +00:00
etl Change active experiments format in Experiments ETL 2017-02-09 15:52:17 -04:00
examples/new_report.kp Examples/new report.kp (#1) 2016-11-25 14:22:23 +00:00
projects Adding analysis of crash ping client delays 2017-01-31 17:07:12 -05:00
tutorials Add longitudinal dataset tutorial 2016-11-29 23:41:54 +00:00
.knowledge_repo_config.py Initial creation of knowledge data repository structure. 2016-11-22 13:50:46 +00:00
README.md Update documentation. 2016-11-25 14:22:32 +00:00

README.md

The Knowledge Repository

Introduction

The Knowledge Repository project is focussed on facilitating the sharing of knowledge between data scientists and other technical roles using data formats and tools that make sense in these professions. It provides various data stores (and utilities to manage them) for "knowledge posts". These knowledge posts are a general markdown format that is automatically generated from the following common formats:

  • Jupyter/Ipython notebooks
  • Rmd notebooks
  • Markdown files

The Jupyter, Rmd, and Markdown files are required to have a specific set of yaml style headers which are used to organize and discover research:

---
title: I Found that Lemurs Do Funny Dances
authors:
- sally_smarts
- wesley_wisdom
tags:
- knowledge
- example
created_at: 2016-06-29
updated_at: 2016-06-30
tldr: This is short description of the content and findings of the post.
---

Users add these notebooks/files to the knowledge repository through the knowledge_repo tool, as described below; which allows them to be rendered and curated in the knowledge repository's web app.

Getting started

Installation

To install the knowledge repository tooling, simply run:

pip install git+ssh://git@github.com/airbnb/knowledge-repo.git

Writing Knowledge Posts

TLDR Guide For Contributing

Here is a snapshot of the commands you need to run to upload your own knowledge post.

  1. Create a new report starting from the "New Report" template available on a newly launched a.t.m.o. cluster.
  2. Download the report on your machine (e.g. ~/Documents/my_post.ipynb).
  3. git clone this knowledge repository.
  4. Set the $KNOWLEDGE_REPO environment variable to the location of the knowledge repository.
  5. knowledge_repo add ~/Documents/my_post.ipynb -p projects/test_project
  6. knowledge_repo preview projects/test_project
  7. knowledge_repo submit projects/test_project
  8. Open a PR in GitHub
  9. After it has been reviewed, merge it in to master.

Technical Details

What is a Knowledge Repository

A knowledge repository is a virtual filesystem (such as a git repository or database). A GitKnowledgeRepository, for example, has the following structure:

<repo>
    + .git  # The git repository metadata
    + .resources  # A folder into which the knowledge_repo repository is checked out (as a git submodule)
    - .knowledge_repo_config.py  # Local configuration for this knowledge repository
    - <knowledge posts>

The use of a git submodule to checkout the knowledge_repo into .resources allows use to ensure that the client and server are using the same version of the code. When one uses the knowledge_repo script, it actually passes the options to the version of the knowledge_repo script in .resources/scripts/knowledge_repo. Thus, updating the version of knowledge_repo used by client and server alike is as simple as changing which revision is checked out by git submodule in the usual way. That is:

pushd .resources
git pull
git checkout <revision>/<branch>
popd
git commit -a -m 'Updated version of the knowledge_repo'
git push

Then, all users and servers associated with this repository will be updated to the new version. This prevents version mismatches between client and server, and all users of the repository.

In development, it is often useful to disable this chaining. To use the local code instead of the code in the checked out knowledge repository, pass the --dev option as:

knowledge_repo --repo <repo_path> --dev <action> ...

What is a Knowledge Post?

A knowledge post is a virtual directory, with the following structure:

<knowledge_post>
	- knowledge.md
	+ images/* [Optional]
	+ orig_src/* [Optional; stores the original converted file]