Skip to content

feat : fast api #2

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

Merged
merged 21 commits into from
Jul 22, 2025
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
11 changes: 7 additions & 4 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
NEO4J_URI
NEO4J_DB
NEO4J_USER
NEO4J_PASSWORD
NEO4J_URI = "YOUR_NEO4J_URL"
NEO4J_DATABASE = "YOUR_NEO4J_DATABASE"
NEO4J_USER = "YOUR_NEO4J_USER"
NEO4J_PASSWORD = "YOUR_NEO4J_PASSWORD"

JWT_SECRET_KEY = "YOUR_JWT_SECRET_KEY"
JWT_ALGORITHM = "JWT_ALGORITHM" #"HS256" recommended
125 changes: 125 additions & 0 deletions .github/workflows/docker-inference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Build and Push Docker Image

on:
release:
type: [published]
#trigger on each commit of each branch and push with latest tag
push :
# pull_request:
# paths:
# - 'pyproject.toml'
# - './docker/**'
# - '.github/workflows/**'

env:
REGISTRY: ghcr.io

jobs:
build-image:
runs-on: ubuntu-latest
#if: github.ref != 'refs/heads/main'
permissions:
contents: read
packages: write

steps:
# https://github.com/actions/checkout
- name: checkout repository
uses: actions/checkout@v4

- name: lowercase image name
run: |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/[email protected]

# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Get current release version
id: release-version
run: |
version=$(grep -E '^version += +' pyproject.toml | sed -E 's/.*= +//' | sed "s/['\"]//g")
echo "version=${version}" >> $GITHUB_OUTPUT
echo "version_build=${version}_"$(git rev-parse --short "$GITHUB_SHA") >> $GITHUB_OUTPUT

# https://github.com/docker/build-push-action
- name: Build Docker image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64
file: tools/images/Dockerfile-inference
push: false
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.release-version.outputs.version_build }}
build-args: PLATFORM=cu124
outputs: type=image,annotation-index.org.opencontainers.image.description=Run a Graph Neural Network.

push-image:
runs-on: ubuntu-latest
#if: github.ref == 'refs/heads/main'
permissions:
contents: read
packages: write

steps:
# https://github.com/actions/checkout
- name: checkout repository
uses: actions/checkout@v4

- name: lowercase image name
run: |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/[email protected]

# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Get current release version
id: release-version
run: |
version=$(grep -E '^version += +' pyproject.toml | sed -E 's/.*= +//' | sed "s/['\"]//g")
echo "version=${version}" >> $GITHUB_OUTPUT
echo "version_build=${version}_"$(git rev-parse --short "$GITHUB_SHA") >> $GITHUB_OUTPUT

# https://github.com/docker/login-action
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/docker/metadata-action
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.event_name == 'push' }}
type=raw,value=${{ needs.build-image.outputs.version }},enable=${{ github.event_name == 'release' }}
# for future:
# type=raw,value=${{ needs.build-image.outputs.version_build }},enable=${{ github.event_name == 'push' }}

# https://github.com/docker/build-push-action
- name: Push Docker image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64
file: tools/images/Dockerfile-inference
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: PLATFORM=cu124
outputs: type=image,annotation-index.org.opencontainers.image.description=Run a Graph Neural Network.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
with:
context: .
platforms: linux/amd64
file: .docker/Dockerfile
file: tools/images/Dockerfile-train
push: false
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.release-version.outputs.version_build }}
build-args: PLATFORM=cu124
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
with:
context: .
platforms: linux/amd64
file: .docker/Dockerfile
file: tools/images/Dockerfile-train
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
.venv

# Ignore data folders
open-pulse-graph-classifier/data/*
**/data/
src/open-pulse-graph-classifier/data/
!.gitkeep

# Python cache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ python open-pulse-graph-classifier/main.py
```
source .venv/bin/activate
uv pip install -r requirements.txt
python open-pulse-graph-classifier/main.py
python src/openpulse_graph_classifier/main.py
```

### RunAI
Expand Down
113 changes: 0 additions & 113 deletions open-pulse-graph-classifier/loaders.py

This file was deleted.

47 changes: 0 additions & 47 deletions open-pulse-graph-classifier/main.py

This file was deleted.

Loading
Loading