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

Update build_openstack_packages to support downstream gitlab #2699

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

raukadah
Copy link
Contributor

@raukadah raukadah commented Jan 31, 2025

This pr:

  • Since downstream gerrit repos is moved to gitlab. It drops downstream gerrit support and adds gitlab support.

  • Use the zuul clonned content instead of clonning from gerrit or gitlab. As zuul already checks out the source code. Let's reclone it for dlrn purpose.

  • Drop branch creation task as it is no longer needed.

  • Update patches branches to gitlab for gitlab related repos. Currently we have downstream openstack code on gerrit and gitlab.

  • For RHOS-18, downstream distgit uses rhoso-18 not rhos. It also updates the project.ini to reflect the same.

Related-Jira: https://issues.redhat.com/browse/OSPRH-13660

Copy link
Contributor

openshift-ci bot commented Jan 31, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Jan 31, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign cescgina for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Collaborator

@lewisdenny lewisdenny left a comment

Choose a reason for hiding this comment

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

Hi @raukadah, could you please add a commit message to explain this change

@raukadah raukadah marked this pull request as draft February 3, 2025 06:06
@raukadah raukadah marked this pull request as ready for review February 3, 2025 06:11
@raukadah
Copy link
Contributor Author

raukadah commented Feb 3, 2025

/hold

@raukadah raukadah force-pushed the fix_downstream branch 6 times, most recently from 4070691 to 798e3bf Compare February 3, 2025 10:48
@raukadah raukadah changed the title [WIP]Use zuul clonned repo instead of pulling from git source Update build_openstack_packages to support downstream gitlab cee Feb 3, 2025
@raukadah
Copy link
Contributor Author

raukadah commented Feb 3, 2025

/hold cancel

@raukadah
Copy link
Contributor Author

raukadah commented Feb 3, 2025

Hi @raukadah, could you please add a commit message to explain this change

Done!

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/1c7d1238aac243e6b9a2237f2ce34e3d

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 28m 34s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 13m 34s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 22m 35s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 05s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 25s
✔️ ci-framework-openstack-meta-content-provider SUCCESS in 13m 32s
✔️ build-push-container-cifmw-client SUCCESS in 16m 53s
✔️ cifmw-molecule-build_openstack_packages SUCCESS in 10m 14s

@raukadah raukadah changed the title Update build_openstack_packages to support downstream gitlab cee Update build_openstack_packages to support downstream gitlab Feb 4, 2025
Copy link
Contributor

@SeanMooney SeanMooney left a comment

Choose a reason for hiding this comment

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

/lgtm

loop:
- "{{ cifmw_bop_osp_release }}-rhel-9-trunk"
- "{{ cifmw_bop_osp_release }}-trunk-patches"
version: "{{ cifmw_bop_osp_release }}-trunk-patches"
Copy link
Contributor

Choose a reason for hiding this comment

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

you are initially checking out trunk-patches, that may not be correct in all cases such as if we want to run this in the -patches branch so you should not assume it trunk-patches in general. this was also assumed in the old code so that ok for now but we likely want to look this up based on the target branch of the MR when this is run in patches ci. for now this is enough to have parity with the older code.


- name: Update the project reference in packages.yml # noqa: command-instead-of-module
vars:
_old_content: 'osp-patches: ssh://{{ _change.host | split("//") | last }}:22/{{ _change.project }}'
_old_content: 'osp-patches: git@{{ _change.host | split("//") | last }}:{{ _change.project }}.git'
Copy link
Contributor

Choose a reason for hiding this comment

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

thecnically the git protocal is just ssh by another name but ya this makes sense

