dapr / installer-bundle

Dapr bundled installer containing CLI and runtime packaged together. This eliminated the need to download Docker images when initializing Dapr locally.
Apache License 2.0
37 stars 8 forks source link

Ignore image owner like `daprio` and save the image with only the image name as prefix #2

Closed mukundansundar closed 2 years ago

mukundansundar commented 2 years ago

Expected Behavior

file name of the image only contains the image name followed by the version and extension.

Actual Behavior

file name of the image in the installer bundle contains the owner name(daprio) followed by image name (dapr) followed by version and extension.

Following up on the discussion in this issue, make the switch to save the image with filename that does not contain owner name as prefix.

mukundansundar commented 2 years ago

The issue with just renaming the filename is that even if the filename is dapr-1.7.0-rc.2.tar.gz docker image was saved as daprio/dapr:1.7.0-rc.2 so when the image is loaded back from the save file, it is still loaded as daprio/dapr:1.7.0-rc.2 and CLI breaks because it actually expects dapr:1.7.0-rc.2.

Two options:

  1. Option 1 installer-bundle defines a file like below. Change the version.json Existing file in installer-bundle
    {
    "daprd": "1.7.0-rc.2", 
    "dashboard": "0.10.0-rc.1",
    "cli": "1.7.0-rc.2", 
    }

    to details.json and let it have the following details:

    {
    "daprd": "1.7.0-rc.2", 
    "dashboard": "0.10.0-rc.1",
    "cli": "1.7.0-rc.2", 
    "daprBinarySubDir": "dist",
    "dockerImageSubDir": "docker",
    "daprImageName": "<repo>/dapr:1.7.0-rc.2",
    "daprImageFileName": "<repo>-dapr:1.7.0-rc.2.tar.gz"
    }

    That is the contract that CLI will use to load the given images. CLI will take the filename from daprImageFileName and image name from daprImageName. This way both can be independent. This will require changes in the CLI to use this details.json file

  2. use dapr tag to retag daprio/dapr-1.7.0-rc.2 into something like dapr/dapr:1.7.0-rc.2 and save file as dapr-dapr-1.7.0-rc.2.tar.gz

Essentially CLI assumes that the filename is same as the image name. Without more details being provided as in the contract in 1 CLI will not be able to load the image properly.

artursouza commented 2 years ago

LGTM for option 1.

shivamkm07 commented 2 years ago

@artursouza this can be closed now since PR #3 fixing this issue is merged.