summaryrefslogtreecommitdiff
path: root/devstack
diff options
context:
space:
mode:
authorLingxian Kong <anlin.kong@gmail.com>2019-12-04 16:02:09 +1300
committerLingxian Kong <anlin.kong@gmail.com>2019-12-05 00:45:56 +1300
commit8fc0b7695d8e74e9ff45ca4e1857eccbea81726c (patch)
tree541d615ee3f9d83bcf999ef7e0bfba84b3aba7da /devstack
parentbdd44790fb10b20a7ef4ceed161bb2ca0e4f5c48 (diff)
downloadtrove-8fc0b7695d8e74e9ff45ca4e1857eccbea81726c.tar.gz
Build reusable Trove guest image for dev
When building the guest image for dev_mode=true, the controller IP address is injected to the image in order for the guest-agent to download Trove code during initialization. As a result, we have to build guest image each time in the Trove CI because the image build relies on the devstack host IP address. If we could remove the dependency, we can build the image(in devmode=true) for a specific datastore once and use that image for all related CI jobs, which could save some time for Trove CI. Fix the current CI issue as well. Change-Id: If23f4f179a6ab72cfb35e4c45d55142fedb76498
Diffstat (limited to 'devstack')
-rw-r--r--devstack/plugin.sh30
1 files changed, 16 insertions, 14 deletions
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index 0b4e9041..6102e9c6 100644
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -281,14 +281,25 @@ function configure_trove {
iniset $TROVE_GUESTAGENT_CONF DEFAULT remote_swift_client trove.common.clients_admin.swift_client_trove_admin
iniset $TROVE_GUESTAGENT_CONF DEFAULT remote_glance_client trove.common.clients_admin.glance_client_trove_admin
- # To avoid 'Connection timed out' error of sudo command inside the guest agent
- CLOUDINIT_PATH=/etc/trove/cloudinit/${TROVE_DATASTORE_TYPE}.cloudinit
- sudo mkdir -p $(dirname "$CLOUDINIT_PATH")
- sudo touch "$CLOUDINIT_PATH"
- sudo tee $CLOUDINIT_PATH >/dev/null <<'EOF'
+ # 1. To avoid 'Connection timed out' error of sudo command inside the guest agent
+ # 2. Config the controller IP address used by guest-agent to download Trove code during initialization (only valid for dev_mode=true).
+ common_cloudinit=/etc/trove/cloudinit/common.cloudinit
+ sudo mkdir -p $(dirname ${common_cloudinit})
+ sudo touch ${common_cloudinit}
+ sudo tee ${common_cloudinit} >/dev/null <<EOF
#cloud-config
manage_etc_hosts: "localhost"
+write_files:
+ - path: /etc/trove/controller.conf
+ content: |
+ CONTROLLER=${SERVICE_HOST}
EOF
+
+ # NOTE(lxkong): Remove this when we support common cloud-init file for all datastores.
+ for datastore in "mysql" "mariadb"
+ do
+ sudo cp ${common_cloudinit} /etc/trove/cloudinit/${datastore}.cloudinit
+ done
}
# install_trove() - Collect source and prepare
@@ -482,15 +493,6 @@ function create_guest_image {
$TROVE_MANAGE db_load_datastore_config_parameters "$TROVE_DATASTORE_TYPE" "$TROVE_DATASTORE_VERSION" \
$DEST/trove/trove/templates/$TROVE_DATASTORE_TYPE/validation-rules.json
fi
-
- # To avoid 'Connection timed out' error of sudo command inside the guest agent.
- CLOUDINIT_PATH=/etc/trove/cloudinit/${TROVE_DATASTORE_TYPE}.cloudinit
- sudo mkdir -p $(dirname "$CLOUDINIT_PATH")
- sudo touch "$CLOUDINIT_PATH"
- sudo tee $CLOUDINIT_PATH >/dev/null <<'EOF'
-#cloud-config
-manage_etc_hosts: "localhost"
-EOF
}
# Set up Trove management network and make configuration change.