Search in sources :

Example 1 with ArtifactException

use of ml.comet.experiment.artifact.ArtifactException in project comet-java-sdk by comet-ml.

the class LoggedArtifactImpl method download.

@Override
public DownloadedArtifact download(@NonNull Path folder, @NonNull AssetOverwriteStrategy overwriteStrategy) throws ArtifactException {
    // create downloaded artifact
    DownloadedArtifactImpl artifact = new DownloadedArtifactImpl(this);
    // read all assets associated with this artifact
    Collection<LoggedArtifactAsset> assets = this.getAssets();
    artifact.addLoggedAssets(assets);
    // check if there is assets to be downloaded
    int assetsToDownload = assets.stream().filter(loggedArtifactAsset -> !loggedArtifactAsset.isRemote()).mapToInt(value -> 1).sum();
    if (assetsToDownload == 0) {
        // show warning and return
        this.logger.warn(getString(ARTIFACT_HAS_NO_ASSETS_TO_DOWNLOAD, this.getFullName()));
        return artifact;
    }
    this.logger.info(getString(START_DOWNLOAD_ARTIFACT_ASSETS, assetsToDownload));
    // create parallel execution flow with errors delaying
    // allowing processing of items even if some of them failed
    Observable<ArtifactAsset> observable = Observable.fromStream(assets.stream()).filter(loggedArtifactAsset -> !loggedArtifactAsset.isRemote()).flatMap(loggedArtifactAsset -> Observable.just(loggedArtifactAsset).subscribeOn(// make it parallel on IO scheduler
    Schedulers.io()).map(asset -> asset.download(folder, overwriteStrategy)), true);
    // subscribe and wait for processing results
    CompletableFuture<Void> result = new CompletableFuture<>();
    observable.doOnNext(// update artifact asset
    artifact::updateAsset).ignoreElements().blockingSubscribe(() -> {
        logger.info(getString(ARTIFACT_ASSETS_DOWNLOAD_COMPLETED, this.getFullName(), assetsToDownload, folder));
        result.complete(null);
    }, throwable -> {
        logger.error(getString(FAILED_TO_DOWNLOAD_ARTIFACT_ASSETS, this.getFullName(), folder), throwable);
        result.completeExceptionally(throwable);
    });
    // check if any exception was raised during download and raise ArtifactException
    try {
        result.get();
    } catch (ExecutionException ex) {
        throw new ArtifactException(getString(FAILED_TO_DOWNLOAD_ARTIFACT_ASSETS, this.getFullName(), folder), ex.getCause());
    } catch (InterruptedException ex) {
        throw new ArtifactException(getString(FAILED_TO_DOWNLOAD_ARTIFACT_ASSETS, this.getFullName(), folder), ex);
    }
    return artifact;
}
Also used : Setter(lombok.Setter) Getter(lombok.Getter) ArtifactUtils(ml.comet.experiment.impl.utils.ArtifactUtils) LoggerFactory(org.slf4j.LoggerFactory) ArtifactDownloadException(ml.comet.experiment.artifact.ArtifactDownloadException) CompletableFuture(java.util.concurrent.CompletableFuture) ArtifactAssetImpl(ml.comet.experiment.impl.asset.ArtifactAssetImpl) ArtifactAssetNotFoundException(ml.comet.experiment.artifact.ArtifactAssetNotFoundException) LoggedArtifactAsset(ml.comet.experiment.artifact.LoggedArtifactAsset) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) READ(java.nio.file.StandardOpenOption.READ) Schedulers(io.reactivex.rxjava3.schedulers.Schedulers) LoggedArtifact(ml.comet.experiment.artifact.LoggedArtifact) HashSet(java.util.HashSet) AssetOverwriteStrategy(ml.comet.experiment.artifact.AssetOverwriteStrategy) ArtifactException(ml.comet.experiment.artifact.ArtifactException) Observable(io.reactivex.rxjava3.core.Observable) FAILED_TO_DOWNLOAD_ARTIFACT_ASSETS(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_DOWNLOAD_ARTIFACT_ASSETS) ToString(lombok.ToString) ARTIFACT_HAS_NO_ASSETS_TO_DOWNLOAD(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_HAS_NO_ASSETS_TO_DOWNLOAD) ArtifactAsset(ml.comet.experiment.artifact.ArtifactAsset) Path(java.nio.file.Path) LogMessages.getString(ml.comet.experiment.impl.resources.LogMessages.getString) OutputStream(java.io.OutputStream) DownloadedArtifact(ml.comet.experiment.artifact.DownloadedArtifact) Logger(org.slf4j.Logger) START_DOWNLOAD_ARTIFACT_ASSETS(ml.comet.experiment.impl.resources.LogMessages.START_DOWNLOAD_ARTIFACT_ASSETS) Files(java.nio.file.Files) NonNull(lombok.NonNull) Collection(java.util.Collection) Set(java.util.Set) FileUtils(org.apache.commons.io.FileUtils) IOException(java.io.IOException) Objects(java.util.Objects) ExecutionException(java.util.concurrent.ExecutionException) ARTIFACT_ASSETS_DOWNLOAD_COMPLETED(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_ASSETS_DOWNLOAD_COMPLETED) FileSystems(java.nio.file.FileSystems) InputStream(java.io.InputStream) FAILED_TO_FIND_ASSET_IN_ARTIFACT(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_FIND_ASSET_IN_ARTIFACT) LoggedArtifactAsset(ml.comet.experiment.artifact.LoggedArtifactAsset) ArtifactAsset(ml.comet.experiment.artifact.ArtifactAsset) ArtifactException(ml.comet.experiment.artifact.ArtifactException) LoggedArtifactAsset(ml.comet.experiment.artifact.LoggedArtifactAsset) CompletableFuture(java.util.concurrent.CompletableFuture) ExecutionException(java.util.concurrent.ExecutionException)

Example 2 with ArtifactException

use of ml.comet.experiment.artifact.ArtifactException in project comet-java-sdk by comet-ml.

the class BaseExperiment method upsertArtifact.

/**
 * Synchronously upsert provided Comet artifact into Comet backend.
 *
 * @param artifact the {@link ArtifactImpl} instance.
 * @return the {@link ArtifactEntry} describing saved artifact.
 * @throws ArtifactException if operation failed.
 */
ArtifactEntry upsertArtifact(@NonNull final Artifact artifact) throws ArtifactException {
    try {
        ArtifactImpl artifactImpl = (ArtifactImpl) artifact;
        ArtifactRequest request = createArtifactUpsertRequest(artifactImpl);
        ArtifactEntry response = validateAndGetExperimentKey().concatMap(experimentKey -> getRestApiClient().upsertArtifact(request, experimentKey)).blockingGet();
        if (StringUtils.isBlank(response.getPreviousVersion())) {
            getLogger().info(getString(ARTIFACT_VERSION_CREATED_WITHOUT_PREVIOUS, artifactImpl.getName(), response.getCurrentVersion()));
        } else {
            getLogger().info(getString(ARTIFACT_VERSION_CREATED_WITH_PREVIOUS, artifactImpl.getName(), response.getCurrentVersion(), response.getPreviousVersion()));
        }
        return response;
    } catch (Throwable e) {
        throw new ArtifactException(getString(FAILED_TO_UPSERT_ARTIFACT, artifact), e);
    }
}
Also used : Connection(ml.comet.experiment.impl.http.Connection) RestApiUtils.createArtifactUpsertRequest(ml.comet.experiment.impl.utils.RestApiUtils.createArtifactUpsertRequest) LoggedExperimentAsset(ml.comet.experiment.asset.LoggedExperimentAsset) EXPERIMENT_LIVE(ml.comet.experiment.impl.resources.LogMessages.EXPERIMENT_LIVE) ArtifactDownloadException(ml.comet.experiment.artifact.ArtifactDownloadException) LoggedArtifactAsset(ml.comet.experiment.artifact.LoggedArtifactAsset) RestApiUtils.createLogEndTimeRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogEndTimeRequest) StringUtils(org.apache.commons.lang3.StringUtils) ExperimentMetadata(ml.comet.experiment.model.ExperimentMetadata) FAILED_TO_DOWNLOAD_ASSET_FILE_ALREADY_EXISTS(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_DOWNLOAD_ASSET_FILE_ALREADY_EXISTS) SOURCE_CODE(ml.comet.experiment.impl.asset.AssetType.SOURCE_CODE) RestApiUtils.createGraphRequest(ml.comet.experiment.impl.utils.RestApiUtils.createGraphRequest) Duration(java.time.Duration) RestApiUtils.createLogMetricRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogMetricRequest) Path(java.nio.file.Path) SdkErrorCodes.artifactVersionStateNotClosed(ml.comet.experiment.impl.constants.SdkErrorCodes.artifactVersionStateNotClosed) FAILED_TO_DELETE_TEMPORARY_ASSET_FILE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_DELETE_TEMPORARY_ASSET_FILE) NonNull(lombok.NonNull) AssetUtils.createAssetFromData(ml.comet.experiment.impl.utils.AssetUtils.createAssetFromData) FAILED_TO_DOWNLOAD_ASSET(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_DOWNLOAD_ASSET) ARTIFACT_NOT_FOUND(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_NOT_FOUND) FAILED_TO_UPSERT_ARTIFACT(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_UPSERT_ARTIFACT) StandardCharsets(java.nio.charset.StandardCharsets) SdkErrorCodes.noArtifactFound(ml.comet.experiment.impl.constants.SdkErrorCodes.noArtifactFound) SdkErrorCodes.artifactVersionStateNotClosedErrorOccurred(ml.comet.experiment.impl.constants.SdkErrorCodes.artifactVersionStateNotClosedErrorOccurred) ARTIFACT_DOWNLOAD_FILE_OVERWRITTEN(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_DOWNLOAD_FILE_OVERWRITTEN) FAILED_TO_RESOLVE_ASSET_FILE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_RESOLVE_ASSET_FILE) Experiment(ml.comet.experiment.Experiment) DownloadArtifactAssetOptions(ml.comet.experiment.impl.asset.DownloadArtifactAssetOptions) Optional.empty(java.util.Optional.empty) Single(io.reactivex.rxjava3.core.Single) FAILED_TO_COMPARE_CONTENT_OF_FILES(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_COMPARE_CONTENT_OF_FILES) ArtifactNotFoundException(ml.comet.experiment.artifact.ArtifactNotFoundException) ArtifactRequest(ml.comet.experiment.impl.rest.ArtifactRequest) ArrayList(java.util.ArrayList) Artifact(ml.comet.experiment.artifact.Artifact) ARTIFACT_VERSION_CREATED_WITHOUT_PREVIOUS(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_VERSION_CREATED_WITHOUT_PREVIOUS) SystemUtils(ml.comet.experiment.impl.utils.SystemUtils) ALL(ml.comet.experiment.impl.asset.AssetType.ALL) FAILED_REGISTER_EXPERIMENT(ml.comet.experiment.impl.resources.LogMessages.FAILED_REGISTER_EXPERIMENT) GitMetaData(ml.comet.experiment.model.GitMetaData) RestApiResponse(ml.comet.experiment.impl.rest.RestApiResponse) Files(java.nio.file.Files) IOException(java.io.IOException) ExperimentContext(ml.comet.experiment.context.ExperimentContext) File(java.io.File) ARTIFACT_NOT_READY(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_NOT_READY) ExecutionException(java.util.concurrent.ExecutionException) EXPERIMENT_CREATED(ml.comet.experiment.impl.resources.LogMessages.EXPERIMENT_CREATED) Function(io.reactivex.rxjava3.functions.Function) CometGeneralException(ml.comet.experiment.exception.CometGeneralException) AssetUtils.createAssetFromFile(ml.comet.experiment.impl.utils.AssetUtils.createAssetFromFile) ArtifactVersionAssetResponse(ml.comet.experiment.impl.rest.ArtifactVersionAssetResponse) ExperimentStatusResponse(ml.comet.experiment.impl.rest.ExperimentStatusResponse) ArtifactEntry(ml.comet.experiment.impl.rest.ArtifactEntry) RestApiUtils.createLogParamRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogParamRequest) RestApiUtils.createLogStartTimeRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogStartTimeRequest) AssetImpl(ml.comet.experiment.impl.asset.AssetImpl) LoggedArtifact(ml.comet.experiment.artifact.LoggedArtifact) ArtifactException(ml.comet.experiment.artifact.ArtifactException) RestApiUtils.createLogLineRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogLineRequest) RestApiUtils.createGitMetadataRequest(ml.comet.experiment.impl.utils.RestApiUtils.createGitMetadataRequest) ARTIFACT_VERSION_CREATED_WITH_PREVIOUS(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_VERSION_CREATED_WITH_PREVIOUS) CreateExperimentRequest(ml.comet.experiment.impl.rest.CreateExperimentRequest) ArtifactAsset(ml.comet.experiment.artifact.ArtifactAsset) LogMessages.getString(ml.comet.experiment.impl.resources.LogMessages.getString) Collection(java.util.Collection) RestApiUtils.createLogHtmlRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogHtmlRequest) ArtifactVersionDetail(ml.comet.experiment.impl.rest.ArtifactVersionDetail) GET_ARTIFACT_FAILED_UNEXPECTEDLY(ml.comet.experiment.impl.resources.LogMessages.GET_ARTIFACT_FAILED_UNEXPECTEDLY) Value(ml.comet.experiment.model.Value) List(java.util.List) FAILED_TO_CREATE_TEMPORARY_ASSET_DOWNLOAD_FILE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_CREATE_TEMPORARY_ASSET_DOWNLOAD_FILE) FAILED_TO_READ_DOWNLOADED_FILE_SIZE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_READ_DOWNLOADED_FILE_SIZE) BiFunction(io.reactivex.rxjava3.functions.BiFunction) Disposable(io.reactivex.rxjava3.disposables.Disposable) Optional(java.util.Optional) GetArtifactOptions(ml.comet.experiment.artifact.GetArtifactOptions) MinMaxResponse(ml.comet.experiment.impl.rest.MinMaxResponse) CreateExperimentResponse(ml.comet.experiment.impl.rest.CreateExperimentResponse) Getter(lombok.Getter) CompletableFuture(java.util.concurrent.CompletableFuture) ArtifactAssetImpl(ml.comet.experiment.impl.asset.ArtifactAssetImpl) ExceptionUtils(ml.comet.experiment.impl.utils.ExceptionUtils) AssetOverwriteStrategy(ml.comet.experiment.artifact.AssetOverwriteStrategy) ARTIFACT_HAS_NO_DETAILS(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_HAS_NO_DETAILS) RestApiUtils.createTagRequest(ml.comet.experiment.impl.utils.RestApiUtils.createTagRequest) InvalidArtifactStateException(ml.comet.experiment.artifact.InvalidArtifactStateException) REMOTE_ASSET_CANNOT_BE_DOWNLOADED(ml.comet.experiment.impl.resources.LogMessages.REMOTE_ASSET_CANNOT_BE_DOWNLOADED) COMPLETED_DOWNLOAD_ARTIFACT_ASSET(ml.comet.experiment.impl.resources.LogMessages.COMPLETED_DOWNLOAD_ARTIFACT_ASSET) FAILED_TO_UPDATE_ARTIFACT_VERSION_STATE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_UPDATE_ARTIFACT_VERSION_STATE) ArtifactVersionState(ml.comet.experiment.impl.rest.ArtifactVersionState) RestApiUtils.createLogOtherRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogOtherRequest) RestApiUtils.createArtifactVersionStateRequest(ml.comet.experiment.impl.utils.RestApiUtils.createArtifactVersionStateRequest) ArtifactDto(ml.comet.experiment.impl.rest.ArtifactDto) CometUtils(ml.comet.experiment.impl.utils.CometUtils) ARTIFACT_ASSETS_FILE_EXISTS_PRESERVING(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_ASSETS_FILE_EXISTS_PRESERVING) Logger(org.slf4j.Logger) FileUtils(ml.comet.experiment.impl.utils.FileUtils) ConnectionInitializer(ml.comet.experiment.impl.http.ConnectionInitializer) FileAlreadyExistsException(java.nio.file.FileAlreadyExistsException) CometApiException(ml.comet.experiment.exception.CometApiException) FAILED_TO_READ_LOGGED_ARTIFACT_ASSETS(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_READ_LOGGED_ARTIFACT_ASSETS) FAILED_READ_DATA_FOR_EXPERIMENT(ml.comet.experiment.impl.resources.LogMessages.FAILED_READ_DATA_FOR_EXPERIMENT) ArtifactRequest(ml.comet.experiment.impl.rest.ArtifactRequest) ArtifactEntry(ml.comet.experiment.impl.rest.ArtifactEntry) ArtifactException(ml.comet.experiment.artifact.ArtifactException)

