-
Notifications
You must be signed in to change notification settings - Fork 5
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
core: allow oci_layers_on_top with single manifest #18
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: tarilabs <[email protected]>
Signed-off-by: tarilabs <[email protected]>
Tested also locally with: kind create cluster
./e2e/deploy_distribution_registry.sh
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml
e2e/repeat.sh kubectl apply --server-side -f https://github.com/kserve/kserve/releases/download/v0.14.0/kserve.yaml
e2e/repeat.sh kubectl apply --server-side -f https://github.com/kserve/kserve/releases/download/v0.14.0/kserve-cluster-resources.yaml
kubectl patch configmap/inferenceservice-config -n kserve --type=strategic -p '{"data": {"deploy": "{\"defaultDeploymentMode\": \"RawDeployment\"}"}}'
e2e/enable-modelcar.sh
IMAGE_DIR=download
OCI_REGISTRY_SOURCE=quay.io/mmortari/hello-world-wait:latest
OCI_REGISTRY_DESTINATION=localhost:5001/nstestorg/modelcar
# the following is done manually, but python shortcut are available
oras copy --platform linux/arm64 --to-oci-layout ${OCI_REGISTRY_SOURCE} ${IMAGE_DIR}:latest
chmod +w download/blobs/sha256/70378ac6bb0f7e7e39ce50fff837162f5fd38c4e8daf8de1a120df9a7d79d633
chmod +w download/blobs/sha256/c23ed8b7e30f5edd2417e1dd99fedad4445f3e835edb58760b2f83f2c0517878
# ...resume scenario
poetry run olot $IMAGE_DIR --modelcard tests/data/sample-model/README.md tests/data/sample-model/model.joblib
skopeo copy --tls-verify=false --multi-arch all oci:${IMAGE_DIR}:latest docker://${OCI_REGISTRY_DESTINATION}
skopeo copy --src-tls-verify=false docker://localhost:5001/nstestorg/modelcar docker-daemon:localhost:5001/nstestorg/modelcar:v1
e2e/repeat.sh kubectl apply -f e2e/isvc-modelcar.yaml
kubectl wait --for=condition=Ready isvc/my-inference-service --timeout=240s
echo "Starting port-forward..."
kubectl port-forward svc/my-inference-service-predictor 8080:80 &
PID=$!
sleep 2
echo "I have launched port-forward in background with: $PID."
echo "Check that OIP return the expected name"
curl -s http://localhost:8080/v2/models | jq -e '.models | index("my-inference-service") != null'
echo "Check that OIP produces an Inference Prediction"
curl -s -H "Content-Type: application/json" -d @e2e/data/input0.json http://localhost:8080/v2/models/my-inference-service/infer | jq
curl -s -H "Content-Type: application/json" -d @e2e/data/input1.json http://localhost:8080/v2/models/my-inference-service/infer | jq
curl -s -H "Content-Type: application/json" -d @e2e/data/input4.json http://localhost:8080/v2/models/my-inference-service/infer | jq |
Crazyglue
approved these changes
Mar 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Comment on lines
-144
to
+145
print(m) | ||
logger.debug("Parsing manifest %s", m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great cleanup!
syntaxsdev
approved these changes
Mar 5, 2025
thanks @Crazyglue @syntaxsdev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
when downloading single-arch (non-multi-arch) base image into oci-layout, using for example:
skopeo copy ----multi-arch system ...
oras copy --platform linux/arm64 --to-oci-layout ...
the base image oci-layout will not reference Index(es) but only OCI Image Manifest, the single image Manifest of the single-arch.
This modification resolves an old TODO in the code.