Skip to content

Commit f3cd94a

Browse files
authored
Merge pull request #696 from FlorentinD/wrong-db-type-ci
Improve ci script logging + Comment on catching 404
2 parents 5ec8bef + 8c6b67f commit f3cd94a

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

graphdatascience/session/dedicated_sessions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def list(self) -> List[SessionInfo]:
9696
try:
9797
sessions.extend(self._aura_api.list_sessions(db.id))
9898
except AuraApiError as e:
99-
# ignore 404 errors when listing sessions as it could mean paused sessions or deleted sessions
99+
# ignore 404 errors when listing sessions
100+
# it could mean paused sessions or deleted sessions (or an invalid instance type)
100101
if e.status_code != 404:
101102
raise e
102103

@@ -107,7 +108,8 @@ def _find_existing_session(self, session_name: str, dbid: str) -> Optional[Sessi
107108
try:
108109
matched_sessions = [s for s in self._aura_api.list_sessions(dbid) if s.name == session_name]
109110
except AuraApiError as e:
110-
# ignore 404 errors when listing sessions as it could mean paused sessions or deleted sessions
111+
# ignore 404 errors when listing sessions
112+
# it could mean paused sessions or deleted sessions (or an invalid instance type)
111113
if e.status_code != 404:
112114
raise e
113115

scripts/ci/run_targeting_aura_sessions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77

88
from aura_api_ci import AuraApiCI
99

10-
logging.basicConfig(level=logging.INFO)
10+
logging.basicConfig(level=logging.DEBUG)
1111

1212

1313
def main() -> None:
1414
client_id = os.environ["AURA_API_CLIENT_ID"]
1515
client_secret = os.environ["AURA_API_CLIENT_SECRET"]
16-
tenant_id = os.environ.get("TENANT_ID")
16+
tenant_id = os.environ.get("AURA_API_TENANT_ID")
1717
aura_api = AuraApiCI(client_id=client_id, client_secret=client_secret, tenant_id=tenant_id)
1818

1919
MAX_INT = 1000000
2020
instance_name = f"ci-build-{sys.argv[1]}" if len(sys.argv) > 1 else "ci-instance-" + str(rd.randint(0, MAX_INT))
2121

2222
create_result = aura_api.create_instance(instance_name, memory="1GB", type="professional-db")
2323
instance_id = create_result["id"]
24-
logging.info("Creation of database accepted")
24+
logging.info(f"Creation of database with id '{instance_id}'")
2525

2626
try:
2727
aura_api.check_running(instance_id)
28-
logging.info("Database %s up and running", instance_id)
28+
logging.info("Database up and running")
2929

3030
uri = create_result["connection_url"]
3131
username = create_result["username"]

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ commands =
7272
passenv =
7373
AURA_API_CLIENT_ID
7474
AURA_API_CLIENT_SECRET
75+
AURA_API_TENANT_ID
7576
AURA_ENV
7677
AURA_DB_ADDRESS
7778
AURA_DB_USER
@@ -80,4 +81,4 @@ passenv =
8081
deps =
8182
-r {toxinidir}/requirements/dev/notebook-aura-ci.txt
8283
commands =
83-
python ./scripts/run_notebooks.py sessions
84+
python ./scripts/run_notebooks.py sessions

0 commit comments

Comments
 (0)