def main(): log.msg("RUN main") # initialize app init() # initialize db log.msg("RUN db.init(app)") db.init(app) # this is probably pointless until there's a GUI of sorts app.jinja_env.auto_reload = True log.msg("RUN container.run") container.run(app=app, address="tcp:8080", debug=True)
def build_artifacts(self): args = { "remove": True, "privileged": True, "volumes": { os.environ.get('HYPRIOT_ARTIFACTS_VOLUME'): { "bind": "/builds" } }, "environment": { "TIMESTAMP_OUTPUT": "false", "FIRMWARE_REPO": self.firmware_repo }, "image": self.image } container.run(args)
def build_artifacts(self): args = { "remove": True, "privileged": True, "volumes": { os.environ.get('HYPRIOT_ARTIFACTS_VOLUME'): { "bind": "/builds" } }, "environment": { "TIMESTAMP_OUTPUT": "false", "RPI_KERNEL_BRANCH": self.kernel_branch, "RPI_KERNEL_REPO": self.kernel_repo }, "image": self.image } container.run(args)
def build_artifacts(self): args = { "remove": True, "privileged": True, "volumes": { os.environ.get('HYPRIOT_ARTIFACTS_VOLUME'): { "bind": "/workspace" } }, "image": self.image } if self.device == "rpi": args['command'] = "/builder/rpi/build.sh" elif self.device == "odroid": args['command'] = "/builder/odroid/build.sh" container.run(args)
def testBasic(self): os.chdir('/') commands = container.run(container_command='/bin/container_command', android_target='target_name', docker_bin='/bin/true', meta_dir='') self.assertEqual(commands, [ '/bin/true', 'run', '--mount', 'type=bind,source=/,target=/src', '--rm', '--tty', '--privileged', '--interactive', 'android-build', 'python', '-B', '/src/development/keystone/nsjail.py', '--android_target', 'target_name', '--chroot', '/', '--source_dir', '/src', '--user_id', str(os.getuid()), '--group_id', str(os.getgid()), '--command', '/bin/container_command' ])
def build_artifacts(self): root_fs_instance = RootFs(self.configs) blank_image_instance = BlankImage(self.configs) rpi_bootloader_instance = RpiBootloader(self.configs) rpi_kernel_instance = RpiKernel(self.configs) args = { "remove": True, "privileged": True, "volumes": { os.environ.get('HYPRIOT_ARTIFACTS_VOLUME'): { "bind": "/workspace" }, "/boot": { "bind": "/boot" }, "/lib/modules": { "bind": "/lib/modules" } }, "environment": { "FETCH_MISSING_ARTIFACTS": "false", "DOCKER_ENGINE_VERSION": self.docker_engine_version, "DOCKER_COMPOSE_VERSION": self.docker_compose_version, "DOCKER_MACHINE_VERSION": self.docker_machine_version, "KERNEL_VERSION": rpi_kernel_instance.get_kernel_version(), "BOOTLOADER_ARTIFACT": rpi_bootloader_instance.get_artifacts_names()[0], "RAW_IMAGE_ARTIFACT": blank_image_instance.get_artifacts_names()[0], "ROOT_FS_ARTIFACT": root_fs_instance.get_artifacts_names()[0], "KERNEL_ARTIFACT": rpi_kernel_instance.get_artifacts_names()[0], "VERSION": self.version }, "image": self.image } container.run(args)
def build_artifacts(self): args = { "remove": True, "privileged": True, "volumes": { os.environ.get('HYPRIOT_ARTIFACTS_VOLUME'): { "bind": "/workspace" } }, "environment": { "HYPRIOT_HOSTNAME": self.hostname, "HYPRIOT_GROUPNAME": self.groupname, "HYPRIOT_USERNAME": self.username, "HYPRIOT_PASSWORD": self.password, "HYPRIOT_OS_VERSION": self.version }, "image": self.image } for key in RootFs.target_properties[self.target]: args['environment'][key] = RootFs.target_properties[ self.target][key] container.run(args)
structlog.configure(processors=[ structlog.processors.StackInfoRenderer(), structlog.twisted.JSONRenderer() ], context_class=dict, logger_factory=twisted.LoggerFactory(), wrapper_class=twisted.BoundLogger, cache_logger_on_first_use=True) if __name__ == "__main__": args = docopt(__doc__, version="LinkLib Livereload 0.1") db.init(app) init_logging() init_blueprints([index, link, login_view, register, api, testpage]) init_login(app) if args['live']: app.debug = True server = Server(app.wsgi_app) server.watch('static/*') server.watch('templates/*') server.serve(liveport=8082, host='localhost', open_url_delay=0, debug=True) elif args['waitress']: serve(app, listen='*:8080') else: print("init container.py") container.run(app, ENDPOINT, DEBUG)
def main(): app.init() db.init(app.app) container.run(app.app, config.endpoint, config.debug)