Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cmd/cli/command/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var debugCmd = &cobra.Command{
Use: "debug [SERVICE...]",
Annotations: authNeededAlways,
Hidden: true,
Short: "Debug a build, deployment, or service failure",
Short: "Debug a build, deployment, or service failure (Pro subscription required for full debugging)",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
etag, _ := cmd.Flags().GetString("etag")
Expand Down
1 change: 1 addition & 0 deletions src/cmd/cli/command/estimate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func TestPrintEstimate(t *testing.T) {
expectedOutput := `
Estimate for Deployment Mode: AFFORDABLE

Available on all tiers.
This mode is optimized for low cost and rapid iteration. Your application
will be deployed with spot instances. Databases will be provisioned using
resources optimized for burstable memory. Deployments are replaced entirely on
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/cli/command/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var generateCmd = &cobra.Command{
Use: "generate",
Args: cobra.MaximumNArgs(1),
Aliases: []string{"gen"},
Short: "Generate a sample Defang project",
Short: "Generate a sample Defang project (Starter: limited generations/month, Pro: unlimited)",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()

Expand Down
4 changes: 0 additions & 4 deletions src/cmd/cli/command/whoami.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"github.com/DefangLabs/defang/src/pkg/cli"
"github.com/DefangLabs/defang/src/pkg/cli/client"
"github.com/DefangLabs/defang/src/pkg/term"
defangv1 "github.com/DefangLabs/defang/src/protos/io/defang/v1"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -49,9 +48,6 @@ var whoamiCmd = &cobra.Command{
if !global.Verbose {
data.Tenant = ""
data.TenantID = ""
if data.SubscriberTier == defangv1.SubscriptionTier_SUBSCRIPTION_TIER_UNSPECIFIED {
data.SubscriberTier = defangv1.SubscriptionTier_HOBBY // don't show "SUBSCRIPTION_TIER_UNSPECIFIED"
}
}

cols := []string{
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/client/byoc/baseclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (e ErrNoPermission) Error() string {
func (b *ByocBaseClient) GetServiceInfos(ctx context.Context, projectName, delegateDomain, etag string, services map[string]composeTypes.ServiceConfig) ([]*defangv1.ServiceInfo, error) {
numGPUS := compose.GetNumOfGPUs(services)
if numGPUS > 0 && !b.AllowGPU {
return nil, ErrNoPermission("usage of GPUs. Please upgrade on https://s.defang.io/subscription")
return nil, ErrNoPermission("GPU access requires a Pro subscription ($49/mo). Upgrade at https://portal.defang.io/pricing")
}

serviceInfoMap := make(map[string]*Node)
Expand Down
3 changes: 3 additions & 0 deletions src/pkg/cli/estimate.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func GeneratePreview(ctx context.Context, project *compose.Project, client clien
}

var affordableModeEstimateSummary = `
Available on all tiers.
This mode is optimized for low cost and rapid iteration. Your application
will be deployed with spot instances. Databases will be provisioned using
resources optimized for burstable memory. Deployments are replaced entirely on
Expand All @@ -103,12 +104,14 @@ Services will be exposed directly to the public internet for easy debugging.
This mode emphasizes affordability over availability.`

var balancedModeEstimateSummary = `
Requires Pro ($49/mo).
This mode strikes a balance between cost and availability. Your application
will be deployed with spot instances. Databases will be provisioned using
resources optimized for production. Services in the "internal" network will
be deployed to a private subnet with a NAT gateway for outbound internet access.`

var highAvailabilityModeEstimateSummary = `
Requires Enterprise ($499/mo).
This mode prioritizes availability. Your application
will be deployed with on-demand instances in multiple availability zones.
Databases will be provisioned using resources optimized for production.
Expand Down
21 changes: 10 additions & 11 deletions src/pkg/cli/whoami.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ package cli
import (
"context"

"github.com/DefangLabs/defang/src/pkg"
"github.com/DefangLabs/defang/src/pkg/auth"
"github.com/DefangLabs/defang/src/pkg/cli/client"
"github.com/DefangLabs/defang/src/pkg/term"
"github.com/DefangLabs/defang/src/pkg/types"

defangv1 "github.com/DefangLabs/defang/src/protos/io/defang/v1"
)

type ShowAccountData struct {
Provider client.ProviderID `json:"provider"`
SubscriberTier defangv1.SubscriptionTier `json:"subscriberTier"`
Region string `json:"region"`
Workspace string `json:"workspace"`
Tenant string `json:"tenant,omitempty"` // this is the subdomain
TenantID string `json:"tenantId,omitempty"`
Email string `json:"email"`
Name string `json:"name"`
Provider client.ProviderID `json:"provider"`
SubscriberTier string `json:"subscriberTier"`
Region string `json:"region"`
Workspace string `json:"workspace"`
Tenant string `json:"tenant,omitempty"` // this is the subdomain
TenantID string `json:"tenantId,omitempty"`
Email string `json:"email"`
Name string `json:"name"`
}

func Whoami(ctx context.Context, fabric client.FabricClient, maybeProvider client.Provider, userInfo *auth.UserInfo, tenantSelection types.TenantNameOrID) (ShowAccountData, error) {
Expand All @@ -36,7 +35,7 @@ func Whoami(ctx context.Context, fabric client.FabricClient, maybeProvider clien
term.Debug("User ID: " + resp.UserId)
showData := ShowAccountData{
Region: resp.Region,
SubscriberTier: resp.Tier,
SubscriberTier: pkg.SubscriptionTierToString(resp.Tier),
Tenant: resp.Tenant,
TenantID: resp.TenantId,
Workspace: ResolveWorkspaceName(userInfo, tenantSelection),
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/whoami_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestWhoami(t *testing.T) {

want := ShowAccountData{
Provider: client.ProviderDefang,
SubscriberTier: defangv1.SubscriptionTier_PRO,
SubscriberTier: "Pro",
Region: "us-west-2",
Workspace: "Tenant One",
Tenant: "tenant-1",
Expand Down
8 changes: 5 additions & 3 deletions src/pkg/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@ func SubscriptionTierToString(tier defangv1.SubscriptionTier) string {
case defangv1.SubscriptionTier_SUBSCRIPTION_TIER_UNSPECIFIED:
fallthrough // free tier
case defangv1.SubscriptionTier_HOBBY:
return "Hobby"
return "Starter"
case defangv1.SubscriptionTier_PERSONAL:
return "Personal"
return "Starter (Legacy)"
case defangv1.SubscriptionTier_PRO:
return "Pro"
case defangv1.SubscriptionTier_TEAM:
return "Team"
return "Enterprise"
case defangv1.SubscriptionTier_EXPIRED:
return "Expired"
default:
return "Unknown"
}
Expand Down
Loading