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

feat(pkg) add jenkins-infra/mirrorscripts under Puppet management #3358

Merged

Conversation

dduportal
Copy link
Contributor

@dduportal dduportal commented Mar 29, 2024

Follow up of jenkins-infra/helpdesk#3414

This PR is the first step of #3352.

It adds the set of "mirror scripts" used on the pkg VM (pkg.origin.jenkins.io and updates.jenkins.io) under Puppet management but without any templated content (subsequent PR):

  • The repository jenkins-infra/mirror-scripts was imported into dist/profile/templates/mirror-scripts with all its history using the following command (note: 7184a97f1a2591684f6b5b32abaf7ff5efb1dfd3 being the HEAD of its main branch):

    git subtree add -P dist/profile/templates/mirror-scripts https://github.com/jenkins-infra/mirror-scripts 7184a97f1a2591684f6b5b32abaf7ff5efb1dfd3
    • Note that any git log command in the future will see the imported reference files at the root of jenkins-infra/jenkins-infra so might need addition options. But a subsequent PR will have the script renamed with a .erb extension.
  • There is only one commit to be review: the last one e8a6aebf69ae0898f44cdabf3a8e052e3e5d0302 which has the puppet management code.

    • Note that the file content uses the template() function but no templated content is available yet!
    • The .gitignore and the README.md files have been removed from mirror-scripts

The following workflow is expected once this PR is approved (or if a "force merge" is triggered) - tested on a local vagrant VM

  • before merging:
    • Run the puppet agent on the VM one last time to ensure the "noop" diff won't be polluted by the usual Jenkins keys regular changes (will be fixed on another PR)
    • Disabling puppet agent before on the pkg VM
  • Merge the PR here
  • Run a puppet agent "noop" and make sure that only the changes here are expected, then apply
    -Note: We only expect the 6 symlinks to be replaced by files
  • Compare the content of the 6 new files with the content of their counterparts in /srv/releases/mirror-scripts/. They should be the same
  • If OK, then delete the directory /srv/releases/mirror-scripts and the /srv/releases/.git* config file (if any)
  • Restart the pupept agent and check there are no changes

mirrorbrain Puppet-managed User and others added 30 commits August 21, 2020 19:19
I'm aware that some of the scripts are in jenkins-infra/jenkins-infra
but the puppet agent has been disabled for ages
and this is an easy way to ensure we don't lose changes
Handle the case when there are no recent releases
Co-authored-by: mirrorbrain Puppet-managed User <mirrorbrain@ip-172-31-33-96.ec2.internal>
Server is down and cannot receive the files.
…d-archives-upload

Revert "Suspend archives upload"
Server is down and cannot receive the files.

See jenkins-infra/mirror-scripts#5 for an example
and jenkins-infra/mirror-scripts#6 for the change
that reverted it when archives.jenkins.io was again available.
…archives

Temporarily disable upload to archives.jenkins-ci.org
…e-upload-to-archives

Revert "Temporarily disable upload to archives.jenkins-ci.org"
sync-recent-releases must copy directory content
in order to solve dependencies conflict
fix(sync recent releases): adding a venv python for blobxfer
…blobxfer CLI

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
fix(batch upload,sync) follow up of 503b7ac to use a virtual env for blobxfer CLI
…PATH when running from a crontab

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
…or azcopy

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
…591684f6b5b32abaf7ff5efb1dfd3'

git-subtree-dir: dist/profile/templates/mirror-scripts
git-subtree-mainline: 9d388e8
git-subtree-split: 7184a97
…-it (content not templatized yet)

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal dduportal changed the title Feat/pkg/add mirrorscripts feat(pkg) add jenkins-infra/mirrorscripts under Puppet management Mar 29, 2024
@dduportal dduportal marked this pull request as ready for review March 29, 2024 12:07
@dduportal dduportal requested a review from a team as a code owner March 29, 2024 12:07
@lemeurherve
Copy link
Member

WDYT of rebasing some of the recent commits?

@dduportal
Copy link
Contributor Author

WDYT of rebasing some of the recent commits?

I'm not sure to understand: what is the problem it would solve? Not sure how to do it either?

@lemeurherve
Copy link
Member

Sorry, by rebasing I meant squashing commits so the git (recent) history would be a little bit cleaner and easier to navigate if needed.

@MarkEWaite
Copy link
Contributor

Sorry, by rebasing I meant squashing commits so the git (recent) history would be a little bit cleaner and easier to navigate if needed.

I'm opposed to rebase or squash of changes on the primary branch of a repository because it requires others who have forked or cloned the repository to perform additional actions to replace the history that is being rewritten. That is especially problematic when git clone is used to populate a tools collection onto a machine. I do that with agents in my private Jenkins controller and it would be a terrible experience if I changed the existing history of the primary branch.

