Skip to content

Commit 913e0fc

Browse files
committed
mcv: address binary cache review comments
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
1 parent 5d5d4eb commit 913e0fc

File tree

3 files changed

+14
-48
lines changed

3 files changed

+14
-48
lines changed

mcv/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ skopeo inspect containers-storage:quay.io/gkm/vector-add-cache:rocm | jq -r '.La
274274
To Create an OCI image for a vLLM Cache run the following:
275275

276276
```bash
277-
mcv -c -i quay.io/mtahhan/vllm-flash-attention:rocm -d example/vllm-cache
277+
mcv -c -i quay.io/gkm/cache-examples:vllm-example -d example/vllm-cache
278278
INFO[2025-09-03 09:04:15] Hardware accelerator(s) detected (2). GPU support enabled.
279279
INFO[2025-09-03 09:04:15] Using buildah to build the image
280280
INFO[2025-09-03 09:04:23] Detected cache components: [vllm]
@@ -285,12 +285,12 @@ INFO[2025-09-03 09:04:24] OCI image created successfully.
285285
To inspect the image labels specifically run:
286286

287287
```bash
288-
skopeo inspect containers-storage:quay.io/mtahhan/vllm-flash-attention:rocm
288+
skopeo inspect containers-storage:quay.io/gkm/cache-examples:vllm-example
289289
{
290-
"Name": "quay.io/mtahhan/vllm-flash-attention",
291-
"Digest": "sha256:ed4dad604449aec384cf71ca310b55b71369357596bfa2d38b16697dc314d848",
290+
"Name": "quay.io/gkm/cache-examples",
291+
"Digest": "sha256:9e731d58adccd608cb18dcefe259acd30ffe976d5e98208a4158ce22c0b5d1e2",
292292
"RepoTags": [],
293-
"Created": "2025-09-03T09:04:23.891933044Z",
293+
"Created": "2026-02-10T12:04:38.260317569Z",
294294
"DockerVersion": "",
295295
"Labels": {
296296
"cache.vllm.image/cache-size-bytes": "2269180",
@@ -300,13 +300,13 @@ skopeo inspect containers-storage:quay.io/mtahhan/vllm-flash-attention:rocm
300300
"Architecture": "amd64",
301301
"Os": "linux",
302302
"Layers": [
303-
"sha256:088097095e6040fe597c64330f2f2e0f256b31b2243417a8c2a6a38408e2c1da"
303+
"sha256:440b5cbd3b76dc17a6012e17fc56341d4894b88ab7a85b12c5e2f6f7c4b80661"
304304
],
305305
"LayersData": [
306306
{
307-
"MIMEType": "application/vnd.oci.image.layer.v1.tar",
308-
"Digest": "sha256:088097095e6040fe597c64330f2f2e0f256b31b2243417a8c2a6a38408e2c1da",
309-
"Size": 2357760,
307+
"MIMEType": "application/vnd.oci.image.layer.v1.tar+gzip",
308+
"Digest": "sha256:440b5cbd3b76dc17a6012e17fc56341d4894b88ab7a85b12c5e2f6f7c4b80661",
309+
"Size": 250291,
310310
"Annotations": null
311311
}
312312
],
@@ -317,7 +317,7 @@ skopeo inspect containers-storage:quay.io/mtahhan/vllm-flash-attention:rocm
317317
To extract the vLLM Cache run the following:
318318

319319
```bash
320-
mcv -e -i quay.io/mtahhan/vllm-flash-attention:rocm
320+
mcv -e -i quay.io/gkm/cache-examples:vllm-example
321321
INFO[2025-09-03 09:06:00] Hardware accelerator(s) detected (2). GPU support enabled.
322322
INFO[2025-09-03 09:06:02] Preflight GPU compatibility check passed.
323323
INFO[2025-09-03 09:06:02] Preflight completed matched="[0 1]" unmatched="[]"
@@ -375,7 +375,7 @@ Upon successful completion, you will see an output similar to:
375375
```bash
376376
Successfully verified SCT...
377377
tlog entry created with index: 215011903
378-
Pushing signature to: quay.io/mtahhan/01-vector-add-cache
378+
Pushing signature to: quay.io/gkm/cache-examples
379379
```
380380
381381
## MCV Client API
@@ -398,7 +398,7 @@ import (
398398
399399
func main() {
400400
err := client.ExtractCache(client.Options{
401-
ImageName: "quay.io/mtahhan/01-vector-add-cache:latest",
401+
ImageName: "quay.io/gkm/cache-examples:vector-add-cache-cuda",
402402
CacheDir: "/tmp/testcache",
403403
LogLevel: "debug",
404404
EnableBaremetal: nil, // or false if explicitly desired
@@ -456,7 +456,7 @@ import (
456456

457457
func main() {
458458
matched, unmatched, err := client.PreflightCheck(
459-
"quay.io/mtahhan/01-vector-add-cache:latest")
459+
"quay.io/gkm/cache-examples:vector-add-cache-cuda")
460460
if err != nil {
461461
log.Fatalf("Preflight check failed: %v", err)
462462
}

mcv/pkg/utils/utils.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"os"
88
"os/exec"
9-
"path/filepath"
109
"strings"
1110

1211
"github.com/redhat-et/MCU/mcv/pkg/constants"
@@ -64,27 +63,6 @@ func SanitizeGroupJSON(filePath string) error {
6463
return writeFormattedJSON(filePath, parsed)
6564
}
6665

67-
// RestoreFullPathsInGroupJSON prepends the full TritonCacheDir path to child_paths in __grp__*.json files.
68-
func RestoreFullPathsInGroupJSON(filePath, basePath string) error {
69-
data, err := os.ReadFile(filePath)
70-
if err != nil {
71-
return fmt.Errorf("failed to read %s: %w", filePath, err)
72-
}
73-
74-
var parsed map[string]map[string]string
75-
if err := json.Unmarshal(data, &parsed); err != nil {
76-
return fmt.Errorf("failed to parse JSON in %s: %w", filePath, err)
77-
}
78-
79-
for key, val := range parsed["child_paths"] {
80-
if strings.HasPrefix(val, ".triton/cache") {
81-
parsed["child_paths"][key] = filepath.Join(basePath, strings.TrimPrefix(val, ".triton/cache/"))
82-
}
83-
}
84-
85-
return writeFormattedJSON(filePath, parsed)
86-
}
87-
8866
// writeFormattedJSON writes the given data as pretty-formatted JSON to a file.
8967
func writeFormattedJSON(filePath string, data interface{}) error {
9068
formatted, err := json.MarshalIndent(data, "", " ")

mcv/pkg/utils/utils_test.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestHasApp(t *testing.T) {
2929
assert.False(t, HasApp("fake_app_that_does_not_exist"))
3030
}
3131

32-
func TestSanitizeGroupJSONAndRestore(t *testing.T) {
32+
func TestSanitizeGroupJSON(t *testing.T) {
3333
testDir := t.TempDir()
3434
testFile := filepath.Join(testDir, "test.json")
3535

@@ -57,18 +57,6 @@ func TestSanitizeGroupJSONAndRestore(t *testing.T) {
5757
assert.NoError(t, err)
5858
assert.NoError(t, json.Unmarshal(content, &sanitized))
5959
assert.Equal(t, expectedSanitized, sanitized["child_paths"])
60-
61-
// Now restore with fake base path
62-
basePath := "/mnt/fake"
63-
err = RestoreFullPathsInGroupJSON(testFile, basePath)
64-
assert.NoError(t, err)
65-
66-
restored := map[string]map[string]string{}
67-
content, err = os.ReadFile(testFile)
68-
assert.NoError(t, err)
69-
assert.NoError(t, json.Unmarshal(content, &restored))
70-
assert.Equal(t, filepath.Join(basePath, "a"), restored["child_paths"]["one"])
71-
assert.Equal(t, filepath.Join(basePath, "b"), restored["child_paths"]["two"])
7260
}
7361

7462
func TestCleanupMCVDirs(t *testing.T) {

0 commit comments

Comments
 (0)