Skip to content

Fix cortex get pretty output for async apis #2427

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

Merged
merged 1 commit into from
Feb 1, 2022

Conversation

jackmpcollins
Copy link
Contributor

This should fix the following error seen when running cortex get for a cluster with more async APIs than realtime.

panic: runtime error: index out of range [1] with length 1 [recovered]
    panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/cortexlabs/cortex/pkg/lib/exit.Panic({0x3adf9a0, 0xc0006a6230}, {0x0, 0x0, 0x0})
    /home/circleci/project/pkg/lib/exit/exit.go:60 +0x108
github.com/cortexlabs/cortex/pkg/lib/exit.RecoverAndExit({0x0, 0x0, 0x0})
    /home/circleci/project/pkg/lib/exit/exit.go:66 +0x55
panic({0x33c3a80, 0xc00059c408})
    /usr/local/go/src/runtime/panic.go:1038 +0x215
github.com/cortexlabs/cortex/cli/cmd.asyncAPIsTable({0xc0005b4800, 0x7, 0x3}, {0xc000341410, 0x1, 0xc00053f980})
    /home/circleci/project/cli/cmd/lib_async_apis.go:93 +0x54e
github.com/cortexlabs/cortex/cli/cmd.getAPIsByEnv({{0xc0002bd8b0, 0xd}, {0xc00053f080, 0xc0005391d0}})
    /home/circleci/project/cli/cmd/get.go:433 +0x86b
github.com/cortexlabs/cortex/cli/cmd.glob..func16.1()
    /home/circleci/project/cli/cmd/get.go:163 +0x426
github.com/cortexlabs/cortex/cli/cmd.rerun(0x2b, 0x7)
    /home/circleci/project/cli/cmd/lib_watch.go:106 +0x62
github.com/cortexlabs/cortex/cli/cmd.glob..func16(0x51ae4e0, {0xc0002d0260, 0x0, 0x2})
    /home/circleci/project/cli/cmd/get.go:92 +0x34c
github.com/spf13/cobra.(*Command).execute(0x51ae4e0, {0xc0002d0240, 0x2, 0x2})
    /home/circleci/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0x51af160)
    /home/circleci/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
    /home/circleci/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
github.com/cortexlabs/cortex/cli/cmd.Execute()
    /home/circleci/project/cli/cmd/root.go:171 +0x256
main.main()
    /home/circleci/project/cli/main.go:24 +0x17
exit status 2

checklist:

  • run make test and make lint
  • test manually (i.e. build/push all images, restart operator, and re-deploy APIs)
  • update examples
  • update docs and add any new files to summary.md (view in gitbook after merging)
  • cherry-pick into release branches if applicable
  • alert the dev team if the dev environment changed

@jackmpcollins
Copy link
Contributor Author

Would it be possible to include this in a 0.42.1 version of the CLI which I can use against my 0.42.0 Cortex cluster?

@deliahu deliahu merged commit 5e94db2 into cortexlabs:master Feb 1, 2022
@deliahu
Copy link
Member

deliahu commented Feb 1, 2022

Thanks for the fix!

We are planning on releasing v0.42.1 soon, but we do have a strict version check for the cli <> operator API (since we don't guarantee backwards compatibility yet). I do think it would make sense to relax the validation to just check that the major/minor versions match. In the meantime, the easiest thing to do would be to cherry-pick the fix on top of the v0.42.0 tag, and then build the CLI. It should be straightforward for you to do in the future if you need to, but for this fix here is the linux cli and here is the darwin cli.

@jackmpcollins
Copy link
Contributor Author

Awesome, thank you!

@jackmpcollins jackmpcollins deleted the fix-async-model-listing branch February 1, 2022 20:54
RobertLucian pushed a commit that referenced this pull request Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants