-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add preliminiary github app version (#192)
* Use quart as framework * Add tasks * Use asyncio in provider * Use more async where needed * Get rid of eclipse_project property * Adjust docker config
- Loading branch information
Showing
87 changed files
with
2,611 additions
and
1,125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# build jsonnet-bundler using a go environment | ||
FROM docker.io/library/golang:1.18 AS builder-go | ||
RUN go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected] | ||
|
||
# build otterdog using a python environment | ||
FROM docker.io/library/python:3.10.10-slim as builder-python3 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
golang | ||
|
||
WORKDIR /app | ||
|
||
ENV PIP_DEFAULT_TIMEOUT=100 \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=1 \ | ||
PIP_NO_CACHE_DIR=1 \ | ||
POETRY_VERSION=1.7.1 | ||
|
||
COPY ../otterdog ./otterdog | ||
COPY ../pyproject.toml ../poetry.lock ../README.md ./hypercorn-cfg.toml ./ | ||
COPY ./entrypoint.sh ./docker/entrypoint.sh | ||
COPY ./start-webapp ./docker/start-webapp | ||
|
||
RUN pip install "poetry==$POETRY_VERSION" | ||
|
||
RUN poetry config virtualenvs.in-project true && \ | ||
poetry install --only=main,app --no-root && \ | ||
poetry build && \ | ||
poetry install --only-root | ||
|
||
# create the final image having python3.10 as base | ||
FROM python:3.10.10-slim | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
git | ||
|
||
COPY --from=builder-go /go/bin/jb /usr/bin/jb | ||
COPY --from=builder-python3 /app/.venv /app/.venv | ||
COPY --from=builder-python3 /app/otterdog /app/otterdog | ||
COPY --from=builder-python3 /app/docker/entrypoint.sh /app/entrypoint.sh | ||
COPY --from=builder-python3 /app/docker/start-webapp /app/start-webapp | ||
COPY --from=builder-python3 /app/hypercorn-cfg.toml /app/hypercorn-cfg.toml | ||
|
||
RUN chmod +x /app/entrypoint.sh | ||
RUN chmod +x /app/start-webapp | ||
|
||
WORKDIR /app | ||
|
||
# set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
ENTRYPOINT ["/app/entrypoint.sh"] |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# if any of the commands in your code fails for any reason, the entire script fails | ||
set -o errexit | ||
# fail exit if one of your pipe command fails | ||
set -o pipefail | ||
# exits if any of your variables is not set | ||
set -o nounset | ||
|
||
exec "$@" |
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,5 @@ | ||
bind = "0.0.0.0:5000" | ||
workers = 1 | ||
accesslog = '-' | ||
loglevel = 'info' | ||
h11_max_incomplete_size = 4 |
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,17 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# ******************************************************************************* | ||
# Copyright (c) 2024 Eclipse Foundation and others. | ||
# This program and the accompanying materials are made available | ||
# under the terms of the MIT License | ||
# which is available at https://spdx.org/licenses/MIT.html | ||
# SPDX-License-Identifier: MIT | ||
# ******************************************************************************* | ||
# | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
.venv/bin/hypercorn --config hypercorn-cfg.toml otterdog.app |
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
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.