Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: promote single-tailnet out of experimental#11366

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spikecurtis merged 1 commit intomainfromspike/single-tailnet-experimental
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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: 0 additions & 2 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 0 additions & 2 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

32 changes: 13 additions & 19 deletionscoderd/coderd.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -458,25 +458,19 @@ func New(options *Options) *API {

api.Auditor.Store(&options.Auditor)
api.TailnetCoordinator.Store(&options.TailnetCoordinator)
ifapi.Experiments.Enabled(codersdk.ExperimentSingleTailnet) {
api.agentProvider,err=NewServerTailnet(api.ctx,
options.Logger,
options.DERPServer,
api.DERPMap,
options.DeploymentValues.DERP.Config.ForceWebSockets.Value(),
func(context.Context) (tailnet.MultiAgentConn,error) {
return (*api.TailnetCoordinator.Load()).ServeMultiAgent(uuid.New()),nil
},
wsconncache.New(api._dialWorkspaceAgentTailnet,0),
api.TracerProvider,
)
iferr!=nil {
panic("failed to setup server tailnet: "+err.Error())
}
}else {
api.agentProvider=&wsconncache.AgentProvider{
Cache:wsconncache.New(api._dialWorkspaceAgentTailnet,0),
}
api.agentProvider,err=NewServerTailnet(api.ctx,
options.Logger,
options.DERPServer,
api.DERPMap,
options.DeploymentValues.DERP.Config.ForceWebSockets.Value(),
func(context.Context) (tailnet.MultiAgentConn,error) {
return (*api.TailnetCoordinator.Load()).ServeMultiAgent(uuid.New()),nil
},
wsconncache.New(api._dialWorkspaceAgentTailnet,0),
api.TracerProvider,
)
iferr!=nil {
panic("failed to setup server tailnet: "+err.Error())
}
api.TailnetClientService,err=tailnet.NewClientService(
api.Logger.Named("tailnetclient"),
Expand Down
6 changes: 0 additions & 6 deletionscodersdk/deployment.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2084,11 +2084,6 @@ const (
// only Coordinator
ExperimentTailnetPGCoordinatorExperiment="tailnet_pg_coordinator"

// ExperimentSingleTailnet replaces workspace connections inside coderd to
// all use a single tailnet, instead of the previous behavior of creating a
// single tailnet for each agent.
ExperimentSingleTailnetExperiment="single_tailnet"

// Deployment health page
ExperimentDeploymentHealthPageExperiment="deployment_health_page"

Expand All@@ -2102,7 +2097,6 @@ const (
// not be included here and will be essentially hidden.
varExperimentsAll=Experiments{
ExperimentDeploymentHealthPage,
ExperimentSingleTailnet,
}

// Experiments is a list of experiments.
Expand Down
1 change: 0 additions & 1 deletiondocs/api/schemas.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

34 changes: 13 additions & 21 deletionsenterprise/wsproxy/wsproxy.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -239,27 +239,19 @@ func New(ctx context.Context, opts *Options) (*Server, error) {
returnnil,xerrors.Errorf("parse app security key: %w",err)
}

varagentProvider workspaceapps.AgentProvider
ifopts.Experiments.Enabled(codersdk.ExperimentSingleTailnet) {
stn,err:=coderd.NewServerTailnet(ctx,
s.Logger,
nil,
func()*tailcfg.DERPMap {
returns.latestDERPMap.Load()
},
regResp.DERPForceWebSockets,
s.DialCoordinator,
wsconncache.New(s.DialWorkspaceAgent,0),
s.TracerProvider,
)
iferr!=nil {
returnnil,xerrors.Errorf("create server tailnet: %w",err)
}
agentProvider=stn
}else {
agentProvider=&wsconncache.AgentProvider{
Cache:wsconncache.New(s.DialWorkspaceAgent,0),
}
agentProvider,err:=coderd.NewServerTailnet(ctx,
s.Logger,
nil,
func()*tailcfg.DERPMap {
returns.latestDERPMap.Load()
},
regResp.DERPForceWebSockets,
s.DialCoordinator,
wsconncache.New(s.DialWorkspaceAgent,0),
s.TracerProvider,
)
iferr!=nil {
returnnil,xerrors.Errorf("create server tailnet: %w",err)
}

workspaceAppsLogger:=opts.Logger.Named("workspaceapps")
Expand Down
59 changes: 1 addition & 58 deletionsenterprise/wsproxy/wsproxy_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,6 @@ import (
"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/v2/agent/agenttest"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/coderd"
"github.com/coder/coder/v2/coderd/coderdtest"
"github.com/coder/coder/v2/coderd/healthcheck/derphealth"
"github.com/coder/coder/v2/coderd/httpmw"
Expand DownExpand Up@@ -431,7 +430,7 @@ resourceLoop:
require.False(t,p2p)
}

funcTestWorkspaceProxyWorkspaceApps_Wsconncache(t*testing.T) {
funcTestWorkspaceProxyWorkspaceApps(t*testing.T) {
t.Parallel()

apptest.Run(t,false,func(t*testing.T,opts*apptest.DeploymentOptions)*apptest.Deployment {
Expand DownExpand Up@@ -487,59 +486,3 @@ func TestWorkspaceProxyWorkspaceApps_Wsconncache(t *testing.T) {
}
})
}

funcTestWorkspaceProxyWorkspaceApps_SingleTailnet(t*testing.T) {
t.Parallel()

apptest.Run(t,false,func(t*testing.T,opts*apptest.DeploymentOptions)*apptest.Deployment {
deploymentValues:=coderdtest.DeploymentValues(t)
deploymentValues.DisablePathApps=clibase.Bool(opts.DisablePathApps)
deploymentValues.Dangerous.AllowPathAppSharing=clibase.Bool(opts.DangerousAllowPathAppSharing)
deploymentValues.Dangerous.AllowPathAppSiteOwnerAccess=clibase.Bool(opts.DangerousAllowPathAppSiteOwnerAccess)
deploymentValues.Experiments= []string{
string(codersdk.ExperimentSingleTailnet),
"*",
}

client,_,api,user:=coderdenttest.NewWithAPI(t,&coderdenttest.Options{
Options:&coderdtest.Options{
DeploymentValues:deploymentValues,
AppHostname:"*.primary.test.coder.com",
IncludeProvisionerDaemon:true,
RealIPConfig:&httpmw.RealIPConfig{
TrustedOrigins: []*net.IPNet{{
IP:net.ParseIP("127.0.0.1"),
Mask:net.CIDRMask(8,32),
}},
TrustedHeaders: []string{
"CF-Connecting-IP",
},
},
WorkspaceAppsStatsCollectorOptions:opts.StatsCollectorOptions,
},
LicenseOptions:&coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureWorkspaceProxy:1,
},
},
})

// Create the external proxy
ifopts.DisableSubdomainApps {
opts.AppHost=""
}
proxyAPI:=coderdenttest.NewWorkspaceProxy(t,api,client,&coderdenttest.ProxyOptions{
Name:"best-proxy",
Experiments:coderd.ReadExperiments(api.Logger,deploymentValues.Experiments.Value()),
AppHostname:opts.AppHost,
DisablePathApps:opts.DisablePathApps,
})

return&apptest.Deployment{
Options:opts,
SDKClient:client,
FirstUser:user,
PathAppBaseURL:proxyAPI.Options.AccessURL,
}
})
}
2 changes: 0 additions & 2 deletionssite/src/api/typesGenerated.ts
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

Original file line numberDiff line numberDiff line change
Expand Up@@ -34,13 +34,13 @@ const meta: Meta<typeof GeneralSettingsPageView> = {
description:
"Enable one or more experiments. These are not ready for production. Separate multiple experiments with commas, or enter '*' to opt-in to all available experiments.",
flag:"experiments",
value:["single_tailnet"],
value:["workspace_actions"],
flag_shorthand:"",
hidden:false,
},
],
deploymentDAUs:MockDeploymentDAUResponse,
safeExperiments:["single_tailnet","deployment_health_page"],
safeExperiments:["deployment_health_page"],
},
};

Expand DownExpand Up@@ -102,6 +102,6 @@ export const allExperimentsEnabled: Story = {
hidden:false,
},
],
safeExperiments:["single_tailnet","deployment_health_page"],
safeExperiments:["deployment_health_page"],
},
};

[8]ページ先頭

©2009-2025 Movatter.jp