From 0abff7ef8242c82821974a32860473790bd1e754 Mon Sep 17 00:00:00 2001 From: Aleksandar Sukovic Date: Wed, 21 Dec 2022 17:28:42 +0000 Subject: [PATCH 1/6] chore: WIP - custom binaries --- config/binary_config.go | 106 +++++++++++++ config/config.go | 39 +++-- config/faucet_config.go | 2 +- config/network_config.go | 17 +++ config/node_config.go | 2 +- config/parser.go | 4 +- generator/binary/commands.go | 27 ++++ generator/binary/generator.go | 107 +++++++++++++ generator/generator.go | 21 ++- generator/initiate.go | 12 +- net_confs/config.hcl | 11 ++ .../default/liqbot_full.tmpl | 140 ++++++++++++++++++ nomad/job_runner.go | 53 ++++++- nomad/job_runner_defaults.go | 41 ++++- nomad/runner/binary_installer.go | 2 +- types/generated_services.go | 10 +- types/types.go | 8 +- 17 files changed, 578 insertions(+), 24 deletions(-) create mode 100644 config/binary_config.go create mode 100644 generator/binary/commands.go create mode 100644 generator/binary/generator.go create mode 100644 net_confs/node_set_templates/default/liqbot_full.tmpl diff --git a/config/binary_config.go b/config/binary_config.go new file mode 100644 index 00000000..7ea9f0c0 --- /dev/null +++ b/config/binary_config.go @@ -0,0 +1,106 @@ +package config + +import ( + "fmt" + "os" + + "code.vegaprotocol.io/vegacapsule/utils" +) + +type BinaryConfig struct { + /* + description: Name of the service that is going to be used as an identifier when service runs. + example: + type: hcl + value: | + binary_service "service-name" { + ... + } + */ + Name string `hcl:"name,label"` + + /* + description: Command that will run at the app startup. + example: + type: hcl + value: | + cmd = "serve" + */ + Command string `hcl:"cmd,optional"` + + /* + description: List of arguments that will be added to cmd. + example: + type: hcl + value: | + args = [ + "--config", "--config=config/config_capsule.yaml", + ] + */ + Args []string `hcl:"args,optional"` + + /* + description: | + [Go template](templates.md) of a Binary Service config. + + The [binary.ConfigTemplateContext](templates.md#binaryconfigtemplatecontext) can be used in the template. + Example can be found in [default network config](net_confs/config.hcl). + examples: + - type: hcl + value: | + config_template = < Date: Tue, 3 Jan 2023 16:17:44 +0000 Subject: [PATCH 2/6] fix: Various bug fixes --- config/binary_config.go | 4 +- config/config.go | 1 - generator/binary/generator.go | 4 + net_confs/config.hcl | 17 +++- .../default/liqbot_full.tmpl | 9 +- .../default/traderbot_full.tmpl | 94 +++++++++++++++++++ nomad/job_runner.go | 20 ++-- nomad/job_runner_defaults.go | 6 +- types/network_jobs.go | 4 +- 9 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 net_confs/node_set_templates/default/traderbot_full.tmpl diff --git a/config/binary_config.go b/config/binary_config.go index 7ea9f0c0..8478717e 100644 --- a/config/binary_config.go +++ b/config/binary_config.go @@ -78,6 +78,8 @@ type BinaryConfig struct { ConfigTemplate *string `hcl:"config_template,optional"` ConfigTemplateFile *string `hcl:"config_template_file,optional"` + + Sync bool `hcl:"sync,optional"` } func (b *BinaryConfig) GetConfigTemplate(configDir string) (*string, error) { @@ -86,7 +88,7 @@ func (b *BinaryConfig) GetConfigTemplate(configDir string) (*string, error) { } if b.ConfigTemplateFile == nil { - return nil, fmt.Errorf("no config template provided") + return nil, nil } templateFile, err := utils.AbsPathWithPrefix(configDir, *b.ConfigTemplateFile) diff --git a/config/config.go b/config/config.go index 8fac5ced..ce61f7ed 100644 --- a/config/config.go +++ b/config/config.go @@ -288,7 +288,6 @@ func (c *Config) loadAndValidatePreGenerate(preGen PreGenerate) (*PreGenerate, e func (c *Config) loadAndValidatePSConfigTemplates() error { mErr := utils.NewMultiError() - // TODO: also pre-start? if c.Network.PostStart == nil { return nil } diff --git a/generator/binary/generator.go b/generator/binary/generator.go index 3a6b3ba2..85de8900 100644 --- a/generator/binary/generator.go +++ b/generator/binary/generator.go @@ -54,6 +54,10 @@ func (cg *ConfigGenerator) InitiateAndConfigure(conf *config.BinaryConfig) (*typ return nil, fmt.Errorf("failed to init binary for %q: %w", conf.Name, err) } + if conf.ConfigTemplate == nil { + return initBinary, nil + } + configTemplate, err := NewConfigTemplate(*conf.ConfigTemplate) if err != nil { return nil, fmt.Errorf("failed to create new template config for %q: %w", conf.Name, err) diff --git a/net_confs/config.hcl b/net_confs/config.hcl index 636bb24c..703c35c7 100644 --- a/net_confs/config.hcl +++ b/net_confs/config.hcl @@ -80,10 +80,21 @@ EOT binary_service "liqbot" { cmd = "liqbot" binary_path = "liqbot" - # args = [ - # "--config", "${binary_services}/liqbot/config.toml" - # ] + args = [ + "--config", "${binary_services}/liqbot/config.toml" + ] config_template_file = "./node_set_templates/default/liqbot_full.tmpl" + sync = true + } + + binary_service "traderbot" { + cmd = "traderbot" + binary_path = "traderbot" + args = [ + "--config", "${binary_services}/traderbot/config.toml" + ] + config_template_file = "./node_set_templates/default/traderbot_full.tmpl" + sync = true } } diff --git a/net_confs/node_set_templates/default/liqbot_full.tmpl b/net_confs/node_set_templates/default/liqbot_full.tmpl index 0258bd4a..3e30345e 100644 --- a/net_confs/node_set_templates/default/liqbot_full.tmpl +++ b/net_confs/node_set_templates/default/liqbot_full.tmpl @@ -1,8 +1,3 @@ -a // node_url -// ethereum_url -// faucet_url - - Locations = ["localhost:3027"] VegaAssetID = "b4f2726571fbe8e33b442dc92ed2d7f0d810e21835b7371a7915a365f07ccd9b" callTimeoutMills = 10000 @@ -16,7 +11,7 @@ callTimeoutMills = 10000 [Server] Env = "prod" Listen = ":7800" - Logformat = "text" + Logencoding = "console" Loglevel = "debug" [Token] @@ -32,6 +27,7 @@ callTimeoutMills = 10000 [Whale] FaucetRateLimit = "2s" FaucetURL = "http://localhost:1790" + TopUpScale = 10 [Whale.OwnerPrivateKeys] 993ed98f4f770d91a796faab1738551193ba45c62341d20597df70fea6704ede = "a37f4c2a678aefb5037bf415a826df1540b330b7e471aa54184877ba901b9ef0" b4f2726571fbe8e33b442dc92ed2d7f0d810e21835b7371a7915a365f07ccd9b = "a37f4c2a678aefb5037bf415a826df1540b330b7e471aa54184877ba901b9ef0" @@ -65,6 +61,7 @@ callTimeoutMills = 10000 SeedAmount = 1000000000000000000 SeedOrderCount = 100 SeedOrderSize = 400 + TopUpScale = 10 TargetLNVol = 0.25 [Bots.StrategyDetails.LongeningShape] [[Bots.StrategyDetails.LongeningShape.Buys]] diff --git a/net_confs/node_set_templates/default/traderbot_full.tmpl b/net_confs/node_set_templates/default/traderbot_full.tmpl new file mode 100644 index 00000000..13a03953 --- /dev/null +++ b/net_confs/node_set_templates/default/traderbot_full.tmpl @@ -0,0 +1,94 @@ +[Server] + Apm = true + Gracefulshutdown = 3_000 + Listen = ":80" + Logencoding = "console" + Loglevel = "debug" + Env = "prod" + +[Wallet] + NodeURL = "localhost:3027" + StorePath = "/tmp/wallet/traderbot" + +[Faucet] + Ratelimit = "2s" + + [Faucet.server] + Scheme = "http" + Host = "localhost:1790" + Path = "/" + + [[Faucet.assets]] + Id = "fBTC" + Name = "fBTC" + TopUp = 1_000_000_000 + + [[Faucet.assets]] + Id = "fDAI" + Name = "fDAI" + TopUp = 1_000_000_000_000 + + [[Faucet.assets]] + Id = "fEURO" + Name = "fEURO" + TopUp = 10_000_000_000 + + [[Faucet.assets]] + Id = "fUSDC" + Name = "fUSDC" + TopUp = 100_000_000_000 + +[Token] + EthereumAPIAddress = "ws://localhost:8545" + Erc20BridgeAddress = "0x9708FF7510D4A7B9541e1699d15b53Ecb1AFDc54" + StakingBridgeAddress = "0x9135f5afd6F055e731bca2348429482eE614CFfA" + SyncTimeoutSec = 100 + +[Whale] + FaucetURL = "http://localhost:1790" + FaucetRateLimit = "2s" + TopUpScale = 100 + + [Whale.wallet] + Name = "whale2" + Passphrase = "pastazazube" + StorePath = "/tmp/wallet/whale" + NodeURL = "localhost:3027" + + [Whale.ownerPrivateKeys] + "993ed98f4f770d91a796faab1738551193ba45c62341d20597df70fea6704ede" = "a37f4c2a678aefb5037bf415a826df1540b330b7e471aa54184877ba901b9ef0" + "B4f2726571fbe8e33b442dc92ed2d7f0d810e21835b7371a7915a365f07ccd9b" = "a37f4c2a678aefb5037bf415a826df1540b330b7e471aa54184877ba901b9ef0" + + [Whale.slack] + Enabled = false + +[[Pricing]] + Base = "BTC" + Quote = "USD" + Wander = true + +[[Pricing]] + Base = "UNI" + Quote = "DAI" + Wander = true + +[[Nodes]] + Name = "API-GRPC" + +[Nodes.address] + Scheme = "grpc" + Host = "localhost:3027" + +[[Traders]] + Name = "t-000001" + Scale = 10 + Rate = 2 + TopUpScale = 200 + Active = true + Type = "Normal" + [Traders.parameters] + marketBase = "BTC" + marketQuote = "USD" + marketSettlementVegaAssetID = "993ed98f4f770d91a796faab1738551193ba45c62341d20597df70fea6704ede" + sizemean = "24" + sizestddev = "5" diff --git a/nomad/job_runner.go b/nomad/job_runner.go index 3f4800c7..cad8e2ae 100644 --- a/nomad/job_runner.go +++ b/nomad/job_runner.go @@ -204,17 +204,17 @@ func (r *JobRunner) runBinaryJobs(ctx context.Context, binaryConfigs []config.Bi for i, bc := range binaryConfigs { // capture in the loop by copy bc := bc - g.Go(func() error { + + runJob := func() error { // Skip for already running jobs if r.Client.JobRunning(ctx, bc.Name) { return nil } - job := r.defaultBinaryJob(bc, binaries[i]) + job := r.defaultBinaryJob(&bc, binaries[i]) if err := r.runAndWait(ctx, job, nil); err != nil { - log.Printf("failed to run pre start job %q: %s", *job.ID, err) - return nil // fmt.Errorf("failed to run pre start job %q: %w", *job.ID, err) + return fmt.Errorf("failed to run pre start job %q: %w", *job.ID, err) } jobIDsLock.Lock() @@ -222,7 +222,15 @@ func (r *JobRunner) runBinaryJobs(ctx context.Context, binaryConfigs []config.Bi jobIDsLock.Unlock() return nil - }) + } + + if bc.Sync { + if err := runJob(); err != nil { + return nil, err + } + } else { + g.Go(runJob) + } } if err := g.Wait(); err != nil { @@ -340,7 +348,7 @@ func (r *JobRunner) startNetwork( } if conf.Network.PostStart != nil { - extraBinaryJobIDs, err := r.runBinaryJobs(ctx, conf.Network.PostStart.Binary, generatedSvcs.Binary) + extraBinaryJobIDs, err := r.runBinaryJobs(gCtx, conf.Network.PostStart.Binary, generatedSvcs.Binary) if err != nil { return result, fmt.Errorf("failed to run post start jobs: %w", err) } diff --git a/nomad/job_runner_defaults.go b/nomad/job_runner_defaults.go index 5066915c..516ab6fc 100644 --- a/nomad/job_runner_defaults.go +++ b/nomad/job_runner_defaults.go @@ -3,7 +3,6 @@ package nomad import ( "fmt" "path" - "strings" "time" "code.vegaprotocol.io/vegacapsule/config" @@ -264,10 +263,7 @@ func (r *JobRunner) defaultFaucetJob(conf *config.FaucetConfig, fc *types.Faucet } } -func (r *JobRunner) defaultBinaryJob(conf config.BinaryConfig, c *types.Binary) *api.Job { - if !strings.Contains(strings.Join(c.Args, ""), "--config") { - c.Args = append(c.Args, "--config", c.ConfigFilePath) - } +func (r *JobRunner) defaultBinaryJob(conf *config.BinaryConfig, c *types.Binary) *api.Job { return &api.Job{ ID: &c.Name, Datacenters: []string{"dc1"}, diff --git a/types/network_jobs.go b/types/network_jobs.go index 8b0e97cb..a02b6580 100644 --- a/types/network_jobs.go +++ b/types/network_jobs.go @@ -43,7 +43,7 @@ func (nj *NetworkJobs) MergeNetworkJobs(toMerge NetworkJobs) { } } -func (nj NetworkJobs) Exists(jobID string) bool { +func (nj *NetworkJobs) Exists(jobID string) bool { if _, ok := nj.NodesSetsJobIDs[jobID]; ok { return true } @@ -88,7 +88,7 @@ func (nj *NetworkJobs) RemoveRunningJobsIDs(ids []string) { } } -func (nj NetworkJobs) ToSlice() []string { +func (nj *NetworkJobs) ToSlice() []string { out := append(nj.NodesSetsJobIDs.ToSlice(), nj.ExtraJobIDs.ToSlice()...) if nj.FaucetJobID != "" { From 0683c9304b7ea972667121164b46cee0af711206 Mon Sep 17 00:00:00 2001 From: Aleksandar Sukovic Date: Tue, 3 Jan 2023 17:05:56 +0000 Subject: [PATCH 3/6] fix: Revert Nomad version --- nomad/runner/binary_installer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nomad/runner/binary_installer.go b/nomad/runner/binary_installer.go index 451025e5..9b88cdd9 100644 --- a/nomad/runner/binary_installer.go +++ b/nomad/runner/binary_installer.go @@ -18,7 +18,7 @@ import ( const ( nomadBinName = "nomad" - nomadBinaryVersion = "1.4.0-beta.1" + nomadBinaryVersion = "1.3.1" ) var ( From 3f22ec8b35d3fd481d9dd4e578f6446f56bd995c Mon Sep 17 00:00:00 2001 From: Aleksandar Sukovic Date: Sat, 7 Jan 2023 13:24:53 +0000 Subject: [PATCH 4/6] chore: Update bot configs --- net_confs/node_set_templates/default/liqbot_full.tmpl | 2 ++ net_confs/node_set_templates/default/traderbot_full.tmpl | 3 +++ 2 files changed, 5 insertions(+) diff --git a/net_confs/node_set_templates/default/liqbot_full.tmpl b/net_confs/node_set_templates/default/liqbot_full.tmpl index 3e30345e..5f921d9b 100644 --- a/net_confs/node_set_templates/default/liqbot_full.tmpl +++ b/net_confs/node_set_templates/default/liqbot_full.tmpl @@ -23,6 +23,8 @@ callTimeoutMills = 10000 [Wallet] NodeURL = "localhost:3027" StorePath = "/tmp/wallet/liqbot" + Name = liqbot + Passphrase = liqbot-secret [Whale] FaucetRateLimit = "2s" diff --git a/net_confs/node_set_templates/default/traderbot_full.tmpl b/net_confs/node_set_templates/default/traderbot_full.tmpl index 13a03953..e5524a73 100644 --- a/net_confs/node_set_templates/default/traderbot_full.tmpl +++ b/net_confs/node_set_templates/default/traderbot_full.tmpl @@ -9,6 +9,9 @@ [Wallet] NodeURL = "localhost:3027" StorePath = "/tmp/wallet/traderbot" + Name = traderbot + Passphrase = traderbot-secret + RecoveryPhrase: "quality vicious jazz item normal fun budget river sport cargo young foster valid alley slogan excess express weekend true vicious winner jump group weekend" [Faucet] Ratelimit = "2s" From 5b35ed01a0073f2b4ef80e1b08a742d4a2de5919 Mon Sep 17 00:00:00 2001 From: Aleksandar Sukovic Date: Fri, 20 Jan 2023 13:47:48 +0000 Subject: [PATCH 5/6] fix: Update liqbot config --- net_confs/node_set_templates/default/liqbot_full.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net_confs/node_set_templates/default/liqbot_full.tmpl b/net_confs/node_set_templates/default/liqbot_full.tmpl index 5f921d9b..2f643b41 100644 --- a/net_confs/node_set_templates/default/liqbot_full.tmpl +++ b/net_confs/node_set_templates/default/liqbot_full.tmpl @@ -60,7 +60,7 @@ callTimeoutMills = 10000 PosManagementFraction = 0.25 PosManagementSleepMilliseconds = 5050 PriceSteerOrderScale = 10.5 - SeedAmount = 1000000000000000000 + StakeAmount = 1000000000000000000 SeedOrderCount = 100 SeedOrderSize = 400 TopUpScale = 10 From 4ad352bb0c50747af0e0891f8f5e0ca1d6e79171 Mon Sep 17 00:00:00 2001 From: Aleksandar Sukovic Date: Wed, 1 Feb 2023 12:52:21 +0000 Subject: [PATCH 6/6] fix: Configs --- net_confs/config.hcl | 22 --- net_confs/config_bots.hcl | 136 ++++++++++++++++++ .../default/liqbot_full.tmpl | 4 +- .../default/traderbot_full.tmpl | 6 +- nomad/job_runner_defaults.go | 3 +- 5 files changed, 143 insertions(+), 28 deletions(-) create mode 100644 net_confs/config_bots.hcl diff --git a/net_confs/config.hcl b/net_confs/config.hcl index 703c35c7..4b611c06 100644 --- a/net_confs/config.hcl +++ b/net_confs/config.hcl @@ -76,28 +76,6 @@ EOT } } - post_start { - binary_service "liqbot" { - cmd = "liqbot" - binary_path = "liqbot" - args = [ - "--config", "${binary_services}/liqbot/config.toml" - ] - config_template_file = "./node_set_templates/default/liqbot_full.tmpl" - sync = true - } - - binary_service "traderbot" { - cmd = "traderbot" - binary_path = "traderbot" - args = [ - "--config", "${binary_services}/traderbot/config.toml" - ] - config_template_file = "./node_set_templates/default/traderbot_full.tmpl" - sync = true - } - } - genesis_template_file = "./genesis.tmpl" smart_contracts_addresses_file = "./public_smart_contracts_addresses.json" diff --git a/net_confs/config_bots.hcl b/net_confs/config_bots.hcl new file mode 100644 index 00000000..703c35c7 --- /dev/null +++ b/net_confs/config_bots.hcl @@ -0,0 +1,136 @@ +vega_binary_path = "vega" + +network "testnet" { + ethereum { + chain_id = "1440" + network_id = "1441" + endpoint = "ws://127.0.0.1:8545/" + } + + faucet "faucet-1" { + wallet_pass = "f4uc3tw4ll3t-v3g4-p4ssphr4e3" + + template = <<-EOT +[Node] + Port = 3002 + IP = "127.0.0.1" +EOT + } + + wallet "wallet-1" { + template = <<-EOT +Name = "DV" +Level = "info" +TokenExpiry = "168h0m0s" +Port = 1789 +Host = "0.0.0.0" + +[API] + [API.GRPC] + Hosts = [{{range $i, $v := .Validators}}{{if ne $i 0}},{{end}}"127.0.0.1:{{add 300 $i}}2"{{end}}] + Retries = 5 +EOT + } + + pre_start { + docker_service "ganache-1" { + image = "vegaprotocol/ganache:latest" + cmd = "ganache-cli" + args = [ + "--blockTime", "1", + "--chainId", "1440", + "--networkId", "1441", + "-h", "0.0.0.0", + "-p", "8545", + "-m", "ozone access unlock valid olympic save include omit supply green clown session", + "--db", "/app/ganache-db", + ] + static_port { + value = 8545 + to = 8545 + } + auth_soft_fail = true + } + docker_service "postgres-1" { + image = "vegaprotocol/timescaledb:2.8.0-pg14" + cmd = "postgres" + args = [] + env = { + POSTGRES_USER="vega" + POSTGRES_PASSWORD="vega" + POSTGRES_DBS="vega0,vega1,vega2,vega3,vega4,vega5,vega6,vega7,vega8,vega9,vega10,vega11,vega12,vega13,vega14,vega15,vega16,vega17,vega18,vega19,vega20,vega21,vega22,vega23,vega24,vega25" + } + + static_port { + value = 5232 + to = 5432 + } + resources { + cpu = 600 + memory = 900 + } + + volume_mounts = ["${network_home_path}:${network_home_path}"] + + auth_soft_fail = true + } + } + + post_start { + binary_service "liqbot" { + cmd = "liqbot" + binary_path = "liqbot" + args = [ + "--config", "${binary_services}/liqbot/config.toml" + ] + config_template_file = "./node_set_templates/default/liqbot_full.tmpl" + sync = true + } + + binary_service "traderbot" { + cmd = "traderbot" + binary_path = "traderbot" + args = [ + "--config", "${binary_services}/traderbot/config.toml" + ] + config_template_file = "./node_set_templates/default/traderbot_full.tmpl" + sync = true + } + } + + genesis_template_file = "./genesis.tmpl" + smart_contracts_addresses_file = "./public_smart_contracts_addresses.json" + + node_set "validators" { + count = 2 + mode = "validator" + + node_wallet_pass = "n0d3w4ll3t-p4ssphr4e3" + vega_wallet_pass = "w4ll3t-p4ssphr4e3" + ethereum_wallet_pass = "ch41nw4ll3t-3th3r3um-p4ssphr4e3" + + config_templates { + vega_file = "./node_set_templates/default/vega_validators.tmpl" + tendermint_file = "./node_set_templates/default/tendermint_validators.tmpl" + } + } + + node_set "full" { + count = 1 + mode = "full" + use_data_node = true + + pre_start_probe { + postgres { + connection = "user=vega dbname=vega{{ .NodeNumber }} password=vega port=5232 sslmode=disable" + query = "select 10 + 10" + } + } + + config_templates { + vega_file = "./node_set_templates/default/vega_full.tmpl" + tendermint_file = "./node_set_templates/default/tendermint_full.tmpl" + data_node_file = "./node_set_templates/default/data_node_full_external_postgres.tmpl" + } + } +} diff --git a/net_confs/node_set_templates/default/liqbot_full.tmpl b/net_confs/node_set_templates/default/liqbot_full.tmpl index 2f643b41..1b56d810 100644 --- a/net_confs/node_set_templates/default/liqbot_full.tmpl +++ b/net_confs/node_set_templates/default/liqbot_full.tmpl @@ -23,8 +23,8 @@ callTimeoutMills = 10000 [Wallet] NodeURL = "localhost:3027" StorePath = "/tmp/wallet/liqbot" - Name = liqbot - Passphrase = liqbot-secret + Name = "liqbot" + Passphrase = "liqbot-secret" [Whale] FaucetRateLimit = "2s" diff --git a/net_confs/node_set_templates/default/traderbot_full.tmpl b/net_confs/node_set_templates/default/traderbot_full.tmpl index e5524a73..c723d087 100644 --- a/net_confs/node_set_templates/default/traderbot_full.tmpl +++ b/net_confs/node_set_templates/default/traderbot_full.tmpl @@ -9,9 +9,9 @@ [Wallet] NodeURL = "localhost:3027" StorePath = "/tmp/wallet/traderbot" - Name = traderbot - Passphrase = traderbot-secret - RecoveryPhrase: "quality vicious jazz item normal fun budget river sport cargo young foster valid alley slogan excess express weekend true vicious winner jump group weekend" + Name = "traderbot" + Passphrase = "traderbot-secret" + RecoveryPhrase = "quality vicious jazz item normal fun budget river sport cargo young foster valid alley slogan excess express weekend true vicious winner jump group weekend" [Faucet] Ratelimit = "2s" diff --git a/nomad/job_runner_defaults.go b/nomad/job_runner_defaults.go index 213abd58..6b5eb06b 100644 --- a/nomad/job_runner_defaults.go +++ b/nomad/job_runner_defaults.go @@ -1,6 +1,7 @@ package nomad import ( + "context" "fmt" "path" "time" @@ -348,7 +349,7 @@ func (r *JobRunner) defaultDockerJob(conf config.DockerConfig) *api.Job { } } -func (r *JobRunner) defaultExecJob(ctx context.Context, conf config.ExecConfig) *api.Job { +func (r *JobRunner) defaultExecJob(_ context.Context, conf config.ExecConfig) *api.Job { return &api.Job{ ID: &conf.Name, Datacenters: []string{"dc1"},