Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
Signed-off-by: tarilabs <[email protected]>
  • Loading branch information
tarilabs committed Dec 17, 2024
1 parent 73d8988 commit cd1a9ac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# oci layers on top

1. use simple tool like `skopeo` ( or `oras cp`, or ...) and produce an [oci image layout](https://github.com/opencontainers/image-spec/blob/main/image-layout.md) of the _base image_ for the [Modelcar](https://kserve.github.io/website/latest/modelserving/storage/oci/#prepare-an-oci-image-with-model-data) (ie base image could be: A. `ubi-micro`, B. `busybox`, or C. even [simple base image for KServe Modelcar](https://github.com/tarilabs/demo20241108-base?tab=readme-ov-file#a-minimal-base-image-for-kserve-modelcarsidecar-puposes-that-does-nothing), etc.)
2. (this project) use pure python way to add layers of the ML models, and any metadata like ModelCarD
3. use simple tool from step 1 to push the resulting layout to the remote registry (i.e. `simpletool cp ... quay.io/mmortari/model:car`)
4. ... you now have a Modelcar inside of your OCI registry that can be used with KServe and more!

## Dev Notes

Expand Down
18 changes: 15 additions & 3 deletions tests/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
from pathlib import Path
import tarfile


from olot.basics import HashingWriter, get_file_hash

def test_single_file_tar(tmp_path):

def test_get_file_hash():
"""As get_file_hash() function is used in other test, making sure it is generating the expected digest for known data
"""
hello_path = Path(__file__).parent / "data" / "hello.md"
checksum_from_disk = get_file_hash(hello_path)
assert checksum_from_disk == "d91aa8aa7b56706b89e4a9aa27d57f45785082ba40e8a67e58ede1ed5709afd8"


def test_bespoke_single_file_tar(tmp_path):
"""Example bespoke use of HashingWriter for .tar
"""
hello_path = Path(__file__).parent / "data" / "hello.md"
sha256_path = tmp_path / "blobs" / "sha256"
sha256_path.mkdir(parents=True, exist_ok=True)
Expand All @@ -33,7 +43,9 @@ def test_single_file_tar(tmp_path):
print(file)


def test_single_file_gz(tmp_path):
def test_bespoke_single_file_gz(tmp_path):
"""Example bespoke use of HashingWriter for .tar.gz
"""
hello_path = Path(__file__).parent / "data" / "hello.md"
sha256_path = tmp_path / "blobs" / "sha256"
sha256_path.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit cd1a9ac

Please sign in to comment.