julep icon indicating copy to clipboard operation
julep copied to clipboard

refactor: introduce julep_common env + exceptions

Open creatorrr opened this issue 6 months ago • 1 comments
trafficstars

Summary

  • share init_env and compute_gunicorn_workers in new julep_common package
  • add JulepError and TooManyRequestsError exceptions
  • use shared utilities in agents-api and integrations service
  • copy shared package in Docker builds
  • update docker-bake and compose files

Testing

  • ruff check
  • ruff format

creatorrr avatar May 17 '25 05:05 creatorrr

CI Feedback 🧐

(Feedback updated until commit https://github.com/julep-ai/julep/commit/9c605d898ceb418a2ff2f0a226d3daa2b46ac7ed)

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: Test

Failed stage: Set up python and install dependencies [❌]

Failure summary:

The action failed during the Python package installation process in the agents-api directory. The
specific error occurred when trying to generate package metadata for agents-api==1.0.0. The failure
was caused by a relative path issue with the dependency julep-common. The error message indicates
that the system couldn't resolve the relative path ../julep_common specified in the dependencies.

Relevant error logs:
1:  ##[group]Operating System
2:  Ubuntu
...

965:  prune-cache: true
966:  ignore-nothing-to-cache: false
967:  ##[endgroup]
968:  Downloading uv from "https://github.com/astral-sh/uv/releases/download/0.7.5/uv-x86_64-unknown-linux-gnu.tar.gz" ...
969:  [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/a5037535-6208-4cb9-9e2b-bc6820da862a -f /home/runner/work/_temp/05a3c2b5-37f0-4c3f-812b-2bb75621c438
970:  Added /opt/hostedtoolcache/uv/0.7.5/x86_64 to the path
971:  Added /home/runner/.local/bin to the path
972:  Set UV_CACHE_DIR to /home/runner/work/_temp/setup-uv-cache
973:  Successfully installed uv version 0.7.5
974:  Searching files using cache dependency glob: **/uv.lock
975:  /home/runner/work/julep/julep/agents-api/uv.lock
976:  /home/runner/work/julep/julep/cli/uv.lock
977:  /home/runner/work/julep/julep/integrations-service/uv.lock
978:  Found 3 files to hash.
979:  Trying to restore uv cache from GitHub Actions cache with key: setup-uv-1-x86_64-unknown-linux-gnu-0.7.5-d92603d25acef1c08e643c37cc2475e5e190deb9690356b084828d60043a591f
980:  ##[warning]Failed to restore: Cache service responded with 422
981:  No GitHub Actions cache found for key: setup-uv-1-x86_64-unknown-linux-gnu-0.7.5-d92603d25acef1c08e643c37cc2475e5e190deb9690356b084828d60043a591f
...

1009:  Binaries available at /opt/hostedtoolcache/golang-migrate/migrate/latest/linux-x64
1010:  ##[group]Run cd agents-api
1011:  [36;1mcd agents-api[0m
1012:  [36;1muv python install[0m
1013:  [36;1muv sync --all-extras --dev[0m
1014:  shell: /usr/bin/bash -e {0}
1015:  env:
1016:  UV_CACHE_DIR: /home/runner/work/_temp/setup-uv-cache
1017:  ##[endgroup]
1018:  Downloading cpython-3.12.10-linux-x86_64-gnu (download) (20.3MiB)
1019:  Downloading cpython-3.12.10-linux-x86_64-gnu (download)
1020:  Installed Python 3.12.10 in 1.14s
1021:  + cpython-3.12.10-linux-x86_64-gnu
1022:  Using CPython 3.12.10
1023:  Creating virtual environment at: .venv
1024:  error: Failed to generate package metadata for `agents-api==1.0.0 @ virtual+.`
1025:  Caused by: Failed to parse metadata from built wheel
1026:  Caused by: relative path without a working directory: ../julep_common
1027:  julep-common@ file://../julep_common
1028:  ^^^^^^^^^^^^^^^^^^^^^^
1029:  ##[error]Process completed with exit code 2.
1030:  Post job cleanup.