Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d5e18a3
Initial plan
Copilot Oct 31, 2025
d08dea3
Update packages to latest versions and fix deprecated API usage
Copilot Oct 31, 2025
61d26bd
Fix ignore_errors API to use correct method syntax
Copilot Oct 31, 2025
49e8a81
Address code review feedback: fix typos, simplify list creation, add …
Copilot Oct 31, 2025
ad2f82d
Merge pull request #3 from animikhaich/copilot/update-packages-and-co…
animikhaich Oct 31, 2025
cf1caa8
Initial plan
Copilot Oct 31, 2025
44854d4
Initial plan
Copilot Oct 31, 2025
934554a
Add GitHub workflow to build and push Docker images
Copilot Oct 31, 2025
41c84fc
Add workflow documentation and update README with GHCR instructions
Copilot Oct 31, 2025
c93e20c
Add PyTorch support and create multiple Docker images
Copilot Oct 31, 2025
eb8d3f4
Add framework guide and test verification
Copilot Nov 1, 2025
10a3c03
Refactor PyTorch training to use streamlit callbacks properly
Copilot Nov 1, 2025
58af375
Fix PyTorch data loader label assignment logic
Copilot Nov 1, 2025
d78cbaa
Add path validation to prevent path traversal attacks
Copilot Nov 1, 2025
2dd6652
Add comprehensive security documentation
Copilot Nov 1, 2025
263c5ad
Add quick start guide for users
Copilot Nov 1, 2025
c9f8053
Merge pull request #5 from animikhaich/copilot/add-github-workflows-d…
animikhaich Nov 1, 2025
3e80c71
Merge branch 'dev' into copilot/add-training-support-pytorch
animikhaich Nov 1, 2025
2609c5c
Merge pull request #4 from animikhaich/copilot/add-training-support-p…
animikhaich Nov 1, 2025
9768656
Updated dockerfiles and github workflows
animikhaich Nov 1, 2025
826eec2
Added: Tensorlfow and PyTorch with separate dockerfiles and builds
animikhaich Nov 1, 2025
19037e7
Merge branch 'main' into dev
animikhaich Nov 1, 2025
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.venv
data
64 changes: 64 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# GitHub Workflows

This directory contains GitHub Actions workflows for the No-Code Classification Toolkit.

## Docker Build and Push Workflow

**File:** `docker-build-push.yml`

### Purpose
Automatically builds and pushes Docker images to GitHub Container Registry (ghcr.io) whenever code is pushed to the repository.

### Triggers
The workflow runs on:
- **Push to main branch**: Builds and pushes images with `latest` tag
- **Push tags matching `v*`**: Builds and pushes versioned releases (e.g., `v1.0.0`)
- **Pull requests to main**: Builds images for testing (does not push)
- **Manual trigger**: Can be triggered manually via GitHub Actions UI

### Docker Image Tags
The workflow creates multiple tags for each build:

- `latest` - Latest build from the main branch
- `main` - Latest build from the main branch
- `v1.2.3` - Semantic version tags (for tagged releases)
- `v1.2` - Major.minor version tags
- `v1` - Major version tags
- `main-<sha>` - Branch name with commit SHA

### Docker Registry
Images are pushed to GitHub Container Registry:
```
ghcr.io/animikhaich/no-code-classification-toolkit
```

### Usage

#### Pull the latest image:
```bash
docker pull ghcr.io/animikhaich/no-code-classification-toolkit:latest
```

#### Pull a specific version:
```bash
docker pull ghcr.io/animikhaich/no-code-classification-toolkit:v1.0.0
```

#### Run the container:
```bash
docker run -it --runtime nvidia --net host -v /path/to/dataset:/data ghcr.io/animikhaich/no-code-classification-toolkit:latest
```

### Permissions
The workflow requires:
- `contents: read` - To checkout the repository
- `packages: write` - To push images to GitHub Container Registry

### Features
- **Docker Buildx**: Uses BuildKit for efficient multi-platform builds
- **Layer caching**: Leverages GitHub Actions cache for faster builds
- **Metadata extraction**: Automatically generates Docker labels and tags
- **Security**: Uses `GITHUB_TOKEN` for authentication (no manual secrets needed)

### Monitoring
You can monitor workflow runs in the [Actions tab](https://github.com/animikhaich/No-Code-Classification-Toolkit/actions) of the repository.
90 changes: 90 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Build and Push Docker Images

on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# TensorFlow image
- name: Extract metadata (tensorflow)
id: meta-tensorflow
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-tensorflow
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push TensorFlow image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.tensorflow
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-tensorflow.outputs.tags }}
labels: ${{ steps.meta-tensorflow.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# PyTorch image
- name: Extract metadata (pytorch)
id: meta-pytorch
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-pytorch
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push PyTorch image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.pytorch
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-pytorch.outputs.tags }}
labels: ${{ steps.meta-pytorch.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,7 @@ dmypy.json
model/
logs*
old_data/
test*
test*


data
15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

23 changes: 23 additions & 0 deletions Dockerfile.both
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM astral/uv:python3.12-bookworm-slim

ARG DEBIAN_FRONTEND=noninteractive

# Install Python and necessary tools
RUN apt-get update && apt-get install -y \
parallel \
&& rm -rf /var/lib/apt/lists/*

# Create app directory
RUN mkdir /app
WORKDIR /app

# Copy requirements and install dependencies
COPY ./requirements-tensorflow.txt /app
COPY ./requirements-pytorch.txt /app
RUN uv pip install --no-cache-dir -r requirements-tensorflow.txt --system
RUN uv pip install --no-cache-dir -r requirements-pytorch.txt --system

# Copy application files
COPY . /app

CMD ["sh", "launch.sh"]
15 changes: 15 additions & 0 deletions Dockerfile.pytorch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM astral/uv:python3.12-bookworm-slim

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get install -y parallel

RUN mkdir /app
WORKDIR /app
COPY ./requirements-pytorch.txt /app

RUN uv pip install -r requirements-pytorch.txt --system
COPY . /app

CMD ["sh", "launch.sh"]
15 changes: 15 additions & 0 deletions Dockerfile.tensorflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM astral/uv:python3.12-bookworm-slim

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get install -y parallel

RUN mkdir /app
WORKDIR /app
COPY ./requirements-tensorflow.txt /app

RUN uv pip install -r requirements-tensorflow.txt --system
COPY . /app

CMD ["sh", "launch.sh"]
Loading
Loading