• Stars
    star
    529
  • Rank 80,684 (Top 2 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 8 years ago
  • Updated 25 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

reddit's python service framework

baseplate.py

It's much easier to manage a bunch of services when they all have the same shape: the way they're developed, the way they interact with the infrastructure they run on, and the way they interact with each other. Baseplate is reddit's specification for the common shape of our services. This library, Baseplate.py, is the Python implementation of that specification.

Baseplate.py glues together tooling for interacting with the reddit backend ecosystem and spackles over things that are missing. It integrates with Apache Thrift, Pyramid, and client libraries for many systems to transparently make your applications observable.

Baseplate applications transparently get:

  • Timing and request rate metrics using statsd
  • Distributed tracing with Zipkin
  • Error reporting and aggregation with Sentry

And can take advantage of:

  • Integration with commonly used clients like: Thrift, SQLAlchemy, cassandra-driver, pymemcache, redis-py, and Kombu
  • Secrets securely pulled from Vault

And many other things!

pre-commit

This repo comes with pre-commit hooks that let you (on a voluntary basis) enable pre-commit and/or pre-push hooks.

Configuration can be found at the root of the directory in .pre-commit-config.yaml. On its own, the configuration file doesn't do anything. You either need to run the hooks manually or install them so that they run automatically on every commit or push.

Currently, we run the make fmt target on commit and make lint / pytest actions on push.

Specific hooks can be temporarily disabled.

You can install hooks only for a specific step (i.e. pre-push).

Testing in Snoodev

You can upgrade any service to use in development Baseplate code in Snoodev by editing the requirements file for the service you would like to use for testing. Update the the Baseplate requirement to pull from Github instead, like this:

diff --git a/requirements.txt b/requirements.txt
index aef8ad8..d32a078 100644
--- a/requirements.txt
+++ b/requirements.txt
-baseplate==2.5.7
+git+https://github.com/reddit/baseplate.py@<ref>#egg=baseplate

In this case the ref can be either a commit hash or a branch name. After making this update you can check if the service works in Snoodev.

Warning
Never deploy this change to production. Production should always use a Baseplate semantic version that has been tagged, and released.

More Repositories

1

IndicatorFastScroll

Android library providing a simple UI control for scrolling through RecyclerViews
Kotlin
698
star
2

redditsans

Reddit Sans. The typeface of the internet.
Pug
368
star
3

rpan-studio

RPAN Studio
C
263
star
4

snudown

reddit's markdown renderer. based on sundown.
C
180
star
5

rollingpin

fast deploy to lots of servers
Python
144
star
6

baseplate.go

Reddit's Service Framework in Go
Go
89
star
7

bugs

opinionated jira client for 80% of a devs jira usage
Shell
87
star
8

node-api-client

JavaScript
86
star
9

mcsauna

Track hottest memcached keys by regex in a graphite-friendly format.
Go
63
star
10

monitors

daemons to monitor reddit ops
Python
61
star
11

thebutton-data

press history for /r/thebutton
60
star
12

AlienBlue

Alien Blue iOS app - r/AlienBlue
Objective-C
59
star
13

node-platform

A set of tools to enable easy universal rendering and page navigation on a React + Redux stack
JavaScript
47
star
14

node-horse

JavaScript
35
star
15

error-pages

the bummer mobile
HTML
33
star
16

node-build

build system for ES2015 projects
JavaScript
29
star
17

node-flags

๐Ÿพ
JavaScript
25
star
18

devvit

Reddit for Developers
TypeScript
25
star
19

CodableRPC

A Swift RPC client & server implementation using Codable.
Swift
18
star
20

node-horse-react

JavaScript
14
star
21

diamond-memcached-slab-collector

A Diamond collector for capturing memcached slab statistics.
Python
13
star
22

experiments.py

reddit's python experiments framework
Python
10
star
23

snooboots

Exploratory bootstrap customized for reddit
CSS
9
star
24

cabot-alert-slack

A simple Cabot alerting plugin for Slack.
Python
9
star
25

event-tracker

JavaScript
9
star
26

node-rest-cache

An LRU-based caching solution for rest-like data fetching.
JavaScript
9
star
27

cqlmapper

A baseplate compatible fork of datastax' cqlengine library
Python
9
star
28

node-widgets

A collection of Reddit specific React components and the Redux actions and reducers to accompany them
JavaScript
8
star
29

devvit-sandbox

Devvit example apps and sketches not ready for production.
TypeScript
8
star
30

obs-browser-plugin

Browser plugin for OBS Studio
C++
8
star
31

node-middleware

Middleware for Redux
JavaScript
7
star
32

node-private

login / register / etc endpoints, only useful if you have access your own reddit instance
JavaScript
7
star
33

node-text-js

JavaScript
7
star
34

play

๐Ÿ› A little playground for building apps on Reddit.
TypeScript
6
star
35

monoceros

Go
6
star
36

jsapi-example-consumer

JavaScript
5
star
37

reddit-gtm-template

The official tag template for the Reddit conversion pixel for use with Google Tag Manager
Smarty
5
star
38

baseplate.py-upgrader

automates much of the work of upgrading to newer baseplate.py versions
Python
4
star
39

iOS-interview

Sandbox for the iOS Programming Interview
Swift
4
star
40

reddit-coredns-plugins

Some CoreDNS plugins that reddit made
Go
3
star
41

django-underpants

tiny helpers for integrating django with underpants
Python
3
star
42

reddit-client-lib

library of client side code to be shared between multiple projects
JavaScript
3
star
43

checkpoints

2
star
44

edgecontext

request.edge_context payload definitions
Go
2
star
45

baseplate-celery

Python
2
star
46

thrift-compiler

a thrift compiler in a docker container
Dockerfile
2
star
47

einhorn

Einhorn: the language-independent shared socket manager
Ruby
2
star
48

test

1
star
49

thrift-python

1
star
50

docker-bazelisk

Docker image for Bazelisk
Dockerfile
1
star
51

android-interview

Sandbox for Android Programming Interview
Kotlin
1
star
52

spinnakerpb

Protobufs and a Golang lib for representing Spinnaker pipelines
Go
1
star
53

.github

1
star
54

xctestrunner

A executable binary to run prebuilt iOS tests on iOS simulator/real device.
Python
1
star
55

data-firehose-client

JavaScript
1
star