-
Notifications
You must be signed in to change notification settings - Fork 3
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
0 parents
commit d680066
Showing
68 changed files
with
7,083 additions
and
0 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,28 @@ | ||
**/__pycache__ | ||
**/.venv | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
**/.nox | ||
LICENSE | ||
.history |
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,9 @@ | ||
# Credentials for AWS account with an access to Bedrock models | ||
AWS_ACCESS_KEY_ID=<key> | ||
AWS_SECRET_ACCESS_KEY=<key> | ||
DEFAULT_REGION=us-east-1 | ||
|
||
# Misc env vars for the server | ||
LOG_LEVEL=INFO # Default in prod is INFO. Use DEBUG for dev. | ||
WEB_CONCURRENCY=1 # Number of unicorn workers | ||
TEST_SERVER_URL=http://0.0.0.0:5001 |
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,12 @@ | ||
[flake8] | ||
# E501 line is too long | ||
# W503 line break before binary operator | ||
# E203 whitespace before ':' | ||
ignore = E501, W503, E203 | ||
exclude = | ||
.venv, | ||
.nox, | ||
__pycache__ | ||
per-file-ignores = | ||
# imported but unused | ||
tests/locust/app.py: F401 |
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,14 @@ | ||
{ | ||
"LABEL": { | ||
"name": "", | ||
"color": "EEEEEE" | ||
}, | ||
"CHECKS": { | ||
"prefixes": ["fix: ", "feat: ", "feature: ", "chore: ", "hotfix: "] | ||
}, | ||
"MESSAGES": { | ||
"success": "All OK", | ||
"failure": "Missing prefix", | ||
"notice": "" | ||
} | ||
} |
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,15 @@ | ||
name: Code checks - tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- development | ||
- release-* | ||
|
||
jobs: | ||
run_tests: | ||
uses: epam/ai-dial-ci/.github/workflows/test_python_docker.yml@0.1.0 | ||
with: | ||
bypass_checks: false | ||
python_version: 3.11 | ||
secrets: inherit |
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,13 @@ | ||
name: Release version | ||
|
||
on: | ||
push: | ||
branches: [ development, release-* ] | ||
|
||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
release: | ||
uses: epam/ai-dial-ci/.github/workflows/publish_python_docker.yml@0.1.0 | ||
secrets: inherit |
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,12 @@ | ||
.DS_Store | ||
venv | ||
.venv | ||
.env | ||
.history | ||
.idea | ||
__pycache__ | ||
.nox | ||
dist | ||
.vscode/launch.json | ||
~* | ||
leftovers |
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,7 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-python.python", | ||
"ms-python.black-formatter", | ||
"ms-python.isort" | ||
] | ||
} |
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,14 @@ | ||
{ | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
}, | ||
"editor.tabSize": 4 | ||
}, | ||
"python.testing.pytestArgs": ["."], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"python.analysis.typeCheckingMode": "basic" | ||
} |
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,32 @@ | ||
FROM python:3.11-alpine as builder | ||
|
||
RUN pip install poetry | ||
|
||
WORKDIR /app | ||
|
||
# Install split into two steps (the dependencies and the sources) | ||
# in order to leverage the Docker caching | ||
COPY pyproject.toml poetry.lock poetry.toml ./ | ||
RUN poetry install --no-interaction --no-ansi --no-cache --no-root --no-directory --only main | ||
|
||
COPY . . | ||
RUN poetry install --no-interaction --no-ansi --no-cache --only main | ||
|
||
FROM python:3.11-alpine as server | ||
|
||
WORKDIR /app | ||
|
||
# Copy the sources and virtual env. No poetry. | ||
RUN adduser -u 1001 --disabled-password --gecos "" appuser | ||
COPY --chown=appuser --from=builder /app . | ||
|
||
COPY ./scripts/docker_entrypoint.sh /docker_entrypoint.sh | ||
RUN chmod +x /docker_entrypoint.sh | ||
|
||
ENV LOG_LEVEL=INFO | ||
EXPOSE 5000 | ||
|
||
USER appuser | ||
ENTRYPOINT ["/docker_entrypoint.sh"] | ||
|
||
CMD ["uvicorn", "aidial_adapter_bedrock.app:app", "--host", "0.0.0.0", "--port", "5000"] |
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,29 @@ | ||
FROM python:3.11-slim as builder | ||
|
||
RUN pip install poetry | ||
|
||
WORKDIR /app | ||
|
||
# Install split into two steps (the dependencies and the sources) | ||
# in order to leverage the Docker caching | ||
COPY pyproject.toml poetry.lock poetry.toml ./ | ||
RUN poetry install --no-interaction --no-ansi --no-cache --no-root --no-directory --with test | ||
|
||
COPY . . | ||
RUN poetry install --no-interaction --no-ansi --no-cache --with test | ||
|
||
FROM python:3.11-slim as test | ||
|
||
WORKDIR /app | ||
|
||
# Copy the sources and virtual env. No poetry. | ||
RUN adduser -u 1001 --disabled-password --gecos "" appuser | ||
COPY --chown=appuser --from=builder /app . | ||
|
||
COPY ./scripts/docker_entrypoint.sh /docker_entrypoint.sh | ||
RUN chmod +x /docker_entrypoint.sh | ||
|
||
USER appuser | ||
ENTRYPOINT ["/docker_entrypoint.sh"] | ||
|
||
CMD ["pytest", "tests/unit_tests"] |
Oops, something went wrong.