Debian Codegraph @

infra/bots/assets/mesa_intel_driver_linux_22/create.py

raw
1 #!/usr/bin/env python
2 #
3 # Copyright 2022 Google LLC
4 #
5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file.
7
8
9 """Create the mesa driver."""
10
11
12 import argparse
13 import subprocess
14
15 MESA_VERSION = '22.1.3'
16
17 def create_asset(target_dir):
18 """Create the asset."""
19 cmd = [
20 'docker', 'build', '-t', 'mesa-driver-builder:latest',
21 './mesa_intel_driver_linux_22/mesa-driver-builder',
22 ]
23 print('Building container', cmd)
24 subprocess.check_output(cmd)
25
26 cmd = [
27 'docker', 'run', '--volume', '%s:/OUT' % target_dir,
28 '--env', 'MESA_VERSION=%s' % MESA_VERSION,
29 'mesa-driver-builder'
30 ]
31 print('Running container', cmd)
32 subprocess.check_output(cmd)
33
34
35 def main():
36 parser = argparse.ArgumentParser()
37 parser.add_argument('--target_dir', '-t', required=True)
38 args = parser.parse_args()
39 create_asset(args.target_dir)
40
41
42 if __name__ == '__main__':
43 main()