Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Ensure CLI references compatible images #3371

Closed
Tracked by #3019
nojnhuh opened this issue May 18, 2021 · 2 comments
Closed
Tracked by #3019

Ensure CLI references compatible images #3371

nojnhuh opened this issue May 18, 2021 · 2 comments
Assignees
Labels
area/cli Related to OSM CLI area/upgrade Upgrade related build and release Build and release related
Milestone

Comments

@nojnhuh
Copy link
Contributor

nojnhuh commented May 18, 2021

Problem

Currently, the main branch references the latest tagged version for the default images used by the OSM chart (and therefore osm install):

tag: v0.8.3

This causes version skew when the main branch is updated but the default image tag stays the same. This becomes an issue when following documentation corresponding to the main branch which refers to new features since the last release and instructions use osm install without overriding the images to images newer than the latest release that implement those features.

Goal

The goal is to come up with a solution such that make build-osm && bin/osm install "just works" in all cases.

To do this, make build-osm would have to become dependent on building and pushing the images used by the control plane, then the CLI would refer to those images by default. The image tag must be unique to maintain a 1:1 mapping of CLI to images.

Solution

Here's one possible implementation I can think of:

  1. list docker-push-{init,init-osm-controller,osm-controller,osm-injector} as dependencies of build-osm in the Makefile:

    osm/Makefile

    Line 108 in b14458f

    build-osm: check-go-version

    • Ensure the CTR_TAG is set to some deterministic value. The current Git SHA might be close enough, though ideally it would differentiate between dirty and clean worktrees. CTR_REGISTRY can be set to
  2. create new package-scoped variables (likely in cmd/cli/install.go) for the tag and registry location of the built images and pass the values to them in the Makefile using the same method as we do for version info:

    osm/Makefile

    Line 21 in 3fde0f1

    LDFLAGS ?= "-X $(BUILD_DATE_VAR)=$(BUILD_DATE) -X $(BUILD_VERSION_VAR)=$(VERSION) -X $(BUILD_GITCOMMIT_VAR)=$(GIT_SHA) -X main.chartTGZSource=$$(cat -) -s -w"

  3. In the install command, if OpenServiceMesh.image.registry or OpenServiceMesh.image.tag are not overridden via --set, override them with the values of the package-scoped variables defined above. This could be done in this function:

    func (i *installCmd) resolveValues() (map[string]interface{}, error) {

    This would still allow users to override the images the standard way per-osm install invocation.

Other things I haven't fully thought through yet

  • Installing with helm instead of osm
  • images stored in password-protected registries
  • Upgrades
  • Release builds and maintenance

/cc @shashankram

@nojnhuh nojnhuh added this to the v0.10.0 milestone May 19, 2021
@nojnhuh nojnhuh self-assigned this May 19, 2021
@nojnhuh nojnhuh added build and release Build and release related area/cli Related to OSM CLI labels May 19, 2021
@nojnhuh
Copy link
Contributor Author

nojnhuh commented May 19, 2021

I opened a draft PR implementing this idea that should be ready to try out: #3380

@draychev draychev added the area/upgrade Upgrade related label Jun 22, 2021
@draychev draychev mentioned this issue Jun 30, 2021
17 tasks
@draychev draychev modified the milestones: v0.10.0, vNext Aug 19, 2021
@shashankram
Copy link
Member

Discussed offline with @nojnhuh and there isn't an immediate need for this as the default image tags in main refer to latest-main.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli Related to OSM CLI area/upgrade Upgrade related build and release Build and release related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants