Skip to content

Commit

Permalink
Merge branch 'main' into fix-tox-ini
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang committed Oct 5, 2024
2 parents 5f763b1 + 5d667d5 commit eaab9f1
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{".":"5.1.6","packages/phoenix-evals":"0.16.1","packages/phoenix-otel":"0.5.1"}
{".":"5.2.0","packages/phoenix-evals":"0.16.1","packages/phoenix-otel":"0.5.1"}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [5.2.0](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-v5.1.6...arize-phoenix-v5.2.0) (2024-10-05)


### Features

* phoenix cli ([#4870](https://github.com/Arize-ai/phoenix/issues/4870)) ([a8a8e3b](https://github.com/Arize-ai/phoenix/commit/a8a8e3b1aff2bfa6cb24f821d9b484ab024528a9))


### Bug Fixes

* create optional dependency group for umap-learn and fast-hdbscan ([#4868](https://github.com/Arize-ai/phoenix/issues/4868)) ([32c2bd8](https://github.com/Arize-ai/phoenix/commit/32c2bd8799e2eb0472b158f0007e7faf2aaa7278))

## [5.1.6](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-v5.1.5...arize-phoenix-v5.1.6) (2024-10-04)


Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ dependencies = [
]
dynamic = ["version"]

[project.scripts]
arize-phoenix = "phoenix.server.main:main"
phoenix = "phoenix.server.main:main"

[project.optional-dependencies]
dev = [
"gcsfs",
Expand Down
55 changes: 29 additions & 26 deletions src/phoenix/server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import codecs
import os
import sys
from argparse import ArgumentParser
from argparse import SUPPRESS, ArgumentParser
from importlib.metadata import version
from pathlib import Path
from threading import Thread
Expand Down Expand Up @@ -130,6 +130,9 @@ def _get_pid_file() -> Path:


def main() -> None:
initialize_settings()
setup_logging()

primary_inferences_name: str
reference_inferences_name: Optional[str]
trace_dataset_name: Optional[str] = None
Expand All @@ -138,23 +141,29 @@ def main() -> None:
reference_inferences: Optional[Inferences] = None
corpus_inferences: Optional[Inferences] = None

# automatically remove the pid file when the process is being gracefully terminated
atexit.register(_remove_pid_file)

parser = ArgumentParser()
parser.add_argument("--database-url", required=False)
parser.add_argument("--export_path")
parser.add_argument("--host", type=str, required=False)
parser.add_argument("--port", type=int, required=False)
parser.add_argument("--read-only", action="store_true", required=False) # Default is False
parser.add_argument("--no-internet", action="store_true")
parser.add_argument("--umap_params", type=str, required=False, default=DEFAULT_UMAP_PARAMS_STR)
parser.add_argument("--debug", action="store_true")
# Whether the app is running in a development environment
parser.add_argument("--dev", action="store_true")
parser.add_argument("--no-ui", action="store_true")

subparsers = parser.add_subparsers(dest="command", required=True)
parser = ArgumentParser(usage="phoenix serve", add_help=False)
parser.add_argument(
"-h",
"--help",
action="help",
help=SUPPRESS,
)
parser.add_argument("--database-url", required=False, help=SUPPRESS)
parser.add_argument("--export_path", help=SUPPRESS)
parser.add_argument("--host", type=str, required=False, help=SUPPRESS)
parser.add_argument("--port", type=int, required=False, help=SUPPRESS)
parser.add_argument("--read-only", action="store_true", required=False, help=SUPPRESS)
parser.add_argument("--no-internet", action="store_true", help=SUPPRESS)
parser.add_argument(
"--umap_params", type=str, required=False, default=DEFAULT_UMAP_PARAMS_STR, help=SUPPRESS
)
parser.add_argument("--debug", action="store_true", help=SUPPRESS)
parser.add_argument("--dev", action="store_true", help=SUPPRESS)
parser.add_argument("--no-ui", action="store_true", help=SUPPRESS)

subparsers = parser.add_subparsers(dest="command", required=True, help=SUPPRESS)

serve_parser = subparsers.add_parser("serve")
serve_parser.add_argument(
Expand Down Expand Up @@ -186,7 +195,7 @@ def main() -> None:
)
serve_parser.add_argument(
"--force-fixture-ingestion",
action="store_true", # default is False
action="store_true",
required=False,
help=(
"Whether or not to check the database age before adding the fixtures. "
Expand All @@ -196,7 +205,7 @@ def main() -> None:
)
serve_parser.add_argument(
"--scaffold-datasets",
action="store_true", # default is False
action="store_true",
required=False,
help=(
"Whether or not to add any datasets defined in "
Expand All @@ -213,15 +222,13 @@ def main() -> None:

fixture_parser = subparsers.add_parser("fixture")
fixture_parser.add_argument("fixture", type=str, choices=[fixture.name for fixture in FIXTURES])
fixture_parser.add_argument("--primary-only", action="store_true") # Default is False
fixture_parser.add_argument("--primary-only", action="store_true")

trace_fixture_parser = subparsers.add_parser("trace-fixture")
trace_fixture_parser.add_argument(
"fixture", type=str, choices=[fixture.name for fixture in TRACES_FIXTURES]
)
trace_fixture_parser.add_argument(
"--simulate-streaming", action="store_true"
) # Default is False
trace_fixture_parser.add_argument("--simulate-streaming", action="store_true")

demo_parser = subparsers.add_parser("demo")
demo_parser.add_argument("fixture", type=str, choices=[fixture.name for fixture in FIXTURES])
Expand Down Expand Up @@ -272,7 +279,6 @@ def main() -> None:
)
trace_dataset_name = args.trace_fixture
elif args.command == "serve":
# We use sets to avoid duplicates
if args.with_fixture:
primary_inferences, reference_inferences, corpus_inferences = get_inferences(
str(args.with_fixture),
Expand All @@ -293,7 +299,6 @@ def main() -> None:
scaffold_datasets = args.scaffold_datasets
host: Optional[str] = args.host or get_env_host()
if host == "::":
# TODO(dustin): why is this necessary? it's not type compliant
host = None

port = args.port or get_env_port()
Expand Down Expand Up @@ -416,6 +421,4 @@ def initialize_settings() -> None:


if __name__ == "__main__":
initialize_settings()
setup_logging()
main()
2 changes: 1 addition & 1 deletion src/phoenix/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.1.6"
__version__ = "5.2.0"

0 comments on commit eaab9f1

Please sign in to comment.