Add support for custom container image name
This change threads the components input to their resources function so that the container can be configured with the optional custom image name when set. Change-Id: I496cc0237f378057b8125f673a760dcda80ecd99
This commit is contained in:
parent
344a0b763b
commit
ba2691fb47
@ -2,10 +2,12 @@ let Kubernetes = ../../Kubernetes.dhall
|
||||
|
||||
let F = ../functions.dhall
|
||||
|
||||
let InputExecutor = (../input.dhall).Executor.Type
|
||||
|
||||
let JobVolume = (../input.dhall).JobVolume.Type
|
||||
|
||||
in \(app-name : Text)
|
||||
-> \(image-name : Optional Text)
|
||||
-> \(input-executor : InputExecutor)
|
||||
-> \(data-dir : List F.Volume.Type)
|
||||
-> \(volumes : List F.Volume.Type)
|
||||
-> \(env : List Kubernetes.EnvVar.Type)
|
||||
@ -31,7 +33,7 @@ in \(app-name : Text)
|
||||
, claim-size = 0
|
||||
, container = Kubernetes.Container::{
|
||||
, name = "executor"
|
||||
, image = image-name
|
||||
, image = input-executor.image
|
||||
, args = Some [ "zuul-executor", "-d" ]
|
||||
, imagePullPolicy = Some "IfNotPresent"
|
||||
, ports = Some
|
||||
|
@ -2,8 +2,10 @@ let Kubernetes = ../../Kubernetes.dhall
|
||||
|
||||
let F = ../functions.dhall
|
||||
|
||||
let InputMerger = (../input.dhall).Merger.Type
|
||||
|
||||
in \(app-name : Text)
|
||||
-> \(image-name : Optional Text)
|
||||
-> \(input-merger : InputMerger)
|
||||
-> \(data-dir : List F.Volume.Type)
|
||||
-> \(volumes : List F.Volume.Type)
|
||||
-> \(env : List Kubernetes.EnvVar.Type)
|
||||
@ -18,7 +20,7 @@ in \(app-name : Text)
|
||||
, volumes = volumes
|
||||
, container = Kubernetes.Container::{
|
||||
, name = "merger"
|
||||
, image = image-name
|
||||
, image = input-merger.image
|
||||
, args = Some [ "zuul-merger", "-d" ]
|
||||
, imagePullPolicy = Some "IfNotPresent"
|
||||
, env = Some env
|
||||
|
@ -5,9 +5,8 @@ let F = ../functions.dhall
|
||||
let InputPreview = (../input.dhall).Preview.Type
|
||||
|
||||
in \(app-name : Text)
|
||||
-> \(image-name : Optional Text)
|
||||
-> \(data-dir : List F.Volume.Type)
|
||||
-> \(input-preview : InputPreview)
|
||||
-> \(data-dir : List F.Volume.Type)
|
||||
-> F.KubernetesComponent::{
|
||||
, Service = Some (F.mkService app-name "preview" "preview" 80)
|
||||
, Deployment = Some
|
||||
@ -19,7 +18,7 @@ in \(app-name : Text)
|
||||
, data-dir = data-dir
|
||||
, container = Kubernetes.Container::{
|
||||
, name = "preview"
|
||||
, image = image-name
|
||||
, image = input-preview.image
|
||||
, imagePullPolicy = Some "IfNotPresent"
|
||||
, ports = Some
|
||||
[ Kubernetes.ContainerPort::{
|
||||
|
@ -30,10 +30,9 @@ let registry-env =
|
||||
)
|
||||
|
||||
in \(app-name : Text)
|
||||
-> \(image-name : Optional Text)
|
||||
-> \(input-registry : InputRegistry)
|
||||
-> \(data-dir : List F.Volume.Type)
|
||||
-> \(volumes : List F.Volume.Type)
|
||||
-> \(input-registry : InputRegistry)
|
||||
-> F.KubernetesComponent::{
|
||||
, Service = Some (F.mkService app-name "registry" "registry" 9000)
|
||||
, StatefulSet = Some
|
||||
@ -47,7 +46,7 @@ in \(app-name : Text)
|
||||
, claim-size = F.defaultNat input-registry.storage-size 20
|
||||
, container = Kubernetes.Container::{
|
||||
, name = "registry"
|
||||
, image = image-name
|
||||
, image = input-registry.image
|
||||
, args = Some
|
||||
[ "zuul-registry"
|
||||
, "-c"
|
||||
|
@ -2,8 +2,10 @@ let Kubernetes = ../../Kubernetes.dhall
|
||||
|
||||
let F = ../functions.dhall
|
||||
|
||||
let InputScheduler = (../input.dhall).Scheduler.Type
|
||||
|
||||
in \(app-name : Text)
|
||||
-> \(image-name : Optional Text)
|
||||
-> \(input-scheduler : InputScheduler)
|
||||
-> \(data-dir : List F.Volume.Type)
|
||||
-> \(volumes : List F.Volume.Type)
|
||||
-> \(env : List Kubernetes.EnvVar.Type)
|
||||
@ -20,7 +22,7 @@ in \(app-name : Text)
|
||||
, claim-size = 5
|
||||
, container = Kubernetes.Container::{
|
||||
, name = "scheduler"
|
||||
, image = image-name
|
||||
, image = input-scheduler.image
|
||||
, args = Some [ "zuul-scheduler", "-d" ]
|
||||
, imagePullPolicy = Some "IfNotPresent"
|
||||
, ports = Some
|
||||
|
@ -2,8 +2,10 @@ let Kubernetes = ../../Kubernetes.dhall
|
||||
|
||||
let F = ../functions.dhall
|
||||
|
||||
let InputWeb = (../input.dhall).Web.Type
|
||||
|
||||
in \(app-name : Text)
|
||||
-> \(image-name : Optional Text)
|
||||
-> \(input-web : InputWeb)
|
||||
-> \(data-dir : List F.Volume.Type)
|
||||
-> \(volumes : List F.Volume.Type)
|
||||
-> \(env : List Kubernetes.EnvVar.Type)
|
||||
@ -19,7 +21,7 @@ in \(app-name : Text)
|
||||
, volumes = volumes
|
||||
, container = Kubernetes.Container::{
|
||||
, name = "web"
|
||||
, image = image-name
|
||||
, image = input-web.image
|
||||
, args = Some [ "zuul-web", "-d" ]
|
||||
, imagePullPolicy = Some "IfNotPresent"
|
||||
, ports = Some
|
||||
|
@ -148,6 +148,17 @@ in \(input : Input)
|
||||
|
||||
let image = \(name : Text) -> "${org}/${name}:${version}"
|
||||
|
||||
let set-image =
|
||||
\(default-name : Text)
|
||||
-> \(input-name : Optional Text)
|
||||
-> { image =
|
||||
merge
|
||||
{ None = Some default-name
|
||||
, Some = \(_ : Text) -> input-name
|
||||
}
|
||||
input-name
|
||||
}
|
||||
|
||||
let etc-zuul =
|
||||
Volume::{
|
||||
, name = input.name ++ "-secret-zuul"
|
||||
@ -306,7 +317,7 @@ in \(input : Input)
|
||||
}
|
||||
, Zuul =
|
||||
let zuul-image =
|
||||
\(name : Text) -> Some (image ("zuul-" ++ name))
|
||||
\(name : Text) -> set-image (image "zuul-${name}")
|
||||
|
||||
let zuul-env =
|
||||
F.mkEnvVarValue (toMap { HOME = "/var/lib/zuul" })
|
||||
@ -357,14 +368,18 @@ in \(input : Input)
|
||||
in { Scheduler =
|
||||
./components/Scheduler.dhall
|
||||
input.name
|
||||
(zuul-image "scheduler")
|
||||
( input.scheduler
|
||||
// zuul-image "scheduler" input.scheduler.image
|
||||
)
|
||||
zuul-data-dir
|
||||
(zuul-volumes # [ sched-config ])
|
||||
(zuul-env # db-secret-env # zk-hosts-secret-env)
|
||||
, Executor =
|
||||
./components/Executor.dhall
|
||||
input.name
|
||||
(zuul-image "executor")
|
||||
( input.executor
|
||||
// zuul-image "executor" input.executor.image
|
||||
)
|
||||
zuul-data-dir
|
||||
(zuul-volumes # [ executor-ssh-key ])
|
||||
(zuul-env # db-nosecret-env)
|
||||
@ -372,30 +387,34 @@ in \(input : Input)
|
||||
, Web =
|
||||
./components/Web.dhall
|
||||
input.name
|
||||
(zuul-image "web")
|
||||
(input.web // zuul-image "web" input.web.image)
|
||||
zuul-data-dir
|
||||
zuul-volumes
|
||||
(zuul-env # db-secret-env # zk-hosts-secret-env)
|
||||
, Merger =
|
||||
./components/Merger.dhall
|
||||
input.name
|
||||
(zuul-image "merger")
|
||||
( input.merger
|
||||
// zuul-image "merger" input.merger.image
|
||||
)
|
||||
zuul-data-dir
|
||||
zuul-volumes
|
||||
(zuul-env # db-nosecret-env)
|
||||
, Registry =
|
||||
./components/Registry.dhall
|
||||
input.name
|
||||
(zuul-image "registry")
|
||||
( input.registry
|
||||
// zuul-image "registry" input.registry.image
|
||||
)
|
||||
zuul-data-dir
|
||||
[ etc-zuul-registry ]
|
||||
input.registry
|
||||
, Preview =
|
||||
./components/Preview.dhall
|
||||
input.name
|
||||
(zuul-image "preview")
|
||||
( input.preview
|
||||
// zuul-image "preview" input.preview.image
|
||||
)
|
||||
zuul-data-dir
|
||||
input.preview
|
||||
}
|
||||
, Nodepool =
|
||||
let nodepool-image =
|
||||
|
Loading…
Reference in New Issue
Block a user