autoverse-cli 0.22.0__py3-none-any.whl → 0.23.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoverse-cli
3
- Version: 0.22.0
3
+ Version: 0.23.2
4
4
  Summary: The Autoverse CLI
5
5
  Author-email: Dan Kamrath <dan.kamrath@autonomalabs.com>
6
6
  License: # End-User License Agreement (EULA) of the Autonoma AutoVerse CLI
@@ -1,20 +1,20 @@
1
- autoverse_cli-0.22.0.dist-info/licenses/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
1
+ autoverse_cli-0.23.2.dist-info/licenses/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
2
2
  avrs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- avrs/app_version.py,sha256=w5X_Dh9-yJyZBOHdImpW4D66WqjgZI5bnaFJ3M988KQ,856
3
+ avrs/app_version.py,sha256=cw08VU3BKOIk8N48m-1-F_Zqc0UaUH8XIiIGxwzE7qg,856
4
4
  avrs/argparse_help.py,sha256=EoEaohGXZXqJvs1dFEzbo9vh47CYdHdSY2Im2Ps2iFo,945
5
5
  avrs/avrs.py,sha256=L9qjMWCYUBOyplMg1Mx0s6ZYDQzAciYCr8Qbgtw5b1U,4892
6
6
  avrs/can_tool.py,sha256=IBoctKobBJ3wCq4ZdtuXuXH4AMEUxazCfYT6YP0Luw8,7161
7
7
  avrs/can_tool_util.py,sha256=G3q21dTGMLc09SDq_RieoW7kSn-kXPkXxPDjavPh4hQ,7710
8
8
  avrs/cfg.py,sha256=kMn08Z4Ms1PAu2-U1QI8weEJeIVEppP4A4_tFfwnjtg,2924
9
- avrs/launcher.py,sha256=1xew4ZPZtbKE2364ZRlT-TnWabRVKBESk8ZKSpxs8rU,9539
10
- avrs/launcher_util.py,sha256=oWsFBqqDgaLBvqe9m0ahTviXLZvOHKP_8mebKYzQF3Q,5384
9
+ avrs/launcher.py,sha256=ejuWlm0c6yQivFHVb5L8M68rq9rS4M9rZa6l0E5Wu64,9536
10
+ avrs/launcher_util.py,sha256=_0RjCcDfS_R8K5MFQJwrGaCzfPfeQY7ESvCdvtPbFyo,6358
11
11
  avrs/race_cloud.py,sha256=0m7BdclKhTrqdAA2kLIobwfoYA8X_PRDCFWoizHtPIQ,20124
12
12
  avrs/race_cloud_bridge_can.py,sha256=K3is7GFzWo2KBojr6V65kz138UfkVFXXofVxSAziArY,2888
13
- avrs/race_cloud_cfg_util.py,sha256=EsluoCgOqtyrG-hH_RIb9tPbIA6ayBRS_idqYD3Yk6s,12118
13
+ avrs/race_cloud_cfg_util.py,sha256=u_wnMJgrHlidx8S7zF4jAoTRkl2gQTSgcXliGwsvG8E,12050
14
14
  avrs/race_cloud_fwd_api.py,sha256=jB4kt6Shu9Pj96WPVjK790PZjucYxmuHjjVKczQfyZI,1620
15
15
  avrs/race_cloud_util.py,sha256=g1gCxmK-8n32aNj0NWEiZr79s1rB0EYbGmNLabsIW0U,14297
16
16
  avrs/simconfig.py,sha256=UZc4FrxVHUkk2e9IglSpuojXkaL_nPrJW7trbEGgOOo,2907
17
- avrs/simconfig_util.py,sha256=2tNh-pU-Mbmc7SnGdRQ4UN43YAH0cpnyeCVTh1VHGHc,4922
17
+ avrs/simconfig_util.py,sha256=Ds1lO3X8s5RAXQuc6KDSdH9N9MhdbVeE0kgMnNStIDM,5934
18
18
  avrs/tests.py,sha256=3JeYBjn0tRqHXERDROfzmYuW1KXeCcKur5Bw-EIegto,153
19
19
  avrs/util.py,sha256=SB8Jgsh8IpFdpy3pWPuEoYExLed9XimEAMtYn4gU42g,301
20
20
  avrs/requests/change_camera.py,sha256=p7S5C2KtSBuknj4-0jkAJtTQcdlSQ5Mwm0lmZIk3QTI,857
