Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree: drop support for cosaDir #125

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions vars/cosaBuild.groovy
Original file line number Diff line number Diff line change
@@ -1,44 +1,29 @@
// Build CoreOS, possibly with modifications.
// Available parameters:
// cosaDir: string -- Cosa working directory
// extraArgs: string -- Extra arguments to pass to `cosa build`
// extraFetchArgs: string -- Extra arguments to pass to `cosa fetch`
// gitBranch string -- Git Branch for fedora-coreos-config
// make: boolean -- Run `make && make install DESTDIR=...`
// makeDirs: []string -- Extra list of directories from which to `make && make install DESTDIR=...`
// noForce: boolean -- Do not force a cosa build even if nothing changed
// noStrict boolean -- Do not run cosa using `--strict' option
// overlays: []string -- List of directories to overlay
// skipInit: boolean -- Assume `cosa init` has already been run
// skipKola: boolean -- Do not automatically run kola on resulting build
def call(params = [:]) {
stage("Build") {
def cosaDir = utils.getCosaDir(params)
def extraFetchArgs = params.get('extraFetchArgs', "");
def extraArgs = params.get('extraArgs', "");

shwrap("mkdir -p ${cosaDir}")

if (!params['skipInit']) {
def branchArg = ""
if (params['gitBranch']) {
branchArg = "--branch ${params['gitBranch']}"
}
shwrap("cd ${cosaDir} && cosa init ${branchArg} https://github.com/coreos/fedora-coreos-config")
}

if (params['make']) {
shwrap("make && make install DESTDIR=${cosaDir}/overrides/rootfs")
}
if (params['makeDirs']) {
params['makeDirs'].each{
shwrap("make -C ${it} && make -C ${it} install DESTDIR=${cosaDir}/overrides/rootfs")
}
shwrap("cosa init ${branchArg} https://github.com/coreos/fedora-coreos-config")
}

if (params['overlays']) {
params['overlays'].each{
shwrap("rsync -av ${it}/ ${cosaDir}/overrides/rootfs")
shwrap("rsync -av ${it}/ overrides/rootfs")
}
}
if (!params['noStrict']) {
Expand All @@ -49,8 +34,8 @@ def call(params = [:]) {
extraArgs = "--force ${extraArgs}"
}

shwrap("cd ${cosaDir} && cosa fetch ${extraFetchArgs}")
shwrap("cd ${cosaDir} && cosa build ${extraArgs}")
shwrap("cosa fetch ${extraFetchArgs}")
shwrap("cosa build ${extraArgs}")
}

if (!params['skipKola']) {
Expand Down
13 changes: 0 additions & 13 deletions vars/cosaParallelCmds.groovy

This file was deleted.

203 changes: 0 additions & 203 deletions vars/gangplank.groovy

This file was deleted.

25 changes: 11 additions & 14 deletions vars/kola.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// addExtTests: []string -- list of test paths to run
// allowUpgradeFail boolean -- warn instead of fail on upgrade failure
// arch: string -- the target architecture
// cosaDir: string -- cosa working directory
// parallel: integer -- number of tests to run in parallel (default: # CPUs)
// skipBasicScenarios boolean -- skip basic qemu scenarios
// skipUpgrade: boolean -- skip running `cosa kola --upgrades`
Expand All @@ -13,8 +12,6 @@
// disableRerun: boolean -- disable reruns of failed tests
// marker: string -- some identifying text to add to uploaded artifact filenames
def call(params = [:]) {
def cosaDir = utils.getCosaDir(params)

// this is shared between `kola run` and `kola run-upgrade`
def platformArgs = params.get('platformArgs', "");
def buildID = params.get('build', "latest");
Expand All @@ -31,7 +28,7 @@ def call(params = [:]) {
def token = shwrapCapture("uuidgen | cut -f1 -d-")

// Create a unique output directory for this run of kola
def outputDir = shwrapCapture("cd ${cosaDir} && cosa shell -- mktemp -d ${cosaDir}/tmp/kola-XXXXX")
def outputDir = shwrapCapture("cosa shell -- mktemp -d tmp/kola-XXXXX")

// list of identifiers for each run for log collection
def ids = []
Expand All @@ -48,7 +45,7 @@ def call(params = [:]) {
// src/config repo which is also automatically added.
if (shwrapRc("""
test -d ${env.WORKSPACE}/tests/kola
configorigin=\$(cd ${cosaDir}/src/config && git config --get remote.origin.url)
configorigin=\$(cd src/config && git config --get remote.origin.url)
gitorigin=\$(cd ${env.WORKSPACE} && git config --get remote.origin.url)
test "\$configorigin" != "\$gitorigin"
""") == 0)
Expand All @@ -61,8 +58,8 @@ def call(params = [:]) {
shwrap("mkdir -p /var/tmp/kola && ln -s ${env.WORKSPACE} /var/tmp/kola/${name}")
} else {
shwrap("""
cd ${cosaDir} && cosa shell -- mkdir -p /var/tmp/kola
cd ${cosaDir} && cosa remote-session sync ${env.WORKSPACE}/ :/var/tmp/kola/${name}/
cosa shell -- mkdir -p /var/tmp/kola
cosa remote-session sync ${env.WORKSPACE}/ :/var/tmp/kola/${name}/
""")
}
args += "--exttest /var/tmp/kola/${name}"
Expand All @@ -87,23 +84,23 @@ def call(params = [:]) {
// do a single run in that case.
id = marker == "" ? "kola" : "kola-${marker}"
ids += id
shwrap("cd ${cosaDir} && cosa kola run ${rerun} --output-dir=${outputDir}/${id} --build=${buildID} ${archArg} ${platformArgs} --parallel ${parallel} ${args} ${extraArgs}")
shwrap("cosa kola run ${rerun} --output-dir=${outputDir}/${id} --build=${buildID} ${archArg} ${platformArgs} --parallel ${parallel} ${args} ${extraArgs}")
} else {
// basic run
if (!params['skipBasicScenarios']) {
id = marker == "" ? "kola-basic" : "kola-basic-${marker}"
ids += id
shwrap("cd ${cosaDir} && cosa kola run ${rerun} --output-dir=${outputDir}/${id} --basic-qemu-scenarios")
shwrap("cosa kola run ${rerun} --output-dir=${outputDir}/${id} --basic-qemu-scenarios")
}
// normal run (without reprovision tests because those require a lot of memory)
id = marker == "" ? "kola" : "kola-${marker}"
ids += id
shwrap("cd ${cosaDir} && cosa kola run ${rerun} --output-dir=${outputDir}/${id} --build=${buildID} ${archArg} ${platformArgs} --tag '!reprovision' --parallel ${parallel} ${args}")
shwrap("cosa kola run ${rerun} --output-dir=${outputDir}/${id} --build=${buildID} ${archArg} ${platformArgs} --tag '!reprovision' --parallel ${parallel} ${args}")

// re-provision tests (not run with --parallel argument to kola)
id = marker == "" ? "kola-reprovision" : "kola-reprovision-${marker}"
ids += id
shwrap("cd ${cosaDir} && cosa kola run ${rerun} --output-dir=${outputDir}/${id} --build=${buildID} ${archArg} ${platformArgs} --tag reprovision ${args}")
shwrap("cosa kola run ${rerun} --output-dir=${outputDir}/${id} --build=${buildID} ${archArg} ${platformArgs} --tag reprovision ${args}")
}
}

Expand All @@ -115,7 +112,7 @@ def call(params = [:]) {
try {
def id = marker == "" ? "kola-upgrade" : "kola-upgrade-${marker}"
ids += id
shwrap("cd ${cosaDir} && cosa kola ${rerun} --output-dir=${outputDir}/${id} --upgrades --build=${buildID} ${archArg} ${platformArgs}")
shwrap("cosa kola ${rerun} --output-dir=${outputDir}/${id} --upgrades --build=${buildID} ${archArg} ${platformArgs}")
} catch(e) {
if (params["allowUpgradeFail"]) {
warnError(message: 'Upgrade Failed') {
Expand All @@ -137,9 +134,9 @@ def call(params = [:]) {
} finally {
for (id in ids) {
// sanity check kola actually ran and dumped its output
shwrap("cd ${cosaDir} && cosa shell -- test -d ${outputDir}/${id}")
shwrap("cosa shell -- test -d ${outputDir}/${id}")
// collect the output
shwrap("cd ${cosaDir} && cosa shell -- tar -c --xz ${outputDir}/${id} > ${env.WORKSPACE}/${id}-${token}.tar.xz || :")
shwrap("cosa shell -- tar -c --xz ${outputDir}/${id} > ${env.WORKSPACE}/${id}-${token}.tar.xz || :")
archiveArtifacts allowEmptyArchive: true, artifacts: "${id}-${token}.tar.xz"
}
}
Expand Down
Loading