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

merge dev to main #460

Merged
merged 17 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e174d62
feat: test for queue (#400)
plon-Susk7 Oct 10, 2024
3805859
feat: add support for video in operator to detect language (#408)
plon-Susk7 Oct 16, 2024
c2b6cbe
feat: added support to the tesseract operator for tamil and telugu (#…
plon-Susk7 Oct 17, 2024
fe4c2a6
feat: example notebook for storing and searching similar videos (#412)
plon-Susk7 Oct 22, 2024
53544ce
feat: example notebook for storing and searching similar audios (#417)
plon-Susk7 Oct 23, 2024
98b9336
feat: example notebook for visualising videos using t-SNE (#418)
plon-Susk7 Oct 24, 2024
7fd9c40
feat: example notebook for clustering videos (#419)
plon-Susk7 Oct 25, 2024
2638d51
feat: example notebook for clustering using given labels (#420)
plon-Susk7 Oct 26, 2024
8c6495f
feat: example notebook for storing images and searching via text (#424)
plon-Susk7 Oct 26, 2024
57b8560
chore: moving image vec operator out of src (#433)
aatmanvaidya Nov 9, 2024
91a87fd
feat: initialise uv setup and package a operator (#434)
plon-Susk7 Nov 12, 2024
d173380
feat: refactor feluda api (#438)
aatmanvaidya Nov 18, 2024
2c8c74c
feat: script to update dependencies in toml files (#439)
plon-Susk7 Nov 18, 2024
f6811bc
Merge pull request #442 from tattle-made/uv-evaluation
aatmanvaidya Nov 18, 2024
ceecad0
feat: test for text_vec_rep_paraphrase_lxml operator (#446)
adoo100 Dec 5, 2024
b33161e
feat: multi-package semantic versioning for monorepo (#458)
plon-Susk7 Dec 20, 2024
adbfa9e
refactor: minor change to overall code (#459)
aatmanvaidya Dec 23, 2024
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
68 changes: 0 additions & 68 deletions .ci/docker-compose.yml

This file was deleted.

286 changes: 148 additions & 138 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,159 +7,169 @@ on:
pull_request:
types:
- closed
# - opened
# - reopened
# - synchronize
branches:
- main

jobs:
release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
concurrency: release
permissions:
contents: write
# Map a step output to a job output
outputs:
released: ${{ steps.release.outputs.released }}
tag: ${{ steps.release.outputs.tag }}

if: github.event.pull_request.merged == true # Ensure the PR was merged
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Python version
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: "3.11"

- name: Install dependencies for Semantic Versioning
run: |
python -m pip install --upgrade pip
pip install tomli tomli-w

- name: Get Base and Latest Commits of the Merged PR
id: commit-range
run: |
# Get the base commit of the PR (the commit where it diverged from the main branch)
BASE_COMMIT=$(git merge-base HEAD^ origin/main)

# Get the commits introduced by this PR
COMMITS=$(git rev-list --reverse $BASE_COMMIT..HEAD)

# Extract the first and last commits
FIRST_COMMIT=$(echo "$COMMITS" | head -n 1)
LATEST_COMMIT=$(echo "$COMMITS" | tail -n 1)

# Set outputs for later steps
echo "base_commit=$BASE_COMMIT" >> $GITHUB_OUTPUT
echo "first_commit=$FIRST_COMMIT" >> $GITHUB_OUTPUT
echo "latest_commit=$LATEST_COMMIT" >> $GITHUB_OUTPUT

# Log for debugging
echo "Base Commit: $BASE_COMMIT"
echo "First Commit in PR: $FIRST_COMMIT"
echo "Latest Commit in PR: $LATEST_COMMIT"

- name: Get Latest Feluda Tag
id: latest-tag
run: |
LATEST_TAG=$(git tag -l "feluda-[0-9]*" | sort -V | tail -n1)
echo "current_tag=$LATEST_TAG" >> $GITHUB_OUTPUT
echo "current feluda tag: $LATEST_TAG"

- name: Run Dynamic Semantic Release Script
env:
FIRST_COMMIT: ${{ steps.commit-range.outputs.first_commit }}
LATEST_COMMIT: ${{ steps.commit-range.outputs.latest_commit }}
run: |
pwd
# run the script
python -m scripts.semantic_release_workflow "$FIRST_COMMIT" "$LATEST_COMMIT"

- name: Commit and Push Changes
id: push-changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions [Bot]"

if [[ -n $(git status -s) ]]; then
git add .
git commit -m "chore: semantic versioning workflow and update related files"
git push
git push --tags

# Check if new feluda tag was created
NEW_TAG=$(git tag -l "feluda-[0-9]*" | sort -V | tail -n1)
if [ "$NEW_TAG" != "${{ steps.latest-tag.outputs.current_tag }}" ]; then
echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT
echo "tag_created=true" >> $GITHUB_OUTPUT
else
echo "tag_created=false" >> $GITHUB_OUTPUT
fi
else
echo "tag_created=false" >> $GITHUB_OUTPUT
fi

- name: Create GitHub Release
if: steps.push-changes.outputs.tag_created == 'true'
run: |
gh release create "${{ steps.push-changes.outputs.new_tag }}" \
--repo="${GITHUB_REPOSITORY}" \
--title="Release ${{ steps.push-changes.outputs.new_tag }}" \
--generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# rough logic for generating custom changelog's
# - name: Generate Release Notes and Update Changelog
# if: steps.push-changes.outputs.tag_created == 'true'
# id: release-notes
# run: |
# # Get the previous feluda tag
# PREV_TAG=$(git tag -l "feluda-[0-9]*" | sort -V | grep -B1 "${{ steps.push-changes.outputs.new_tag }}" | head -n1)
# echo "Prev feluda tag: $PREV_TAG"
# echo "New feluda tag: ${{ steps.push-changes.outputs.new_tag }}"

# # Create release notes file with header
# echo "# Release ${{ steps.push-changes.outputs.new_tag }}" > release_notes.md
# echo "" >> release_notes.md

# # Function to add section if commits exist
# add_section() {
# local title="$1"
# local pattern="$2"
# local commits=$(git log "${PREV_TAG}^..${{ steps.push-changes.outputs.new_tag }}" --pretty=format:"* %s (%h)" | grep "^* $pattern" || true)
# if [ ! -z "$commits" ]; then
# echo "## $title" >> release_notes.md
# echo "$commits" >> release_notes.md
# echo "" >> release_notes.md
# fi
# }

# # Add sections only if they have commits
# add_section "Features" "feat"
# add_section "Bug Fixes" "fix"
# add_section "Chores" "chore"
# add_section "Documentation" "docs"

# # Add miscellaneous section for other commits
# misc_commits=$(git log "${PREV_TAG}^..${{ steps.push-changes.outputs.new_tag }}" --pretty=format:"* %s (%h)" |
# grep -v "^* feat" |
# grep -v "^* fix" |
# grep -v "^* chore" |
# grep -v "^* docs" || true)

# if [ ! -z "$misc_commits" ]; then
# echo "## Miscellaneous" >> release_notes.md
# echo "$misc_commits" >> release_notes.md
# echo "" >> release_notes.md
# fi

# # Update CHANGELOG.md
# if [ -f CHANGELOG.md ]; then
# cat release_notes.md > temp_changelog
# echo "" >> temp_changelog
# cat CHANGELOG.md >> temp_changelog
# mv temp_changelog CHANGELOG.md
# else
# cat release_notes.md > CHANGELOG.md
# fi

# # Commit the updated CHANGELOG
# git add CHANGELOG.md
# git commit -m "docs: update CHANGELOG.md for ${{ steps.push-changes.outputs.new_tag }}"
# git push



- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@c82bd673c30da94a02e039963c8c4c8a51758096 # v9.1.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

docker:
needs: release
if: needs.release.outputs.released == 'true'
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0

- name: Login to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v.3.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Publish vidvec amd64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/vidvec/Dockerfile.video_worker
platforms: linux/amd64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-vidvec:worker-amd64-${{ needs.release.outputs.tag }}

- name: Publish vidvec arm64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/vidvec/Dockerfile.video_worker_graviton
platforms: linux/arm64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-vidvec:worker-arm64-${{ needs.release.outputs.tag }}

- name: Publish audiovec amd64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/audiovec/Dockerfile.audio_worker
platforms: linux/amd64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-audiovec:worker-amd64-${{ needs.release.outputs.tag }}

- name: Publish audiovec arm64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/audiovec/Dockerfile.audio_worker_graviton
platforms: linux/arm64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-audiovec:worker-arm64-${{ needs.release.outputs.tag }}

- name: Publish media hash amd64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/hash/Dockerfile.hash_worker
platforms: linux/amd64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-hash:worker-amd64-${{ needs.release.outputs.tag }}

- name: Publish media hash arm64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/hash/Dockerfile.hash_worker_graviton
platforms: linux/arm64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-hash:worker-arm64-${{ needs.release.outputs.tag }}

- name: Publish media worker amd64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/media/Dockerfile.media_worker
platforms: linux/amd64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-media:worker-amd64-${{ needs.release.outputs.tag }}

- name: Publish media worker arm64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/media/Dockerfile.media_worker_graviton
platforms: linux/arm64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-media:worker-arm64-${{ needs.release.outputs.tag }}

# - name: deploy to cluster
# uses: steebchen/[email protected]
# with: # defaults to latest kubectl binary version
# config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
# command: set image --record deployment/feluda-server feluda-server=tattletech/feluda-server:${{ steps.vars.outputs.sha_short }}
# - name: verify deployment
# uses: steebchen/[email protected]
# with:
# config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
# version: v1.21.0 # specify kubectl binary version explicitly
# command: rollout status deployment/feluda-server
Loading
Loading