Skip to content

Commit e276663

Browse files
authored
Merge pull request #31 from ufcg-lsd/fixing_timeout_on_aws
Fixing timeout on aws
2 parents 9754025 + e692793 commit e276663

File tree

603 files changed

+32403
-5595
lines changed

Some content is hidden

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

603 files changed

+32403
-5595
lines changed

auth/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv

auth/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
FROM python:3.12.11-slim
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23
LABEL org.opencontainers.image.authors="Hystax"
34

45
WORKDIR /usr/src/app/
5-
ENV PYTHONPATH /usr/src/app/
66

77
RUN apt-get update && apt-get install -y libsodium-dev \
88
&& apt-get autoremove -y \
99
&& apt-get clean \
1010
&& rm -rf /var/lib/apt/lists/*
1111

12-
COPY tools/optscale_exceptions tools/optscale_exceptions
13-
COPY tools/optscale_time tools/optscale_time
14-
COPY tools/optscale_password tools/optscale_password
15-
COPY optscale_client/config_client optscale_client/config_client
16-
COPY optscale_client/rest_api_client optscale_client/rest_api_client
12+
COPY tools tools
13+
COPY optscale_client optscale_client
1714
COPY auth/zoho_integrator auth/zoho_integrator
1815

19-
COPY auth/requirements.txt auth/requirements.txt
20-
RUN pip install --no-cache-dir -r /usr/src/app/auth/requirements.txt
16+
COPY auth/__init__.py auth/__init__.py
17+
COPY auth/pyproject.toml auth/pyproject.toml
18+
COPY auth/uv.lock auth/uv.lock
2119

2220
COPY auth/auth_server/alembic auth/auth_server/alembic
2321
COPY auth/auth_server/controllers auth/auth_server/controllers
@@ -27,7 +25,9 @@ COPY auth/auth_server/models auth/auth_server/models
2725
COPY auth/auth_server/*.py ./auth/auth_server/
2826
COPY auth/auth_server/alembic.template auth/auth_server/alembic.template
2927
COPY auth/auth_server/swagger auth/auth_server/swagger
30-
RUN python -u auth/auth_server/write_spec.py
3128

32-
CMD ["python", "-u","/usr/src/app/auth/auth_server/server.py"]
29+
RUN uv --project auth sync --locked --no-dev
30+
RUN uv --project auth run python -u auth/auth_server/write_spec.py
31+
32+
CMD ["uv", "--project", "auth", "run", "python", "-u", "/usr/src/app/auth/auth_server/server.py"]
3333
EXPOSE 8905

auth/Dockerfile_tests

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
ARG BUILDTAG=build
22
FROM auth:${BUILDTAG}
3+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
4+
35
LABEL org.opencontainers.image.authors="Hystax"
46

57
COPY tools/check_alembic_down_revisions tools/check_alembic_down_revisions
68
COPY optscale_client/auth_client /usr/src/app/optscale_client/auth_client
7-
COPY auth/test-requirements.txt auth/test-requirements.txt
8-
COPY auth/.pylintrc auth/.coveragerc ./auth/
9-
RUN pip install --no-cache-dir -r auth/test-requirements.txt
9+
COPY auth/.pylintrc auth/.coveragerc auth/pyproject.toml auth/uv.lock auth/__init__.py ./auth/
10+
11+
RUN uv --project auth sync --locked
1012

1113
COPY auth/auth_server/tests auth/auth_server/tests

auth/pyproject.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[project]
2+
name = "auth"
3+
version = "0.1.0"
4+
requires-python = ">=3.12.11,<3.13"
5+
dependencies = [
6+
"alembic==1.13.1",
7+
"apispec==6.3.1",
8+
"config-client",
9+
"cryptography==44.0.1",
10+
"google-auth==1.23.0",
11+
"mysql-connector-python==9.1.0",
12+
"optscale-exceptions",
13+
"optscale-password",
14+
"optscale-time",
15+
"ordered-set==4.1.0",
16+
"pyjwt>=2.4.0",
17+
"pymacaroons==0.9.2",
18+
"pyyaml==6.0.1",
19+
"requests==2.32.4",
20+
"restapi-client",
21+
"sqlalchemy==1.3.24",
22+
"tornado==6.5",
23+
"zcrmsdk==3.1.0",
24+
]
25+
26+
[build-system]
27+
requires = ["uv_build==0.8.15"]
28+
build-backend = "uv_build"
29+
30+
[tool.uv.build-backend]
31+
module-root = ".."
32+
module-name = "auth"
33+
34+
[tool.uv.sources]
35+
optscale-exceptions = { path = "../tools/optscale_exceptions" }
36+
optscale-time = { path = "../tools/optscale_time" }
37+
optscale-password = { path = "../tools/optscale_password" }
38+
config-client = { path = "../optscale_client/config_client" }
39+
restapi-client = { path = "../optscale_client/rest_api_client" }
40+
auth-client = { path = "../optscale_client/auth_client" }
41+
check-alembic-down-revisions = { path = "../tools/check_alembic_down_revisions" }
42+
43+
[dependency-groups]
44+
dev = [
45+
"auth-client",
46+
"check-alembic-down-revisions",
47+
"coverage==4.2",
48+
"freezegun==0.3.8",
49+
"pycodestyle==2.11.1",
50+
"pylint==3.0.3",
51+
]

auth/requirements.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

auth/run_test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ docker build -t ${TEST_IMAGE} --build-arg BUILDTAG=${BUILD_TAG} -f auth/Dockerfi
88

99
echo "Pycodestyle tests>>>"
1010
docker run -i --rm ${TEST_IMAGE} \
11-
bash -c "pycodestyle auth"
11+
bash -c "uv --project auth run pycodestyle --exclude=.venv auth"
1212
echo "<<<Pycodestyle tests"
1313

1414
echo "Pylint tests>>>"
1515
docker run -i --rm ${TEST_IMAGE} \
16-
bash -c "pylint --rcfile=auth/.pylintrc --fail-under=9 --fail-on=E,C,F ./auth"
16+
bash -c "uv --directory auth run pylint --fail-under=9 --fail-on=E,F ."
1717
echo "<<Pylint tests"
1818

1919
echo "Alembic down revision tests>>>"
2020
docker run -i --rm ${TEST_IMAGE} bash -c \
21-
"tools/check_alembic_down_revisions/check_alembic_down_revisions.py --alembic_versions_path auth/auth_server/alembic/versions"
21+
"uv --project auth run tools/check_alembic_down_revisions/check_alembic_down_revisions.py --alembic_versions_path auth/auth_server/alembic/versions"
2222
echo "<<Alembic down revision tests"
2323

2424
echo "Unit tests>>>"
2525
docker run -i --rm ${TEST_IMAGE} \
26-
bash -c "python3 -m unittest discover ./auth/auth_server/tests"
26+
bash -c "uv --project auth run python -m unittest discover ./auth/auth_server/tests"
2727
echo "<<Unit tests"
2828

2929
docker rmi ${TEST_IMAGE}

auth/test-requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)