gangplank: make it easy to copy over arbitrary files
Right now there is no easy way that I can find to copy an arbitrary file over to the remote host for a gangplank run. It would be nice to have that.
For example, we recently found an issue with bump-lockfile where we weren't actually forwarding the updated manifest to the aarch64 builder, so the build/tests that were running for aarch64 were actually for what was in current git main rather than the proposed bump to the lockfile. One way we could have worked around this was to add the file to a list of extra files to copy and then put it in place in a prep script, but there's no easy way to copy extra files.
We could create a cache.tar.gz of the manifest-lock.aarch64.json and put it in our bucket and that would get copied over if we add require_cache: true to our spec, but it's a bit of a hack.
NOTE: for that require_cache: true hack to work I had to apply this patch to gangplank (not sure why):
diff --git a/gangplank/internal/ocp/bc.go b/gangplank/internal/ocp/bc.go
index 0984cab59..49e1b3316 100644
--- a/gangplank/internal/ocp/bc.go
+++ b/gangplank/internal/ocp/bc.go
@@ -742,7 +742,7 @@ func getStageFiles(buildID string,
&RemoteFile{
Bucket: bucket,
Compressed: true,
- ForceExtractPath: "/", // will extract to /srv/cache
+//// ForceExtractPath: "/", // will extract to /srv/cache
Minio: m,
Object: obj,
})
and then placed cache.tar.gz at builds/cache/cache.tar.gz and ran:
gangplank pod --podman --bucket=builds --image localhost/coreos-assembler:latest --arch aarch64 --spec spec.spec
Either way would be nice to make it easier to copy files across to the remote.