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

pipeline: fully move to S3 #67

Merged
merged 1 commit into from
Jun 6, 2019
Merged
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
34 changes: 16 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,12 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
}

stage('Fetch') {
// XXX: drop `!prod && ` once we've uploaded prod builds there
if (!prod && s3_builddir) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we ran this once already? or do we need coreos/coreos-assembler#545 first?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did buildupload once already, so we have something to buildprep from. coreos/coreos-assembler#545 is for the case where there's nothing to buildprep from (which is mostly relevant for devel pipelines).

if (s3_builddir) {
utils.shwrap("""
coreos-assembler buildprep s3://${s3_builddir}
""")
}

if (prod) {
// make sure our cached version matches prod exactly before continuing
utils.rsync_in("builds", "builds")
}

utils.shwrap("""
coreos-assembler fetch
""")
Expand Down Expand Up @@ -164,10 +158,9 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
""")
}

stage('Prune') {
// XXX: stop pruning like this when we fully drop artifact server
stage('Prune Cache') {
utils.shwrap("""
coreos-assembler prune --keep=8
coreos-assembler prune --keep=1
""")

// If the cache img is larger than e.g. 8G, then nuke it. Otherwise
Expand All @@ -188,9 +181,21 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
coreos-assembler compress
""")

if (s3_builddir) {
// just upload as public-read for now, but see discussions in
// https://github.com/coreos/fedora-coreos-tracker/issues/189
utils.shwrap("""
coreos-assembler buildupload s3 --acl=public-read ${s3_builddir}
""")
}

// XXX: For now, we keep uploading the latest build to the artifact
// server to make it easier for folks to access since we don't have
// a stream metadata frontend/website set up yet. The key part here
// is that it is *not* the canonical storage for builds.

// Change perms to allow reading on webserver side.
// Don't touch symlinks (https://github.com/CentOS/sig-atomic-buildscripts/pull/355)
// XXX: can drop this when dropping artifact server
utils.shwrap("""
find builds/ ! -type l -exec chmod a+rX {} +
""")
Expand All @@ -201,13 +206,6 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
if (prod) {
utils.rsync_out("builds", "builds")
}

if (s3_builddir) {
// XXX: just upload as public-read for now
utils.shwrap("""
coreos-assembler buildupload s3 --acl=public-read ${s3_builddir}
""")
}
}
}}
}