diff options
author | Lingxian Kong <anlin.kong@gmail.com> | 2020-04-07 10:52:16 +1200 |
---|---|---|
committer | Lingxian Kong <anlin.kong@gmail.com> | 2020-05-27 10:31:50 +1200 |
commit | aa1d4d224674f44d9cd882eddb2537907adf5382 (patch) | |
tree | b9baf26bfb4b15497696d020fea41364bd0576c8 /trove/cmd | |
parent | 523d66e8fd5d29be8dbae9aa79c5348d3dce8c64 (diff) | |
download | trove-aa1d4d224674f44d9cd882eddb2537907adf5382.tar.gz |
Datastore containerization
Significant changes:
* Using docker image to install datastore.
* Datastore image is common to different datastores.
* Using backup docker image to do backup and restore.
* Support MariaDB replication
* Set most of the functional jobs as non-voting as nested
virtualization is not supported in CI.
Change-Id: Ia9c97a63a961eebc336b70d28dc77638144c1834
Diffstat (limited to 'trove/cmd')
-rw-r--r-- | trove/cmd/guest.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/trove/cmd/guest.py b/trove/cmd/guest.py index 6e12db57..ff86e4f3 100644 --- a/trove/cmd/guest.py +++ b/trove/cmd/guest.py @@ -12,7 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - import sys from oslo_config import cfg as openstack_cfg @@ -23,6 +22,7 @@ from trove.common import cfg from trove.common import debug_utils from trove.common.i18n import _ from trove.guestagent import api as guest_api +from trove.guestagent.common import operating_system CONF = cfg.CONF # The guest_id opt definition must match the one in common/cfg.py @@ -31,9 +31,18 @@ CONF.register_opts([openstack_cfg.StrOpt('guest_id', default=None, openstack_cfg.StrOpt('instance_rpc_encr_key', help=('Key (OpenSSL aes_cbc) for ' 'instance RPC encryption.'))]) +LOG = logging.getLogger(__name__) def main(): + log_levels = [ + 'docker=WARN', + ] + default_log_levels = logging.get_default_log_levels() + default_log_levels.extend(log_levels) + logging.set_defaults(default_log_levels=default_log_levels) + logging.register_options(CONF) + cfg.parse_args(sys.argv) logging.setup(CONF, None) debug_utils.setup() @@ -50,6 +59,11 @@ def main(): "was not injected into the guest or not read by guestagent")) raise RuntimeError(msg) + # Create user and group for running docker container. + LOG.info('Creating user and group for database service') + uid = cfg.get_configuration_property('database_service_uid') + operating_system.create_user('database', uid) + # rpc module must be loaded after decision about thread monkeypatching # because if thread module is not monkeypatched we can't use eventlet # executor from oslo_messaging library. |