Skip to content

Commit

Permalink
Merge pull request #16006 from MinaProtocol/dkijania/fix_develop_nigh…
Browse files Browse the repository at this point in the history
…tly_with_merge

Fix develop nightly with merge
  • Loading branch information
mrmr1993 committed Sep 4, 2024
2 parents f81a9d8 + 126ab66 commit c0c9d70
Show file tree
Hide file tree
Showing 35 changed files with 305 additions and 430 deletions.
57 changes: 41 additions & 16 deletions buildkite/src/Command/DockerImage.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ let Size = ./Size.dhall

let Profiles = ../Constants/Profiles.dhall

let Artifacts = ../Constants/Artifacts.dhall

let BuildFlags = ../Constants/BuildFlags.dhall

let Cmd = ../Lib/Cmds.dhall
Expand All @@ -20,59 +18,81 @@ let DockerLogin = ../Command/DockerLogin/Type.dhall

let DebianRepo = ../Constants/DebianRepo.dhall

let DebianVersions = ../Constants/DebianVersions.dhall

let Network = ../Constants/Network.dhall

let Artifacts = ../Constants/Artifacts.dhall

let ReleaseSpec =
{ Type =
{ deps : List Command.TaggedKey.Type
, network : Text
, service : Text
, service : Artifacts.Type
, version : Text
, branch : Text
, repo : Text
, no_cache : Bool
, deb_codename : Text
, deb_codename : DebianVersions.DebVersion
, deb_release : Text
, deb_version : Text
, deb_profile : Profiles.Type
, deb_repo : DebianRepo.Type
, build_flags : BuildFlags.Type
, step_key : Text
, step_key_suffix : Text
, if : Optional B/If
}
, default =
{ deps = [] : List Command.TaggedKey.Type
, network = "${Network.lowerName Network.Type.Devnet}"
, version = "\\\${MINA_DOCKER_TAG}"
, service = Artifacts.dockerName Artifacts.Type.Daemon
, service = Artifacts.Type.Daemon
, branch = "\\\${BUILDKITE_BRANCH}"
, repo = "\\\${BUILDKITE_REPO}"
, deb_codename = "bullseye"
, deb_codename = DebianVersions.DebVersion.Bullseye
, deb_release = "\\\${MINA_DEB_RELEASE}"
, deb_version = "\\\${MINA_DEB_VERSION}"
, deb_profile = Profiles.Type.Standard
, build_flags = BuildFlags.Type.None
, deb_repo = DebianRepo.Type.PackagesO1Test
, no_cache = False
, step_key = "daemon-standard-docker-image"
, step_key_suffix = "-docker-image"
, if = None B/If
}
}

let stepKey =
\(spec : ReleaseSpec.Type)
-> "${Artifacts.lowerName
spec.service}${Profiles.toLabelSegment
spec.deb_profile}${BuildFlags.toLabelSegment
spec.build_flags}${spec.step_key_suffix}"

let stepLabel =
\(spec : ReleaseSpec.Type)
-> "Docker: ${Artifacts.capitalName
spec.service} ${spec.network} ${DebianVersions.capitalName
spec.deb_codename} ${Profiles.toSuffixUppercase
spec.deb_profile} ${BuildFlags.toSuffixUppercase
spec.build_flags}"

let generateStep =
\(spec : ReleaseSpec.Type)
-> let exportMinaDebCmd = "export MINA_DEB_CODENAME=${spec.deb_codename}"
-> let exportMinaDebCmd =
"export MINA_DEB_CODENAME=${DebianVersions.lowerName
spec.deb_codename}"

let maybeCacheOption = if spec.no_cache then "--no-cache" else ""

let buildDockerCmd =
"./scripts/docker/build.sh"
++ " --service ${spec.service}"
++ " --service ${Artifacts.dockerName spec.service}"
++ " --network ${spec.network}"
++ " --version ${spec.version}"
++ " --branch ${spec.branch}"
++ " ${maybeCacheOption} "
++ " --deb-codename ${spec.deb_codename}"
++ " --deb-codename ${DebianVersions.lowerName
spec.deb_codename}"
++ " --deb-repo ${DebianRepo.address spec.deb_repo}"
++ " --deb-release ${spec.deb_release}"
++ " --deb-version ${spec.deb_version}"
Expand All @@ -83,10 +103,11 @@ let generateStep =

