Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,20 @@
"ppa": true,
"version": "system"
},
"ghcr.io/devcontainers-contrib/features/pipenv:2": {
"ghcr.io/devcontainers-extra/features/pipenv:2": {
"version": "latest"
},
"ghcr.io/va-h/devcontainers-features/uv:1": {
"shellautocompletion": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/nvidia-cuda:1": {
"installCudnn": true,
"installCudnnDev": true,
"installNvtx": true,
"installToolkit": true,
"cudaVersion": "12.5",
"cudnnVersion": "9.3.0.75"
}
},

Expand Down
69 changes: 33 additions & 36 deletions .devcontainer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,47 @@ export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo apt install -y libopenblas-dev libyaml-dev ffmpeg wget ca-certificates

# Install CUDA and cuDNN if not already installed
if ! command -v nvcc &> /dev/null; then
# # Install CUDA and cuDNN if not already installed
# if ! command -v nvcc &> /dev/null; then

CUDA_VERSION="12.3"
CUDNN_VERSION="8.9.7.29-1+cuda12.2" # Not sure why no 12.3
# CUDA_VERSION="12.3"
# CUDNN_VERSION="8.9.7.29-1+cuda12.2" # Not sure why no 12.3

NVIDIA_REPO_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64"
KEYRING_PACKAGE="cuda-keyring_1.1-1_all.deb"
KEYRING_PACKAGE_URL="$NVIDIA_REPO_URL/$KEYRING_PACKAGE"
KEYRING_PACKAGE_PATH="$(mktemp -d)"
KEYRING_PACKAGE_FILE="$KEYRING_PACKAGE_PATH/$KEYRING_PACKAGE"
wget -O "$KEYRING_PACKAGE_FILE" "$KEYRING_PACKAGE_URL"
sudo apt install -yq "$KEYRING_PACKAGE_FILE"
sudo apt update -yq
# NVIDIA_REPO_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64"
# KEYRING_PACKAGE="cuda-keyring_1.1-1_all.deb"
# KEYRING_PACKAGE_URL="$NVIDIA_REPO_URL/$KEYRING_PACKAGE"
# KEYRING_PACKAGE_PATH="$(mktemp -d)"
# KEYRING_PACKAGE_FILE="$KEYRING_PACKAGE_PATH/$KEYRING_PACKAGE"
# wget -O "$KEYRING_PACKAGE_FILE" "$KEYRING_PACKAGE_URL"
# sudo apt install -yq "$KEYRING_PACKAGE_FILE"
# sudo apt update -yq

# Install CUDA libraries
cuda_pkg="cuda-libraries-${CUDA_VERSION/./-}"
sudo apt install -yq "$cuda_pkg"
# # Install CUDA libraries
# cuda_pkg="cuda-libraries-${CUDA_VERSION/./-}"
# sudo apt install -yq "$cuda_pkg"

# Install cuDNN
cudnn_pkg="libcudnn8=${CUDNN_VERSION}"
sudo apt install -yq "$cudnn_pkg_version"
# # Install cuDNN
# cudnn_pkg="libcudnn8=${CUDNN_VERSION}"
# sudo apt install -yq "$cudnn_pkg_version"

# Install cuDNN dev
cudnn_dev_pkg="libcudnn8-dev=${CUDNN_VERSION}"
sudo apt install -yq "$cudnn_dev_pkg"
# # Install cuDNN dev
# cudnn_dev_pkg="libcudnn8-dev=${CUDNN_VERSION}"
# sudo apt install -yq "$cudnn_dev_pkg"

# Install NVTX
nvtx_pkg="cuda-nvtx-${CUDA_VERSION/./-}"
sudo apt install -yq "$nvtx_pkg"
# # Install NVTX
# nvtx_pkg="cuda-nvtx-${CUDA_VERSION/./-}"
# sudo apt install -yq "$nvtx_pkg"

# Install CUDA Toolkit
toolkit_pkg="cuda-toolkit-${CUDA_VERSION/./-}"
sudo apt install -yq "$toolkit_pkg"
# # Install CUDA Toolkit
# toolkit_pkg="cuda-toolkit-${CUDA_VERSION/./-}"
# sudo apt install -yq "$toolkit_pkg"

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
# export LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

# Clean up
sudo rm -rf /var/lib/apt/lists/*
fi

# Install poetry
pipx install poetry --pip-args '--no-cache-dir --force-reinstall'
# # Clean up
# sudo rm -rf /var/lib/apt/lists/*
# fi

# Install project dependencies
poetry install
uv sync
26 changes: 17 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@ name: HeartKit CI

on: [push]

env:
PYTHON_VERSION: '3.11'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup Python 🐍
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'
cache: 'poetry'
- run: poetry install
- run: poetry run task lint
- run: poetry run task test
enable-cache: true
- name: Install dependencies 🔧
run: |
uv sync
uv run ruff check
uv run pytest tests/
20 changes: 9 additions & 11 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Deploy to GitHub Pages

on:
push:
branches: [$default-branch]
release:
types:
- created
workflow_dispatch:

permissions:
Expand All @@ -26,24 +27,21 @@ jobs:

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Install Poetry
run: pipx install poetry
- name: Install Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'
cache: 'poetry'
enable-cache: true
- name: Install and Build 🔧
env:
CI: ""
PUBLIC_URL: "${{ steps.pages.outputs.base_url }}/"
run: |
poetry install --no-root --only docs
poetry run mkdocs build
uv sync --only-group docs
uv run mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: Release to PyPi

# on:
# release:
# types:
# - created

on:
push:
branches: [$default-branch]
release:
types:
- created
workflow_dispatch:

jobs:
Expand All @@ -16,16 +12,13 @@ jobs:
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Install Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'
cache: 'poetry'
enable-cache: true
- name: Install and Build 🔧
run: |
poetry build
uv build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ repos:
args: [ --config=pyproject.toml ]
- id: ruff-format
args: [ --config=pyproject.toml ]
- repo: https://github.com/python-poetry/poetry
rev: 1.8.3
hooks:
- id: poetry-check
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ HeartKit is an AI Development Kit (ADK) that enables developers to easily train
## <span class="sk-h2-span">Requirements

* [Python ^3.11+](https://www.python.org)
* [Poetry ^1.6.1+](https://python-poetry.org/docs/#installation)
* [uv ^1.6.1+](https://docs.astral.sh/uv/getting-started/installation/)

The following are also required to compile/flash the binary for the EVB demo:

Expand All @@ -47,7 +47,7 @@ Alternatively, you can install the package from source by cloning the repository
```bash
git clone https://github.com/AmbiqAI/heartkit.git
cd heartkit
poetry install
uv sync
```

---
Expand Down
Loading