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

docs: Add docs for installing GitHub packages for Bento #4720

Merged
merged 2 commits into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/source/guides/build-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,29 @@ BentoML will lock the package to the version available in the current environmen
You don't need to specify ``bentoml`` as a dependency in this field since the current version of BentoML will be added to the list by default. However,
you can override this by specifying a different BentoML version.

To include a package from a GitHub repository, use the `pip requirements file format <https://pip.pypa.io/en/stable/reference/requirements-file-format/>`_. You can specify the repository URL, the branch, tag, or commit to install from, and the subdirectory if the Python package is not in the root of the repository.

.. code-block:: yaml

python:
packages:
# Install from a specific branch
- "git+https://github.com/username/repository.git@branch_name"
# Install from a specific tag
- "git+https://github.com/username/repository.git@v1.0.0"
# Install from a specific commit
- "git+https://github.com/username/repository.git@abcdef1234567890abcdef1234567890abcdef12"
# Install from a subdirectory
- "git+https://github.com/username/repository.git@branch_name#subdirectory=package_dir"

If your project depends on a private GitHub repository, you can include the Python package from the repository via SSH. Make sure that the environment where BentoML is running has the appropriate SSH keys configured and that `these keys are added to GitHub <https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account>`_. In the following example, ``git@github.com:username/repository.git`` is the SSH URL for the repository.

.. code-block:: yaml

python:
packages:
- "git+ssh://git@github.com/username/repository.git@branch_name"

If you already have a `requirements.txt <https://pip.pypa.io/en/stable/reference/requirements-file-format/>`_
file that defines Python packages for your project, you may also supply a path to the ``requirements.txt`` file directly:

Expand Down