Skip to content

Commit 5b565c5

Browse files
committed
Merge branch 'main' of github.com:VectorInstitute/aieng-template-implementation
2 parents d2946e7 + 2977dcd commit 5b565c5

File tree

12 files changed

+795
-623
lines changed

12 files changed

+795
-623
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ENV_VARIABLE_ONE=<your_environment_variable_value_one>
2+
ENV_VARIABLE_TWO=<your_environment_variable_value_two>

.github/workflows/code_checks.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,25 @@ jobs:
2929
run-code-check:
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v4.2.2
32+
- uses: actions/checkout@v5.0.0
3333

3434
- name: Install uv
35-
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca
35+
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4
3636
with:
3737
# Install a specific version of uv.
3838
version: "0.7.6"
3939
enable-cache: true
4040

4141
- name: "Set up Python"
42-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
42+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
4343
with:
4444
python-version-file: ".python-version"
4545

46-
- name: Install the project
47-
run: uv sync --all-extras --dev
48-
4946
- name: Install dependencies and check code
5047
run: |
48+
uv venv .venv
5149
source .venv/bin/activate
50+
uv sync --all-extras --dev
5251
pre-commit run --all-files
5352
5453
- name: pip-audit (gh-action-pip-audit)

.github/workflows/publish.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,33 @@ jobs:
1616
run: |
1717
sudo apt-get update
1818
sudo apt-get install libcurl4-openssl-dev libssl-dev
19-
- uses: actions/checkout@v4.2.2
19+
- uses: actions/checkout@v5.0.0
2020

2121
- name: Install uv
22-
uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04
22+
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4
2323
with:
2424
# Install a specific version of uv.
2525
version: "0.7.6"
2626
enable-cache: true
2727

2828
- name: "Set up Python"
29-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
29+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
3030
with:
3131
python-version-file: ".python-version"
3232

33-
- name: Install the project
34-
run: cd aieng-topic-impl && uv sync --dev
33+
- name: Install dependencies
34+
run: |
35+
cd aieng-topic-impl
36+
uv venv .venv
37+
source .venv/bin/activate
38+
uv sync --all-extras --dev
3539
3640
- name: Build package
3741
run: cd aieng-topic-impl && source .venv/bin/activate && uv build
3842

3943
- name: Publish package
40-
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
44+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
4145
with:
4246
user: __token__
4347
password: ${{ secrets.PYPI_API_TOKEN }}
4448
packages-dir: aieng-topic-impl/dist/
45-
46-
- name: Create GitHub Release
47-
id: create_release
48-
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
49-
with:
50-
artifacts: "aieng-topic-impl/dist/*"
51-
generateReleaseNotes: true

.github/workflows/unit_tests.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,24 @@ jobs:
3737
unit-tests:
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v4.2.2
40+
- uses: actions/checkout@v5.0.0
4141

4242
- name: Install uv
43-
uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04
43+
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4
4444
with:
4545
# Install a specific version of uv.
4646
version: "0.7.6"
4747
enable-cache: true
4848

4949
- name: "Set up Python"
50-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
50+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
5151
with:
5252
python-version-file: ".python-version"
5353

54-
- name: Install the project
55-
run: cd aieng-topic-impl && uv sync --all-extras --dev
56-
5754
- name: Install dependencies and check code
5855
run: |
5956
cd aieng-topic-impl
57+
uv venv .venv
6058
source .venv/bin/activate
59+
uv sync --all-extras --dev
6160
uv run pytest -m "not integration_test" tests

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ wheels/
2222

2323
# ipynb checkpoints
2424
**.ipynb_checkpoints
25+
26+
.env

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to aieng-template
22

3-
Thanks for your interest in contributing to the aieng-template-bootcamp!
3+
Thanks for your interest in contributing to the aieng-template-implementation!
44

55
To submit PRs, please fill out the PR template along with the PR. If the PR
66
fixes an issue, don't forget to link the PR to the issue!

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
2+
3+
EXPOSE 8888
4+
5+
# Install system dependencies
6+
RUN apt-get update \
7+
&& apt-get install -y \
8+
sudo \
9+
curl \
10+
git \
11+
jq \
12+
tar \
13+
unzip \
14+
ca-certificates \
15+
build-essential \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# !!IMPORTANT!!
19+
# THIS SECTION SHOULD NOT BE MODIFIED AS
20+
# IT IS USED TO MAKE THIS IMAGE COMPATIBLE WITH CODER
21+
#######################################################################
22+
ARG USER=coder
23+
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
24+
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
25+
&& chmod 0440 /etc/sudoers.d/${USER}
26+
27+
USER ${USER}
28+
WORKDIR /home/${USER}
29+
########################################################################
30+
31+
# Copy the code into the container
32+
COPY --chown=${USER}:${USER} . /home/${USER}/aieng-template-implementation
33+
34+
# Start the container and run the project setup script
35+
CMD ["bash", "aieng-template-implementation/scripts/setup.sh"]

