Skip to content

Commit

Permalink
Move base images to python 3.10 (#550)
Browse files Browse the repository at this point in the history
## Checks

- [x] `make lint`: I've run `make lint` to lint the changes in this PR.
- [x] `make test`: I've made sure the tests (`make test-cpu` or `make
test`) are passing.
- Additional tests:
   - [ ] Benchmark tests (when contributing new models)
   - [ ] GPU/HW tests
  • Loading branch information
spillai authored May 4, 2024
1 parent 909c4ce commit e9a4c2c
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"] # , "macos-latest", "windows-latest"
python-version: ["3.9"]
python-version: ["3.10"]
defaults:
run:
shell: bash -el {0}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
python-version: ["3.10"]
defaults:
run:
shell: bash -el {0}
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
python-version: ["3.10"]
defaults:
run:
shell: bash -el {0}
Expand All @@ -40,7 +40,7 @@ jobs:
fail-fast: true
matrix:
os: ["macos-latest"]
python-version: ["3.8"]
python-version: ["3.10"]
defaults:
run:
shell: bash -el {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
python-version: ["3.10"]
defaults:
run:
shell: bash -el {0}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.8
python: python3.10

ci:
autofix_prs: true
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ FROM debian:buster-slim AS base-cpu

# Setup environment variables
ENV AGIPACK_PROJECT nos
ENV AGIPACK_PYENV nos-py38
ENV AGIPACK_PYENV nos-py310
ENV AGIPACK_PATH /opt/agi-pack

ENV DEBIAN_FRONTEND="noninteractive"
ENV PYTHON_VERSION 3.8.15
ENV PYTHON_VERSION 3.10.11
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONWARNINGS ignore
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ FROM nvidia/cuda:11.8.0-base-ubuntu22.04 AS base-gpu

# Setup environment variables
ENV AGIPACK_PROJECT nos
ENV AGIPACK_PYENV nos-py38
ENV AGIPACK_PYENV nos-py310
ENV AGIPACK_PATH /opt/agi-pack

ENV DEBIAN_FRONTEND="noninteractive"
ENV PYTHON_VERSION 3.8.15
ENV PYTHON_VERSION 3.10.11
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONWARNINGS ignore
Expand Down
2 changes: 1 addition & 1 deletion docker/agibuild.cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ images:
base-cpu:
base: debian:buster-slim
name: nos
python: "3.8"
python: "3.10"
system:
- gnupg2
- sudo
Expand Down
2 changes: 1 addition & 1 deletion docker/agibuild.cu121.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ images:
base-gpu:
base: nvidia/cuda:12.1.1-base-ubuntu22.04
name: nos
python: "3.8"
python: "3.10"
system:
- gnupg2
- sudo
Expand Down
2 changes: 1 addition & 1 deletion docker/agibuild.gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ images:
base-gpu:
base: nvidia/cuda:11.8.0-base-ubuntu22.04
name: nos
python: "3.8"
python: "3.10"
system:
- gnupg2
- sudo
Expand Down
8 changes: 4 additions & 4 deletions docs/OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
To quickly get started with a light-weight NOS client, run the following command:

```shell
$ conda create -n nos-py38 python=3.8
$ conda activate nos-py38
$ conda create -n nos-py310 python=3.10
$ conda activate nos-py310
$ pip install torch-nos
```

Expand All @@ -44,8 +44,8 @@ In the setup above, the client pulls and utilizes the NOS docker server that run
If you're interested in developing or contributing new models to NOS, consider installing the full NOS server via pip/conda:
```shell
$ conda create -n nos-py38 python=3.8
$ conda activate nos-py38
$ conda create -n nos-py310 python=3.10
$ conda activate nos-py310
$ conda install pytorch>=2.0.1 torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
$ pip install torch-nos[server]
```
Expand Down
2 changes: 0 additions & 2 deletions examples/discord/app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
bot:
image: autonomi/nos:latest-discord-app
Expand Down
2 changes: 0 additions & 2 deletions examples/docker/docker-compose.cpu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
server-cpu:
image: autonomi/nos:latest-cpu
Expand Down
2 changes: 0 additions & 2 deletions examples/docker/docker-compose.gpu-with-gateway.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
server:
image: autonomi/nos:latest-gpu
Expand Down
2 changes: 0 additions & 2 deletions examples/docker/docker-compose.gpu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
server-gpu:
image: autonomi/nos:latest-gpu
Expand Down
4 changes: 2 additions & 2 deletions examples/notebook/00-quickstart-welcome-to-nos.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"NOS is available on PyPI and can be installed via pip. We recommend using a virtual environment or conda to install NOS:\n",
"\n",
"```bash\n",
"$ conda create -n nos-py38 python=3.8\n",
"$ conda activate nos-py38\n",
"$ conda create -n nos-py310 python=3.10\n",
"$ conda activate nos-py310\n",
"$ pip install torch-nos\n",
"```\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/skypilot/sky.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resources:
setup: |
# Setup conda environment
conda init bash
conda create -n nos python=3.8 -y
conda create -n nos python=3.10 -y
conda activate nos
# Install docker compose plugin
Expand Down
50 changes: 4 additions & 46 deletions makefiles/Makefile.agibuild.mk
Original file line number Diff line number Diff line change
@@ -1,54 +1,30 @@
# Copyright 2023 Autonomi AI, Inc. All rights reserved.
AGIPACK_ARGS :=

agi-build-cpu: # equivalent to agi-build-py38-cpu (target=base-cpu, cpu, test-cpu)
agi-build-cpu: # equivalent to agi-build-py310-cpu (target=base-cpu, cpu, test-cpu)
agi-pack build ${AGIPACK_ARGS} \
--target cpu \
-c docker/agibuild.cpu.yaml \
-o docker/Dockerfile.cpu \
-p 3.8.15 \
-p 3.10.11 \
-b debian:buster-slim \
-t '${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-cpu'
docker tag \
${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-cpu \
${DOCKER_IMAGE_NAME}:latest-cpu

agi-build-gpu: # equivalent to agi-build-py38-cu118 (target=base-gpu, gpu, test-gpu)
agi-build-gpu: # equivalent to agi-build-py310-cu118 (target=base-gpu, gpu, test-gpu)
agi-pack build ${AGIPACK_ARGS} \
--target gpu \
-c docker/agibuild.gpu.yaml \
-o docker/Dockerfile.gpu \
-p 3.8.15 \
-p 3.10.11 \
-b nvidia/cuda:11.8.0-base-ubuntu22.04 \
-t '${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-gpu'
docker tag \
${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-gpu \
${DOCKER_IMAGE_NAME}:latest-gpu

agi-build-py38-cu118:
agi-pack build ${AGIPACK_ARGS} \
--target gpu \
-c docker/agibuild.gpu.yaml \
-o docker/Dockerfile.py38-cu118 \
-p 3.8.15 \
-b nvidia/cuda:11.8.0-base-ubuntu22.04 \
-t '${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py38-cu118'
docker tag \
${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py38-cu118 \
${DOCKER_IMAGE_NAME}:latest-py38-cu118

agi-build-py39-cu118:
agi-pack build ${AGIPACK_ARGS} \
--target gpu \
-c docker/agibuild.gpu.yaml \
-o docker/Dockerfile.py39-cu118 \
-p 3.9.13 \
-b nvidia/cuda:11.8.0-base-ubuntu22.04 \
-t '${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py39-cu118'
docker tag \
${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py39-cu118 \
${DOCKER_IMAGE_NAME}:latest-py39-cu118

agi-build-py310-cu118:
agi-pack build ${AGIPACK_ARGS} \
--target gpu \
Expand All @@ -61,18 +37,6 @@ agi-build-py310-cu118:
${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py310-cu118 \
${DOCKER_IMAGE_NAME}:latest-py310-cu118

agi-build-py38-cu121:
agi-pack build ${AGIPACK_ARGS} \
--target gpu \
-c docker/agibuild.cu121.yaml \
-o docker/Dockerfile.py38-cu121 \
-p 3.8.15 \
-b nvidia/cuda:12.1.1-base-ubuntu22.04 \
-t '${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py38-cu121'
docker tag \
${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py38-cu121 \
${DOCKER_IMAGE_NAME}:latest-py38-cu121

agi-build-py310-cu121:
agi-pack build ${AGIPACK_ARGS} \
--target gpu \
Expand All @@ -86,18 +50,12 @@ agi-build-py310-cu121:
${DOCKER_IMAGE_NAME}:latest-py310-cu121

agi-build-cu118: \
agi-build-py38-cu118 \
agi-build-py39-cu118 \
agi-build-py310-cu118

agi-build-cu121: \
agi-build-py310-cu121

agi-push-cu118:
docker push ${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py38-cu118
docker push ${DOCKER_IMAGE_NAME}:latest-py38-cu118
docker push ${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py39-cu118
docker push ${DOCKER_IMAGE_NAME}:latest-py39-cu118
docker push ${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-py310-cu118
docker push ${DOCKER_IMAGE_NAME}:latest-py310-cu118

Expand Down
2 changes: 1 addition & 1 deletion makefiles/Makefile.base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ docker-build-and-push-multiplatform-cpu:
agi-pack generate ${AGIPACK_ARGS} \
-c docker/agibuild.cpu.yaml \
-o docker/Dockerfile.multiplatform.cpu \
-p 3.8.15 \
-p 3.10.11 \
-b debian:buster-slim \
-t '${DOCKER_IMAGE_NAME}:${NOS_VERSION_TAG}-{target}'
make .docker-build-and-push-multiplatform \
Expand Down
2 changes: 0 additions & 2 deletions nos/cli/templates/docker-compose.serve.yml.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
{%- if http %}
nos-http-gateway:
Expand Down
2 changes: 1 addition & 1 deletion nos/common/shm.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def copy(shm_map: Dict[str, Any], data: Dict[str, Any]) -> Dict[str, Any]:
shm_map[key]
), f"Shared memory already initialized with length={len(shm_map[key])}, provided input with length={len(data[key])}."
# Move data from the data dict value to the shared memory segment.
for item, shm in zip(data[key], shm_map[key]):
for item, shm in zip(data[key], shm_map[key], strict=False):
shm.copy_from(item)
elif isinstance(data[key], np.ndarray):
# Move data from the data dict value to the shared memory segment.
Expand Down
4 changes: 2 additions & 2 deletions nos/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def _init_telemetry_logger() -> None:
debug=SENTRY_DEBUG,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
traces_sample_rate=0.05,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
profiles_sample_rate=0.05,
release=__version__,
integrations=[
sentry_loguru,
Expand Down
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "torch-nos"
description = "Nitrous Oxide for your AI Infrastructure."
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.8.10"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
Expand All @@ -21,8 +21,6 @@ classifiers = [
"Topic :: Scientific/Engineering :: Image Processing",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",

Expand Down Expand Up @@ -85,7 +83,7 @@ exclude = [

[tool.black]
line-length = 119
target-version = ['py38']
target-version = ['py310']
exclude = '''
/(
\.data
Expand Down Expand Up @@ -119,7 +117,7 @@ ignore = [
"B904", # B904: check for raise from None
]
line-length = 119
target-version = "py38"
target-version = "py310"

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
Expand Down
2 changes: 1 addition & 1 deletion tests/common/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_common_tqdm():
import time

# Use tqdm as a regular progress bar
for i1, i2 in zip(range(10), tqdm(range(10))):
for i1, i2 in zip(range(10), tqdm(range(10)), strict=False):
assert i1 == i2

# Use tqdm as a timer
Expand Down

0 comments on commit e9a4c2c

Please sign in to comment.