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

rebasing development with main #137

Merged
merged 7 commits into from
Mar 7, 2024
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
112 changes: 57 additions & 55 deletions .ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,61 @@ services:
context: ./../src
dockerfile: Dockerfile.test
target: test
env_file: ./../src/test.env
command: bash -c "python -c 'import time';
while ! curl store:9200 | grep -q 'You Know, for Search'
&& ! curl queue:15672 | grep -q '<!DOCTYPE html>';
do python -c 'time.sleep(10)';
done;
nose2 tests"
links:
- store
- queue
depends_on:
store:
condition: service_started
queue:
condition: service_started
# env_file: ./../src/test.env
command: bash -c "python -m unittest discover -s ./tests/core/models -p "test_*.py";
python -m unittest core.operators.test_vid_vec_rep_resnet;
python -m unittest core.operators.test_audio_vec_embedding"
# bash -c "python -c 'import time';
# while ! curl store:9200 | grep -q 'You Know, for Search'
# && ! curl queue:15672 | grep -q '<!DOCTYPE html>';
# do python -c 'time.sleep(10)';
# done;
# links:
# - store
# - queue
# depends_on:
# store:
# condition: service_started
# queue:
# condition: service_started

store:
container_name: es
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.0
volumes:
- ./.docker/es/data:/var/lib/elasticsearch/data
# ports:
# - "9300:9300"
# - "9200:9200"
environment:
- xpack.security.enabled=false
- discovery.type=single-node
- http.cors.enabled=true
- http.cors.allow-origin=http://localhost:1358,http://127.0.0.1:1358
- http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
- http.cors.allow-credentials=true
- ES_JAVA_OPTS=-Xms750m -Xmx2g
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK

queue:
image: rabbitmq:3.12.12-management
container_name: rabbitmq
hostname: rabbit
volumes:
- ./.docker/rabbitmq/data:/var/lib/rabbitmq
- ./.docker/rabbitmq/logs:/var/log/rabbitmq
environment:
RABBITMQ_ERLANG_COOKIE: "secret-cookie"
RABBITMQ_DEFAULT_USER: "admin"
RABBITMQ_DEFAULT_PASS: "Admin123"
# ports:
# - "5672:5672"
# - "15672:15672"
# store:
# container_name: es
# image: docker.elastic.co/elasticsearch/elasticsearch:8.12.0
# volumes:
# - ./.docker/es/data:/var/lib/elasticsearch/data
## ports:
## - "9300:9300"
## - "9200:9200"
# environment:
# - xpack.security.enabled=false
# - discovery.type=single-node
# - http.cors.enabled=true
# - http.cors.allow-origin=http://localhost:1358,http://127.0.0.1:1358
# - http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
# - http.cors.allow-credentials=true
# - ES_JAVA_OPTS=-Xms750m -Xmx2g
# ulimits:
# memlock:
# soft: -1
# hard: -1
# nofile:
# soft: 65536
# hard: 65536
# cap_add:
# - IPC_LOCK
#
# queue:
# image: rabbitmq:3.12.12-management
# container_name: rabbitmq
# hostname: rabbit
# volumes:
# - ./.docker/rabbitmq/data:/var/lib/rabbitmq
# - ./.docker/rabbitmq/logs:/var/log/rabbitmq
# environment:
# RABBITMQ_ERLANG_COOKIE: "secret-cookie"
# RABBITMQ_DEFAULT_USER: "admin"
# RABBITMQ_DEFAULT_PASS: "Admin123"
## ports:
## - "5672:5672"
## - "15672:15672"
70 changes: 40 additions & 30 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,64 +26,74 @@ jobs:
with:
python-version: '3.11'

- name: Dry Run to get next release version
id: next_version
run: |
pip install python-semantic-release
export NEXT_TAG_VERSION=$(semantic-release --noop version --print)
echo "new_tag_version=${NEXT_TAG_VERSION}" >> $GITHUB_OUTPUT
# - name: Dry Run to get next release version
# id: next_version
# shell: bash
# run: |
# pip install python-semantic-release
# echo "new_tag_version=$(semantic-release --noop version --print)" >> $GITHUB_OUTPUT

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

# - name: Declare some variables
# id: vars
# shell: bash
# run: |
# echo "setting variables"
# echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# echo "the release status is: ${{ steps.release.outputs.released }}"
# echo "the new version is: ${{ steps.release.outputs.version }}"
# echo "the new tag version is: ${{ steps.release.outputs.tag }}"

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

- name: Publish vidvec amd64 benchmark to dockerhub
#if: steps.release.outcome == 'success'
- name: Publish vidvec amd64 worker to dockerhub
if: steps.release.outputs.released == 'true'
uses: elgohr/Publish-Docker-Github-Action@main
with:
username: tattletech
password: ${{ secrets.DOCKER_PASSWORD }}
name: tattletech/feluda-operator-vidvec
workdir: src/
dockerfile: benchmark/vidvec/Dockerfile.vid_vec_rep_resnet
tags: benchmark-amd64-${{ steps.next_version.outputs.new_tag_version }}
dockerfile: worker/vidvec/Dockerfile.video_worker
tags: worker-amd64-${{ steps.release.outputs.tag }}
platforms: linux/amd64

- name: Publish vidvec arm64 benchmark to dockerhub
#if: steps.release.outcome == 'success'
- name: Publish vidvec arm64 worker to dockerhub
if: steps.release.outputs.released == 'true'
uses: elgohr/Publish-Docker-Github-Action@main
with:
username: tattletech
password: ${{ secrets.DOCKER_PASSWORD }}
name: tattletech/feluda-operator-vidvec
workdir: src/
dockerfile: benchmark/vidvec/Dockerfile.vid_vec_rep_resnet.graviton
tags: benchmark-arm64-${{ steps.next_version.outputs.new_tag_version }}
dockerfile: worker/vidvec/Dockerfile.video_worker.graviton
tags: worker-arm64-${{ steps.release.outputs.tag }}
platforms: linux/arm64

# - name: Publish vidvec amd64 worker to dockerhub
# #if: steps.release.outcome == 'success'
# uses: elgohr/Publish-Docker-Github-Action@main
# with:
# username: tattletech
# password: ${{ secrets.DOCKER_PASSWORD }}
# name: tattletech/feluda-operator-vidvec
# workdir: src/
# dockerfile: worker/vidvec/Dockerfile.video_worker
# tags: worker-amd64-${{ steps.next_version.outputs.new_tag_version }}
# platforms: linux/amd64
- name: Publish audiovec amd64 worker to dockerhub
if: steps.release.outputs.released == 'true'
uses: elgohr/Publish-Docker-Github-Action@main
with:
username: tattletech
password: ${{ secrets.DOCKER_PASSWORD }}
name: tattletech/feluda-operator-audiovec
workdir: src/
dockerfile: worker/audiovec/Dockerfile.audio_worker
tags: worker-amd64-${{ steps.release.outputs.tag }}
platforms: linux/amd64

- name: Publish audiovec arm64 worker to dockerhub
if: steps.release.outputs.released == 'true'
uses: elgohr/Publish-Docker-Github-Action@main
with:
username: tattletech
password: ${{ secrets.DOCKER_PASSWORD }}
name: tattletech/feluda-operator-audiovec
workdir: src/
dockerfile: worker/audiovec/Dockerfile.audio_worker.graviton
tags: worker-arm64-${{ steps.release.outputs.tag }}
platforms: linux/arm64

# - name: deploy to cluster
# uses: steebchen/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Launch containers to run tests
id: vars
run: |
docker compose -f ./.ci/docker-compose.yml -p ci up -d store queue sut
docker compose -f ./.ci/docker-compose.yml -p ci up -d sut
docker logs -f ci-sut-1
echo "sut_output=$(docker wait ci-sut-1)" >> $GITHUB_OUTPUT

Expand Down
4 changes: 2 additions & 2 deletions src/core/operators/test_audio_vec_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def tearDownClass(cls):
# delete config files
pass

# @skip
@skip
def test_sample_audio_from_disk(self):
audio_file_path = AudioFactory.make_from_file_on_disk(r'core/operators/sample_data/audio.wav')
audio_emb = audio_vec_embedding.run(audio_file_path)
Expand All @@ -26,4 +26,4 @@ def test_sample_audio_from_url(self):
"https://raw.githubusercontent.com/tattle-made/feluda/main/src/core/operators/sample_data/audio.wav"
)
audio_emb = audio_vec_embedding.run(audio_path)
self.assertEqual(2048, len(audio_emb))
self.assertEqual(2048, len(audio_emb))