@@ -22,31 +22,15 @@ Metadata:
22
22
- CertificateSubdomain
23
23
- CertificateHostedZone
24
24
- CertificateEmail
25
- -
26
- Label :
27
- default : " Database Lab Engine (DLE) configuration"
28
- Parameters :
29
- - DLERetrievalRefreshTimetable
30
- - PostgresDumpParallelJobs
31
- - DLEVerificationToken
32
- - DLEDebugMode
33
25
-
34
26
Label :
35
27
default : " Source PostgreSQL parameters"
36
28
Parameters :
37
29
- SourceDatabaseSize
38
- - SourcePostgresHost
39
- - SourcePostgresPort
40
- - SourcePostgresUsername
41
- - SourcePostgresPassword
42
- - SourcePostgresDBName
43
- - PostgresConfigSharedPreloadLibraries
44
- - SourcePostgresDBList
45
30
-
46
31
Label :
47
32
default : " Advanced DLE configuration"
48
33
Parameters :
49
- - PostgresDockerImage
50
34
- DLEZFSDataSetsNumber
51
35
ParameterLabels :
52
36
KeyName :
@@ -63,36 +47,14 @@ Metadata:
63
47
default : " Hosted zone"
64
48
CertificateEmail :
65
49
default : " Certificate email"
66
- DLEDebugMode :
67
- default : " DLE debug mode"
68
50
DLEVerificationToken :
69
51
default : " DLE verification token"
70
- DLERetrievalRefreshTimetable :
71
- default : " DLE retrieval refresh timetable"
72
- PostgresDockerImage :
73
- default : " Postgres docker image"
74
52
DLEZFSDataSetsNumber :
75
53
default : " Number of supported snapshots."
76
- PostgresDumpParallelJobs :
77
- default : " Number of pg_dump jobs"
78
- SourcePostgresDBName :
79
- default : " Database name"
80
54
VPC :
81
55
default : " VPC security group"
82
56
Subnet :
83
57
default : " Subnet"
84
- SourcePostgresHost :
85
- default : " Host name or IP"
86
- SourcePostgresPort :
87
- default : " Port"
88
- SourcePostgresUsername :
89
- default : " User name"
90
- SourcePostgresPassword :
91
- default : " Password"
92
- PostgresConfigSharedPreloadLibraries :
93
- default : " shared_preload_libraries parameter"
94
- SourcePostgresDBList :
95
- default : " Comma separated list of databases to copy"
96
58
Parameters :
97
59
Subnet :
98
60
Description : Subnet to attach EC2 machine.
@@ -150,68 +112,18 @@ Parameters:
150
112
AllowedPattern : ' ^$|[^\s@]+@[^\s@]+\.[^\s@]+'
151
113
Default : ' '
152
114
ConstraintDescription : Must be a valid email of the form \'user@example.com\'
153
- DLEDebugMode :
154
- Description : Enables DLE debug mode
155
- Type : String
156
- Default : True
157
- AllowedValues :
158
- - True
159
- - False
160
115
DLEVerificationToken :
161
116
Description : DLE verification token
162
117
Type : String
163
118
Default : " example-verification-token"
164
119
MinLength : ' 9'
165
120
MaxLength : ' 32'
166
- DLERetrievalRefreshTimetable :
167
- Description : DLE refresh schedule on cron format
168
- Type : String
169
- Default : ' 0 0 * * *'
170
121
DLEZFSDataSetsNumber :
171
122
Description : Number of database copies needed
172
123
Type : Number
173
124
Default : 2
174
125
MinValue : 2
175
126
MaxValue : 100
176
- PostgresDockerImage :
177
- Description : Docker image to run PostgreSQL
178
- Type : String
179
- Default : ' postgresai/extended-postgres:14'
180
- SourcePostgresDBName :
181
- Description : Source database name. This parameter is used to connect to the database
182
- Type : String
183
- Default : ' postgres'
184
- SourcePostgresHost :
185
- Description : Source Postgres cluster host name or IP
186
- Type : String
187
- Default : ' '
188
- SourcePostgresPort :
189
- Description : Source Postgres cluster port
190
- Type : Number
191
- MinValue : 1024
192
- MaxValue : 65535
193
- Default : 5432
194
- SourcePostgresUsername :
195
- Description : Source Postgres cluster username
196
- Type : String
197
- Default : postgres
198
- SourcePostgresPassword :
199
- Description : Source Postgres cluster password
200
- Type : String
201
- Default : ' '
202
- NoEcho : true
203
- PostgresConfigSharedPreloadLibraries :
204
- Description : Source Postgres shared_preload_libraries value
205
- Type : String
206
- Default : ' '
207
- PostgresDumpParallelJobs :
208
- Description : Number of jobs to run pg_dump against the source database
209
- Type : String
210
- Default : ' 1'
211
- SourcePostgresDBList :
212
- Description : List of database names on source for copy to DLE. Leave it empty to copy all accessible databases
213
- Type : String
214
- Default : ' '
215
127
Mappings :
216
128
AWSInstanceType2Arch :
217
129
r5.large :
@@ -404,41 +316,20 @@ Resources:
404
316
dle_config_path="/home/ubuntu/.dblab/engine/configs"
405
317
dle_meta_path="/home/ubuntu/.dblab/engine/meta"
406
318
postgres_conf_path="/home/ubuntu/.dblab/postgres_conf"
407
-
408
- # Create a special marker file to identify that the DLE is running as a "managed" instance
409
- # (e.g., launched using Marketplace or Terraform), and has not yet been configured.
410
- touch $dle_meta_path/pending.retrieval
319
+ dle_logs_path="home/ubuntu/.dblab/engine/logs"
411
320
412
321
yq e -i '
413
- .global.debug=${DLEDebugMode} |
414
322
.embeddedUI.host="" |
323
+ .embeddedUI.dockerImage="registry.gitlab.com/postgres-ai/database-lab/ce-ui:$DLE_DOCKER_IMAGE_VERSION" |
415
324
.server.verificationToken="${DLEVerificationToken}" |
416
- .retrieval.refresh.timetable="${DLERetrievalRefreshTimetable}" |
417
- .retrieval.spec.logicalRestore.options.forceInit=true |
418
325
.poolManager.mountDir = "/var/lib/dblab/dblab_pool" |
419
326
.retrieval.spec.logicalDump.options.dumpLocation="/var/lib/dblab/dblab_pool/dataset_1/dump/" |
420
- .retrieval.spec.logicalRestore.options.dumpLocation="/var/lib/dblab/dblab_pool/dataset_1/dump/" |
421
- .databaseContainer.dockerImage="${PostgresDockerImage}" |
422
- .databaseConfigs.configs.shared_preload_libraries="${PostgresConfigSharedPreloadLibraries}"
327
+ .retrieval.spec.logicalRestore.options.forceInit=true |
328
+ .retrieval.spec.logicalRestore.options.dumpLocation="/var/lib/dblab/dblab_pool/dataset_1/dump/"
423
329
' $dle_config_path/server.yml
424
330
425
- yq e -i '
426
- .retrieval.spec.logicalDump.options.source.connection.host = "${SourcePostgresHost}" |
427
- .retrieval.spec.logicalDump.options.source.connection.port = ${SourcePostgresPort} |
428
- .retrieval.spec.logicalDump.options.source.connection.dbname="${SourcePostgresDBName}" |
429
- .retrieval.spec.logicalDump.options.source.connection.username = "${SourcePostgresUsername}" |
430
- .retrieval.spec.logicalDump.options.source.connection.password = "${SourcePostgresPassword}" |
431
- .retrieval.spec.logicalDump.options.parallelJobs = ${PostgresDumpParallelJobs} |
432
- .retrieval.spec.logicalRestore.options.configs.shared_preload_libraries = "${PostgresConfigSharedPreloadLibraries}"
433
- ' $dle_config_path/server.yml
434
-
435
- for i in $(echo ${SourcePostgresDBList} | sed "s/,/ /g")
436
- do
437
- yq e -i "
438
- .retrieval.spec.logicalDump.options.databases.$i = {}
439
- " $dle_config_path/server.yml
440
- done
441
331
332
+ touch $dle_meta_path/pending.retrieval
442
333
443
334
sudo docker run \
444
335
--detach \
@@ -449,9 +340,14 @@ Resources:
449
340
--volume /var/run/docker.sock:/var/run/docker.sock \
450
341
--volume /var/lib/dblab:/var/lib/dblab/:rshared \
451
342
--volume /var/lib/dblab/dblab_pool/dataset_1/dump/:/var/lib/dblab/dblab_pool/dataset_1/dump/:rshared \
452
- --volume $dle_config_path:/home/dblab/configs:ro \
343
+ --volume $dle_config_path:/home/dblab/configs \
453
344
--volume $dle_meta_path:/home/dblab/meta \
345
+ --volume $dle_logs_path:/home/dblab/logs \
454
346
--volume $postgres_conf_path:/home/dblab/standard/postgres/control \
347
+ --volume /sys/kernel/debug:/sys/kernel/debug:rw \
348
+ --volume /lib/modules:/lib/modules:ro \
349
+ --volume /proc:/host_proc:ro \
350
+ --env DLE_COMPUTING_INFRASTRUCTURE=AWS \
455
351
--env DOCKER_API_VERSION=1.39 \
456
352
--restart always \
457
353
registry.gitlab.com/postgres-ai/database-lab/dblab-server:$DLE_DOCKER_IMAGE_VERSION
@@ -478,7 +374,7 @@ Resources:
478
374
sudo systemctl enable envoy
479
375
sudo systemctl start envoy
480
376
fi
481
-
377
+
482
378
# upgrade ssm agent version
483
379
wget https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/amazon-ssm-agent/3.1.1575.0/amazon-ssm-agent-ubuntu-amd64.tar.gz
484
380
tar -xf amazon-ssm-agent-ubuntu-amd64.tar.gz
@@ -490,7 +386,7 @@ Resources:
490
386
--url=http://localhost:2345 \
491
387
--token=${DLEVerificationToken} \
492
388
--insecure'
493
-
389
+
494
390
while ! echo "UI started" | nc localhost 2346; do sleep 10; done
495
391
/opt/aws/bin/cfn-signal -e $? -d "DLE UI is available" -r "DLE Deploy Process Complete" '${WaitHandle}'
496
392
0 commit comments