@@ -42,8 +42,8 @@ avrs/requests/toggle_hud.py,sha256=sV5t5QZc4uvRihPVk8jEKZiQNsyF9tsUwq5b4jjZplc,3
42
42
  avrs/requests/vd.py,sha256=Rd0mCc89m2yKjftVf0cMHMFbJG4iFd09KzrI-DsCLgI,2606
43
43
  avrs/requests/vehicle_input.py,sha256=R1b1xkRtOBkwyU6OSN4bWVlYsIUroZG0WKbYbc4pEH8,729
44
44
  avrs/requests/vehicle_replay.py,sha256=7HPfVLjSLNbOyzU77Bz29qpHqRsMUAIWvnwvnNiw2nk,15026
45
- autoverse_cli-0.22.0.dist-info/METADATA,sha256=THzl7ol5bxB4Z7wOs8OHMZYlnCjWGEGABsBuWylPJPE,3364
46
- autoverse_cli-0.22.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
- autoverse_cli-0.22.0.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
48
- autoverse_cli-0.22.0.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
49
- autoverse_cli-0.22.0.dist-info/RECORD,,
45
+ autoverse_cli-0.23.2.dist-info/METADATA,sha256=Ea0bwsSjIaizcL857zOxTxPgFS3wB5RQHhcxDfNjy3E,3364
46
+ autoverse_cli-0.23.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
+ autoverse_cli-0.23.2.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
48
+ autoverse_cli-0.23.2.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
49
+ autoverse_cli-0.23.2.dist-info/RECORD,,
avrs/app_version.py CHANGED
@@ -2,7 +2,7 @@ import http.client
2
2
  import json
3
3
 
4
4
  def get_app_version():
5
- return '0.22.0'
5
+ return '0.23.2'
6
6
 
7
7
  def check_app_is_latest():
8
8
  pass
avrs/launcher.py CHANGED
@@ -91,7 +91,7 @@ class AvrsLauncher:
91
91
 
92
92
  def get_variants(self, args):
93
93
  if 'license' not in self.cfg:
94
- status += 'no license has been registered\n'
94
+ print('no license has been registered\n')
95
95
  return
96
96
 
97
97
  (dl_keys_ok, dl_keys_status, self.cfg) = try_get_launcher_download_keys(self.cfg)
avrs/launcher_util.py CHANGED
@@ -51,18 +51,41 @@ def try_get_launcher_download_keys(cfg):
51
51
  }).encode('utf-8')
52
52
  connection.request('POST', '/test', body, headers)
53
53
  response = connection.getresponse()
54
- if response.status != 200:
55
- status = 'response had status code {}'.format(response)
56
- return (False, status, out_cfg)
57
- dlinfo = json.loads(json.loads(response.read().decode('utf-8'))['body'])
58
-
59
- out_cfg['dlkey_id'] = dlinfo['dlkey_id']
60
- out_cfg['dlkey'] = dlinfo['dlkey']
61
- out_cfg['variants'] = dlinfo['variants']
62
-
63
- # set available variants here as well
64
54
 
65
- return (True, status, out_cfg)
55
+ api_ok = False
56
+ api_status = ""
57
+
58
+ if response.status == 200:
59
+ res_full = json.loads(response.read().decode('utf-8'))
60
+ status += "primary api response: {}".format(res_full)
61
+ dlinfo = json.loads(res_full['body'])
62
+ code = res_full['statusCode']
63
+ if code == 200:
64
+ api_ok = True
65
+ for k, v in dlinfo.items():
66
+ out_cfg[k] = v
67
+
68
+ if not api_ok:
69
+ #try other api
70
+ alt_api_url = 'uu6fmbvrhk.execute-api.us-east-1.amazonaws.com'
71
+ connection = http.client.HTTPSConnection(alt_api_url)
72
+ connection.request('POST', '/test/alt', body, headers)
73
+ response = connection.getresponse()
74
+ if response.status == 200:
75
+ res_full = json.loads(response.read().decode('utf-8'))
76
+ status += "alt api response: {}".format(res_full)
77
+ dlinfo = json.loads(res_full.get('body', "{}"))
78
+ code = res_full['statusCode']
79
+ if code == 200:
80
+ api_ok = True
81
+ for k, v in dlinfo.items():
82
+ out_cfg[k] = v
83
+ else:
84
+ status += "primary and alt returned non 200"
85
+ else:
86
+ status += "primary and alt returned non 200"
87
+
88
+ return (api_ok, status, out_cfg)
66
89
 
67
90
  def has_launcher_download_keys(cfg):
68
91
  """
@@ -100,23 +123,25 @@ def get_launcher_build_info(cfg):
100
123
  """
101
124
  Contacts API to discover the current latest build version
102
125
  """
103
- status = ''
104
- db_resource = boto3.resource(
105
- 'dynamodb',
106
- 'us-east-1',
107
- aws_access_key_id=cfg['dlkey_id'],
108
- aws_secret_access_key=cfg['dlkey'])
109
126
 
110
- table = db_resource.Table('autoverse-ci-meta')
111
- item = table.get_item(Key={'package-name': 'autoverse'})
127
+ api_url = 'zn5boqqk60.execute-api.us-east-1.amazonaws.com'
128
+ connection = http.client.HTTPSConnection(api_url)
129
+ headers = {'Content-type': 'application/json'}
130
+ connection.request('POST', '/test', {}, headers)
131
+ response = connection.getresponse()
132
+
133
+ if response.status != 200:
134
+ return (False, "get build info api returned {}".format(response.status), "", "")
112
135
 
113
- if not 'Item' in item or 'prod' not in item['Item'] or 'staging' not in item['Item']:
114
- status = 'Unable to Retrieve Latest Version'
115
- return (False, status, '', '')
136
+ res_full = json.loads(response.read().decode('utf-8'))
137
+ info = json.loads(res_full['body'])
138
+ code = res_full['statusCode']
139
+ if code != 200:
140
+ return (False, "get build info api returned {}".format(code), "", "")
116
141
 
117
- latest_version = item['Item']['prod']
118
- staged_version = item.get('Item', {}).get('staging', latest_version)
119
- return (True, status, latest_version, staged_version)
142
+ latest_version = info['prod']
143
+ staged_version = info.get('staging', latest_version)
144
+ return (True, "ok", latest_version, staged_version)
120
145
 
121
146
  def download_simulator_archive(cfg, source_path, target_path):
122
147
  """
@@ -13,7 +13,8 @@ from avrs.simconfig_util import *
13
13
  # inside SimConfigFiles instead of doing it manually
14
14
  EXPECTED_ENV_NAMES = [
15
15
  "yas",
16
- "adrome"
16
+ "adrome",
17
+ "suzuka"
17
18
  ]
18
19
 
19
20
  def get_payload(cfg_object, payload_name):
@@ -24,7 +25,6 @@ def get_payload(cfg_object, payload_name):
24
25
 
25
26
  def clear_autospawns():
26
27
  logger = logging.getLogger('avrs')
27
- # also need to edit the yas_marina_env.json to have autospawn for this config
28
28
  sim_path = os.environ.get('AVRS_INSTALL_PATH',
29
29
  os.path.join(os.environ['HOME'], 'autoverse-linux'))
30
30
  sim_saved = os.path.join(sim_path, 'Linux', 'Autoverse', 'Saved')
avrs/simconfig_util.py CHANGED
@@ -1,15 +1,37 @@
1
1
  import os
2
2
  import json
3
+ import logging
3
4
 
4
5
  class SimConfigFiles():
5
6
  def __init__(self, saved_dir):
6
7
 
8
+ logger = logging.getLogger('avrs')
9
+
7
10
  self.required_files = {
8
11
  'main': os.path.join(saved_dir, 'simconfig.json'),
9
12
  'eav24': os.path.join(saved_dir, 'Objects', 'Eav24_default.json'),
10
13
  'yas': os.path.join(saved_dir, 'Environments', 'yasmarina_env.json'),
11
- 'adrome': os.path.join(saved_dir, 'Environments', 'autonodrome.json')
14
+ 'adrome': os.path.join(saved_dir, 'Environments', 'autonodrome.json'),
15
+ 'suzuka': os.path.join(saved_dir, "Environments", "Suzuka", "suzuka.json")
16
+ }
17
+
18
+ self.alt_paths = {
19
+ "main": [],
20
+ "eav24": [],
21
+ "yas": [os.path.join(saved_dir, 'Environments', "YasMarina", 'yasmarina_env.json')],
22
+ "adrome": [os.path.join(saved_dir, 'Environments', "Autonodrome", 'autonodrome.json')],
23
+ "suzuka": [os.path.join(saved_dir, "Environments", "Suzuka", "suzuka.json")]
12
24
  }
25
+
26
+ # support alternative paths for new directory structure, but retain backward compat
27
+ for k, v in self.required_files.items():
28
+ if not os.path.exists(v):
29
+ for alt_path in self.alt_paths.get(k, []):
30
+ if os.path.exists(alt_path):
31
+ logger.info("could not find file under {} but found under alt path {}".format(
32
+ v, alt_path))
33
+ self.required_files[k] = alt_path
34
+
13
35
  self.files = {}
14
36
 
15
37
  ok, status = self.validate()