def download_image(self, imgp, fname, version): self.log.info('Downloading the %s Ubuntu image.' % version) with pushd(imgp): url = 'https://cloud-images.ubuntu.com/releases/%s/release/%s' % ( version, fname) self.call('curl', '--remote-name', url)
def upload_image(self, imgp, fname): self.log.info('Uploading to OpenStack...') with pushd(imgp): self.call('openstack', 'image', 'create', '--container-format', 'bare', '--disk-format', 'qcow2', '--min-disk', 0, '--min-ram', 0, '--file', fname, fname)
def take_action(self, parsed_args): self.log.info('Building frontend.') with pushd(frontend_path(self.local_src), if_missing='Please run "aic frontend source" and retry.'): frontend_tgz = Path(self.local_images, 'frontend.tgz') with environment({'NODE_ENV': 'production'}): self.call('make', 'clean', 'all') self.call('tar', 'cfz', frontend_tgz, 'build') self.log.info('Build complete in %s', frontend_tgz)
def take_action(self, parsed_args): # Player self.log.info('Building Player binaries + images.') with pushd(player_path(self.local_src), if_missing='Please run "aic player source" and retry.'): self.call('make', 'docker-all') # player.camera self.log.info('Building player.camera binary + image.') with pushd(player_camera_path(self.local_src), if_missing='Please run "aic player source" and retry.'): self.call('make', 'docker-all') # Docker-compose images self.log.info('Building Player misc. Images.') with pushd(player_compose_path(self.local_src), if_missing='Please run "aic player source" and retry.'): self.call('make', 'clean', 'docker-images') with pushd(dslcc_path(self.local_src), if_missing='Please run "aic player source" and retry.'): self.call('make', 'clean', 'docker-images') with pushd(testcc_path(self.local_src), if_missing='Please run "aic player source" and retry.'): self.call('make', 'clean', 'docker-images') self.log.info('Saving docker images...') docker_images_tar = Path(self.local_images, 'docker-images.tar') self.call('docker', 'save', '-o', docker_images_tar.as_posix(), 'aic.adb', 'aic.audio', 'aic.avmdata', 'aic.camera', 'aic.dslcc', 'aic.ffserver', 'aic.prjdata', 'aic.sdl', 'aic.sensors', 'aic.testcc', 'aic.xorg') self.log.info('Build complete in %s', docker_images_tar)
def take_action(self, parsed_args): fbadb_path = Path(player_compose_path(self.local_src), 'fb-adb') target_adb = Path(player_compose_path(self.local_src), 'adb', 'fb-adb') with pushd(fbadb_path, if_missing='Please run "aic player source" and retry.'): self.call('docker', 'build', '-t', 'fb-adb', '.') proc = self.call('docker', 'run', '--rm', '-d', 'fb-adb', 'tail', '-f', '/dev/null', capture_out=True) container_id = proc['output'].strip() self.call( 'docker', 'cp', '{}:/home/developer/fb-adb/build/fb-adb'.format(container_id), target_adb)