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

Jinja docker template #426

Merged
merged 4 commits into from
Oct 15, 2024
Merged

Jinja docker template #426

merged 4 commits into from
Oct 15, 2024

Conversation

michaelfeil
Copy link
Owner

@michaelfeil michaelfeil commented Oct 15, 2024

This pull request includes significant updates to the Dockerfile setup and workflow configurations to enhance the build process for different platforms. The changes focus on adding support for NVIDIA, CPU, and AMD builds, improving the Dockerfile generation process, and refining the workflow for Docker container releases.

Dockerfile and Workflow Enhancements:

  • Workflow Configuration Updates:

  • Dockerfile Generation and Template Improvements:

    • libs/infinity_emb/Dockerfile.jinja2: Created a Jinja2 template for generating Dockerfiles for different platforms (NVIDIA, CPU, AMD), ensuring consistency and reducing manual edits.
    • libs/infinity_emb/docker.template.yaml: Added configuration for generating Dockerfiles using the Jinja2 template, specifying base images and installation commands for each platform.
    • libs/infinity_emb/Dockerfile, libs/infinity_emb/Dockerfile.amd_auto, libs/infinity_emb/Dockerfile.cpu_auto: Updated Dockerfiles to include autogenerated warnings and platform-specific configurations. [1] [2] [3]
  • Makefile Enhancements:

    • libs/infinity_emb/Makefile: Added a template_docker target to automate the generation of Dockerfiles using the Jinja2 template and the configuration file. [1] [2]

These changes streamline the Docker build process, making it easier to manage and deploy containers across different platforms.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR introduces a Jinja2-based templating system for generating Dockerfiles, improving flexibility and maintainability across different environments (CUDA, CPU, AMD).

  • Added Dockerfile.jinja2 template and docker.template.yaml configuration file for customizable Docker builds
  • Created Dockerfile.amd_auto and Dockerfile.cpu_auto for AMD and CPU-specific builds
  • Updated pyproject.toml with new dependencies and Poetry sources for different PyTorch configurations
  • Modified Makefile to include a new 'template_docker' target for generating Dockerfiles
  • Changed import condition in infinity_emb/transformer/audio/torch.py to require both torch and transformers

9 file(s) reviewed, 24 comment(s)
Edit PR Review Bot Settings | Greptile

libs/infinity_emb/Dockerfile Outdated Show resolved Hide resolved
libs/infinity_emb/Dockerfile Outdated Show resolved Hide resolved
# do not ask any interactive question
POETRY_NO_INTERACTION=1 \
EXTRAS="all" \
PYTHON="python3.11"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: PYTHON variable set to python3.11, but base image uses python3.10. This mismatch may cause issues.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, but amd is currently not working

libs/infinity_emb/Dockerfile.amd_auto Show resolved Hide resolved
libs/infinity_emb/Dockerfile.amd_auto Show resolved Hide resolved
libs/infinity_emb/Makefile Show resolved Hide resolved
libs/infinity_emb/docker.template.yaml Show resolved Hide resolved
libs/infinity_emb/docker.template.yaml Show resolved Hide resolved
libs/infinity_emb/docker.template.yaml Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 15, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.15%. Comparing base (46ff710) to head (b866753).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #426   +/-   ##
=======================================
  Coverage   79.15%   79.15%           
=======================================
  Files          41       41           
  Lines        3229     3229           
=======================================
  Hits         2556     2556           
  Misses        673      673           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

michaelfeil

This comment was marked as off-topic.

@michaelfeil michaelfeil merged commit 8c50da2 into main Oct 15, 2024
36 checks passed
@michaelfeil michaelfeil deleted the jinja-docker-template branch October 15, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants