diff --git a/.github/workflows/nameguard-api-pypi-package-release.yml b/.github/workflows/nameguard-python-pypi-package-release.yml similarity index 100% rename from .github/workflows/nameguard-api-pypi-package-release.yml rename to .github/workflows/nameguard-python-pypi-package-release.yml diff --git a/.github/workflows/nameguard-api-unit-tests.yml b/.github/workflows/nameguard-python-unit-tests.yml similarity index 100% rename from .github/workflows/nameguard-api-unit-tests.yml rename to .github/workflows/nameguard-python-unit-tests.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f64027ed..5ad054cd8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,6 @@ repos: hooks: - id: ruff args: [ --fix ] - files: '^api/.*\.py' + files: '^packages/nameguard-python/.*\.py' - id: ruff-format - files: '^api/.*\.py' + files: '^packages/nameguard-python/.*\.py' diff --git a/packages/nameguard-python/.docker/config.json b/apps/api.nameguard.io/.docker/config.json similarity index 100% rename from packages/nameguard-python/.docker/config.json rename to apps/api.nameguard.io/.docker/config.json diff --git a/apps/api.nameguard.io/Dockerfile b/apps/api.nameguard.io/Dockerfile new file mode 100644 index 000000000..74b0e7ac4 --- /dev/null +++ b/apps/api.nameguard.io/Dockerfile @@ -0,0 +1,13 @@ +FROM --platform=linux/arm64 public.ecr.aws/lambda/python:3.11 + +WORKDIR /app + +COPY ../../packages/nameguard-python/pyproject.toml ../../packages/nameguard-python/poetry.lock ../../packages/nameguard-python/LICENSE ../../packages/nameguard-python/README.md ./ +COPY ../../packages/nameguard-python/nameguard ./nameguard/ +RUN pip install --no-cache-dir .[lambda] + +# warmup +RUN python -m nameguard.web_api +RUN python -m nameguard.lambda + +CMD [ "nameguard.lambda.handler" ] diff --git a/apps/api.nameguard.io/serverless.yml b/apps/api.nameguard.io/serverless.yml index 610ac1379..500bbfb3f 100644 --- a/apps/api.nameguard.io/serverless.yml +++ b/apps/api.nameguard.io/serverless.yml @@ -27,8 +27,7 @@ provider: ecr: images: oss-nameguard: - # /packages/nameguard-python/ - path: ../../packages/nameguard-python/ + path: ./ platform: linux/arm64 plugins: diff --git a/packages/nameguard-python/Dockerfile b/packages/nameguard-python/Dockerfile deleted file mode 100644 index 6a77e73b4..000000000 --- a/packages/nameguard-python/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM --platform=linux/arm64 public.ecr.aws/lambda/python:3.11 - -WORKDIR /app - -COPY pyproject.toml poetry.lock LICENSE README.md ./ -COPY nameguard ./nameguard/ -RUN pip install --no-cache-dir .[lambda] - -# warmup -RUN python -m nameguard.web_api -RUN python -m nameguard.lambda - -CMD [ "nameguard.lambda.handler" ]