Example 3 with ArtifactException

use of ml.comet.experiment.artifact.ArtifactException in project comet-java-sdk by comet-ml.

the class ArtifactSupportTest method testLogAndDownloadArtifactAsset_failForRemote.

@Test
@Timeout(value = 300, unit = SECONDS)
public void testLogAndDownloadArtifactAsset_failForRemote() throws IOException {
    Path tmpDir = Files.createTempDirectory("testLogAndDownloadArtifactAsset");
    try (OnlineExperimentImpl experiment = (OnlineExperimentImpl) createOnlineExperiment()) {
        ArtifactImpl artifact = createArtifact();
        // add remote assets
        // 
        URI firstAssetLink = new URI("s3://bucket/folder/firstAssetFile.extension");
        String firstAssetFileName = "firstAssetFileName";
        artifact.addRemoteAsset(firstAssetLink, firstAssetFileName);
        // log artifact and check results
        // 
        CompletableFuture<LoggedArtifact> futureArtifact = experiment.logArtifact(artifact);
        LoggedArtifact loggedArtifact = futureArtifact.get(60, SECONDS);
        // get artifact details from server
        // 
        LoggedArtifact loggedArtifactFromServer = experiment.getArtifact(loggedArtifact.getName(), loggedArtifact.getWorkspace(), loggedArtifact.getVersion());
        // get logged assets and download to local dir
        // 
        Collection<LoggedArtifactAsset> loggedAssets = loggedArtifactFromServer.getAssets();
        assertEquals(1, loggedAssets.size(), "wrong number of assets returned");
        LoggedArtifactAsset asset = loggedAssets.iterator().next();
        assertNotNull(asset);
        ArtifactException ex = assertThrows(ArtifactException.class, () -> asset.download(tmpDir));
        assertEquals(getString(REMOTE_ASSET_CANNOT_BE_DOWNLOADED, asset), ex.getMessage());
    } catch (Throwable t) {
        fail(t);
    } finally {
        PathUtils.delete(tmpDir);
    }
}
Also used : Path(java.nio.file.Path) LoggedArtifact(ml.comet.experiment.artifact.LoggedArtifact) LoggedArtifactAsset(ml.comet.experiment.artifact.LoggedArtifactAsset) ArtifactException(ml.comet.experiment.artifact.ArtifactException) LogMessages.getString(ml.comet.experiment.impl.resources.LogMessages.getString) URI(java.net.URI) Test(org.junit.jupiter.api.Test) Timeout(org.junit.jupiter.api.Timeout)