I don't object to squash or rebase during a merge operation. That tends to keep the history of the primary branch more tidy. However, once something is on the primary branch, a rewrite of history creates pain for others.

@lemeurherve
Copy link
Member

lemeurherve commented Mar 29, 2024

Sorry, by rebasing I meant squashing commits so the git (recent) history would be a little bit cleaner and easier to navigate if needed.

I'm opposed to rebase or squash of changes on the primary branch of a repository because it requires others who have forked or cloned the repository to perform additional actions to replace the history that is being rewritten. That is especially problematic when git clone is used to populate a tools collection onto a machine. I do that with agents in my private Jenkins controller and it would be a terrible experience if I changed the existing history of the primary branch.

I don't object to squash or rebase during a merge operation. That tends to keep the history of the primary branch more tidy. However, once something is on the primary branch, a rewrite of history creates pain for others.

As these commits aren't in this repo yet I'm proposing to take the opportunity of this PR to squash some of these.
No one should be impacted by this as there is no rebase or squash of any commit of the primary branch, only on commits of this pull request.

@dduportal
Copy link
Contributor Author

Sorry, by rebasing I meant squashing commits so the git (recent) history would be a little bit cleaner and easier to navigate if needed.

I'm opposed to rebase or squash of changes on the primary branch of a repository because it requires others who have forked or cloned the repository to perform additional actions to replace the history that is being rewritten. That is especially problematic when git clone is used to populate a tools collection onto a machine. I do that with agents in my private Jenkins controller and it would be a terrible experience if I changed the existing history of the primary branch.
I don't object to squash or rebase during a merge operation. That tends to keep the history of the primary branch more tidy. However, once something is on the primary branch, a rewrite of history creates pain for others.

As these commits aren't in this repo yet I'm proposing to take the opportunity of this PR to squash some of these. No one should be impacted by this as there is no rebase or squash of any commit of the primary branch, only on commits of this pull request.

The goal of importing the history is to allow navigating through the git CLI instead of having to search GitHub (https://github.com/jenkins-infra/mirror-scripts/commits/main/). It means the history should be kept to map to the existing (almost archived) repository otherwise I don't see the need.

Rewriting the imported history has an impact: it will be hard to map a given change to the associated history in https://github.com/jenkins-infra/mirror-scripts.

Besides, what would the criteria to decide to rebase or not? Who would have to do this? It looks like a superficial change and that means spending hours getting a review + consensus on each squashed commit. I don't see the problem being solved by doing this, but only the waste of time. Could you clarify your request in that matter?

dduportal added a commit to dduportal/jenkins-infra that referenced this pull request Mar 29, 2024
The set of "mirror scripts" imported in jenkins-infra#3358
have their content templatized to map to puppet hieradata configuration used by profiles.

Note: the profile `updatesite` has been updated (default param. value move to hieradata)
to allow other profiles to lookup the value (`updatesite` and `pkgrepo`` are still highly coupled on the same VM).

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal
Copy link
Contributor Author

Starting a pairing session with @smerle33 to land this PR and process forward.

We'll merge with the option "Merge commit" to avoid polluting the main branch's history. The git log will still be able to search the imported history through the ref-log, but we won't have what appear to be an annoyance regarding the collection of commits.

Copy link
Contributor

@smerle33 smerle33 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@smerle33 smerle33 merged commit 79bde8f into jenkins-infra:production Mar 29, 2024
2 checks passed
@dduportal dduportal deleted the feat/pkg/add-mirrorscripts branch March 29, 2024 15:56
@dduportal
Copy link
Contributor Author

Deployment went well (following the written procedure).

dduportal added a commit to dduportal/jenkins-infra that referenced this pull request Mar 29, 2024
The set of "mirror scripts" imported in jenkins-infra#3358
have their content templatized to map to puppet hieradata configuration used by profiles.

Note: the profile `updatesite` has been updated (default param. value move to hieradata)
to allow other profiles to lookup the value (`updatesite` and `pkgrepo`` are still highly coupled on the same VM).

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
smerle33 added a commit that referenced this pull request Mar 29, 2024
* chore(pkg) templatize mirror-scripts on the 'pkgrepo' profile

The set of "mirror scripts" imported in #3358
have their content templatized to map to puppet hieradata configuration used by profiles.

Note: the profile `updatesite` has been updated (default param. value move to hieradata)
to allow other profiles to lookup the value (`updatesite` and `pkgrepo`` are still highly coupled on the same VM).

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>

* Update dist/profile/manifests/pkgrepo.pp

* Update dist/profile/manifests/pkgrepo.pp

* code review fixup

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>

* code review fixup

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>

* code review fixup

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>

* code review fixup

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>

* Update spec/classes/profile/pkgrepo_spec.rb

---------

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Co-authored-by: Stéphane MERLE <95630726+smerle33@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants