Skip to content

Draft: feat: create Database Lab Bootstrap component (#311)

Artyom Kartasov requested to merge 311-database-lab-bootstrap into master

Description

Create a new component that runs Database Lab Engine without using external parameters or flags:

  • add a new component: bootstrap
  • extends configuration to set up DLE parameters
  • run DLE container and report launching
  • add Makefile-commands to build a new binary file
  • dockerize Database Lab Bootstrap and build Docker images

Related issue

#311

Examples

engine:
  # Directory to store the state of Database Lab Engine: configs and metadata. Relative path is not valid.
  stateDir: "/home/user/.dblab/engine"

  # Database Lab Engine container.
  dockerImage: "postgresai/dblab-server:3.0.0-rc.1"

  # Additional volumes to mount to Database Lab Engine.
  volumes:

  # Environment variables passing to Database Lab Engine container.
  envs:
    - DOCKER_API_VERSION=1.39

  # The main token that is used to work with Database Lab API.
  verificationToken: "secret_token"

  # The host to which the Database Lab server accepts HTTP connections.
  # By default uses an empty string to accept connections to all network interfaces.
  # Keep it default when running inside a Docker container.
  host: "127.0.0.1"

  # HTTP server port. Default: 2345.
  port: 2345
$ docker run \
  --rm \
  --name dblab_bootstrap \
  --privileged \
  --volume /var/lib/dblab:/var/lib/dblab/:rshared \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  --volume ~/.dblab/engine/configs:/home/dblab/configs:ro \
  --volume ~/.dblab/engine/meta:/home/dblab/meta \
postgresai/dblab-bootstrap:latest

2021/12/10 11:30:39 config.go:58: [DEBUG]  Config loaded
2021/12/10 11:30:39 bootstrap.go:124: [INFO]   DLE has started successfully on 127.0.0.1:2345.
2021/12/10 11:30:39 bootstrap.go:127: [INFO]   Local UI has started successfully on 0.0.0.0:2346.

Checklist

  • the MR description has been reviewed
  • this MR contains text changes and they have been reviewed OR there are no texts changes
  • this MR contains GUI/CLI changes and they have been reviewed OR there are no GUI/CLI changes
  • this MR contains API changes, specifications reflect those changes and they have been reviewed OR there are no API changes

Closes #311

Edited by Anatoly Stansler

Merge request reports