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

[BUG] flytectl upgrade is broken after moving to the monorepo #5372

Closed
2 tasks done
eapolinario opened this issue May 15, 2024 · 5 comments · Fixed by #5470
Closed
2 tasks done

[BUG] flytectl upgrade is broken after moving to the monorepo #5372

eapolinario opened this issue May 15, 2024 · 5 comments · Fixed by #5470
Assignees
Labels
bug Something isn't working flytectl Issues related to flytectl -Flytes CLI good first issue Good for newcomers help wanted Extra attention is needed monorepo

Comments

@eapolinario
Copy link
Contributor

Describe the bug

The command itself is broken and also unit tests are failing with:

--- FAIL: TestUpgrade (0.29s)
    --- FAIL: TestUpgrade/Successful_upgrade (0.29s)
        upgrade_test.go:53: 
            	Error Trace:	/home/runner/work/flyte/flyte/flytectl/cmd/upgrade/upgrade_test.go:53
            	Error:      	Expected nil, but got: &errors.errorString{s:"unexpected EOF"}
            	Test:       	TestUpgrade/Successful_upgrade
        upgrade_test.go:54: 
            	Error Trace:	/home/runner/work/flyte/flyte/flytectl/cmd/upgrade/upgrade_test.go:54
            	Error:      	"" does not contain "Successfully updated to version"
            	Test:       	TestUpgrade/Successful_upgrade
Flytectl rollback is not available on windows 

 A new release of flytectl is available: v0.2.20 → v1.12.0 
https://github.com/flyteorg/flyte/releases/tag/v1.12.0 

time="2024-05-15T19:23:52Z" level=info msg="Initialized Mock Clientset"
--- FAIL: TestSelfUpgrade (0.02s)
    --- FAIL: TestSelfUpgrade/Successful_upgrade (0.02s)
        upgrade_test.go:116: 
            	Error Trace:	/home/runner/work/flyte/flyte/flytectl/cmd/upgrade/upgrade_test.go:116
            	Error:      	Expected nil, but got: &errors.errorString{s:"unexpected EOF"}
            	Test:       	TestSelfUpgrade/Successful_upgrade
time="2024-05-15T19:23:52Z" level=info msg="Initialized Mock Clientset"
time="2024-05-15T19:23:52Z" level=info msg="Initialized Mock Clientset"
time="2024-05-15T19:23:52Z" level=info msg="Initialized Mock Clientset"
time="2024-05-15T19:23:52Z" level=info msg="Initialized Mock Clientset"
time="2024-05-15T19:23:52Z" level=info msg="Initialized Mock Clientset"
--- FAIL: TestSelfUpgradeRollback (0.00s)
    --- FAIL: TestSelfUpgradeRollback/Successful_rollback (0.00s)
        upgrade_test.go:145: 
            	Error Trace:	/home/runner/work/flyte/flyte/flytectl/cmd/upgrade/upgrade_test.go:145
            	Error:      	Expected nil, but got: &errors.errorString{s:"flytectl backup doesn't exist. Rollback is not possible"}
            	Test:       	TestSelfUpgradeRollback/Successful_rollback
FAIL	github.com/flyteorg/flyte/flytectl/cmd/upgrade	0.387s

Expected behavior

The upgrade command should either work or be removed. I can see an argument for removing it, since we have other means of upgrading (e.g. on the mac we can use brew upgrade flytectl).

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@eapolinario eapolinario added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels May 15, 2024
Copy link

runllm bot commented May 15, 2024

The issue with the flytectl upgrade command breaking after the monorepo migration is known. The error traces indicate issues with unexpected EOF and missing backups for rollback. This is likely due to changes in the repository structure and dependencies.

Would you like more details on potential fixes or workarounds?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @RunLLM to ask follow-up questions. See runllm.com for more!

@eapolinario eapolinario added good first issue Good for newcomers help wanted Extra attention is needed flytectl Issues related to flytectl -Flytes CLI monorepo and removed untriaged This issues has not yet been looked at by the Maintainers labels May 16, 2024
@eapolinario
Copy link
Contributor Author

The work here has to do with how to list flytectl releases from the monorepo and use that list of releases as opposed to all releases.

More specifically, we use https://github.com/mouuff/go-rocket-update to provide this self-upgrade functionality, the issue is that when we check the releases this library ends up calling a github API that doesn't return the flytectl releases (which use git tags of the form flytectl/vX.Y.Z).

Resolving this issue will require some investigation. Here are some ideas:

  1. implement a new provider that understands flytectl releases (similar to how we do in
    releases, _, err := g.ListReleases(context.Background(), owner, repoName, &github.ListOptions{
    )
  2. use the zip provider (given that we download the new release separately).

@novahow
Copy link
Contributor

novahow commented May 28, 2024

#take

@novahow
Copy link
Contributor

novahow commented Jun 6, 2024

@eapolinario Hi, I investigated the issue and implemented a new provider. I'm curious about how flytectl upgrade used to work before moving to monorepo? because according to

if isGreater, err := util.IsVersionGreaterThan(latest, stdlibversion.Version); err != nil {

latest infers smth like "v0.8.20", and stdlibversion.Version is the version tag of flyte, which may be "v1.12.0" . How did this comparison work before the monorepo migration?

@eapolinario
Copy link
Contributor Author

latest infers smth like "v0.8.20", and stdlibversion.Version is the version tag of flyte, which may be "v1.12.0" . How did this comparison work before the monorepo migration?

before the monorepo migration, stdlibVersion was the current version of flytectl as defined here. Notice that the before the move to the monorepo this referred to git tags of the flytectl repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytectl Issues related to flytectl -Flytes CLI good first issue Good for newcomers help wanted Extra attention is needed monorepo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants