Skip to content

Commit

Permalink
Changing MLFLOW_URI to MLFLOW_TRACKING_URI, and baseuri to `api…
Browse files Browse the repository at this point in the history
…root`
  • Loading branch information
pebeto committed May 17, 2024
1 parent 9b81887 commit e205bcc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/types.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Logger(baseuri; experiment_name="MLJ experiment",
Logger(apiroot; experiment_name="MLJ experiment",
artifact_location=nothing)
A wrapper around a MLFlow service, with an experiment name and an artifact
Expand All @@ -9,8 +9,8 @@ multiple methods in MLJBase.
To use this logger, you need to have a MLFlow server running. For more
information, see [MLFlow documentation](https://www.mlflow.org/docs/latest/quickstart.html).
Depending on the MLFlow server configuration, the `baseuri` can be a local
server or a remote server. The `experiment_name` is used to identify the
Depending on the MLFlow server configuration, the `apiroot` can be a local
or a remote server API. The `experiment_name` is used to identify the
experiment in the MLFlow server. If the experiment does not exist, it will be
created with the default name "MLJ experiment". The `artifact_location` is
used to store the artifacts of the experiment. If not provided, a default
Expand All @@ -29,15 +29,15 @@ struct Logger
experiment_name::String
artifact_location::Union{String,Nothing}
end
function Logger(baseuri; experiment_name="MLJ experiment",
function Logger(apiroot; experiment_name="MLJ experiment",
artifact_location=nothing, verbosity=1)
service = MLFlow(baseuri)
service = MLFlow(apiroot)

Logger(service, verbosity, experiment_name, artifact_location)
end
function show(io::IO, logger::MLJFlow.Logger)
print(io,
"MLFLowLogger(\"$(logger.service.baseuri)\",\n" *
"MLFLowLogger(\"$(logger.service.apiroot)\",\n" *
" experiment_name=\"$(logger.experiment_name)\",\n" *
" artifact_location=\"$(logger.artifact_location)\",\n" *
") using MLFlow API version $(logger.service.apiversion)"
Expand Down
2 changes: 1 addition & 1 deletion test/base.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@testset verbose = true "base" begin
logger = MLJFlow.Logger(ENV["MLFLOW_URI"];
logger = MLJFlow.Logger(ENV["MLFLOW_TRACKING_URI"];
experiment_name="MLJFlow tests",
artifact_location="/tmp/mlj-test")

Expand Down
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ using StatisticalMeasures
# To run this tests, you need to set the URI of your MLFlow server. By default,
# you can set:
#
# ENV["MLFLOW_URI"] = "http://localhost:5000"
# ENV["MLFLOW_TRACKING_URI"] = "http://localhost:5000/api"
#
# For more information, see https://mlflow.org/docs/latest/quickstart.html#view-mlflow-runs-and-experiments
if ~haskey(ENV, "MLFLOW_URI")
error("WARNING: MLFLOW_URI is not set. To run this tests, you need to set the URI of your MLFlow server")
if ~haskey(ENV, "MLFLOW_TRACKING_URI")
error("WARNING: MLFLOW_TRACKING_URI is not set. To run this tests, you need to set the URI of your MLFlow server API")
end

include("base.jl")
Expand Down
4 changes: 2 additions & 2 deletions test/types.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@testset "types" begin
logger = MLJFlow.Logger(ENV["MLFLOW_URI"])
logger = MLJFlow.Logger(ENV["MLFLOW_TRACKING_URI"])

@test typeof(logger) == MLJFlow.Logger
@test typeof(logger.service) == MLFlow

io = IOBuffer()
show(io, logger)
test_string = "MLFLowLogger(\"$(logger.service.baseuri)\",\n" *
test_string = "MLFLowLogger(\"$(logger.service.apiroot)\",\n" *
" experiment_name=\"$(logger.experiment_name)\",\n" *
" artifact_location=\"$(logger.artifact_location)\",\n" *
") using MLFlow API version $(logger.service.apiversion)"
Expand Down

0 comments on commit e205bcc

Please sign in to comment.