Skip to content

feat: Add ability to configure host IP during tesseract serve#185

Merged
dionhaefner merged 7 commits into
mainfrom
dion/configure-host
Jun 4, 2025
Merged

feat: Add ability to configure host IP during tesseract serve#185
dionhaefner merged 7 commits into
mainfrom
dion/configure-host

Conversation

@dionhaefner

@dionhaefner dionhaefner commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

Relevant issue or PR

n/a

Description of changes

  • Serve on 127.0.0.1 (localhost) by default when using tesseract-runtime serve, to avoid accidentally exposing Tesseracts to the local or public internet when using tesseract-runtime directly.
  • Add capability to configure host IP when serving containers via tesseract serve.

To-do:

  • Also expose in Python API
  • Add tests

Testing done

CI + manual

@codecov

codecov Bot commented Jun 3, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 72.41379% with 8 lines in your changes missing coverage. Please review.

Project coverage is 76.21%. Comparing base (2231b34) to head (c6d09ea).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tesseract_core/sdk/cli.py 57.14% 3 Missing ⚠️
tesseract_core/sdk/docker_client.py 66.66% 1 Missing and 2 partials ⚠️
tesseract_core/sdk/engine.py 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #185      +/-   ##
==========================================
- Coverage   76.25%   76.21%   -0.04%     
==========================================
  Files          28       28              
  Lines        3062     3078      +16     
  Branches      476      480       +4     
==========================================
+ Hits         2335     2346      +11     
- Misses        517      519       +2     
- Partials      210      213       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpbrodrick89

jpbrodrick89 commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

This looks good so far, and I think an explicit design is better than implicit. However, I did want to highlight the possibility of having this all configured by -p, e.g -p 127.0.0.1:8000. This could seamlessly pass to docker executable but would probably require some string manipulation to determine whether the host had been manually set and to then prepend 127.0.0.1 if not.

@dionhaefner

Copy link
Copy Markdown
Contributor Author

Yes let's not overload the port argument any more than it already is :)

@dionhaefner
dionhaefner marked this pull request as ready for review June 3, 2025 21:24

@xalelax xalelax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread tesseract_core/sdk/cli.py
Comment thread tesseract_core/sdk/docker_client.py
@dionhaefner
dionhaefner enabled auto-merge (squash) June 4, 2025 10:13
@dionhaefner
dionhaefner merged commit 994afb2 into main Jun 4, 2025
35 checks passed
@dionhaefner
dionhaefner deleted the dion/configure-host branch June 4, 2025 12:29
@pasteurlabs pasteurlabs locked and limited conversation to collaborators Jun 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants