Skip to content

feat(ui): new manager-experience sub-command, use app-slug for data dir, respect flags as defaults #2284

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

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

emosbaugh
Copy link
Member

@emosbaugh emosbaugh commented Jun 9, 2025

What this PR does / why we need it:

  • use the app slug as the default dir only for the manager-experience install flow
  • changes --manager-experience flag to sub-command to embedded-cluster install manager-experience
  • respects flags passed in by end user as defaults in the manager-experience config form

Which issue(s) this PR fixes:

Does this PR require a test?

Does this PR require a release note?


Does this PR require documentation?

@emosbaugh emosbaugh force-pushed the emosbaugh/sc-124300/use-the-app-slug-for-the-default-data-directory branch from 883e121 to 33d8ba6 Compare June 9, 2025 23:35
Copy link

github-actions bot commented Jun 10, 2025

This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID.

Online Installer:

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/appver-dev-30e59d1" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Airgap Installer (may take a few minutes before the airgap bundle is built):

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci-airgap/appver-dev-30e59d1?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

@emosbaugh emosbaugh force-pushed the emosbaugh/sc-124300/use-the-app-slug-for-the-default-data-directory branch from 99a930e to c0a2758 Compare June 10, 2025 21:13
@emosbaugh emosbaugh requested review from sgalsaleh and JGAntunes June 11, 2025 02:52
@emosbaugh emosbaugh force-pushed the emosbaugh/sc-124300/use-the-app-slug-for-the-default-data-directory branch from 314eeb0 to 79c94b9 Compare June 11, 2025 02:57
Comment on lines +353 to +381
proxy, err := parseProxyFlags(cmd)
if err != nil {
return err
}
flags.proxy = proxy

if err := verifyProxyConfig(flags.proxy, prompts.New(), flags.assumeYes); err != nil {
return err
}
logrus.Debug("User confirmed prompt to proceed installing with `http_proxy` set and `https_proxy` unset")

if err := validateCIDRFlags(cmd); err != nil {
return err
}

// parse the various cidr flags to make sure we have exactly what we want
cidrCfg, err := getCIDRConfig(cmd)
if err != nil {
return fmt.Errorf("unable to determine pod and service CIDRs: %w", err)
}
flags.cidrCfg = cidrCfg

// if a network interface flag was not provided, attempt to discover it
if flags.networkInterface == "" {
autoInterface, err := newconfig.DetermineBestNetworkInterface()
if err == nil {
flags.networkInterface = autoInterface
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is probably all redundant in the api right now where defaults are set


if err := validateCIDRFlags(cmd); err != nil {
return err
if err := updateRuntimeConfigFromInstallCmdFlags(flags, rc); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

rather than a configChan, we should just have a runtimeConfigChan and set it directly since its all computed in the api now.

Copy link
Member

Choose a reason for hiding this comment

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

I got rid of the config chan in my branch that installs everything in the api, so there won't be a need for it

@emosbaugh emosbaugh changed the title feat(ui): use the app slug for the default data directory feat(ui): new manager-experience sub-command, use app-slug for data dir, respect flags as defaults Jun 11, 2025
@@ -34,35 +33,12 @@ func (c *InstallController) ConfigureInstallation(ctx context.Context, config *t
return fmt.Errorf("validate: %w", err)
}

if err := c.computeCIDRs(config); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

this was moved to the manager

Comment on lines -45 to -49
// TODO (@team): discuss the distinction between the runtime config and the installation config
// update the runtime config
c.rc.SetDataDir(config.DataDirectory)
c.rc.SetLocalArtifactMirrorPort(config.LocalArtifactMirrorPort)
c.rc.SetAdminConsolePort(config.AdminConsolePort)
Copy link
Member Author

Choose a reason for hiding this comment

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

this was moved to the manager

@@ -22,12 +22,11 @@ type InstallationManager interface {
SetStatus(status types.Status) error
ValidateConfig(config *types.InstallationConfig) error
SetConfigDefaults(config *types.InstallationConfig) error
ConfigureForInstall(ctx context.Context, config *types.InstallationConfig) error
ConfigureHost(ctx context.Context) error
Copy link
Member Author

Choose a reason for hiding this comment

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

this feels out of place in this manager

@@ -190,65 +171,6 @@ func TestConfigureInstallation(t *testing.T) {
}
}

// TestIntegrationComputeCIDRs tests the CIDR computation with real networking utility
func TestIntegrationComputeCIDRs(t *testing.T) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this comment is not correct. it is redundant and tested already in the utils package

@@ -30,7 +30,7 @@ var k0sConfigPathOverride string
func RenderK0sConfig(proxyRegistryDomain string) *k0sconfig.ClusterConfig {
cfg := k0sconfig.DefaultClusterConfig()
// Customize the default k0s configuration to our taste.
cfg.Name = runtimeconfig.BinaryName()
cfg.Name = "k0s"
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 checked in the cluster and it seems to be named this regardless

if manager.installationStore == nil {
manager.installationStore = NewMemoryStore(manager.installation)
manager.installationStore = NewMemoryStore(manager.rc, types.NewStatus())
Copy link
Member

Choose a reason for hiding this comment

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

The status needs to be tied to the one in the "install" type i think, can't be a new one, otherwise it wouldn't update correctly there. That's why the installation object was passed down as a reference

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you elaborate?

Copy link
Member

Choose a reason for hiding this comment

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

before this change, the manager.installation would be a pointer to the one on the install object here:

installation.WithInstallation(controller.install.Steps.Installation),

so the changes reflect in the install object. with this change, it's creating a new status and changes wouldn't reflect in the install object.

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps we need to refactor out these pointers? It is hard to understand and has side effects.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah agreed

Comment on lines +85 to 93
{
Name: "k0s",
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: runtimeconfig.K0sBinaryPath,
Type: ptr.To(corev1.HostPathFile),
},
},
},
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 have no idea why im all of a sudden seeing this error

$ kubectl  -n embedded-cluster logs copy-host-preflight-results-node3-4d8ks
/embedded-cluster/bin/kubectl: /embedded-cluster/bin/kubectl: exec: exec: line 2: line 2: /usr/local/bin/k0s: not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants