reasoning-deployment-service 0.3.9__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.

@@ -300,7 +300,6 @@ class ReasoningEngineDeploymentService:
300
300
  config = config['defaults']
301
301
  scopes = config['scopes']
302
302
  metadata = config['metadata']
303
- agent_folder = config['agent_folder']
304
303
  auth = config['auth']
305
304
  environment_variables = config['environment_variables']
306
305
 
@@ -768,7 +767,6 @@ class ReasoningEngineDeploymentService:
768
767
 
769
768
  return matches[0]
770
769
 
771
-
772
770
  def one_github_deployment_to_go(self):
773
771
  """
774
772
  CI-friendly deploy:
@@ -778,8 +776,17 @@ class ReasoningEngineDeploymentService:
778
776
  """
779
777
  self.info("Starting GitHub deployment...")
780
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
+
781
787
  # Ensure Vertex SDK calls have context for list/update
782
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})")
783
790
  vertexai.init(
784
791
  project=self._project_id,
785
792
  location=self._project_location,
@@ -789,44 +796,64 @@ class ReasoningEngineDeploymentService:
789
796
  # -----------------------------
790
797
  # 1) Reasoning Engine (create or update)
791
798
  # -----------------------------
799
+ self.info(f"[ENGINE] Resolving by display_name={self._reasoning_engine_name}")
792
800
  engine_rn = self.find_engine_by_name(self._reasoning_engine_name)
801
+ self.info(f"[ENGINE] find_engine_by_name -> {engine_rn}")
802
+
793
803
  if not engine_rn:
794
- self.info(f"Engine '{self._reasoning_engine_name}' not found. Creating...")
804
+ self.info(f"[ENGINE] '{self._reasoning_engine_name}' not found. Creating...")
795
805
  self.create_reasoning_engine()
796
- # read back the created id (or re-resolve by name as fallback)
797
- engine_rn = self._read_engine_deployment_record().get("reasoning_engine_id") or \
798
- self.find_engine_by_name(self._reasoning_engine_name)
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}")
799
810
  if not engine_rn:
800
- self.error("Engine creation did not yield a resource name.")
811
+ self.error("[ENGINE] Creation did not yield a resource name.")
801
812
  raise RuntimeError("Engine creation failed.")
802
813
  else:
803
- self.info(f"Engine '{self._reasoning_engine_name}' exists. Updating...")
814
+ self.info(f"[ENGINE] '{self._reasoning_engine_name}' exists. Updating...")
804
815
  self.update_reasoning_engine(engine_rn)
805
816
 
817
+ self.info(f"[ENGINE] final engine_rn={engine_rn}")
818
+
806
819
  # -----------------------------
807
820
  # 2) Authorization (create if missing; update scopes if changed)
808
821
  # -----------------------------
822
+ auth_full_name = None
809
823
  if self._authorization_id:
810
824
  want_scopes = set(self._required_scopes or [])
825
+ self.info(f"[AUTH] id={self._authorization_id} want_scopes={sorted(want_scopes)}")
811
826
  auth_full_name = self.find_authorization_by_id(self._authorization_id)
827
+ self.info(f"[AUTH] find_authorization_by_id -> {auth_full_name}")
812
828
 
813
829
  if not auth_full_name:
814
- self.info(f"Authorization '{self._authorization_id}' not found. Creating...")
830
+ self.info(f"[AUTH] '{self._authorization_id}' not found. Creating...")
815
831
  ok = self._create_authorization()
816
- if not ok:
817
- self.error("Authorization creation failed.")
818
- raise RuntimeError("Authorization creation failed.")
832
+ self.info(f"[AUTH] _create_authorization -> {ok}")
819
833
  auth_full_name = self.find_authorization_by_id(self._authorization_id)
820
- if not auth_full_name:
821
- self.error("Authorization creation did not resolve to a resource.")
822
- raise RuntimeError("Authorization creation failed to resolve.")
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.")
823
838
  else:
824
839
  # Compare scopes; patch if different
825
- r = self._http.get(f"{DISCOVERY_ENGINE_URL}/{auth_full_name}",
826
- headers=self._get_headers(), timeout=60)
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]}")
827
851
  r.raise_for_status()
852
+
828
853
  data = r.json() or {}
829
854
  existing_uri = (((data.get("serverSideOauth2") or {}).get("authorizationUri")) or "")
855
+ self.info(f"[AUTH] existing authorizationUri={existing_uri!r}")
856
+
830
857
  existing_scopes = set()
831
858
  if existing_uri:
832
859
  parsed = urlparse(existing_uri)
@@ -834,53 +861,95 @@ class ReasoningEngineDeploymentService:
834
861
  scope_str = (qs.get("scope", [""])[0] or "")
835
862
  existing_scopes = set(scope_str.split())
836
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
+
837
869
  if existing_scopes != want_scopes:
