Skip to content

Commit c6e0ba1

Browse files
authored
feat: graduate prebuilds to general availability (#18607)
This PR removes the prebuilds experiment and allows the use of prebuilds without opting into an experiment.
1 parent 872aef3 commit c6e0ba1

File tree

17 files changed

+46
-88
lines changed

17 files changed

+46
-88
lines changed

cli/testdata/coder_server_--help.golden

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,12 @@ workspaces stopping during the day due to template scheduling.
677677
must be *. Only one hour and minute can be specified (ranges or comma
678678
separated values are not supported).
679679

680+
WORKSPACE PREBUILDS OPTIONS:
681+
Configure how workspace prebuilds behave.
682+
683+
--workspace-prebuilds-reconciliation-interval duration, $CODER_WORKSPACE_PREBUILDS_RECONCILIATION_INTERVAL (default: 15s)
684+
How often to reconcile workspace prebuilds state.
685+
680686
⚠️ DANGEROUS OPTIONS:
681687
--dangerous-allow-path-app-sharing bool, $CODER_DANGEROUS_ALLOW_PATH_APP_SHARING
682688
Allow workspace apps that are not served from subdomains to be shared.

coderd/apidoc/docs.go

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbauthz/dbauthz_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5059,8 +5059,7 @@ func (s *MethodTestSuite) TestPrebuilds() {
50595059
}))
50605060
s.Run("GetPrebuildMetrics", s.Subtest(func(_ database.Store, check *expects) {
50615061
check.Args().
5062-
Asserts(rbac.ResourceWorkspace.All(), policy.ActionRead).
5063-
ErrorsWithInMemDB(dbmem.ErrUnimplemented)
5062+
Asserts(rbac.ResourceWorkspace.All(), policy.ActionRead)
50645063
}))
50655064
s.Run("CountInProgressPrebuilds", s.Subtest(func(_ database.Store, check *expects) {
50665065
check.Args().

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4270,7 +4270,7 @@ func (q *FakeQuerier) GetParameterSchemasByJobID(_ context.Context, jobID uuid.U
42704270
}
42714271

42724272
func (*FakeQuerier) GetPrebuildMetrics(_ context.Context) ([]database.GetPrebuildMetricsRow, error) {
4273-
return nil, ErrUnimplemented
4273+
return make([]database.GetPrebuildMetricsRow, 0), nil
42744274
}
42754275

42764276
func (q *FakeQuerier) GetPresetByID(ctx context.Context, presetID uuid.UUID) (database.GetPresetByIDRow, error) {

coderd/telemetry/telemetry.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,6 @@ func (r *remoteReporter) createSnapshot() (*Snapshot, error) {
687687
return nil
688688
})
689689
eg.Go(func() error {
690-
if !r.options.Experiments.Enabled(codersdk.ExperimentWorkspacePrebuilds) {
691-
return nil
692-
}
693-
694690
metrics, err := r.options.Database.GetPrebuildMetrics(ctx)
695691
if err != nil {
696692
return xerrors.Errorf("get prebuild metrics: %w", err)

coderd/telemetry/telemetry_test.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -408,16 +408,14 @@ func TestPrebuiltWorkspacesTelemetry(t *testing.T) {
408408

409409
cases := []struct {
410410
name string
411-
experimentEnabled bool
412411
storeFn func(store database.Store) database.Store
413412
expectedSnapshotEntries int
414413
expectedCreated int
415414
expectedFailed int
416415
expectedClaimed int
417416
}{
418417
{
419-
name: "experiment enabled",
420-
experimentEnabled: true,
418+
name: "prebuilds enabled",
421419
storeFn: func(store database.Store) database.Store {
422420
return &mockDB{Store: store}
423421
},
@@ -427,19 +425,11 @@ func TestPrebuiltWorkspacesTelemetry(t *testing.T) {
427425
expectedClaimed: 3,
428426
},
429427
{
430-
name: "experiment enabled, prebuilds not used",
431-
experimentEnabled: true,
428+
name: "prebuilds not used",
432429
storeFn: func(store database.Store) database.Store {
433430
return &emptyMockDB{Store: store}
434431
},
435432
},
436-
{
437-
name: "experiment disabled",
438-
experimentEnabled: false,
439-
storeFn: func(store database.Store) database.Store {
440-
return &mockDB{Store: store}
441-
},
442-
},
443433
}
444434

445435
for _, tc := range cases {
@@ -448,11 +438,6 @@ func TestPrebuiltWorkspacesTelemetry(t *testing.T) {
448438

449439
deployment, snapshot := collectSnapshot(ctx, t, db, func(opts telemetry.Options) telemetry.Options {
450440
opts.Database = tc.storeFn(db)
451-
if tc.experimentEnabled {
452-
opts.Experiments = codersdk.Experiments{
453-
codersdk.ExperimentWorkspacePrebuilds,
454-
}
455-
}
456441
return opts
457442
})
458443

codersdk/deployment.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,7 +3070,6 @@ Write out the current server config as YAML to stdout.`,
30703070
Group: &deploymentGroupPrebuilds,
30713071
YAML: "reconciliation_interval",
30723072
Annotations: serpent.Annotations{}.Mark(annotationFormatDuration, "true"),
3073-
Hidden: ExperimentsSafe.Enabled(ExperimentWorkspacePrebuilds), // Hide setting while this feature is experimental.
30743073
},
30753074
{
30763075
Name: "Reconciliation Backoff Interval",
@@ -3342,7 +3341,6 @@ const (
33423341
ExperimentNotifications Experiment = "notifications" // Sends notifications via SMTP and webhooks following certain events.
33433342
ExperimentWorkspaceUsage Experiment = "workspace-usage" // Enables the new workspace usage tracking.
33443343
ExperimentWebPush Experiment = "web-push" // Enables web push notifications through the browser.
3345-
ExperimentWorkspacePrebuilds Experiment = "workspace-prebuilds" // Enables the new workspace prebuilds feature.
33463344
)
33473345

33483346
// ExperimentsKnown should include all experiments defined above.
@@ -3352,16 +3350,13 @@ var ExperimentsKnown = Experiments{
33523350
ExperimentNotifications,
33533351
ExperimentWorkspaceUsage,
33543352
ExperimentWebPush,
3355-
ExperimentWorkspacePrebuilds,
33563353
}
33573354

33583355
// ExperimentsSafe should include all experiments that are safe for
33593356
// users to opt-in to via --experimental='*'.
33603357
// Experiments that are not ready for consumption by all users should
33613358
// not be included here and will be essentially hidden.
3362-
var ExperimentsSafe = Experiments{
3363-
ExperimentWorkspacePrebuilds,
3364-
}
3359+
var ExperimentsSafe = Experiments{}
33653360

33663361
// Experiments is a list of experiments.
33673362
// Multiple experiments may be enabled at the same time.

docs/admin/templates/extending-templates/prebuilt-workspaces.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Prebuilt workspaces are tightly integrated with [workspace presets](./parameters
2727

2828
- [**Premium license**](../../licensing/index.md)
2929
- **Compatible Terraform provider**: Use `coder/coder` Terraform provider `>= 2.4.1`.
30-
- **Feature flag**: Enable the `workspace-prebuilds` [experiment](../../../reference/cli/server.md#--experiments).
3130

3231
## Enable prebuilt workspaces for template presets
3332

docs/reference/api/schemas.md

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy