Skip to content

Commit 44c3ac3

Browse files
authored
Merge pull request #52 from planetlabs/unify
unify all of the datalake parts here in the one datalake repo to rule them all
2 parents 50d2dd5 + 695c143 commit 44c3ac3

File tree

154 files changed

+46660
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+46660
-33
lines changed

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dist/
1414
downloads/
1515
eggs/
1616
.eggs/
17-
lib/
1817
lib64/
1918
parts/
2019
sdist/
@@ -55,7 +54,4 @@ docs/_build/
5554

5655
# PyBuilder
5756
target/
58-
59-
# Vim
60-
*.swp
61-
*.un~
57+
.vagrant

.travis.yml

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,42 @@
1-
language: python
2-
python:
3-
- '2.7'
4-
- '3.5'
1+
services: docker
52

6-
env:
7-
matrix:
8-
- EXTRAS='[test]'
9-
- EXTRAS='[test,queuable,sentry,krb]'
10-
global:
11-
# see https://github.com/travis-ci/travis-ci/issues/7940
12-
- BOTO_CONFIG=/dev/null
3+
_python_template: &_python_template
4+
language: python
5+
stage: test
6+
before_install: cd client/
7+
install: pip install -e .[test]
8+
script: py.test
9+
deploy:
10+
provider: pypi
11+
user: planet
12+
password:
13+
secure: EgEXpqXu2Iyi7nFuZrFmWBavvOil5r8ctqHGQ6BT2J5+qqE/K1OXblt/l0IcVYryoFTOAyB36Dti4+zgeGmcA+UrvKZyyIT8z0zWyIS/iLWhjiXDJdrDU0zVWXRVC5/AsgsxUkJMVVCke/dxUpIbLNuVV2jwUd3k0VGw+q2XR7Q=
14+
distributions: "sdist bdist_wheel"
15+
skip_existing: true
16+
on:
17+
branch: master
18+
tags: true
19+
repo: planetlabs/datalake
1320

