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

Commitec7631f

Browse files
committed
Merge branch 'rename-core-ui' into 'master'
chore: rename Local UI to Embed UI as a more suitable name and ce-ui Docker image to run UI applicationSee merge request postgres-ai/database-lab!394
2 parents7b00a79 +f2f8126 commitec7631f

File tree

13 files changed

+54
-54
lines changed

13 files changed

+54
-54
lines changed

‎cmd/database-lab/main.go‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"github.com/pkg/errors"
2222

2323
"gitlab.com/postgres-ai/database-lab/v3/internal/cloning"
24+
"gitlab.com/postgres-ai/database-lab/v3/internal/embedui"
2425
"gitlab.com/postgres-ai/database-lab/v3/internal/estimator"
25-
"gitlab.com/postgres-ai/database-lab/v3/internal/localui"
2626
"gitlab.com/postgres-ai/database-lab/v3/internal/observer"
2727
"gitlab.com/postgres-ai/database-lab/v3/internal/platform"
2828
"gitlab.com/postgres-ai/database-lab/v3/internal/provision"
@@ -152,11 +152,11 @@ func main() {
152152
Restore:retrievalSvc.CollectRestoreTelemetry(),
153153
})
154154

155-
localUI:=localui.New(cfg.LocalUI,engProps,runner,docker)
155+
embedUI:=embedui.New(cfg.EmbedUI,engProps,runner,docker)
156156
server:=srv.NewServer(&cfg.Server,&cfg.Global,engProps,docker,cloningSvc,provisioner,retrievalSvc,platformSvc,obs,est,pm,tm)
157157
shutdownCh:=setShutdownListener()
158158

159-
gosetReloadListener(ctx,provisioner,tm,retrievalSvc,pm,cloningSvc,platformSvc,est,localUI,server)
159+
gosetReloadListener(ctx,provisioner,tm,retrievalSvc,pm,cloningSvc,platformSvc,est,embedUI,server)
160160

161161
server.InitHandlers()
162162

@@ -166,10 +166,10 @@ func main() {
166166
}
167167
}()
168168

169-
ifcfg.LocalUI.Enabled {
169+
ifcfg.EmbedUI.Enabled {
170170
gofunc() {
171-
iferr:=localUI.Run(ctx);err!=nil {
172-
log.Err("Failed to startlocal UI container:",err.Error())
171+
iferr:=embedUI.Run(ctx);err!=nil {
172+
log.Err("Failed to startEmbed UI container:",err.Error())
173173
return
174174
}
175175
}()
@@ -223,7 +223,7 @@ func getEngineProperties(ctx context.Context, dockerCLI *client.Client, cfg *con
223223
}
224224

225225
funcreloadConfig(ctx context.Context,provisionSvc*provision.Provisioner,tm*telemetry.Agent,retrievalSvc*retrieval.Retrieval,
226-
pm*pool.Manager,cloningSvc*cloning.Base,platformSvc*platform.Service,est*estimator.Estimator,localUI*localui.UIManager,
226+
pm*pool.Manager,cloningSvc*cloning.Base,platformSvc*platform.Service,est*estimator.Estimator,embedUI*embedui.UIManager,
227227
server*srv.Server)error {
228228
cfg,err:=config.LoadConfiguration()
229229
iferr!=nil {
@@ -247,7 +247,7 @@ func reloadConfig(ctx context.Context, provisionSvc *provision.Provisioner, tm *
247247
returnerr
248248
}
249249

250-
iferr:=localUI.Reload(ctx,cfg.LocalUI);err!=nil {
250+
iferr:=embedUI.Reload(ctx,cfg.EmbedUI);err!=nil {
251251
returnerr
252252
}
253253

@@ -268,15 +268,15 @@ func reloadConfig(ctx context.Context, provisionSvc *provision.Provisioner, tm *
268268
}
269269

270270
funcsetReloadListener(ctx context.Context,provisionSvc*provision.Provisioner,tm*telemetry.Agent,retrievalSvc*retrieval.Retrieval,
271-
pm*pool.Manager,cloningSvc*cloning.Base,platformSvc*platform.Service,est*estimator.Estimator,localUI*localui.UIManager,
271+
pm*pool.Manager,cloningSvc*cloning.Base,platformSvc*platform.Service,est*estimator.Estimator,embedUI*embedui.UIManager,
272272
server*srv.Server) {
273273
reloadCh:=make(chan os.Signal,1)
274274
signal.Notify(reloadCh,syscall.SIGHUP)
275275

276276
forrangereloadCh {
277277
log.Msg("Reloading configuration")
278278

279-
iferr:=reloadConfig(ctx,provisionSvc,tm,retrievalSvc,pm,cloningSvc,platformSvc,est,localUI,server);err!=nil {
279+
iferr:=reloadConfig(ctx,provisionSvc,tm,retrievalSvc,pm,cloningSvc,platformSvc,est,embedUI,server);err!=nil {
280280
log.Err("Failed to reload configuration",err)
281281
}
282282

‎configs/config.example.logical_generic.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ server:
2323
# HTTP server port. Default: 2345.
2424
port:2345
2525

26-
#Local UI. Controls the application to provide a user interface to DLE API.
27-
localUI:
26+
#Embed UI. Controls the application to provide a user interface to DLE API.
27+
embedUI:
2828
enabled:true
2929

3030
# Docker image of the UI application.
31-
dockerImage:"postgresai/local-ui:latest"
31+
dockerImage:"postgresai/ce-ui:latest"
3232

33-
# Host or IP address, from which theLocal UI container accepts HTTP connections.
33+
# Host or IP address, from which theEmbed UI container accepts HTTP connections.
3434
# By default, use a loop-back to accept only local connections.
3535
# The empty string means "all available addresses".
3636
host:"127.0.0.1"

‎configs/config.example.logical_rds_iam.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ server:
2323
# HTTP server port. Default: 2345.
2424
port:2345
2525

26-
#Local UI. Controls the application to provide a user interface to DLE API.
27-
localUI:
26+
#Embed UI. Controls the application to provide a user interface to DLE API.
27+
embedUI:
2828
enabled:true
2929

3030
# Docker image of the UI application.
31-
dockerImage:"postgresai/local-ui:latest"
31+
dockerImage:"postgresai/ce-ui:latest"
3232

33-
# Host or IP address, from which theLocal UI container accepts HTTP connections.
33+
# Host or IP address, from which theEmbed UI container accepts HTTP connections.
3434
# By default, use a loop-back to accept only local connections.
3535
# The empty string means "all available addresses".
3636
host:"127.0.0.1"

‎configs/config.example.physical_generic.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ server:
2323
# HTTP server port. Default: 2345.
2424
port:2345
2525

26-
#Local UI. Controls the application to provide a user interface to DLE API.
27-
localUI:
26+
#Embed UI. Controls the application to provide a user interface to DLE API.
27+
embedUI:
2828
enabled:true
2929

3030
# Docker image of the UI application.
31-
dockerImage:"postgresai/local-ui:latest"
31+
dockerImage:"postgresai/ce-ui:latest"
3232

33-
# Host or IP address, from which theLocal UI container accepts HTTP connections.
33+
# Host or IP address, from which theEmbed UI container accepts HTTP connections.
3434
# By default, use a loop-back to accept only local connections.
3535
# The empty string means "all available addresses".
3636
host:"127.0.0.1"

‎configs/config.example.physical_walg.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ server:
2323
# HTTP server port. Default: 2345.
2424
port:2345
2525

26-
#Local UI. Controls the application to provide a user interface to DLE API.
27-
localUI:
26+
#Embed UI. Controls the application to provide a user interface to DLE API.
27+
embedUI:
2828
enabled:true
2929

3030
# Docker image of the UI application.
31-
dockerImage:"postgresai/local-ui:latest"
31+
dockerImage:"postgresai/ce-ui:latest"
3232

33-
# Host or IP address, from which theLocal UI container accepts HTTP connections.
33+
# Host or IP address, from which theEmbed UI container accepts HTTP connections.
3434
# By default, use a loop-back to accept only local connections.
3535
# The empty string means "all available addresses".
3636
host:"127.0.0.1"

‎internal/localui/local_ui.go‎renamed to ‎internal/embedui/embed_ui.go‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
2021 © Postgres.ai
33
*/
44

5-
// Packagelocalui manageslocal UI container.
6-
packagelocalui
5+
// Packageembedui managesEmbed UI container.
6+
packageembedui
77

88
import (
99
"context"
@@ -40,15 +40,15 @@ const (
4040
healthCheckRetries=5
4141
)
4242

43-
// Config defines configs for alocal UI container.
43+
// Config defines configs for aEmbed UI container.
4444
typeConfigstruct {
4545
Enabledbool`yaml:"enabled"`
4646
DockerImagestring`yaml:"dockerImage"`
4747
Hoststring`yaml:"host"`
4848
Portint`yaml:"port"`
4949
}
5050

51-
// UIManager manageslocal UI container.
51+
// UIManager managesEmbed UI container.
5252
typeUIManagerstruct {
5353
runner runners.Runner
5454
docker*client.Client
@@ -89,16 +89,16 @@ func (ui *UIManager) isConfigChanged(cfg Config) bool {
8989
ui.cfg.Port!=cfg.Port
9090
}
9191

92-
// Run creates a newlocal UI container.
92+
// Run creates a newEmbed UI container.
9393
func (ui*UIManager)Run(ctx context.Context)error {
9494
iferr:=docker.PrepareImage(ui.runner,ui.cfg.DockerImage);err!=nil {
9595
returnfmt.Errorf("failed to prepare Docker image: %w",err)
9696
}
9797

98-
localUI,err:=ui.docker.ContainerCreate(ctx,
98+
embedUI,err:=ui.docker.ContainerCreate(ctx,
9999
&container.Config{
100100
Labels:map[string]string{
101-
cont.DBLabSatelliteLabel:cont.DBLabLocalUILabel,
101+
cont.DBLabSatelliteLabel:cont.DBLabEmbedUILabel,
102102
cont.DBLabInstanceIDLabel:ui.engProps.InstanceID,
103103
cont.DBLabEngineNameLabel:ui.engProps.ContainerName,
104104
},
@@ -125,27 +125,27 @@ func (ui *UIManager) Run(ctx context.Context) error {
125125
},
126126
&network.NetworkingConfig{},
127127
nil,
128-
getLocalUIName(ui.engProps.InstanceID),
128+
getEmbedUIName(ui.engProps.InstanceID),
129129
)
130130

131131
iferr!=nil {
132-
returnfmt.Errorf("failed to prepare Docker image forLocalUI: %w",err)
132+
returnfmt.Errorf("failed to prepare Docker image forEmbed UI: %w",err)
133133
}
134134

135-
iferr:=networks.Connect(ctx,ui.docker,ui.engProps.InstanceID,localUI.ID);err!=nil {
135+
iferr:=networks.Connect(ctx,ui.docker,ui.engProps.InstanceID,embedUI.ID);err!=nil {
136136
returnfmt.Errorf("failed to connect UI container to the internal Docker network: %w",err)
137137
}
138138

139-
iferr:=ui.docker.ContainerStart(ctx,localUI.ID, types.ContainerStartOptions{});err!=nil {
140-
returnfmt.Errorf("failed to start container %q: %w",localUI.ID,err)
139+
iferr:=ui.docker.ContainerStart(ctx,embedUI.ID, types.ContainerStartOptions{});err!=nil {
140+
returnfmt.Errorf("failed to start container %q: %w",embedUI.ID,err)
141141
}
142142

143143
reportLaunching(ui.cfg)
144144

145145
returnnil
146146
}
147147

148-
// Restart destroys and creates a newlocal UI container.
148+
// Restart destroys and creates a newEmbed UI container.
149149
func (ui*UIManager)Restart(ctx context.Context)error {
150150
ui.Stop(ctx)
151151

@@ -156,22 +156,22 @@ func (ui *UIManager) Restart(ctx context.Context) error {
156156
returnnil
157157
}
158158

159-
// Stop removes alocal UI container.
159+
// Stop removes aEmbed UI container.
160160
func (ui*UIManager)Stop(ctx context.Context) {
161-
tools.RemoveContainer(ctx,ui.docker,getLocalUIName(ui.engProps.InstanceID),cont.StopTimeout)
161+
tools.RemoveContainer(ctx,ui.docker,getEmbedUIName(ui.engProps.InstanceID),cont.StopTimeout)
162162
}
163163

164-
funcgetLocalUIName(instanceIDstring)string {
165-
returncont.DBLabLocalUILabel+"_"+instanceID
164+
funcgetEmbedUIName(instanceIDstring)string {
165+
returncont.DBLabEmbedUILabel+"_"+instanceID
166166
}
167167

168-
// reportLaunching reports the launch of theLocalUI container.
168+
// reportLaunching reports the launch of theEmbed UI container.
169169
funcreportLaunching(cfgConfig) {
170170
host:=engine.DefaultListenerHost
171171

172172
ifcfg.Host!="" {
173173
host=cfg.Host
174174
}
175175

176-
log.Msg(fmt.Sprintf("Local UI has started successfully on %s:%d.",host,cfg.Port))
176+
log.Msg(fmt.Sprintf("Embed UI has started successfully on %s:%d.",host,cfg.Port))
177177
}

‎internal/retrieval/engine/postgres/tools/cont/container.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ const (
5353
DBLabDumpLabel="dblab_dump"
5454
// DBLabRestoreLabel defines a label value for restore containers.
5555
DBLabRestoreLabel="dblab_restore"
56-
//DBLabLocalUILabel defines a label value forlocal UI containers.
57-
DBLabLocalUILabel="dblab_local_ui"
56+
//DBLabEmbedUILabel defines a label value forembed UI containers.
57+
DBLabEmbedUILabel="dblab_embed_ui"
5858

5959
// DBLabRunner defines a label to mark runner containers.
6060
DBLabRunner="dblab_runner"

‎pkg/config/config.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"gopkg.in/yaml.v2"
1616

1717
"gitlab.com/postgres-ai/database-lab/v3/internal/cloning"
18+
"gitlab.com/postgres-ai/database-lab/v3/internal/embedui"
1819
"gitlab.com/postgres-ai/database-lab/v3/internal/estimator"
19-
"gitlab.com/postgres-ai/database-lab/v3/internal/localui"
2020
"gitlab.com/postgres-ai/database-lab/v3/internal/observer"
2121
"gitlab.com/postgres-ai/database-lab/v3/internal/platform"
2222
"gitlab.com/postgres-ai/database-lab/v3/internal/provision"
@@ -44,7 +44,7 @@ type Config struct {
4444
Observer observer.Config`yaml:"observer"`
4545
Estimator estimator.Config`yaml:"estimator"`
4646
PoolManager pool.Config`yaml:"poolManager"`
47-
LocalUIlocalui.Config`yaml:"localUI"`
47+
EmbedUIembedui.Config`yaml:"embedUI"`
4848
}
4949

5050
// LoadConfiguration instances a new application configuration.

‎test/1.synthetic.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ curl https://gitlab.com/postgres-ai/database-lab/-/raw/"${CI_COMMIT_BRANCH:-mast
8181
yqeval -i'
8282
.global.debug = true |
8383
.global.telemetry.enabled = false |
84-
.localUI.enabled = false |
84+
.embedUI.enabled = false |
8585
.server.port = env(DLE_SERVER_PORT) |
8686
.provision.portPool.from = env(DLE_PORT_POOL_FROM) |
8787
.provision.portPool.to = env(DLE_PORT_POOL_TO) |

‎test/2.logical_generic.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ curl https://gitlab.com/postgres-ai/database-lab/-/raw/"${CI_COMMIT_BRANCH:-mast
8787
yqeval -i'
8888
.global.debug = true |
8989
.global.telemetry.enabled = false |
90-
.localUI.enabled = false |
90+
.embedUI.enabled = false |
9191
.server.port = env(DLE_SERVER_PORT) |
9292
.poolManager.mountDir = env(DLE_TEST_MOUNT_DIR) |
9393
.provision.portPool.from = env(DLE_PORT_POOL_FROM) |

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp