Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring #11

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
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
70 changes: 70 additions & 0 deletions .devcontainer/cuda-tf/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "cuda-11.8",
"image": "mcr.microsoft.com/devcontainers/python:3.9",
// "hostRequirements": {
// "gpu": "optional"
// },
"runArgs": [
"--gpus=all"
],
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/usr/local/cuda/bin:/home/vscode/.local/bin",
"LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64",
"XLA_FLAGS": "--xla_gpu_cuda_data_dir=/usr/local/cuda"
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true,
"configureZshAsDefaultShell": true,
"username": "vscode",
"userUid": "1000",
"userGid": "1000"
// "upgradePackages": "true"
},
// "ghcr.io/devcontainers/features/python:1": {},
// "ghcr.io/devcontainers/features/node:1": "none",
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": true
},
"ghcr.io/devcontainers/features/nvidia-cuda:1": {
"installCudnn": true,
"cudaVersion": "11.8",
"cudnnVersion": "8.6.0.163",
"installToolkit": true
},
"ghcr.io/iterative/features/nvtop:1": {}
},
"updateContentCommand": "bash .devcontainer/cuda-tf/setup.sh",
"postCreateCommand": [
"nvidia-smi"
],
"customizations": {
"vscode": {
"settings": {
"python.linting.enabled": true,
"python.testing.pytestEnabled": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
},
"[python]": {
"editor.defaultFormatter": "ms-python.vscode-pylance"
},
"editor.rulers": [
80
]
},
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-python.vscode-pylance"
]
}
}
}
13 changes: 13 additions & 0 deletions .devcontainer/cuda-tf/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# install Python packages in virtual environment
# python3.11 -m venv .venv-3.11
# source .venv-3.11/bin/activate
# python -m pip install --upgrade pip

# needed to make sure default python is 3.9 instead of 3.11
sudo ln -s -f /usr/local/bin/python3.9 /usr/bin/python3

# install packages and make sure we use TF 2.14.1
pip install -e .[dev] tensorflow==2.14.1

# install pre-commit hook if not installed already
pre-commit install
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: 'Bug:'
labels: bug
assignees: ''
---

**Describe the bug**
Provide a clear and concise description of the bug.

**How to reproduce**
Include source code:

```python
import airt
...
```

And/Or steps to reproduce the behavior:

1. ...

**Expected behavior**
Explain what you expected to happen clearly and concisely.

**Observed behavior**
Describe what is actually happening clearly and concisely.

**Screenshots**
If applicable, attach screenshots to help illustrate the problem.

**Environment**
Include the info of your environment and monotonic-nn version

**Additional context**
Provide any other relevant context or information about the problem here.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true

contact_links:
- name: Security Contact
about: Please report security vulnerabilities to [email protected]
- name: Question or Problem
about: Ask a question or ask about a problem in GitHub Discussions.
url: https://github.com/airtai/airt/discussions/categories/questions
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Feature Request
about: Suggest an idea for this project
title: 'Feature:'
labels: enhancement
assignees: ''
---

To suggest an idea or inquire about any other enhancement, please follow this template:

**Is your feature request related to a problem? Please describe.**
Provide a clear and concise description of the problem you've encountered. For example: "I'm always frustrated when..."

**Describe the solution you'd like**
Clearly and concisely describe the desired outcome or solution.

**Feature code example**
To help others understand the proposed feature, illustrate it with a code example:

```python
import airt
...
```

**Describe alternatives you've considered**
Provide a clear and concise description of any alternative solutions or features you've thought about.

**Additional context**
Include any other relevant context or screenshots related to the feature request.
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Description

Please include a summary of the change and specify which issue is being addressed. Additionally, provide relevant motivation and context.

Fixes # (issue number)

## Type of change

Please delete options that are not relevant.

- [ ] Documentation (typos, code examples, or any documentation updates)
- [ ] Bug fix (a non-breaking change that resolves an issue)
- [ ] New feature (a non-breaking change that adds functionality)
- [ ] Breaking change (a fix or feature that would disrupt existing functionality)
- [ ] This change requires a documentation update

## Checklist

- [ ] My code adheres to the style guidelines of this project (`scripts/lint.sh` shows no errors)
- [ ] I have conducted a self-review of my own code
- [ ] I have made the necessary changes to the documentation
- [ ] My changes do not generate any new warnings
- [ ] I have added tests to validate the effectiveness of my fix or the functionality of my new feature
- [ ] Both new and existing unit tests pass successfully on my local environment by running `scripts/test-cov.sh`
- [ ] I have ensured that static analysis tests are passing by running `scripts/static-anaylysis.sh`
- [ ] I have included code examples to illustrate the modifications
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# Python
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
19 changes: 19 additions & 0 deletions .github/workflows/check-broken-links-in-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check docs for broken links

on:
workflow_run:
workflows: ["pages-build-deployment"]
types: [completed]

jobs:
check-broken-link:
name: Check docs for broken links
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check links using container
uses: ruzickap/action-my-broken-link-checker@v2
with:
url: https://airt.airt.ai
cmd_params: '--buffer-size=8192 --max-connections=1 --color=always --header="User-Agent:Mozilla/5.0(Firefox/97.0)" --exclude="(localhost:8000|linkedin.com|fonts.gstatic.com|reddit.com)" --max-connections-per-host=1 --rate-limit=1'
debug: true
83 changes: 83 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '39 20 * * 0'

jobs:
analyze:
if: github.event.pull_request.draft == false
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3 # nosemgrep
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3 # nosemgrep

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3 # nosemgrep
with:
category: "/language:${{matrix.language}}"
21 changes: 21 additions & 0 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
43 changes: 43 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy Docs
on:
push:
branches:
- main
paths:
- docs/**
- .github/workflows/deploy-docs.yaml
- airt/__about__.py

permissions:
contents: write
jobs:
deploy_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- run: pip install -e ".[dev]"
- run: ./scripts/build-docs.sh
- run: echo "VERSION=$(python3 -c 'from importlib.metadata import version; print(".".join(version("airt").split(".")[:2]))')" >> $GITHUB_ENV
- run: echo "IS_RC=$(python3 -c 'from importlib.metadata import version; print("rc" in version("airt"))')" >> $GITHUB_ENV
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- run: echo $VERSION
- run: echo $IS_RC
- run: |
if [ "$IS_RC" == "False" ]; then
cd docs && mike deploy -F mkdocs.yml --update-aliases $VERSION latest
mike set-default --push --allow-empty -F mkdocs.yml latest
else
cd docs && mike deploy --push -F mkdocs.yml --update-aliases $VERSION
fi
11 changes: 0 additions & 11 deletions .github/workflows/deploy.yaml

This file was deleted.

Loading