14-
install:
15-
- pip install -e .${EXTRAS}
16-
before_script:
17-
- flake8 .
18-
script:
19-
- py.test
20-
deploy:
21-
provider: pypi
22-
user: planet
23-
password:
24-
secure: EgEXpqXu2Iyi7nFuZrFmWBavvOil5r8ctqHGQ6BT2J5+qqE/K1OXblt/l0IcVYryoFTOAyB36Dti4+zgeGmcA+UrvKZyyIT8z0zWyIS/iLWhjiXDJdrDU0zVWXRVC5/AsgsxUkJMVVCke/dxUpIbLNuVV2jwUd3k0VGw+q2XR7Q=
25-
distributions: "sdist bdist_wheel"
26-
skip_existing: true
27-
on:
28-
branch: master
29-
tags: true
30-
repo: planetlabs/datalake
21+
jobs:
22+
include:
23+
- <<: *_python_template
24+
name: py27 bare
25+
python: 2.7
26+
before_script: flake8 .
27+
- <<: *_python_template
28+
name: py35 bare
29+
python: 3.5
30+
- <<: *_python_template
31+
name: py27 with extras
32+
python: 2.7
33+
install: pip install -e .[test,queuable,sentry,krb]
34+
- <<: *_python_template
35+
name: py35 with extras
36+
python: 3.5
37+
install: pip install -e .[test,queuable,sentry,krb]
38+
- dist: bionic
39+
name: docker
40+
stage: test
41+
script:
42+
- make test

Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM python:2.7-slim-buster
2+
3+
MAINTAINER brian <[email protected]>
4+
5+
ENV LANG C.UTF-8
6+
ENV LC_ALL C.UTF-8
7+
8+
# NB: gcc is only required to build the pyblake package, which does not ship as
9+
# a wheel for linux. Once we move to python3 we can eliminate this dependency
10+
# because hashlib supports blake2.
11+
RUN apt-get update && \
12+
apt-get install --quiet --yes \
13+
gcc \
14+
&& rm -rf /var/lib/apt/lists/* \
15+
&& apt-get clean
16+
17+
# TODO: keep requirements in one place
18+
RUN pip install \
19+
blinker>=1.4 \
20+
boto>=2.38.0 \
21+
boto3>=1.1.3 \
22+
click>=5.1 \
23+
Flask>=0.10.1 \
24+
flask-swagger==0.2.8 \
25+
memoized_property>=1.0.1 \
26+
pyblake2>=0.9.3 \
27+
python-dateutil>=2.4.2 \
28+
python-dotenv>=0.1.3 \
29+
pytz>=2015.4 \
30+
raven[flask]>=5.6.0 \
31+
requests>=2.5 \
32+
simplejson>=3.3.1 \
33+
six>=1.10.0 \
34+
# test requirements
35+
flake8==2.5.0 \
36+
freezegun==0.3.9 \
37+
moto==0.4.27 \
38+
pytest==3.0.2 \
39+
responses==0.5.0
40+
41+
RUN mkdir -p /opt/
42+
COPY . /opt/
43+
44+
# Take care to install clients such that the source code can be mounted into
45+
# the container and used for development. That is, the python paths and paths
46+
# to console scripts Just Work (TM)
47+
ENV PYTHONPATH=/opt/common:/opt/client:/opt/ingester:/opt/api
48+
RUN cd /opt/client && \
49+
python setup.py develop -s /usr/local/bin \
50+
--egg-path ../../../../../opt/client/ \
51+
-d /usr/local/lib/python2.7/site-packages/ \
52+
--no-deps;
53+
54+
ARG VERSION=unspecified
55+
ENV VERSION=$VERSION
56+
57+
WORKDIR /opt
58+
ENTRYPOINT ["/usr/local/bin/datalake"]

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
VERSION=$(shell git describe --tags --dirty)
2+
3+
.PHONY: docker # build the docker container
4+
docker:
5+
docker build --build-arg VERSION=$(VERSION) -t datalake:$(VERSION) .
6+
7+
.PHONY: devshell # Open a developer shell in the docker env
8+
devshell: docker
9+
docker run --rm -it -v $$PWD:/opt --entrypoint /bin/bash datalake:$(VERSION)
10+
11+
.PHONY: test # Run the tests
12+
13+
test: docker
14+
echo VERSION=$(VERSION)
15+
for p in common client ingester api; do \
16+
docker run --rm -it --entrypoint py.test datalake:$(VERSION) $$p; \
17+
done
18+
19+
.PHONY: help # Generate list of targets with descriptions
20+
help:
21+
@grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/ \1: \2/' | expand -t20

api/.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
25+
# PyInstaller
26+
# Usually these files are written by a python script from a template
27+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
28+
*.manifest
29+
*.spec
30+
31+
# Installer logs
32+
pip-log.txt
33+
pip-delete-this-directory.txt
34+
35+
# Unit test / coverage reports
36+
htmlcov/
37+
.tox/
38+
.coverage
39+
.coverage.*
40+
.cache
41+
nosetests.xml
42+
coverage.xml
43+
*,cover
44+
45+
# Translations
46+
*.mo
47+
*.pot
48+
49+
# Django stuff:
50+
*.log
51+
52+
# Sphinx documentation
53+
docs/_build/
54+
55+
# PyBuilder
56+
target/
57+
.vagrant

api/.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: python
2+
python:
3+
- '2.7'
4+
install:
5+
- pip install -e .[test]
6+
before_script:
7+
- flake8 .
8+
script:
9+
- py.test
10+
deploy:
11+
provider: pypi
12+
user: planet
13+
password:
14+
secure: moVRXcjStPtmCqW9N0057EY20JhhPAwIh7JbFN8wcx6eYCzN6M8NCErTlEL8fkl5Wx7QreRMHuZo91lf5nDPQfaNieDyRFxRfg/s5oQZePve6etRxxDphSwmlldtRI0Q6osB4muuXsnXx/A72G2PgtgV6f3FdSv3phXMZKEKZfXKU26TYcvjzygK3afXSsv8T4m8LjSnv/nONwYENZYwyZNiT6/gzSQ5TGYpIw0zU4bhMe1ZX54CbRPgzudbe3phV4NpEAbhVWPfZOH0d0iYCjNm/VKPG83Kf2jLT5sD0VzsULfxaxdtPycXjGlPHMzoGFQWH8x8FcnEnTgcD9irATRgQgQQQHDyYjkoAFxymDYglZolWZpswlPK6/D624GzZD19MxWBt2s6UvXDSKupDX/yxNxNwZa3VtXU1/ylfC5IHP9+OMhANKgtw0k4pUNnj1fI5TXQae1EDtLkOxqUfCSIeJr+AZmIFGvqUbQG05G5SGloGv9eGEjoamnUfgU9SM06n0fbVJvXJ5aHwYQ3DUOnfkMLXrKtuRn7qfzTT3hpRbPTQZxM53zMmLfgP7XwzhDT2UE+FaNSXVofFhPq4UP26OycVfYE5y2mt8hAAa/88qmmgrUzakmDJ7lVL/GQx43RynrlaoKAJa+zIChbJP8QWZKR3LFaJZPB9+doKXg=
15+
on:
16+
tags: true
17+
repo: planetlabs/datalake-api

0 commit comments

Comments
 (0)