Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 4037840

Browse files
committed
initial commit
0 parents  commit 4037840

File tree

243 files changed

+20116
-0
lines changed

Some content is hidden

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

243 files changed

+20116
-0
lines changed

.activate.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
virtualenv_run/bin/activate

.cman_debug_bashrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
alias cman_debug='python -m clusterman.batch.autoscaler_bootstrap start --no-daemon'

.coveragerc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[run]
2+
branch = True
3+
source =
4+
clusterman
5+
6+
[report]
7+
omit =
8+
clusterman/batch/*
9+
exclude_lines =
10+
# Have to re-enable the standard pragma
11+
\#\s*pragma: no cover
12+
13+
# Don't complain if tests don't hit defensive assertion code:
14+
^\s*raise AssertionError\b
15+
^\s*raise NotImplementedError\b
16+
^\s*return NotImplemented\b
17+
^\s*raise$
18+
19+
# Don't complain if non-runnable code isn't run:
20+
^if __name__ == ['"]__main__['"]:$
21+
22+
[html]
23+
directory = coverage-html
24+
25+
# vim:ft=dosini

.coveragerc-yelp

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[run]
2+
branch = True
3+
source =
4+
clusterman
5+
6+
[report]
7+
exclude_lines =
8+
# Have to re-enable the standard pragma
9+
\#\s*pragma: no cover
10+
11+
# Don't complain if tests don't hit defensive assertion code:
12+
^\s*raise AssertionError\b
13+
^\s*raise NotImplementedError\b
14+
^\s*return NotImplemented\b
15+
^\s*raise$
16+
17+
# Don't complain if non-runnable code isn't run:
18+
^if __name__ == ['"]__main__['"]:$
19+
20+
[html]
21+
directory = coverage-html
22+
23+
# vim:ft=dosini

.deactivate.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deactivate

.dockerignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.git
2+
.tox
3+
build
4+
5+
# It is possible a user has their own virtualenv here,
6+
# but we don't want it to pollute the docker context because
7+
# it will get built inside.
8+
virtualenv_run
9+
venv
10+
tests
11+
itests
12+
docs
13+
tools
14+
15+
# y/ycp
16+
.ycp_playground
17+
playground
18+
docker-venv
19+
.activate.sh
20+
.deactivate.sh
21+
22+
# we don't need to send all the Debian package builds to Docker for the paasta service
23+
yelp_package

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
*.py[co]
2+
*.so
3+
*.sw[nop]
4+
.#*
5+
.DS_Store
6+
._*
7+
\#*\#
8+
build
9+
dist
10+
*~
11+
*.log
12+
.coverage
13+
precomputed
14+
.pydevproject
15+
.project
16+
*.sublime-*
17+
virtualenv_run
18+
.tox
19+
*.egg-info/
20+
__pycache__
21+
version
22+
.ycp_playground
23+
playground
24+
docker-venv
25+
.cache
26+
.pytest_cache/
27+
.mypy_cache/
28+
package/itest/autoscaler_config.yaml
29+
package/itest/autoscaler_config.tmpl
30+
package/itest/run_instance.py
31+
package/itest/trusty/*
32+
package/itest/xenial/*
33+
package/itest/bionic/*
34+
/completions/

.pre-commit-config.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
repos:
2+
- repo: [email protected]:mirrors/pre-commit/pre-commit-hooks
3+
sha: v0.9.4
4+
hooks:
5+
- id: double-quote-string-fixer
6+
language_version: python3.6
7+
- id: trailing-whitespace
8+
language_version: python3.6
9+
- id: end-of-file-fixer
10+
language_version: python3.6
11+
exclude: ^\.activate\.sh$
12+
- id: autopep8-wrapper
13+
language_version: python3.6
14+
args: [-i, --max-line-length=131]
15+
- id: check-yaml
16+
language_version: python3.6
17+
- id: debug-statements
18+
language_version: python3.6
19+
exclude: ^itests/environment.py$
20+
- id: name-tests-test
21+
language_version: python3.6
22+
- id: check-added-large-files
23+
language_version: python3.6
24+
exclude: ^(\.activate\.sh|.*clusterman_signals_acceptance\.tar\.gz)$
25+
- id: check-byte-order-marker
26+
language_version: python3.6
27+
- id: fix-encoding-pragma
28+
args: [--remove]
29+
language_version: python3.6
30+
- id: flake8
31+
language_version: python3.6
32+
exclude: ^docs/.*
33+
args: ['--ignore=E121,E123,E126,E133,E226,E241,E242,E704,W503,W504,W505,W605']
34+
- repo: [email protected]:mirrors/asottile/reorder_python_imports
35+
sha: v0.3.5
36+
hooks:
37+
- id: reorder-python-imports
38+
args: [
39+
--remove-import, 'from __future__ import absolute_import',
40+
--remove-import, 'from __future__ import print_function',
41+
--remove-import, 'from __future__ import unicode_literals',
42+
]
43+
language_version: python3.6
44+
- repo: [email protected]:mirrors/asottile/pyupgrade
45+
sha: v1.2.0
46+
hooks:
47+
- id: pyupgrade
48+
args: [--py3-plus]
49+
language_version: python3.6

Dockerfile

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This is an example Dockerfile to run your service in PaaSTA!
2+
# It satisfies the PaaSTA contract.
3+
4+
FROM docker-dev.yelpcorp.com/xenial_yelp:latest
5+
6+
# python and uwsgi deps
7+
RUN apt-get update \
8+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9+
awscli \
10+
git \
11+
libatlas-base-dev \
12+
libpython3.7 \
13+
libxml2 \
14+
libyaml-0-2 \
15+
lsb-release \
16+
make \
17+
openssh-client \
18+
python3.7 \
19+
python-pip \
20+
python-setuptools \
21+
stdin2scribe \
22+
tox \
23+
virtualenv \
24+
zk-flock \
25+
&& apt-get clean
26+
27+
ENV PIP_INDEX_URL=https://pypi.yelpcorp.com/simple
28+
RUN /usr/bin/pip install supervisor
29+
COPY tox.ini requirements.txt requirements-bootstrap.txt extra-requirements-yelp.txt /code/
30+
RUN cd code && tox -e virtualenv_run
31+
RUN cd code && virtualenv_run/bin/pip-custom-platform install -rextra-requirements-yelp.txt
32+
33+
RUN mkdir /home/nobody
34+
ENV HOME /home/nobody
35+
36+
# Code is COPY'ed here after the pip install above, so that code changes do not
37+
# break the preceding cache layer.
38+
COPY . /code
39+
RUN chown nobody /code
40+
41+
# This is needed so that we can pass PaaSTA itests on Jenkins; for some reason (probably aufs-related?)
42+
# root can't modify the contents of /code on Jenkins, even though it works locally. Root needs to
43+
# modify these contents so that it can configure the Dockerized Mesos cluster that we run our itests on.
44+
# This shouldn't be a security risk because we drop privileges below and on overlay2, root can already
45+
# modify the contents of this directory.
46+
RUN chmod -R 775 /code/acceptance
47+
RUN ln -s /code/clusterman/supervisord/fetch_clusterman_signal /usr/bin/fetch_clusterman_signal
48+
RUN ln -s /code/clusterman/supervisord/run_clusterman_signal /usr/bin/run_clusterman_signal
49+
50+
RUN install -d --owner=nobody /code/logs
51+
52+
# Create /nail/run to store the batch PID file
53+
RUN mkdir -p /nail/run && chown -R nobody /nail/run
54+
55+
# For sake of security, don't run your service as a privileged user
56+
USER nobody
57+
WORKDIR /code
58+
ENV BASEPATH=/code PATH=/code/virtualenv_run/bin:$PATH

Dockerfile.external

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This is an example Dockerfile to run your service in PaaSTA!
2+
# It satisfies the PaaSTA contract.
3+
FROM ubuntu:bionic
4+
5+
# python and uwsgi deps
6+
RUN apt-get update \
7+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
8+
awscli \
9+
g++ \
10+
git \
11+
libatlas-base-dev \
12+
libxml2 \
13+
libyaml-0-2 \
14+
lsb-release \
15+
make \
16+
openssh-client \
17+
python3.7-dev \
18+
python3-pip \
19+
python-setuptools \
20+
virtualenv \
21+
&& apt-get clean
22+
23+
RUN /usr/bin/pip3 install supervisor tox
24+
COPY tox.ini requirements.txt requirements-bootstrap.txt /code/
25+
26+
RUN mkdir /home/nobody
27+
ENV HOME /home/nobody
28+
29+
# Code is COPY'ed here after the pip install above, so that code changes do not
30+
# break the preceding cache layer.
31+
COPY . /code
32+
RUN chown nobody /code
33+
RUN cd code && tox -e virtualenv_run && virtualenv_run/bin/pip install -eexamples/clusterman_metrics
34+
35+
RUN ln -s /code/clusterman/supervisord/fetch_clusterman_signal /usr/bin/fetch_clusterman_signal
36+
RUN ln -s /code/clusterman/supervisord/run_clusterman_signal /usr/bin/run_clusterman_signal
37+
38+
RUN install -d --owner=nobody /code/logs
39+
40+
# Create /nail/run to store the batch PID file
41+
RUN mkdir -p /nail/run && chown -R nobody /nail/run
42+
43+
# For sake of security, don't run your service as a privileged user
44+
USER nobody
45+
WORKDIR /code
46+
ENV BASEPATH=/code PATH=/code/virtualenv_run/bin:$PATH

0 commit comments

Comments
 (0)