From d7c6ce0b2e1664cbc67ad8cc61c57afe7bbaae0a Mon Sep 17 00:00:00 2001 From: gatheluck Date: Wed, 24 Jul 2024 05:06:47 +0900 Subject: [PATCH 1/4] docs: update badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e7e3da..0354e45 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Ascender ![stable](https://img.shields.io/badge/stable-v0.1.3-blue) -![python versions](https://img.shields.io/badge/python-3.8%20%7C%203.9-blue) +![python versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue) [![tests](https://github.com/cvpaperchallenge/Ascender/actions/workflows/lint-and-test.yaml/badge.svg)](https://github.com/cvpaperchallenge/Ascender/actions/workflows/lint-and-test.yaml) [![MIT License](https://img.shields.io/github/license/cvpaperchallenge/Ascender?color=green)](LICENSE) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) From 29df151c4e0820fd9a1ca0c317afb8324fd4d046 Mon Sep 17 00:00:00 2001 From: gatheluck Date: Wed, 24 Jul 2024 05:07:16 +0900 Subject: [PATCH 2/4] feat: add python versions used in CI. --- .github/workflows/lint-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-test.yaml b/.github/workflows/lint-and-test.yaml index a5105fc..0c89d9f 100644 --- a/.github/workflows/lint-and-test.yaml +++ b/.github/workflows/lint-and-test.yaml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: [ubuntu] - python-version: ["3.8", "3.9"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] include: - os: ubuntu image: ubuntu-latest From f1409ee68222b1ee255bde4729f796285dae0a35 Mon Sep 17 00:00:00 2001 From: gatheluck Date: Wed, 24 Jul 2024 05:07:55 +0900 Subject: [PATCH 3/4] feat: update docker files for gpu. --- environments/Dockerfile | 38 +++++++++++++++------------- environments/gpu/docker-compose.yaml | 2 +- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/environments/Dockerfile b/environments/Dockerfile index 51e2a18..7841728 100644 --- a/environments/Dockerfile +++ b/environments/Dockerfile @@ -15,32 +15,36 @@ ENV DEBIAN_FRONTEND="noninteractive" \ LANG="C.UTF-8" \ PYTHONPATH=${APPLICATION_DIRECTORY} -# Following is needed to install python 3.7 -RUN apt update && apt install --no-install-recommends -y software-properties-common -RUN add-apt-repository ppa:deadsnakes/ppa - -RUN apt update && apt install --no-install-recommends -y \ - git curl make ssh openssh-client \ - python${PYTHON_VERSION} python3-pip python-is-python3 - -# Following is needed to swtich default python3 version -# For detail, please check following link https://unix.stackexchange.com/questions/410579/change-the-python3-default-version-in-ubuntu -RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \ - && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \ - # `requests` needs to be upgraded to avoid RequestsDependencyWarning - # ref: https://stackoverflow.com/questions/56155627/requestsdependencywarning-urllib3-1-25-2-or-chardet-3-0-4-doesnt-match-a-s - && python3 -m pip install --upgrade pip setuptools requests \ +RUN apt update -y && apt install --no-install-recommends -y software-properties-common \ + # Add deadsnakes PPA to install older Python versions + && add-apt-repository ppa:deadsnakes/ppa \ + && apt-get update && apt-get install -y \ + # Install specified Python + python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python3-pip python3-dev python-is-python3 \ + build-essential openssl libssl-dev libffi-dev ca-certificates git curl make ssh openssh-client \ + && update-ca-certificates \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Swtich default python3 version +RUN update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 + +# Install pip for specified Python version +RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} + +RUN python3 -m pip install --upgrade pip setuptools requests wheel six urllib3 \ && python3 -m pip install poetry # Add user. Without this, following process is executed as admin. RUN groupadd -g ${GID} ${GROUP_NAME} \ - && useradd -ms /bin/sh -u ${UID} -g ${GID} ${USER_NAME} +&& useradd -ms /bin/sh -u ${UID} -g ${GID} ${USER_NAME} USER ${USER_NAME} WORKDIR ${APPLICATION_DIRECTORY} # If ${RUN_POETRY_INSTALL_AT_BUILD_TIME} = "true", install Python package by Poetry and move .venv under ${HOME}. # This process is for CI (GitHub Actions). To prevent overwrite by volume of docker compose, .venv is moved under ${HOME}. -COPY --chown=${UID}:${GID} pyproject.toml poetry.lock poetry.toml . +COPY --chown=${UID}:${GID} pyproject.toml poetry.lock poetry.toml ./ RUN test ${RUN_POETRY_INSTALL_AT_BUILD_TIME} = "true" && poetry install || echo "skip to run poetry install." RUN test ${RUN_POETRY_INSTALL_AT_BUILD_TIME} = "true" && mv ${APPLICATION_DIRECTORY}/.venv ${HOME}/.venv || echo "skip to move .venv." diff --git a/environments/gpu/docker-compose.yaml b/environments/gpu/docker-compose.yaml index 1480f28..fa25da8 100644 --- a/environments/gpu/docker-compose.yaml +++ b/environments/gpu/docker-compose.yaml @@ -13,7 +13,7 @@ services: build: args: - BASE_IMAGE=nvidia/cuda:11.0.3-devel-ubuntu20.04 - - PYTHON_VERSION=3.8 + - PYTHON_VERSION=3.12 - UID=${HOST_UID-1000} - GID=${HOST_GID-1000} - PROJECT_NAME=${PROJECT_NAME_ENV} From a3d89d6ed1c54a6cb1c2c516382fade44a4973b8 Mon Sep 17 00:00:00 2001 From: Yoshihiro Fukuhara Date: Thu, 25 Jul 2024 22:16:38 +0900 Subject: [PATCH 4/4] reflect commit suggestion Co-authored-by: botany <61688218+YoshikiKubotani@users.noreply.github.com> --- environments/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environments/Dockerfile b/environments/Dockerfile index 7841728..369df95 100644 --- a/environments/Dockerfile +++ b/environments/Dockerfile @@ -38,7 +38,7 @@ RUN python3 -m pip install --upgrade pip setuptools requests wheel six urllib3 \ # Add user. Without this, following process is executed as admin. RUN groupadd -g ${GID} ${GROUP_NAME} \ -&& useradd -ms /bin/sh -u ${UID} -g ${GID} ${USER_NAME} + && useradd -ms /bin/sh -u ${UID} -g ${GID} ${USER_NAME} USER ${USER_NAME} WORKDIR ${APPLICATION_DIRECTORY}