All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationClientProvider.kt Maven / Gradle / Ivy

Go to download

Collection of infrastructure libraries and gradle plugins of Avito Android project

There is a newer version: 2024.32
Show newest version
package com.avito.android.runner.devices.internal.kubernetes

import com.avito.android.runner.devices.internal.AndroidDebugBridgeProvider
import com.avito.android.runner.devices.internal.EmulatorsLogsReporterProvider
import com.avito.k8s.KubernetesApiFactory
import com.avito.logger.LoggerFactory
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import java.io.File

public class KubernetesReservationClientProvider(
    private val loggerFactory: LoggerFactory,
    private val kubernetesApiFactory: KubernetesApiFactory,
    private val reservationDeploymentFactoryProvider: ReservationDeploymentFactoryProvider,
    private val emulatorsLogsReporterProvider: EmulatorsLogsReporterProvider,
    private val androidDebugBridgeProvider: AndroidDebugBridgeProvider,
    private val kubernetesReservationListenerProvider: KubernetesReservationListenerProvider
) {

    @ExperimentalCoroutinesApi
    internal fun provide(
        tempLogcatDir: File
    ): KubernetesReservationClient {
        val kubernetesApi = kubernetesApiFactory.create()
        val emulatorsLogsReporter = emulatorsLogsReporterProvider.provide(tempLogcatDir)
        return KubernetesReservationClientFactory(
            kubernetesApi = kubernetesApi,
            reservationDeploymentFactory = reservationDeploymentFactoryProvider.provide(),
            emulatorsLogsReporter = emulatorsLogsReporter,
            deviceProvider = RemoteDeviceProviderImpl(
                kubernetesApi,
                emulatorsLogsReporter,
                androidDebugBridgeProvider.provide(),
                loggerFactory
            ),
            listener = kubernetesReservationListenerProvider.provide(),
            loggerFactory = loggerFactory,
            podsQueryIntervalMs = 10000L,
            dispatcher = Dispatchers.IO
        ).create()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy