9"""Create the mesa driver. This defers to a Docker container
10 with the build_mesa.sh script.
"""
16# TODO(dogben): In the future, it might be simpler to build the docker image as
17# part of this script so that we don't need to push it to the container repo.
18# Doing so would make this script more repeatable, since someone could
19# accidentally change the Docker image that "v2" points to.
20DOCKER_IMAGE = 'gcr.io/skia-public/mesa-driver-builder:v2'
21BUILD_SCRIPT = '/opt/build_mesa.sh'
22MESA_VERSION = '18.3.3'
25def create_asset(target_dir):
26 """Create the asset."""
28 'docker',
'run',
'--volume',
'%s:/OUT' % target_dir,
29 '--env',
'MESA_VERSION=%s' % MESA_VERSION,
30 DOCKER_IMAGE, BUILD_SCRIPT
32 print(
'Running docker cmd', cmd)
33 subprocess.check_output(cmd)
37 parser = argparse.ArgumentParser()
38 parser.add_argument(
'--target_dir',
'-t', required=
True)
39 args = parser.parse_args()
43if __name__ ==
'__main__':
def create_asset(target_dir)
def print(*args, **kwargs)