Skip to content
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

Fetch available agent images with architecture from OCI registry #13459

Closed
wants to merge 6 commits into from

Conversation

ycliuhw
Copy link
Member

@ycliuhw ycliuhw commented Nov 1, 2021

The upgrade-controller command currently fetches available agent versions for upgrading on the client-side which makes the command itself complicated and difficult to manage consistencies. Therefore, we moved the agent versions (jujud-operator image tags) fetching for CAAS to the server-side and the upgrade-controller command calls the ToolVersions facade method instead (This also causes the modelmanager facade upgraded to version 10). Fetching simple streams for IAAS is still a TODOand we should move it to the server-side as well in the future.
To construct a core.Tools for the ToolVersions facade to return, we need the architecture of the agent. So we also implemented two new registry APIs(manifests and blobs) for Arch fetching for OCI images (Because of this, we also migrated some of the registry providers from API v1 to v2 for public repositories.).

Checklist

  • Requires a pylibjuju change
  • Added integration tests for the PR
  • ~Added or updated doc.go related to packages ~changed
  • Comments answer the question of why design decisions were made

QA steps

https://discourse.charmhub.io/t/advanced-config-to-host-your-own-juju-operator-images/5079

Documentation changes

https://discourse.charmhub.io/t/advanced-config-to-host-your-own-juju-operator-images/5079

Bug reference

https://bugs.launchpad.net/juju/+bug/1944801

@ycliuhw
Copy link
Member Author

ycliuhw commented Nov 1, 2021

@ycliuhw
Copy link
Member Author

ycliuhw commented Nov 1, 2021

Copy link
Member

@wallyworld wallyworld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good start but it seems there's a few things that should be looked at?

api/modelmanager/modelmanager.go Outdated Show resolved Hide resolved
apiserver/facades/client/modelmanager/modelinfo_test.go Outdated Show resolved Hide resolved
apiserver/facades/client/modelmanager/modelinfo_test.go Outdated Show resolved Hide resolved
apiserver/facades/client/modelmanager/modelmanager.go Outdated Show resolved Hide resolved
return result, errors.Trace(err)
}
if !isModelAdmin && !m.isAdmin {
return result, apiservererrors.ErrPerm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure being an admin is essential just to be able to see what available agent binary versions there are for a model.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpuse of this facade method is for upgrade-controller, it makes sense to make them having the same permission, right? I can remove the isAdmin check here but it will finally fail the upgrade next step if we do have a version available for uprade.

apiserver/params/params.go Outdated Show resolved Hide resolved
@@ -121,7 +116,21 @@ func (c *upgradeControllerCommand) getControllerAPI() (ControllerAPI, error) {
return c.NewControllerAPIClient()
}

func (c *upgradeControllerCommand) getModelManagerAPI() (ModelManagerAPI, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already on upgradeJujuCommand - that just needs to be moved to baseUpgradeCommand instead of introducing a new implementation here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can move that from upgradeJujuCommand to baseUpgradeCommand unless we want to move the modelcmd.ModelCommandBase from upgradeJujuCommand to the upgradeJujuCommand as well.

docker/registry/internal/acr.go Show resolved Hide resolved
docker/registry/internal/base_manifests.go Show resolved Hide resolved
docker/registry/internal/package_test.go Outdated Show resolved Hide resolved
@ycliuhw ycliuhw changed the title Lp 1944801 Fetch available agent images with architecture from OCI registry Nov 2, 2021
@hpidcock hpidcock added the 2.9 label Nov 4, 2021
@ycliuhw ycliuhw added the do not merge Even if a PR has been approved, do not merge the PR! label Nov 5, 2021
@ycliuhw ycliuhw closed this Nov 11, 2021
@ycliuhw
Copy link
Member Author

ycliuhw commented Nov 11, 2021

This PR has been split into #13465 and #13498.
So close this one now,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 do not merge Even if a PR has been approved, do not merge the PR!
Projects
None yet
3 participants