-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a123fbf
commit 005fd47
Showing
337 changed files
with
7,068 additions
and
3,810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,41 @@ | ||
.mypy_cache | ||
.idea | ||
__pycache__ | ||
/conf | ||
/conf_testing | ||
/build | ||
|
||
# HABApp configurations | ||
run/*/log/ | ||
run/*/config/*.items | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
/lib/ | ||
/lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,44 @@ | ||
FROM python:3.8-alpine | ||
FROM python:3.9-slim as buildimage | ||
|
||
VOLUME [ "/config"] | ||
COPY . /tmp/app_install | ||
|
||
# Install required dependencies | ||
RUN apk add --no-cache \ | ||
# Support for Timezones | ||
tzdata \ | ||
# ujson won't compile without these libs | ||
g++ | ||
RUN set -eux; \ | ||
# wheel all packages for habapp | ||
cd /tmp/app_install; \ | ||
pip wheel --wheel-dir=/root/wheels --use-feature=in-tree-build . | ||
|
||
FROM python:3.9-slim | ||
|
||
COPY --from=buildimage /root/wheels /root/wheels | ||
COPY container/entrypoint.sh /entrypoint.sh | ||
|
||
# Always use latest versions | ||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
ENV HABAPP_HOME=/habapp \ | ||
USER_ID=9001 \ | ||
GROUP_ID=${USER_ID} | ||
|
||
RUN set -eux; \ | ||
# Install required dependencies | ||
apt-get update; \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ | ||
gosu \ | ||
tini; \ | ||
ln -s -f $(which gosu) /usr/local/bin/gosu; \ | ||
apt-get clean; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
mkdir -p ${HABAPP_HOME}; \ | ||
mkdir -p ${HABAPP_HOME}/config; \ | ||
# install HABApp | ||
pip3 install \ | ||
--no-index \ | ||
--find-links=/root/wheels \ | ||
habapp; \ | ||
# prepare entrypoint script | ||
chmod +x /entrypoint.sh; \ | ||
# clean up | ||
rm -rf /root/wheels | ||
|
||
# Install | ||
RUN pip3 install . | ||
WORKDIR ${HABAPP_HOME} | ||
VOLUME ["${HABAPP_HOME}/config"] | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD [ "python", "-m", "HABApp", "--config", "/config" ] | ||
CMD ["gosu", "habapp", "tini", "--", "python", "-m", "HABApp", "--config", "./config"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
include LICENSE | ||
include requirements_setup.txt |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash -x | ||
|
||
set -euo pipefail | ||
|
||
NEW_USER_ID=${USER_ID} | ||
NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} | ||
|
||
echo "Starting with habapp user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" | ||
if ! id -u habapp >/dev/null 2>&1; then | ||
if [ -z "$(getent group $NEW_GROUP_ID)" ]; then | ||
echo "Create group habapp with id ${NEW_GROUP_ID}" | ||
groupadd -g $NEW_GROUP_ID habapp | ||
else | ||
group_name=$(getent group $NEW_GROUP_ID | cut -d: -f1) | ||
echo "Rename group $group_name to habapp" | ||
groupmod --new-name habapp $group_name | ||
fi | ||
echo "Create user habapp with id ${NEW_USER_ID}" | ||
adduser -u $NEW_USER_ID --disabled-password --gecos '' --home "${HABAPP_HOME}" --gid ${NEW_GROUP_ID} habapp | ||
fi | ||
|
||
chown -R habapp:habapp "${HABAPP_HOME}/config" | ||
sync | ||
|
||
exec "$@" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* https://stackoverflow.com/questions/23211695/modifying-content-width-of-the-sphinx-theme-read-the-docs | ||
and https://github.com/readthedocs/sphinx_rtd_theme/issues/295 | ||
*/ | ||
@media screen and (min-width: 767px) { | ||
.wy-nav-content { | ||
max-width: 1100px !important; | ||
} | ||
|
||
/* and fix wrap bug per https://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html */ | ||
.wy-table-responsive table td { | ||
/* !important prevents the common CSS stylesheets from overriding | ||
this as on RTD they are loaded after this stylesheet */ | ||
white-space: normal !important; | ||
} | ||
|
||
.wy-table-responsive { | ||
overflow: visible !important; | ||
} | ||
} | ||
|
||
h1 { font-size: 200% } | ||
h2 { font-size: 180% } | ||
h3 { font-size: 160% } | ||
h4 { font-size: 140% } | ||
h5 { font-size: 120% } | ||
h6 { font-size: 100% } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.