Example 4 with ArtifactException

use of ml.comet.experiment.artifact.ArtifactException in project comet-java-sdk by comet-ml.

the class BaseExperiment method updateArtifactVersionState.

/**
 * Synchronously updates the state associated with Comet artifact version.
 *
 * @param artifactVersionId the artifact version identifier.
 * @param state             the state to be associated.
 * @throws ArtifactException is operation failed.
 */
void updateArtifactVersionState(@NonNull String artifactVersionId, @NonNull ArtifactVersionState state) throws ArtifactException {
    try {
        ArtifactRequest request = createArtifactVersionStateRequest(artifactVersionId, state);
        sendSynchronously(getRestApiClient()::updateArtifactState, request);
    } catch (Throwable e) {
        throw new ArtifactException(getString(FAILED_TO_UPDATE_ARTIFACT_VERSION_STATE, artifactVersionId), e);
    }
}
Also used : ArtifactRequest(ml.comet.experiment.impl.rest.ArtifactRequest) ArtifactException(ml.comet.experiment.artifact.ArtifactException)

Example 5 with ArtifactException

use of ml.comet.experiment.artifact.ArtifactException in project comet-java-sdk by comet-ml.

the class BaseExperiment method getArtifactVersionDetail.

/**
 * Synchronously retrieves all data about a specific Artifact Version.
 *
 * @param options the {@link GetArtifactOptions} defining query options.
 * @return the {@link LoggedArtifact} instance holding all data about a specific Artifact Version.
 * @throws ArtifactNotFoundException     if artifact is not found or no artifact data returned.
 * @throws InvalidArtifactStateException if artifact was not closed or has empty artifact data returned.
 * @throws ArtifactException             if failed to get artifact due to the unexpected error.
 */
