Git Product home page Git Product logo

lr-data's Introduction

LR-Data

This is a small utility to help pull the data from the Learning Registry into a datastore of your choice.

Dependencies

LR-Data requires:

Platform-Specific Requirements:

On OS X, you will also need libevent, which can be installed with homebrew: brew install libevent

Install dependencies - Ubuntu shown as example

sudo apt-get update
sudo apt-get install -y virtualenv python-dev libevent-dev libxml2-dev libxmlsec1-dev

Setup

# Create virtual environment
virtualenv env
. env/bin/activate
# Install python library requirements
pip install -U -r requirements.txt

Configuration

All configuration is done in the src/celeryconfig.py file. For information of configuring Celery please see their document. For lr-data configuration modify

config = {

	"lrUrl": "http://lrdev02.learningregistry.org/harvest/listrecords",

	"couchdb":{

		"dbUrl":"http://localhost:5984/lr-data"

	},
	"tasks": {
		"insert": "tasks.save.insertDocumentMongo",

		"validate": "tasks.validate.emptyValidate",
	}

	"redis":{

		"host":"localhost",

		"port":6379,

		"db":0
	}

	"mongodb":{

		"database":"lr",

		"collection":"envelope",

		"host": "localhost",

		"port": 27017,

	},
}

Customizable tasks are defined in the tasks hash. validate is the task name for validating incoming docs. insert is the task you wish to use to save the data

Startup

There are scripts inside of src to get you started.

  • start_celery_workers.sh - will start your default worker threads responsible for harvesting, validating, and saving LR data
  • stop_celery_workers.sh - stops workers
  • start_harvesting.py - sends harvest request into queue for workers to start working

To start harvesting, activate your virtualenv, start the celery workers, then start harvesting request

cd src
. ../env/bin/activate
./start_celery_workers.sh
./start_harvesting.py

Should you want to stop (or pause) the processing you can stop the celery workers:

./stop_celery_workers.sh

When you want to resume processing, you need only start the celery workers again:

./start_celery_workers.sh

lr-data's People

Contributors

wegrata avatar serpentblade avatar joehobson avatar johnpaulbalagolan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.