Skip to content

Automate Joe bot deployment and improvements

Vitaliy Kukharik requested to merge joe into main

Automate Joe bot deployment

issue: #19 (closed)

By default, Joe Bot is not installed.

Variables:

joe_bot_install: false # do not install Joe Bot by default
joe_version: 0.11.0-rc.4
joe_config_path: "{{ dblab_engine_base_path }}/joe/configs"
joe_meta_path: "{{ dblab_engine_base_path }}/joe/meta"
joe_image: "postgresai/joe:{{ joe_version | replace('v', '') }}"
joe_container_name: joe_bot
joe_container_host: 127.0.0.1
joe_port: 2400
joe_platform_token: "platform_secret_token" # Postgres.ai Platform API secret token.
joe_communication_type: "webui" # Available communication types ("webui", "slack", "slackrtm", "slacksm")
joe_communication_signing_secret: "secret_signing" # Web UI Signing Secret.
joe_communication_slack_signing_secret: "secret_signing" # Slack App Signing Secret.
joe_communication_slack_access_token: "xoxb-XXXX" # Bot User OAuth Access Token.
joe_communication_slack_app_level_token: "xapp-XXXX" # App Level Token (for "slacksm").
joe_communication_channels_channel_id: "{{ platform_project_name }}" # Web UI channel ID.
joe_communication_channels_project: "{{ platform_project_name }}" # Postgres.ai Platform project to which user sessions are to be assigned.
# PostgreSQL connection parameters used to connect Joe to the clone
joe_dblab_params_dbname: "postgres"
joe_dblab_params_sslmode: "prefer"

improvements

  • New variable: "dblab_engine_container_default_volumes" (default: see vars/main.yml)
    • Directories to be mounted in the 'dblab_server' container.
  • New variable: "dblab_engine_container_additional_volumes" (default '[]')
    • Additional directories or files to be mounted in the 'dblab_server' container
  • New variable: "print_usage_instructions" (default: true)
    • Print the usage instructions after deployment. In some cases, it may be necessary to hide the instruction (for example CI/CD) because it contains information about the Verification token.
  • New task "Copy the preprocessing script file"
    • If dblab_engine_preprocess_script is defined, copy the preprocessing script file to '{{ dblab_engine_base_path }}/preprocess.sh'
  • Do not update the apt cache every time the playbook is executed (only if the cache is older than 1 hour). Necessary to ensure atomicity.
  • Check if DBLab CLI ('dblab') is already installed
    • do not attempt to install if the required version of the CLI is already installed. Necessary to ensure atomicity.
  • Prevent unnecessary restart of the dblab_engine container during deployment.
    • An additional restart may result in a physical mode error. This change ensures that the container will be launched only 1 time during deployment.
  • Temporarily disable tests on AWS
    • TODO: Enable tests on AWS when access issues are fixed.
  • Add "preemptible" option for GCP compute
    • variable gcp_compute_instance_preemptible (default: false)
    • Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. Preemptible VMs are available at a 60-91% discount compared to the price of standard VMs, which is great for testing tasks.
    • https://cloud.google.com/compute/docs/instances/preemptible
  • Add support for GCP_SERVICE_ACCOUNT_CONTENTS in base64 encoding.
  • Add zpool_options variable
  • Add docker_version veriable (default: "24.0.7")
Edited by Vitaliy Kukharik

Merge request reports