diff --git a/mlflow/java/client/src/main/java/org/mlflow/tracking/MlflowClient.java b/mlflow/java/client/src/main/java/org/mlflow/tracking/MlflowClient.java index c035f7568034a..9cc79a8ceb6a5 100644 --- a/mlflow/java/client/src/main/java/org/mlflow/tracking/MlflowClient.java +++ b/mlflow/java/client/src/main/java/org/mlflow/tracking/MlflowClient.java @@ -86,7 +86,12 @@ public RunInfo createRun(String experimentId) { request.setStartTime(System.currentTimeMillis()); String username = System.getProperty("user.name"); if (username != null) { - request.setUserId(System.getProperty("user.name")); + RunTag.Builder tag = RunTag.newBuilder(); + tag.setKey("mlflow.user"); + tag.setValue(username); + request.addTags(tag.build()); + // userId is deprecated and will be removed in a future MLflow release + request.setUserId(username); } return createRun(request.build()); } @@ -432,7 +437,6 @@ public void logArtifacts(String runId, File localDir) { getArtifactRepository(runId).logArtifacts(localDir); } - /** * Uploads all files within the given local director an artifactPath within the run's root * artifact directory. For example, if /my/local/dir/ contains two files "file1" and "file2", then