Esempio n. 1
0
    def start(self):
        output.step(self.name, 'Bootstrapping ...', debug=True)
        self.rpc.lock()
        env = self.environment

        self.remote_repository = self.rpc.ensure_repository(
            env.target_directory, env.update_method)
        self.remote_base = self.rpc.ensure_base(env.deployment_base)

        output.step(self.name, 'Updating repository ...', debug=True)
        env.repository.update(self)

        self.rpc.build_batou()

        # Now, replace the basic interpreter connection, with a "real" one
        # that has all our dependencies installed.
        self.connect(self.remote_base + '/batou appenv-python')

        # Reinit after reconnect ...
        self.rpc.lock()
        self.remote_repository = self.rpc.ensure_repository(
            env.target_directory, env.update_method)
        self.remote_base = self.rpc.ensure_base(env.deployment_base)

        # Since we reconnected, any state on the remote side has been lost,
        # so we need to set the target directory again (which we only can
        # know about locally)
        self.rpc.setup_output()

        self.rpc.setup_deployment(env.name, self.fqdn, env.overrides,
                                  env.deployment.timeout,
                                  env.deployment.platform)
Esempio n. 2
0
    def start(self):
        output.step(self.name, "Bootstrapping ...", debug=True)
        self.rpc.lock()
        env = self.environment

        self.remote_repository = self.rpc.ensure_repository(
            env.target_directory, env.update_method)
        self.remote_base = self.rpc.ensure_base(env.deployment_base)

        output.step(self.name, "Updating repository ...", debug=True)
        env.repository.update(self)

        self.rpc.build_batou()

        # Now, replace the basic interpreter connection, with a "real" one
        # that has all our dependencies installed.
        #
        # XXX this requires an interesting move of detecting which appenv
        # version we have available to make this backwards compatible.
        self.connect(self.remote_base + "/appenv python")

        # Reinit after reconnect ...
        self.rpc.lock()
        self.remote_repository = self.rpc.ensure_repository(
            env.target_directory, env.update_method)
        self.remote_base = self.rpc.ensure_base(env.deployment_base)

        # Since we reconnected, any state on the remote side has been lost,
        # so we need to set the target directory again (which we only can
        # know about locally)
        self.rpc.setup_output(output.enable_debug)

        self.rpc.setup_deployment(
            env.name,
            self.name,
            env.overrides,
            env.secret_files,
            env.secret_data,
            env._host_data(),
            env.timeout,
            env.platform,
            {
                key: os.environ.get(key)
                for key in REMOTE_OS_ENV_KEYS if os.environ.get(key)
            },
        )