com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationClientProvider.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of impl Show documentation
Show all versions of impl Show documentation
Collection of infrastructure libraries and gradle plugins of Avito Android project
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