LoggedArtifact getArtifactVersionDetail(@NonNull GetArtifactOptions options) throws ArtifactNotFoundException, InvalidArtifactStateException, ArtifactException {
    try {
        ArtifactVersionDetail detail = validateAndGetExperimentKey().concatMap(experimentKey -> getRestApiClient().getArtifactVersionDetail(options, experimentKey)).blockingGet();
        ArtifactDto artifactDto = detail.getArtifact();
        if (artifactDto == null) {
            throw new InvalidArtifactStateException(getString(ARTIFACT_HAS_NO_DETAILS, options));
        }
        return detail.copyToLoggedArtifact(new LoggedArtifactImpl(artifactDto.getArtifactName(), artifactDto.getArtifactType(), this));
    } catch (CometApiException apiException) {
        switch(apiException.getSdkErrorCode()) {
            case noArtifactFound:
                throw new ArtifactNotFoundException(getString(ARTIFACT_NOT_FOUND, options), apiException);
            case artifactVersionStateNotClosed:
            case artifactVersionStateNotClosedErrorOccurred:
                throw new InvalidArtifactStateException(getString(ARTIFACT_NOT_READY, options), apiException);
            default:
                throw new ArtifactException(getString(GET_ARTIFACT_FAILED_UNEXPECTEDLY, options), apiException);
        }
    } catch (Throwable e) {
        throw new ArtifactException(getString(GET_ARTIFACT_FAILED_UNEXPECTEDLY, options), e);
    }
}
Also used : Connection(ml.comet.experiment.impl.http.Connection) RestApiUtils.createArtifactUpsertRequest(ml.comet.experiment.impl.utils.RestApiUtils.createArtifactUpsertRequest) LoggedExperimentAsset(ml.comet.experiment.asset.LoggedExperimentAsset) EXPERIMENT_LIVE(ml.comet.experiment.impl.resources.LogMessages.EXPERIMENT_LIVE) ArtifactDownloadException(ml.comet.experiment.artifact.ArtifactDownloadException) LoggedArtifactAsset(ml.comet.experiment.artifact.LoggedArtifactAsset) RestApiUtils.createLogEndTimeRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogEndTimeRequest) StringUtils(org.apache.commons.lang3.StringUtils) ExperimentMetadata(ml.comet.experiment.model.ExperimentMetadata) FAILED_TO_DOWNLOAD_ASSET_FILE_ALREADY_EXISTS(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_DOWNLOAD_ASSET_FILE_ALREADY_EXISTS) SOURCE_CODE(ml.comet.experiment.impl.asset.AssetType.SOURCE_CODE) RestApiUtils.createGraphRequest(ml.comet.experiment.impl.utils.RestApiUtils.createGraphRequest) Duration(java.time.Duration) RestApiUtils.createLogMetricRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogMetricRequest) Path(java.nio.file.Path) SdkErrorCodes.artifactVersionStateNotClosed(ml.comet.experiment.impl.constants.SdkErrorCodes.artifactVersionStateNotClosed) FAILED_TO_DELETE_TEMPORARY_ASSET_FILE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_DELETE_TEMPORARY_ASSET_FILE) NonNull(lombok.NonNull) AssetUtils.createAssetFromData(ml.comet.experiment.impl.utils.AssetUtils.createAssetFromData) FAILED_TO_DOWNLOAD_ASSET(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_DOWNLOAD_ASSET) ARTIFACT_NOT_FOUND(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_NOT_FOUND) FAILED_TO_UPSERT_ARTIFACT(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_UPSERT_ARTIFACT) StandardCharsets(java.nio.charset.StandardCharsets) SdkErrorCodes.noArtifactFound(ml.comet.experiment.impl.constants.SdkErrorCodes.noArtifactFound) SdkErrorCodes.artifactVersionStateNotClosedErrorOccurred(ml.comet.experiment.impl.constants.SdkErrorCodes.artifactVersionStateNotClosedErrorOccurred) ARTIFACT_DOWNLOAD_FILE_OVERWRITTEN(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_DOWNLOAD_FILE_OVERWRITTEN) FAILED_TO_RESOLVE_ASSET_FILE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_RESOLVE_ASSET_FILE) Experiment(ml.comet.experiment.Experiment) DownloadArtifactAssetOptions(ml.comet.experiment.impl.asset.DownloadArtifactAssetOptions) Optional.empty(java.util.Optional.empty) Single(io.reactivex.rxjava3.core.Single) FAILED_TO_COMPARE_CONTENT_OF_FILES(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_COMPARE_CONTENT_OF_FILES) ArtifactNotFoundException(ml.comet.experiment.artifact.ArtifactNotFoundException) ArtifactRequest(ml.comet.experiment.impl.rest.ArtifactRequest) ArrayList(java.util.ArrayList) Artifact(ml.comet.experiment.artifact.Artifact) ARTIFACT_VERSION_CREATED_WITHOUT_PREVIOUS(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_VERSION_CREATED_WITHOUT_PREVIOUS) SystemUtils(ml.comet.experiment.impl.utils.SystemUtils) ALL(ml.comet.experiment.impl.asset.AssetType.ALL) FAILED_REGISTER_EXPERIMENT(ml.comet.experiment.impl.resources.LogMessages.FAILED_REGISTER_EXPERIMENT) GitMetaData(ml.comet.experiment.model.GitMetaData) RestApiResponse(ml.comet.experiment.impl.rest.RestApiResponse) Files(java.nio.file.Files) IOException(java.io.IOException) ExperimentContext(ml.comet.experiment.context.ExperimentContext) File(java.io.File) ARTIFACT_NOT_READY(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_NOT_READY) ExecutionException(java.util.concurrent.ExecutionException) EXPERIMENT_CREATED(ml.comet.experiment.impl.resources.LogMessages.EXPERIMENT_CREATED) Function(io.reactivex.rxjava3.functions.Function) CometGeneralException(ml.comet.experiment.exception.CometGeneralException) AssetUtils.createAssetFromFile(ml.comet.experiment.impl.utils.AssetUtils.createAssetFromFile) ArtifactVersionAssetResponse(ml.comet.experiment.impl.rest.ArtifactVersionAssetResponse) ExperimentStatusResponse(ml.comet.experiment.impl.rest.ExperimentStatusResponse) ArtifactEntry(ml.comet.experiment.impl.rest.ArtifactEntry) RestApiUtils.createLogParamRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogParamRequest) RestApiUtils.createLogStartTimeRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogStartTimeRequest) AssetImpl(ml.comet.experiment.impl.asset.AssetImpl) LoggedArtifact(ml.comet.experiment.artifact.LoggedArtifact) ArtifactException(ml.comet.experiment.artifact.ArtifactException) RestApiUtils.createLogLineRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogLineRequest) RestApiUtils.createGitMetadataRequest(ml.comet.experiment.impl.utils.RestApiUtils.createGitMetadataRequest) ARTIFACT_VERSION_CREATED_WITH_PREVIOUS(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_VERSION_CREATED_WITH_PREVIOUS) CreateExperimentRequest(ml.comet.experiment.impl.rest.CreateExperimentRequest) ArtifactAsset(ml.comet.experiment.artifact.ArtifactAsset) LogMessages.getString(ml.comet.experiment.impl.resources.LogMessages.getString) Collection(java.util.Collection) RestApiUtils.createLogHtmlRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogHtmlRequest) ArtifactVersionDetail(ml.comet.experiment.impl.rest.ArtifactVersionDetail) GET_ARTIFACT_FAILED_UNEXPECTEDLY(ml.comet.experiment.impl.resources.LogMessages.GET_ARTIFACT_FAILED_UNEXPECTEDLY) Value(ml.comet.experiment.model.Value) List(java.util.List) FAILED_TO_CREATE_TEMPORARY_ASSET_DOWNLOAD_FILE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_CREATE_TEMPORARY_ASSET_DOWNLOAD_FILE) FAILED_TO_READ_DOWNLOADED_FILE_SIZE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_READ_DOWNLOADED_FILE_SIZE) BiFunction(io.reactivex.rxjava3.functions.BiFunction) Disposable(io.reactivex.rxjava3.disposables.Disposable) Optional(java.util.Optional) GetArtifactOptions(ml.comet.experiment.artifact.GetArtifactOptions) MinMaxResponse(ml.comet.experiment.impl.rest.MinMaxResponse) CreateExperimentResponse(ml.comet.experiment.impl.rest.CreateExperimentResponse) Getter(lombok.Getter) CompletableFuture(java.util.concurrent.CompletableFuture) ArtifactAssetImpl(ml.comet.experiment.impl.asset.ArtifactAssetImpl) ExceptionUtils(ml.comet.experiment.impl.utils.ExceptionUtils) AssetOverwriteStrategy(ml.comet.experiment.artifact.AssetOverwriteStrategy) ARTIFACT_HAS_NO_DETAILS(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_HAS_NO_DETAILS) RestApiUtils.createTagRequest(ml.comet.experiment.impl.utils.RestApiUtils.createTagRequest) InvalidArtifactStateException(ml.comet.experiment.artifact.InvalidArtifactStateException) REMOTE_ASSET_CANNOT_BE_DOWNLOADED(ml.comet.experiment.impl.resources.LogMessages.REMOTE_ASSET_CANNOT_BE_DOWNLOADED) COMPLETED_DOWNLOAD_ARTIFACT_ASSET(ml.comet.experiment.impl.resources.LogMessages.COMPLETED_DOWNLOAD_ARTIFACT_ASSET) FAILED_TO_UPDATE_ARTIFACT_VERSION_STATE(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_UPDATE_ARTIFACT_VERSION_STATE) ArtifactVersionState(ml.comet.experiment.impl.rest.ArtifactVersionState) RestApiUtils.createLogOtherRequest(ml.comet.experiment.impl.utils.RestApiUtils.createLogOtherRequest) RestApiUtils.createArtifactVersionStateRequest(ml.comet.experiment.impl.utils.RestApiUtils.createArtifactVersionStateRequest) ArtifactDto(ml.comet.experiment.impl.rest.ArtifactDto) CometUtils(ml.comet.experiment.impl.utils.CometUtils) ARTIFACT_ASSETS_FILE_EXISTS_PRESERVING(ml.comet.experiment.impl.resources.LogMessages.ARTIFACT_ASSETS_FILE_EXISTS_PRESERVING) Logger(org.slf4j.Logger) FileUtils(ml.comet.experiment.impl.utils.FileUtils) ConnectionInitializer(ml.comet.experiment.impl.http.ConnectionInitializer) FileAlreadyExistsException(java.nio.file.FileAlreadyExistsException) CometApiException(ml.comet.experiment.exception.CometApiException) FAILED_TO_READ_LOGGED_ARTIFACT_ASSETS(ml.comet.experiment.impl.resources.LogMessages.FAILED_TO_READ_LOGGED_ARTIFACT_ASSETS) FAILED_READ_DATA_FOR_EXPERIMENT(ml.comet.experiment.impl.resources.LogMessages.FAILED_READ_DATA_FOR_EXPERIMENT) ArtifactDto(ml.comet.experiment.impl.rest.ArtifactDto) InvalidArtifactStateException(ml.comet.experiment.artifact.InvalidArtifactStateException) ArtifactException(ml.comet.experiment.artifact.ArtifactException) ArtifactVersionDetail(ml.comet.experiment.impl.rest.ArtifactVersionDetail) ArtifactNotFoundException(ml.comet.experiment.artifact.ArtifactNotFoundException) CometApiException(ml.comet.experiment.exception.CometApiException)

Aggregations

ArtifactException (ml.comet.experiment.artifact.ArtifactException)6 LoggedArtifact (ml.comet.experiment.artifact.LoggedArtifact)5 LoggedArtifactAsset (ml.comet.experiment.artifact.LoggedArtifactAsset)5 LogMessages.getString (ml.comet.experiment.impl.resources.LogMessages.getString)5 Path (java.nio.file.Path)4 IOException (java.io.IOException)3 Files (java.nio.file.Files)3 ArrayList (java.util.ArrayList)3 Collection (java.util.Collection)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 ExecutionException (java.util.concurrent.ExecutionException)3 Getter (lombok.Getter)3 NonNull (lombok.NonNull)3 ArtifactAsset (ml.comet.experiment.artifact.ArtifactAsset)3 ArtifactDownloadException (ml.comet.experiment.artifact.ArtifactDownloadException)3 AssetOverwriteStrategy (ml.comet.experiment.artifact.AssetOverwriteStrategy)3 ArtifactAssetImpl (ml.comet.experiment.impl.asset.ArtifactAssetImpl)3 Single (io.reactivex.rxjava3.core.Single)2 Disposable (io.reactivex.rxjava3.disposables.Disposable)2 BiFunction (io.reactivex.rxjava3.functions.BiFunction)2