@@ -40,7 +40,8 @@ custom_preprocess={{ cifmw_bop_build_repo_dir }}/DLRN/scripts/set_nvr.sh,{{ cifm
info_files=osp.yml
versions_url=https://trunk.rdoproject.org/centos9-{{ cifmw_bop_openstack_release }}/current-podified/versions.csv
downstream_source_git_branch={{ cifmw_bop_osp_release }}-trunk-patches
downstream_distro_branch={{ cifmw_bop_osp_release }}{{ '.0' if '.' not in cifmw_bop_osp_release else '' }}-rhel-9-trunk
# downstream_distro_branch needs to be rhoso not rhos.
downstream_distro_branch={{ cifmw_bop_osp_release | replace('rhos', 'rhoso') }}{{ '.0' if '.' not in cifmw_bop_osp_release else '' }}-rhel-9-trunk
Copy link
Contributor

Choose a reason for hiding this comment

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

{{ '.0' if '.' not in cifmw_bop_osp_release else '' }}

so that is transformign 18 to 18.0 but it it was already 18.0.4 it would not modify it
makes sense

@@ -145,25 +145,15 @@
- "'host' in _change"
- "'redhat.com' in _change.host"
block:
- name: Clone the downstream project
- name: Clone the downstream project from zuul clonned repo
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMHO Tying this role even more to zuul is a strategic mistake

Copy link
Contributor

Choose a reason for hiding this comment

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

i strongly disagree.

the fact that this role was ever cloning code is a huge red flag.

our ci is meant to depend on zuul providing repos with all relevant patches pre merged by the zuul executor.

the current logic for making depend on work after the fact is flawed and only exist because of the fact we do not use zuul to prepare all source repos.

i was originally going to go further and ask chandan to remove the clonign fo repos form external sources entirely and only use the zuul provided source code which is the upstream best practice for opendev zuul.

we make it a hard error by default if devstack ever clones a repo for example as it breaks that pardime.

part of the reason we write jobs to let zuul clone the relvent code is to ensure all jobs in any given build set are executing on the same code.

we do get a similar effect by using content providers but its still better to avoid the extra network load and ci time required to have each job clone form upstream/downstream repos during the build.

Copy link
Contributor Author

@raukadah raukadah Feb 5, 2025

Choose a reason for hiding this comment

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

Thank you Pablo for the comments. I am not getting how relying on zuul would cause issues to this role.

Based on Sean's comment I am totally agreeing with him. We should rely on zuul provided repos. If an role's user populate the repos just like zuul does and construct zuul like vars then the role will work flawlessly.
Please let us know if anything we can do to address your concern.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe my message was way too short, cause I'm not pushing to clone the repos by ourselves, I agree with both of you on that. I was just saying that, if the code is already checked out by an external tool (not the cifmw, zuul, for example) why we need to checkout? In this case, if the job is properly configured the repos should be already present in the instance, if a depends-on exists zuul already patched that checked out content, etc. With this checkout here we may loose the depends-on, for example. So, tl;dr: Why we do not just copy the content from the directory that zuul uses?

ansible.builtin.git:
repo: '{{ _change.host }}/gerrit/{{ _change.project }}'
repo: '{{ ansible_user_dir }}/src/{{ _change.host | split("://") | last }}/{{ _change.project }}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we are using zuul as input, why not pick the source from it's metadata? It's already a git repo, so no need to checkout.

Copy link
Contributor Author

@raukadah raukadah Feb 5, 2025

Choose a reason for hiding this comment

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

We construct zuul_change_list like this

2025-02-04 10:14:38.069014 | controller | TASK [build_openstack_packages : Print Zuul change list var=cifmw_bop_change_list] ***
2025-02-04 10:14:38.069019 | controller | Tuesday 04 February 2025  10:14:38 -0500 (0:00:00.120)       0:05:51.056 ******
2025-02-04 10:14:38.069030 | controller | ok: [localhost] =>
2025-02-04 10:14:38.162668 | controller |   cifmw_bop_change_list:
2025-02-04 10:14:38.162698 | controller |   - branch: rhos-18.0-trunk-patches
2025-02-04 10:14:38.162704 | controller |     change: '4'
2025-02-04 10:14:38.162709 | controller |     host: <redacted>
2025-02-04 10:14:38.162714 | controller |     project: <project_ID>
2025-02-04 10:14:38.162718 | controller |     refspec: refs/changes/4/4/a1224a5f2a947bd3d7216b59e74f03492aa145ec

Based on above data, we perform further operations like clonning the repo and building the package using DLRN.
Since for downstream we are going to rely on zuul clonned repo (in future, we may add the same process for upstream gerrit and github). Here, We need to construct the repo name so that we can get the source of zuul metadata. I tried to modify the code on same line. I hope address the above concern.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was referring to, why do we craft the src directory assuming that zuul clones using that format instead of using the src_dir property that zuul uses to expose where's the content cloned?

loop:
- "{{ cifmw_bop_osp_release }}-rhel-9-trunk"
- "{{ cifmw_bop_osp_release }}-trunk-patches"
version: "{{ cifmw_bop_osp_release }}-trunk-patches"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hardcoding -trunk-patches is just asking for future maintenance burden.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor

openshift-ci bot commented Feb 4, 2025

New changes are detected. LGTM label has been removed.

This pr:
* Since downstream gerrit repos is moved to gitlab. It drops downstream
  gerrit support and adds gitlab support.

* Use the zuul clonned content instead of clonning from gerrit or
  gitlab. As zuul already checks out the source code. Let's reclone
  it for dlrn purpose.

* Drop branch creation task as it is no longer needed.
* Use drop provided by the change itself.

* Update patches branches to gitlab for gitlab related repos.
  Currently we have downstream openstack code on gerrit and gitlab.

* For RHOS-18, downstream distgit uses rhoso-18 not rhos. It also
  updates the project.ini to reflect the same.

Signed-off-by: Chandan Kumar (raukadah) <[email protected]>

Related-Jira: https://issues.redhat.com/browse/OSPRH-13660
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ec691c986b3e4bb5b68b8af49aecaa7a

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 46m 26s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 21m 47s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 29m 49s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 55s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 47s
✔️ ci-framework-openstack-meta-content-provider SUCCESS in 16m 34s
✔️ build-push-container-cifmw-client SUCCESS in 23m 59s
cifmw-molecule-build_openstack_packages FAILURE in 14m 26s

@raukadah
Copy link
Contributor Author

raukadah commented Feb 5, 2025

recheck unknown failure on cifmw-molecule-build_openstack_packages

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/65d3291ea3a64b8b8a27c69c760db55a

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 40m 13s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 20m 38s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 25m 06s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 54s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 21s
✔️ ci-framework-openstack-meta-content-provider SUCCESS in 14m 17s
✔️ build-push-container-cifmw-client SUCCESS in 23m 56s
cifmw-molecule-build_openstack_packages FAILURE in 14m 50s

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.

4 participants