Skip to content

Commit

Permalink
Reverting from MLFLOW_API_URI to MLFLOW_TRACKING_URI, allowing co…
Browse files Browse the repository at this point in the history
…mpatibility with `mlflow` ENV standard
  • Loading branch information
pebeto committed May 17, 2024
1 parent b98cb57 commit fecf87a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
MLFLOW_API_URI: "http://localhost:5000/api"
MLFLOW_TRACKING_URI: "http://localhost:5000/api"
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions src/types/mlflow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Default is `false`, using the REST API endpoint.
# Constructors
- `MLFlow(apiroot; apiversion=2.0,headers=Dict())`
- `MLFlow()` - defaults to `MLFlow(ENV["MLFLOW_API_URI"])` or `MLFlow("http://localhost:5000")`
- `MLFlow()` - defaults to `MLFlow(ENV["MLFLOW_TRACKING_URI"])` or `MLFlow("http://localhost:5000/api")`
# Examples
Expand All @@ -34,8 +34,8 @@ end
MLFlow(apiroot; apiversion=2.0, headers=Dict()) = MLFlow(apiroot, apiversion, headers)
function MLFlow()
apiroot = "http://localhost:5000/api"
if haskey(ENV, "MLFLOW_API_URI")
apiroot = ENV["MLFLOW_API_URI"]
if haskey(ENV, "MLFLOW_TRACKING_URI")
apiroot = ENV["MLFLOW_TRACKING_URI"]
end
return MLFlow(apiroot)
end
Expand Down
2 changes: 1 addition & 1 deletion test/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function mlflow_server_is_running(mlf::MLFlow)
end

# creates an instance of mlf
# skips test if mlflow is not available on default location, ENV["MLFLOW_API_URI"]
# skips test if mlflow is not available on default location, ENV["MLFLOW_TRACKING_URI"]
macro ensuremlf()
e = quote
mlf = MLFlow()
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if ~haskey(ENV, "MLFLOW_API_URI")
error("WARNING: MLFLOW_API_URI is not set. To run this tests, you need to set the URI of your MLFlow server API")
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
2 changes: 1 addition & 1 deletion test/test_functional.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testset "MLFlow" begin
mlf = MLFlow()
@test mlf.apiroot == ENV["MLFLOW_API_URI"]
@test mlf.apiroot == ENV["MLFLOW_TRACKING_URI"]
@test mlf.apiversion == 2.0
@test mlf.headers == Dict()
mlf = MLFlow("https://localhost:5001/api", apiversion=3.0)
Expand Down

0 comments on commit fecf87a

Please sign in to comment.