let releaseDockerCmd =
"./scripts/docker/release.sh"
++ " --service ${spec.service}"
++ " --service ${Artifacts.dockerName spec.service}"
++ " --version ${spec.version}"
++ " --network ${spec.network}"
++ " --deb-codename ${spec.deb_codename}"
++ " --deb-codename ${DebianVersions.lowerName
spec.deb_codename}"
++ " --deb-version ${spec.deb_version}"
++ " --deb-profile ${Profiles.lowerName spec.deb_profile}"
++ " --deb-build-flags ${BuildFlags.lowerName
Expand Down Expand Up @@ -123,12 +144,16 @@ let generateStep =
in Command.build
Command.Config::{
, commands = commands
, label = "Docker: ${spec.step_key}"
, key = spec.step_key
, label = "${stepLabel spec}"
, key = "${stepKey spec}"
, target = Size.XLarge
, docker_login = Some DockerLogin::{=}
, depends_on = spec.deps
, if = spec.if
}

in { generateStep = generateStep, ReleaseSpec = ReleaseSpec }
in { generateStep = generateStep
, ReleaseSpec = ReleaseSpec
, stepKey = stepKey
, stepLabel = stepLabel
}
52 changes: 18 additions & 34 deletions buildkite/src/Command/HardforkPackageGeneration.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ let pipeline
"gcr.io/o1labs-192920/mina-daemon:\${BUILDKITE_COMMIT:0:7}-${DebianVersions.lowerName
debVersion}-${network_name}"

let dockerSpec =
DockerImage.ReleaseSpec::{
, deps =
[ { name = pipelineName, key = generateLedgersJobKey } ]
, service = Artifacts.Type.Daemon
, network = network_name
, deb_codename = debVersion
, deb_profile = profile
, deb_repo = DebianRepo.Type.Local
}

in Pipeline.Config::{
, spec = JobSpec::{
, dirtyWhen = [ S.everything ]
Expand Down Expand Up @@ -155,20 +166,7 @@ let pipeline
, key = "publish-hardfork-deb-pkg"
, target = Size.Small
}
, DockerImage.generateStep
DockerImage.ReleaseSpec::{
, deps =
[ { name = pipelineName, key = generateLedgersJobKey } ]
, service = Artifacts.dockerName Artifacts.Type.Daemon
, network = network_name
, deb_codename = "${DebianVersions.lowerName debVersion}"
, deb_profile = profile
, deb_repo = DebianRepo.Type.Local
, step_key =
"daemon-berkeley-${DebianVersions.lowerName
debVersion}${Profiles.toLabelSegment
profile}-docker-image"
}
, DockerImage.generateStep dockerSpec
, Command.build
Command.Config::{
, commands =
Expand All @@ -182,10 +180,7 @@ let pipeline
, target = Size.XLarge
, depends_on =
[ { name = pipelineName
, key =
"daemon-berkeley-${DebianVersions.lowerName
debVersion}${Profiles.toLabelSegment
profile}-docker-image"
, key = DockerImage.stepKey dockerSpec
}
]
, if = None B/If
Expand All @@ -202,10 +197,7 @@ let pipeline
, target = Size.XLarge
, depends_on =
[ { name = pipelineName
, key =
"daemon-berkeley-${DebianVersions.lowerName
debVersion}${Profiles.toLabelSegment
profile}-docker-image"
, key = DockerImage.stepKey dockerSpec
}
]
, if = None B/If
Expand All @@ -214,28 +206,20 @@ let pipeline
DockerImage.ReleaseSpec::{
, deps =
[ { name = pipelineName, key = generateLedgersJobKey } ]
, service = Artifacts.dockerName Artifacts.Type.Archive
, service = Artifacts.Type.Archive
, network = network_name
, deb_codename = "${DebianVersions.lowerName debVersion}"
, deb_codename = debVersion
, deb_profile = profile
, deb_repo = DebianRepo.Type.Local
, step_key =
"archive-${DebianVersions.lowerName
debVersion}${Profiles.toLabelSegment
profile}-docker-image"
}
, DockerImage.generateStep
DockerImage.ReleaseSpec::{
, deps =
[ { name = pipelineName, key = generateLedgersJobKey } ]
, service = Artifacts.dockerName Artifacts.Type.Rosetta
, service = Artifacts.Type.Rosetta
, network = network_name
, deb_repo = DebianRepo.Type.Local
, deb_codename = "${DebianVersions.lowerName debVersion}"
, step_key =
"rosetta-${DebianVersions.lowerName
debVersion}${Profiles.toLabelSegment
profile}-docker-image"
, deb_codename = debVersion
}
]
}
Expand Down
Loading

0 comments on commit c0c9d70

Please sign in to comment.