Remove --free, implement shared CPU/memory and automatic defaults#55
Remove --free, implement shared CPU/memory and automatic defaults#55nathanjcochran merged 10 commits intomainfrom
--free, implement shared CPU/memory and automatic defaults#55Conversation
Askir
left a comment
There was a problem hiding this comment.
generally looks good to me but could use a bit better explanation I think
| cmd.Flags().StringVar(&createCpuMillis, "cpu", "", "CPU allocation in millicores or 'shared'") | ||
| cmd.Flags().StringVar(&createMemoryGBs, "memory", "", "Memory allocation in gigabytes or 'shared'") |
There was a problem hiding this comment.
I think this is a bit confusing with the default behavior not being mentioned?
There was a problem hiding this comment.
I agree, but I think it's going to be hard to fit an explanation of the default behavior into the flag descriptions (whereas previously, it was easy to just list a default value). We can list auto as the default in a follow-up PR if we think that's clearer (I think that change should be backwards-compatible), but I still don't think it would really explain much.
So I think it needs to go in the main --help text. How does this look for now (at least as a first pass - can definitely improve later)? 346aae9
| 8 CPU (8000m) / 32GB | 16 CPU (16000m) / 64GB | 32 CPU (32000m) / 128GB | ||
| Allowed CPU/Memory Configurations: | ||
| shared / shared | 0.5 CPU (500m) / 2GB | 1 CPU (1000m) / 4GB | 2 CPU (2000m) / 8GB | ||
| 4 CPU (4000m) / 16GB | 8 CPU (8000m) / 32GB | 16 CPU (16000m) / 64GB | 32 CPU (32000m) / 128GB |
There was a problem hiding this comment.
I think at least here we should document the default behavior. I'd actually prefer to have auto/auto as a specific option but even if we don't have it we should explain what not providing anything does.
There was a problem hiding this comment.
Yeah, agree. See my other comment above.
Co-authored-by: Jascha Beste <bestejascha@gmail.com> Signed-off-by: Nathan Cochran <nathanjcochran@gmail.com>
See Slack thread and AGE-208 for background.
This implements the changes in AGE-208, with one relatively minor difference: I did not implement explicit "auto" options for each flag. Instead, I just removed the default value for each flag, and am interpreting the zero value (i.e. when the flag is omitted) to mean "auto". This was just a little easier to implement as a first pass, as it meant that I didn't need to update as much of the
--helptext to include references to "auto" or explain what it means. I think it would be easy to add explicit "auto" options as a follow-up, if we're sure we want it.This PR:
--freeflag.sharedfor--cpuand--memory(this is how you create a free services now).--addons,--region,--cpu, and--memory--cpuand--memorydefaults now depend on what type of plan you're on (the free plan defaults tosharedCPU/memory, whereas paid plans default to0.5 CPU/ 2 GB.--addonsand--regiondefaults depend on what type of service you're creating.--addonsdefaults totime-series,ai, whereas if you're creating a paid service, it defaults totime-series.--regioncurrently always defaults tous-east-1, but we intend to have it intelligently choose the best region for paid services in the future.service_createMCP tool.How to test:
go install ./... && servergo install ./...savannah-publicserver:tiger config set api_url http://localhost:8080/public/api/v1tiger service create(default service type depends on your plan)tiger service create --cpu=sharedRelated PRs: