Skip to content

Commit

Permalink
A terrible idea for software versioning in prov
Browse files Browse the repository at this point in the history
Will discuss further with Govert.
  • Loading branch information
greenw0lf committed Jan 21, 2025
1 parent 5dc6720 commit 89e3949
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/tests
.venv
.flake8
.git
.github
.mypy_cache
.pytest_cache
Expand Down
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ COPY ./pyproject.toml ./pyproject.toml
RUN poetry self add poetry-plugin-export==1.8.0
RUN poetry export --format requirements.txt --output requirements.txt

# Get git commit info
RUN apt-get update && \
apt-get install -y git
COPY ./.git/ ./
RUN git rev-parse HEAD >> commit_hash
RUN rm -rf .git/ && apt-get purge -y git


FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04

# Install Python & ffmpeg
Expand All @@ -32,13 +40,10 @@ RUN mkdir /src /data /model /model/.cache
WORKDIR /src

COPY --from=req ./requirements.txt requirements.txt
COPY --from=req ./commit_hash commit_hash
RUN python -m pip install --no-cache-dir -r requirements.txt

# copy the rest into the source dir
COPY ./ /src

# # Get git commit info, then delete the .git folder
# RUN git rev-parse HEAD >> git_commit
# RUN rm -rf .git

ENTRYPOINT ["./docker-entrypoint.sh"]
10 changes: 4 additions & 6 deletions asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@

logger = logging.getLogger(__name__)

# TODO: Get commit hash and use it as version in prov
# (prev impl didn't work)
version = ""
# if os.path.exists("git_commit"):
# with open("git_commit", "r") as f:
# for line in f:
# version = line.strip()
if os.path.exists("commit_hash"):
with open("commit_hash", "r") as f:
for line in f:
version = f"git-{line[:6]}"


def run(input_uri: str, output_uri: str, model=None) -> Optional[str]:
Expand Down
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ services:
max-size: 20m
restart: no
# Uncomment below when testing the service locally
# ports:
# - "5333:5333"
#
ports:
- "5333:5333"

# Comment below to use the CPU instead of the GPU/CUDA
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
# deploy:
# resources:
# reservations:
# devices:
# - capabilities: [gpu]

0 comments on commit 89e3949

Please sign in to comment.