reasoning-deployment-service 0.4.0__py3-none-any.whl → 0.4.1__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.
Potentially problematic release.
This version of reasoning-deployment-service might be problematic. Click here for more details.
- reasoning_deployment_service/reasoning_deployment_service.py +102 -32
- {reasoning_deployment_service-0.4.0.dist-info → reasoning_deployment_service-0.4.1.dist-info}/METADATA +1 -1
- {reasoning_deployment_service-0.4.0.dist-info → reasoning_deployment_service-0.4.1.dist-info}/RECORD +6 -6
- {reasoning_deployment_service-0.4.0.dist-info → reasoning_deployment_service-0.4.1.dist-info}/WHEEL +0 -0
- {reasoning_deployment_service-0.4.0.dist-info → reasoning_deployment_service-0.4.1.dist-info}/entry_points.txt +0 -0
- {reasoning_deployment_service-0.4.0.dist-info → reasoning_deployment_service-0.4.1.dist-info}/top_level.txt +0 -0
|
@@ -767,7 +767,6 @@ class ReasoningEngineDeploymentService:
|
|
|
767
767
|
|
|
768
768
|
return matches[0]
|
|
769
769
|
|
|
770
|
-
|
|
771
770
|
def one_github_deployment_to_go(self):
|
|
772
771
|
"""
|
|
773
772
|
CI-friendly deploy:
|
|
@@ -777,8 +776,17 @@ class ReasoningEngineDeploymentService:
|
|
|
777
776
|
"""
|
|
778
777
|
self.info("Starting GitHub deployment...")
|
|
779
778
|
|
|
779
|
+
# Config snapshot
|
|
780
|
+
self.info(
|
|
781
|
+
f"[CFG] project_id={self._project_id} project_number={self._project_number} "
|
|
782
|
+
f"location={self._project_location} engine_name={self._reasoning_engine_name} "
|
|
783
|
+
f"agent_space_engine={self._agent_space_engine} auth_id={self._authorization_id} "
|
|
784
|
+
f"scopes={self._required_scopes} staging_bucket={self._staging_bucket}"
|
|
785
|
+
)
|
|
786
|
+
|
|
780
787
|
# Ensure Vertex SDK calls have context for list/update
|
|
781
788
|
self._cicd_deploy = True
|
|
789
|
+
self.info(f"[INIT] vertexai.init(project={self._project_id}, location={self._project_location}, staging_bucket={self._staging_bucket})")
|
|
782
790
|
vertexai.init(
|
|
783
791
|
project=self._project_id,
|
|
784
792
|
location=self._project_location,
|
|
@@ -788,44 +796,64 @@ class ReasoningEngineDeploymentService:
|
|
|
788
796
|
# -----------------------------
|
|
789
797
|
# 1) Reasoning Engine (create or update)
|
|
790
798
|
# -----------------------------
|
|
799
|
+
self.info(f"[ENGINE] Resolving by display_name={self._reasoning_engine_name}")
|
|
791
800
|
engine_rn = self.find_engine_by_name(self._reasoning_engine_name)
|
|
801
|
+
self.info(f"[ENGINE] find_engine_by_name -> {engine_rn}")
|
|
802
|
+
|
|
792
803
|
if not engine_rn:
|
|
793
|
-
self.info(f"
|
|
804
|
+
self.info(f"[ENGINE] '{self._reasoning_engine_name}' not found. Creating...")
|
|
794
805
|
self.create_reasoning_engine()
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
806
|
+
rec_after_create = self._read_engine_deployment_record()
|
|
807
|
+
self.info(f"[ENGINE] record after create -> {json.dumps(rec_after_create, indent=2)}")
|
|
808
|
+
engine_rn = rec_after_create.get("reasoning_engine_id") or self.find_engine_by_name(self._reasoning_engine_name)
|
|
809
|
+
self.info(f"[ENGINE] post-create resolution -> {engine_rn}")
|
|
798
810
|
if not engine_rn:
|
|
799
|
-
self.error("
|
|
811
|
+
self.error("[ENGINE] Creation did not yield a resource name.")
|
|
800
812
|
raise RuntimeError("Engine creation failed.")
|
|
801
813
|
else:
|
|
802
|
-
self.info(f"
|
|
814
|
+
self.info(f"[ENGINE] '{self._reasoning_engine_name}' exists. Updating...")
|
|
803
815
|
self.update_reasoning_engine(engine_rn)
|
|
804
816
|
|
|
817
|
+
self.info(f"[ENGINE] final engine_rn={engine_rn}")
|
|
818
|
+
|
|
805
819
|
# -----------------------------
|
|
806
820
|
# 2) Authorization (create if missing; update scopes if changed)
|
|
807
821
|
# -----------------------------
|
|
822
|
+
auth_full_name = None
|
|
808
823
|
if self._authorization_id:
|
|
809
824
|
want_scopes = set(self._required_scopes or [])
|
|
825
|
+
self.info(f"[AUTH] id={self._authorization_id} want_scopes={sorted(want_scopes)}")
|
|
810
826
|
auth_full_name = self.find_authorization_by_id(self._authorization_id)
|
|
827
|
+
self.info(f"[AUTH] find_authorization_by_id -> {auth_full_name}")
|
|
811
828
|
|
|
812
829
|
if not auth_full_name:
|
|
813
|
-
self.info(f"
|
|
830
|
+
self.info(f"[AUTH] '{self._authorization_id}' not found. Creating...")
|
|
814
831
|
ok = self._create_authorization()
|
|
815
|
-
|
|
816
|
-
self.error("Authorization creation failed.")
|
|
817
|
-
raise RuntimeError("Authorization creation failed.")
|
|
832
|
+
self.info(f"[AUTH] _create_authorization -> {ok}")
|
|
818
833
|
auth_full_name = self.find_authorization_by_id(self._authorization_id)
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
834
|
+
self.info(f"[AUTH] post-create resolve -> {auth_full_name}")
|
|
835
|
+
if not ok or not auth_full_name:
|
|
836
|
+
self.error("[AUTH] Creation failed or did not resolve.")
|
|
837
|
+
raise RuntimeError("Authorization creation failed.")
|
|
822
838
|
else:
|
|
823
839
|
# Compare scopes; patch if different
|
|
824
|
-
|
|
825
|
-
|
|
840
|
+
auth_url = f"{DISCOVERY_ENGINE_URL}/{auth_full_name}"
|
|
841
|
+
hdrs = self._get_headers().copy()
|
|
842
|
+
if "Authorization" in hdrs:
|
|
843
|
+
hdrs["Authorization"] = "Bearer ***"
|
|
844
|
+
self.info(f"[AUTH] GET {auth_url} headers={json.dumps(hdrs)}")
|
|
845
|
+
r = self._http.get(auth_url, headers=self._get_headers(), timeout=60)
|
|
846
|
+
self.info(f"[AUTH] GET status={r.status_code} ct={r.headers.get('content-type','')}")
|
|
847
|
+
try:
|
|
848
|
+
self.info(f"[AUTH] GET body={json.dumps(r.json(), indent=2)[:4000]}")
|
|
849
|
+
except Exception:
|
|
850
|
+
self.info(f"[AUTH] GET text={(r.text or '')[:1000]}")
|
|
826
851
|
r.raise_for_status()
|
|
852
|
+
|
|
827
853
|
data = r.json() or {}
|
|
828
854
|
existing_uri = (((data.get("serverSideOauth2") or {}).get("authorizationUri")) or "")
|
|
855
|
+
self.info(f"[AUTH] existing authorizationUri={existing_uri!r}")
|
|
856
|
+
|
|
829
857
|
existing_scopes = set()
|
|
830
858
|
if existing_uri:
|
|
831
859
|
parsed = urlparse(existing_uri)
|
|
@@ -833,53 +861,95 @@ class ReasoningEngineDeploymentService:
|
|
|
833
861
|
scope_str = (qs.get("scope", [""])[0] or "")
|
|
834
862
|
existing_scopes = set(scope_str.split())
|
|
835
863
|
|
|
864
|
+
self.info(
|
|
865
|
+
f"[AUTH] scopes existing={sorted(existing_scopes)} want={sorted(want_scopes)} "
|
|
866
|
+
f"missing={sorted(want_scopes - existing_scopes)} extra={sorted(existing_scopes - want_scopes)}"
|
|
867
|
+
)
|
|
868
|
+
|
|
836
869
|
if existing_scopes != want_scopes:
|
|
837
|
-
self.info("
|
|
870
|
+
self.info("[AUTH] Scopes changed. Patching authorization...")
|
|
838
871
|
new_auth_uri = self._build_authorization_uri(self._oauth_client_id, list(want_scopes))
|
|
839
872
|
patch_payload = {
|
|
840
873
|
"serverSideOauth2": {
|
|
841
874
|
"clientId": self._oauth_client_id,
|
|
842
|
-
"clientSecret": self._oauth_client_secret,
|
|
875
|
+
"clientSecret": "***" if self._oauth_client_secret else None,
|
|
843
876
|
"authorizationUri": new_auth_uri,
|
|
844
877
|
"tokenUri": "https://oauth2.googleapis.com/token",
|
|
845
878
|
}
|
|
846
879
|
}
|
|
847
|
-
|
|
848
|
-
|
|
880
|
+
# remove None to keep payload clean
|
|
881
|
+
if patch_payload["serverSideOauth2"]["clientSecret"] is None:
|
|
882
|
+
patch_payload["serverSideOauth2"].pop("clientSecret", None)
|
|
883
|
+
|
|
884
|
+
hdrs2 = self._get_headers().copy()
|
|
885
|
+
if "Authorization" in hdrs2:
|
|
886
|
+
hdrs2["Authorization"] = "Bearer ***"
|
|
887
|
+
self.info(f"[AUTH] PATCH {auth_url} headers={json.dumps(hdrs2)} payload={json.dumps(patch_payload, indent=2)}")
|
|
888
|
+
pr = self._http.patch(auth_url, headers=self._get_headers(), json=patch_payload, timeout=60)
|
|
889
|
+
self.info(f"[AUTH] PATCH status={pr.status_code} ct={pr.headers.get('content-type','')}")
|
|
890
|
+
try:
|
|
891
|
+
self.info(f"[AUTH] PATCH body={json.dumps(pr.json(), indent=2)[:4000]}")
|
|
892
|
+
except Exception:
|
|
893
|
+
self.info(f"[AUTH] PATCH text={(pr.text or '')[:1000]}")
|
|
849
894
|
pr.raise_for_status()
|
|
850
|
-
self.info("Authorization updated.")
|
|
895
|
+
self.info("[AUTH] Authorization updated.")
|
|
851
896
|
else:
|
|
852
|
-
self.info("
|
|
897
|
+
self.info("[AUTH] Scopes unchanged; no update needed.")
|
|
853
898
|
else:
|
|
854
|
-
self.info("No authorization_id configured; skipping authorization step.")
|
|
899
|
+
self.info("[AUTH] No authorization_id configured; skipping authorization step.")
|
|
855
900
|
|
|
856
901
|
# -----------------------------
|
|
857
902
|
# 3) Agent Space Agent (create or update by displayName under engine)
|
|
858
903
|
# -----------------------------
|
|
904
|
+
self.info(f"[AGENT] Resolving by display_name={self._agent_space_name}")
|
|
859
905
|
existing_agent = self.find_agent_space_agents_by_display(self._agent_space_name)
|
|
906
|
+
self.info(f"[AGENT] find_agent_space_agents_by_display -> {json.dumps(existing_agent, indent=2)}")
|
|
907
|
+
|
|
860
908
|
headers, payload = self._get_agent_space_payload(engine_rn)
|
|
909
|
+
headers_log = headers.copy()
|
|
910
|
+
if "Authorization" in headers_log:
|
|
911
|
+
headers_log["Authorization"] = "Bearer ***"
|
|
912
|
+
self.info(f"[AGENT] request headers={json.dumps(headers_log)}")
|
|
913
|
+
self.info(f"[AGENT] payload={json.dumps(payload, indent=2)}")
|
|
861
914
|
|
|
862
915
|
if not existing_agent:
|
|
863
|
-
self.info(f"
|
|
916
|
+
self.info(f"[AGENT] '{self._agent_space_name}' not found. Creating...")
|
|
864
917
|
create_url = self._get_agent_space_agent_url_new()
|
|
918
|
+
self.info(f"[AGENT] POST {create_url}")
|
|
865
919
|
cr = self._http.post(create_url, headers=headers, json=payload, timeout=90)
|
|
920
|
+
self.info(f"[AGENT] POST status={cr.status_code} ct={cr.headers.get('content-type','')}")
|
|
921
|
+
try:
|
|
922
|
+
self.info(f"[AGENT] POST body={json.dumps(cr.json(), indent=2)[:4000]}")
|
|
923
|
+
except Exception:
|
|
924
|
+
self.info(f"[AGENT] POST text={(cr.text or '')[:1000]}")
|
|
866
925
|
if cr.status_code >= 400:
|
|
867
|
-
|
|
868
|
-
self.error(f"Agent creation failed [{cr.status_code}].")
|
|
926
|
+
self.error(f"[AGENT] Creation failed [{cr.status_code}].")
|
|
869
927
|
cr.raise_for_status()
|
|
870
|
-
|
|
928
|
+
|
|
929
|
+
try:
|
|
930
|
+
j = cr.json() or {}
|
|
931
|
+
except Exception:
|
|
932
|
+
j = {}
|
|
933
|
+
agent_name = j.get("name")
|
|
934
|
+
self.info(f"[AGENT] create response name={agent_name}")
|
|
871
935
|
if agent_name:
|
|
872
936
|
self._write_engine_deployment({"agent_space_id": agent_name})
|
|
873
|
-
self.info(f"
|
|
937
|
+
self.info(f"[AGENT] Created: {agent_name}")
|
|
874
938
|
else:
|
|
875
|
-
self.warning("
|
|
939
|
+
self.warning("[AGENT] Created but response missing name. Verify in console.")
|
|
876
940
|
else:
|
|
877
|
-
self.info(f"
|
|
941
|
+
self.info(f"[AGENT] '{self._agent_space_name}' exists. Updating...")
|
|
878
942
|
patch_url = f"{DISCOVERY_ENGINE_URL}/{existing_agent['full_name']}"
|
|
943
|
+
self.info(f"[AGENT] PATCH {patch_url}")
|
|
879
944
|
ur = self._http.patch(patch_url, headers=headers, json=payload, timeout=90)
|
|
945
|
+
self.info(f"[AGENT] PATCH status={ur.status_code} ct={ur.headers.get('content-type','')}")
|
|
946
|
+
try:
|
|
947
|
+
self.info(f"[AGENT] PATCH body={json.dumps(ur.json(), indent=2)[:4000]}")
|
|
948
|
+
except Exception:
|
|
949
|
+
self.info(f"[AGENT] PATCH text={(ur.text or '')[:1000]}")
|
|
880
950
|
if ur.status_code >= 400:
|
|
881
|
-
self.error(f"
|
|
951
|
+
self.error(f"[AGENT] Update failed [{ur.status_code}].")
|
|
882
952
|
ur.raise_for_status()
|
|
883
|
-
self.info("Agent Space agent updated.")
|
|
953
|
+
self.info("[AGENT] Agent Space agent updated.")
|
|
884
954
|
|
|
885
955
|
self.info("GitHub deployment completed successfully.")
|
{reasoning_deployment_service-0.4.0.dist-info → reasoning_deployment_service-0.4.1.dist-info}/RECORD
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
reasoning_deployment_service/__init__.py,sha256=xDuKt9gGviQiTV6vXBdkBvygnlAOIrwnUjVaMGZy0L4,670
|
|
2
|
-
reasoning_deployment_service/reasoning_deployment_service.py,sha256=
|
|
2
|
+
reasoning_deployment_service/reasoning_deployment_service.py,sha256=wuTtlJ6rOYEW4hnYUw1kaR1awJVRIDXpGwMcVRbY31s,42240
|
|
3
3
|
reasoning_deployment_service/runner.py,sha256=Y_SPGp26eoXRr8Ql6ugRF7jNYq3OwaytFIivuym6ICA,5428
|
|
4
4
|
reasoning_deployment_service/cli_editor/__init__.py,sha256=bN8NPkw8riB92pj2lAwJZuEMOQIO_RRuge0ehnJTW1I,118
|
|
5
5
|
reasoning_deployment_service/cli_editor/api_client.py,sha256=Kzx5iYp0MmowggrSmPLE7I2kt1-8xvdGBAgde9a1gCY,33681
|
|
@@ -22,8 +22,8 @@ reasoning_deployment_service/gui_editor/src/ui/authorization_view.py,sha256=BoNc
|
|
|
22
22
|
reasoning_deployment_service/gui_editor/src/ui/reasoning_engine_view.py,sha256=tCvSPEf4dW0NRdAqfs3yT5Pa873gYeLzCMMIt2r2T4o,14644
|
|
23
23
|
reasoning_deployment_service/gui_editor/src/ui/reasoning_engines_view.py,sha256=IRjFlBbY98usAZa0roOonjvWQOsF6NBW4bBg_k8KnKI,7860
|
|
24
24
|
reasoning_deployment_service/gui_editor/src/ui/ui_components.py,sha256=HdQHy-oSZ3GobQ3FNdH7y_w3ANbFiuf2rMoflAmff0A,55366
|
|
25
|
-
reasoning_deployment_service-0.4.
|
|
26
|
-
reasoning_deployment_service-0.4.
|
|
27
|
-
reasoning_deployment_service-0.4.
|
|
28
|
-
reasoning_deployment_service-0.4.
|
|
29
|
-
reasoning_deployment_service-0.4.
|
|
25
|
+
reasoning_deployment_service-0.4.1.dist-info/METADATA,sha256=TMiDaxtYj99vHPgqntE2ZraheIG0Zp_rsCgo4tD9S3A,5302
|
|
26
|
+
reasoning_deployment_service-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
reasoning_deployment_service-0.4.1.dist-info/entry_points.txt,sha256=onGKjR5ONTtRv3aqEtK863iw9Ty1kLcjfZlsplkRZrA,84
|
|
28
|
+
reasoning_deployment_service-0.4.1.dist-info/top_level.txt,sha256=GKuQS1xHUYLZbatw9DmcYdBxxLhWhhGkV4FmFxgKdp0,29
|
|
29
|
+
reasoning_deployment_service-0.4.1.dist-info/RECORD,,
|
{reasoning_deployment_service-0.4.0.dist-info → reasoning_deployment_service-0.4.1.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|