838
- self.info("Authorization scopes changed. Patching authorization...")
870
+ self.info("[AUTH] Scopes changed. Patching authorization...")
839
871
  new_auth_uri = self._build_authorization_uri(self._oauth_client_id, list(want_scopes))
840
872
  patch_payload = {
841
873
  "serverSideOauth2": {
842
874
  "clientId": self._oauth_client_id,
843
- "clientSecret": self._oauth_client_secret,
875
+ "clientSecret": "***" if self._oauth_client_secret else None,
844
876
  "authorizationUri": new_auth_uri,
845
877
  "tokenUri": "https://oauth2.googleapis.com/token",
846
878
  }
847
879
  }
848
- pr = self._http.patch(f"{DISCOVERY_ENGINE_URL}/{auth_full_name}",
849
- headers=self._get_headers(), json=patch_payload, timeout=60)
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]}")
850
894
  pr.raise_for_status()
851
- self.info("Authorization updated.")
895
+ self.info("[AUTH] Authorization updated.")
852
896
  else:
853
- self.info("Authorization scopes unchanged; no update needed.")
897
+ self.info("[AUTH] Scopes unchanged; no update needed.")
854
898
  else:
855
- self.info("No authorization_id configured; skipping authorization step.")
899
+ self.info("[AUTH] No authorization_id configured; skipping authorization step.")
856
900
 
857
901
  # -----------------------------
858
902
  # 3) Agent Space Agent (create or update by displayName under engine)
859
903
  # -----------------------------
904
+ self.info(f"[AGENT] Resolving by display_name={self._agent_space_name}")
860
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
+
861
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)}")
862
914
 
863
915
  if not existing_agent:
864
- self.info(f"Agent Space agent '{self._agent_space_name}' not found. Creating...")
916
+ self.info(f"[AGENT] '{self._agent_space_name}' not found. Creating...")
865
917
  create_url = self._get_agent_space_agent_url_new()
918
+ self.info(f"[AGENT] POST {create_url}")
866
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]}")
867
925
  if cr.status_code >= 400:
868
- # File-only details already handled elsewhere; surface concise error here
869
- self.error(f"Agent creation failed [{cr.status_code}].")
926
+ self.error(f"[AGENT] Creation failed [{cr.status_code}].")
870
927
  cr.raise_for_status()
871
- agent_name = (cr.json() or {}).get("name")
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}")
872
935
  if agent_name:
873
936
  self._write_engine_deployment({"agent_space_id": agent_name})
874
- self.info(f"Agent Space agent created: {agent_name}")
937
+ self.info(f"[AGENT] Created: {agent_name}")
875
938
  else:
876
- self.warning("Agent created but response missing name. Verify in console.")
939
+ self.warning("[AGENT] Created but response missing name. Verify in console.")
877
940
  else:
878
- self.info(f"Agent Space agent '{self._agent_space_name}' exists. Updating...")
941
+ self.info(f"[AGENT] '{self._agent_space_name}' exists. Updating...")
879
942
  patch_url = f"{DISCOVERY_ENGINE_URL}/{existing_agent['full_name']}"
943
+ self.info(f"[AGENT] PATCH {patch_url}")
880
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]}")
881
950
  if ur.status_code >= 400:
882
- self.error(f"Agent update failed [{ur.status_code}].")
951
+ self.error(f"[AGENT] Update failed [{ur.status_code}].")
883
952
  ur.raise_for_status()
884
- self.info("Agent Space agent updated.")
953
+ self.info("[AGENT] Agent Space agent updated.")
885
954
 
886
955
  self.info("GitHub deployment completed successfully.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reasoning-deployment-service
3
- Version: 0.3.9
3
+ Version: 0.4.1
4
4
  Summary: Deployment helper for Vertex AI Reasoning Engines & Agent Spaces
5
5
  Author-email: Sergio Estrada <sergio.estrada@accenture.com>
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
1
  reasoning_deployment_service/__init__.py,sha256=xDuKt9gGviQiTV6vXBdkBvygnlAOIrwnUjVaMGZy0L4,670
2
- reasoning_deployment_service/reasoning_deployment_service.py,sha256=ZSeT8nPdFEzQ8Op6JWitDIX6PAU-6h9kPocn9fs07Os,38261
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.3.9.dist-info/METADATA,sha256=AIO6lziDsw70NRFQeupLV0afwLk-44JbpY7KlBav6gw,5302
26
- reasoning_deployment_service-0.3.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- reasoning_deployment_service-0.3.9.dist-info/entry_points.txt,sha256=onGKjR5ONTtRv3aqEtK863iw9Ty1kLcjfZlsplkRZrA,84
28
- reasoning_deployment_service-0.3.9.dist-info/top_level.txt,sha256=GKuQS1xHUYLZbatw9DmcYdBxxLhWhhGkV4FmFxgKdp0,29
29
- reasoning_deployment_service-0.3.9.dist-info/RECORD,,
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,,