GUIDELINES.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# GUIDELINES
2+
3+
These guidelines are recommended for anyone creating a repository using this template for building reference implementations.
4+
5+
## Repository Name
6+
7+
Choose a repository name that reflects the main topic of your reference implementations. Avoid generic terms like 'workshop', 'bootcamp', 'reference', or 'implementations'. Instead, use a concise topic name that best describes the content.
8+
9+
**Example:** Use `retrieval-augmented-generation` if your repository contains reference implementations for RAG concepts. Select a single, descriptive topic name for the project.
10+
11+
> **Note:** If you cannot use the recommended naming convention initially, you may start with a different name and update it later.
12+
13+
## Environment Variables
14+
15+
Manage environment variables using a `.env` file and access them in your code with `os.getenv("ENV_VARIABLE", "default-value")`. List all environment-specific variables in a `.env.example` file with placeholder values for easy reference and onboarding.
16+
17+
## Utility Packages
18+
19+
Place all common methods and classes used across implementations in a dedicated module at the repository root. Each package should have its own `pyproject.toml` specifying its details and dependencies. For example, this repository includes the `aieng-topic-impl` package.
20+
21+
If your repository contains multiple packages, link each one in the main `pyproject.toml` as shown below to ensure they are built and linked for local development:
22+
23+
```toml
24+
[tool.uv.workspace]
25+
members = [
26+
"aieng-topic-impl",
27+
]
28+
29+
[tool.uv.sources]
30+
aieng-topic-impl = { workspace = true }
31+
```
32+
33+
When testing packages, use pre-release versions (e.g., v0.1.0a1, v0.1.0a2, v0.1.0b1). After testing, update to a release version (e.g., v1.0.0) before publishing. Follow the [official versioning scheme](https://packaging.python.org/en/latest/discussions/versioning/).
34+
35+
## Google Colab Integration (For Notebooks Only)
36+
37+
Ensure Jupyter Notebooks are runnable on Google Colab. This may require installing your locally linked package and resolving dependency conflicts in the Colab environment.
38+
39+
Add the following Markdown cell at the top of your notebook to enable opening it in Colab:
40+
41+
```markdown
42+
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VectorInstitute/<REPO_NAME>/blob/main/<PATH_TO_NOTEBOOK>)
43+
```
44+
45+
Include a Python cell like the one below at the beginning of your notebook to customize it for Colab:
46+
47+
```python
48+
import os
49+
50+
if "COLAB_RELEASE_TAG" in os.environ:
51+
# Running in Google Colab
52+
# Install required dependencies
53+
!pip3 install numpy==1.26.4 torchvision==0.16.2 aieng-topic-impl
54+
# Uninstall conflicting dependencies
55+
!pip3 uninstall --yes torchao torchaudio torchdata torchsummary torchtune
56+
```
57+
58+
## Dockerization
59+
60+
Dockerize your project to ensure portability and consistency across platforms. This also facilitates deployment on the AI Engineering Platform used in bootcamps and workshops.
61+
62+
- Update the provided `Dockerfile` to suit your project’s needs.
63+
- Modify `scripts/start.sh` to reflect your setup steps. This script will run at container startup.
64+
- Update the `README.md` with instructions to build and start the Docker container.
65+
66+
## GitHub Actions
67+
68+
### Publish
69+
70+
Use this GitHub Actions workflow to publish packages. Create a PyPI token and set the `PYPI_API_TOKEN` secret in your repository settings. To trigger the publish workflow, create a GitHub Release and push a new tag (e.g., `v0.1.0`).
71+
72+
After publishing, test the package by installing it in a new virtual environment and performing a sanity check.

implementations/implementation_a/topic_a_a.ipynb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@
2424
"## Install implementation specific package for a topic"
2525
]
2626
},
27-
{
28-
"cell_type": "code",
29-
"execution_count": null,
30-
"id": "e89d13c0-6d80-45ab-ba7e-32ffc3fdbae5",
31-
"metadata": {},
32-
"outputs": [],
33-
"source": [
34-
"%pip install aieng-topic-impl"
35-
]
36-
},
3727
{
3828
"cell_type": "code",
3929
"execution_count": null,

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ readme = "README.md"
77
repository = "https://github.com/VectorInstitute/aieng-template-implementation"
88
requires-python = ">=3.12"
99
dependencies = [
10+
"aieng-topic-impl",
1011
"jupyterlab>=4.4.2",
1112
]
1213

@@ -24,6 +25,14 @@ dev = [
2425
"ruff>=0.9.2",
2526
]
2627

28+
[tool.uv.workspace]
29+
members = [
30+
"aieng-topic-impl",
31+
]
32+
33+
[tool.uv.sources]
34+
aieng-topic-impl = { workspace = true }
35+
2736
[tool.mypy]
2837
ignore_missing_imports = true
2938
install_types = true

0 commit comments

Comments
 (0)