From 782b17ec7649f27192cdb5c9a7edb422639edcc6 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Wed, 8 May 2024 07:37:56 +0200 Subject: [PATCH] [pre-commit] Update and add further rules; clean-up --- .gitignore | 6 +----- .pre-commit-config.yaml | 16 +++++++--------- Dockerfile | 10 +++++----- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index cd9b0089..2ba7edec 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ *~ *.swp *.pyc -*.egg-info .nfs* .coverage* *.DS_Store @@ -14,15 +13,12 @@ coverage.xml test_results.xml junit-coverage.xml html/ -build/ doc/api/ dist/ cache/ -_citools/ -_work/ .mypy_cache/ .pytest_cache/ -results*/ *_version.py .venv .pixi +results*/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a619cb08..be4ac453 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.2 + rev: v0.4.3 hooks: - id: ruff args: [ --fix ] @@ -20,11 +20,11 @@ repos: hooks: - id: mypy args: [ --install-types, --non-interactive, --no-strict-optional, --ignore-missing-imports ] - # - repo: https://github.com/pre-commit/mirrors-prettier - # rev: v2.7.1 - # hooks: - # - id: prettier - # types_or: [json] + - repo: https://github.com/AleksaC/hadolint-py + rev: v2.12.1b3 + hooks: + - id: hadolint + args: [--ignore, DL3007, --ignore, DL3008] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: @@ -42,7 +42,6 @@ repos: - id: check-yaml exclude: | (?x)( - ^conda/meta.yaml| ^.gitlab-ci.yml ) - id: debug-statements @@ -57,6 +56,5 @@ repos: exclude: | (?x)( ^.pixi/| - ^.pixi.toml/| - ^.pixi.lock/| + ^.pixi.lock| ) diff --git a/Dockerfile b/Dockerfile index f4d2d2f9..0b510c6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,17 +6,17 @@ COPY pyproject.toml pixi.lock /app/ WORKDIR /app RUN pixi install --frozen -e cuda-base COPY dist/*.whl /app/ -RUN /app/.pixi/envs/cuda-base/bin/pip install --no-dependencies --no-build-isolation mednet-*.whl -RUN pixi shell-hook --frozen -e cuda-base > /entrypoint.sh -RUN echo "mednet" >> /entrypoint.sh +RUN /app/.pixi/envs/cuda-base/bin/pip install --no-dependencies --no-build-isolation mednet-*.whl \ + && pixi shell-hook --frozen -e cuda-base > /entrypoint.sh \ + && echo "mednet" >> /entrypoint.sh FROM nvidia/cuda:12.3.1-runtime-ubuntu22.04 AS production # only copy the production environment into prod container COPY --from=build /app/.pixi/envs/cuda-base /app/.pixi/envs/cuda-base COPY --from=build /entrypoint.sh /entrypoint.sh -RUN apt update \ - && apt install -y libopengl0 libegl1 libgl1-mesa-glx > /dev/null \ +RUN apt-get update \ + && apt-get install --no-install-recommends -y libopengl0 libegl1 libgl1-mesa-glx > /dev/null \ && apt-get clean && apt-get autoclean && apt-get autoremove \ && rm -rf /var/lib/apt/lists/* WORKDIR /app -- GitLab