added healthcheck role
improved documentation client configuration promoted to standalone class
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
"pattern": "\\Qnet/woggioni/rbcs/server/rbcs-default.xml\\E"
|
||||
},
|
||||
{
|
||||
"pattern": "\\Qnet/woggioni/rbcs/server/schema/rbcs.xsd\\E"
|
||||
"pattern": "\\Qnet/woggioni/rbcs/server/schema/rbcs-server.xsd\\E"
|
||||
},
|
||||
{
|
||||
"pattern": "\\Qnet/woggioni/rbcs/client/schema/rbcs-client.xsd\\E"
|
||||
|
@@ -11,7 +11,7 @@ import net.woggioni.rbcs.cli.impl.commands.PasswordHashCommand
|
||||
import net.woggioni.rbcs.cli.impl.commands.PutCommand
|
||||
import net.woggioni.rbcs.cli.impl.commands.ServerCommand
|
||||
import net.woggioni.rbcs.common.RbcsUrlStreamHandlerFactory
|
||||
import net.woggioni.rbcs.common.contextLogger
|
||||
import net.woggioni.rbcs.common.createLogger
|
||||
import picocli.CommandLine
|
||||
import picocli.CommandLine.Model.CommandSpec
|
||||
|
||||
@@ -36,7 +36,7 @@ class RemoteBuildCacheServerCli : RbcsCommand() {
|
||||
//We're running in an envelope jar and custom URL protocols won't work
|
||||
RbcsUrlStreamHandlerFactory.install()
|
||||
}
|
||||
val log = contextLogger()
|
||||
val log = createLogger<RemoteBuildCacheServerCli>()
|
||||
val app = Application.builder("rbcs")
|
||||
.configurationDirectoryEnvVar("RBCS_CONFIGURATION_DIR")
|
||||
.configurationDirectoryPropertyKey("net.woggioni.rbcs.conf.dir")
|
||||
|
@@ -5,6 +5,7 @@ import net.woggioni.jwo.LongMath
|
||||
import net.woggioni.rbcs.api.CacheValueMetadata
|
||||
import net.woggioni.rbcs.cli.impl.RbcsCommand
|
||||
import net.woggioni.rbcs.cli.impl.converters.ByteSizeConverter
|
||||
import net.woggioni.rbcs.client.Configuration
|
||||
import net.woggioni.rbcs.client.RemoteBuildCacheClient
|
||||
import net.woggioni.rbcs.common.createLogger
|
||||
import net.woggioni.rbcs.common.debug
|
||||
@@ -29,7 +30,7 @@ class BenchmarkCommand : RbcsCommand() {
|
||||
companion object {
|
||||
private val log = createLogger<BenchmarkCommand>()
|
||||
|
||||
fun run(profile : RemoteBuildCacheClient.Configuration.Profile,
|
||||
fun run(profile : Configuration.Profile,
|
||||
numberOfEntries : Int,
|
||||
entrySize : Int,
|
||||
useRandomValue : Boolean,
|
||||
|
@@ -2,8 +2,11 @@ package net.woggioni.rbcs.cli.impl.commands
|
||||
|
||||
import net.woggioni.jwo.Application
|
||||
import net.woggioni.rbcs.cli.impl.RbcsCommand
|
||||
import net.woggioni.rbcs.client.RemoteBuildCacheClient
|
||||
import net.woggioni.rbcs.client.Configuration
|
||||
import net.woggioni.rbcs.common.createLogger
|
||||
import net.woggioni.rbcs.common.debug
|
||||
import picocli.CommandLine
|
||||
import java.lang.IllegalArgumentException
|
||||
import java.nio.file.Path
|
||||
|
||||
@CommandLine.Command(
|
||||
@@ -24,15 +27,20 @@ class ClientCommand(app : Application) : RbcsCommand() {
|
||||
names = ["-p", "--profile"],
|
||||
description = ["Name of the client profile to be used"],
|
||||
paramLabel = "PROFILE",
|
||||
required = true
|
||||
required = false
|
||||
)
|
||||
var profileName : String? = null
|
||||
get() = field ?: throw IllegalArgumentException("A profile name must be specified using the '-p' command line parameter")
|
||||
|
||||
val configuration : RemoteBuildCacheClient.Configuration by lazy {
|
||||
RemoteBuildCacheClient.Configuration.parse(configurationFile)
|
||||
val configuration : Configuration by lazy {
|
||||
Configuration.parse(configurationFile)
|
||||
}
|
||||
|
||||
override fun run() {
|
||||
val log = createLogger<ClientCommand>()
|
||||
log.debug {
|
||||
"Using configuration file '$configurationFile'"
|
||||
}
|
||||
println("Available profiles:")
|
||||
configuration.profiles.forEach { (profileName, _) ->
|
||||
println(profileName)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package net.woggioni.rbcs.cli.impl.commands
|
||||
|
||||
import net.woggioni.rbcs.cli.impl.RbcsCommand
|
||||
import net.woggioni.rbcs.client.Configuration
|
||||
import net.woggioni.rbcs.client.RemoteBuildCacheClient
|
||||
import net.woggioni.rbcs.common.createLogger
|
||||
import picocli.CommandLine
|
||||
@@ -16,7 +17,7 @@ class HealthCheckCommand : RbcsCommand() {
|
||||
companion object{
|
||||
private val log = createLogger<HealthCheckCommand>()
|
||||
|
||||
fun run(profile : RemoteBuildCacheClient.Configuration.Profile) {
|
||||
fun run(profile : Configuration.Profile) {
|
||||
RemoteBuildCacheClient(profile).use { client ->
|
||||
val random = Random(SecureRandom.getInstance("NativePRNGNonBlocking").nextLong())
|
||||
val nonce = ByteArray(0xa0)
|
||||
|
Reference in New Issue
Block a user