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

rsync to stagingyum per distro #381

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Nov 20, 2023

The rsync script on web01 needs the version to exist on the rsync target in order to properly know what release to work with. In order to include the release we need to rsync per OS rather than one command for the whole version.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

The idea behind sync a whole version is that it's atomic. For Debian (where we have multiple directories) we join the paths:

/usr/bin/rsync -avPx ${deb_paths.join(' ')} ${target_path}

That way it's a single atomic action and everything gets promoted as one. You don't have the risk (*) that EL9 is newer than EL8 because the network failed after EL9 was done.

I still think that we should solve it similar to theforeman/foreman-infra#1994 instead. I'll leave some comments there.

  • Technically, everything can crash, but you minimize the risk

@evgeni
Copy link
Member

evgeni commented Nov 22, 2023

The idea behind sync a whole version is that it's atomic. For Debian (where we have multiple directories) we join the paths:

/usr/bin/rsync -avPx ${deb_paths.join(' ')} ${target_path}

While the above excerpt looks like it, we don't do that. deb_paths are the paths of the actual debs.

The place where we actually call rsync methods from is here:

echo "Repos to rsync: ${repos}"
repos.each { key, value ->
if (value.type == 'stage') {
steps.rsync_packages[key] = {
rsync_to_debian_stage(value.suite, value.component, value.deb_paths)
}
} else {
steps.rsync_packages[key] = {
rsync_to_debian_release(value.suite, value.component, value.deb_paths)
}
}
}

And repos has keys of the form ${suite}-${component}, which is bullseye-3.9, focal-plugins etc.

You can also see it in Jenkins where we have separate "push-{version}-{os}" steps for stage→prod:
https://ci.theforeman.org/blue/organizations/jenkins/foreman-nightly-deb-pipeline/detail/foreman-nightly-deb-pipeline/1353/pipeline
https://ci.theforeman.org/blue/organizations/jenkins/foreman-3.8-release-pipeline/detail/foreman-3.8-release-pipeline/6/pipeline/166

And "{os}-{version}" for packaging → stage:
https://ci.theforeman.org/blue/organizations/jenkins/foreman-packaging-deb-3.8-release/detail/foreman-packaging-deb-3.8-release/12/pipeline/131

@ehelms
Copy link
Member Author

ehelms commented Nov 22, 2023 via email

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I was playing a bit with it and didn't finish it yesterday, but in theforeman/foreman-infra#1994 (comment) I wrote down my findings.

The short version is to add trailing slashes, so my recommendation is to rsync ${collection}/${version}/ ${user}@${host}:rsync_cache/${target}/${version}/

theforeman.org/pipelines/lib/packaging.groovy Outdated Show resolved Hide resolved
@ehelms ehelms force-pushed the rsync-stage-distro branch from 0bbef5c to 31ff9f9 Compare November 22, 2023 16:21
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I didn't test this out end-to-end, but since it's what I recommended based on local testing I approve :)

@ekohl ekohl merged commit 6dd3bfe into theforeman:master Nov 22, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants