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

Migrate doomsday pipeline to python #997

Merged
merged 5 commits into from
Oct 7, 2024

Conversation

adobes1
Copy link
Contributor

@adobes1 adobes1 commented Oct 1, 2024

Migrate doomsday pipeline to Python and add retries to running oc adm release mirror ... and aws s3 sync ... commands

pyartcd/pyartcd/pipelines/doomsday.py Outdated Show resolved Hide resolved
pyartcd/pyartcd/pipelines/doomsday.py Outdated Show resolved Hide resolved
pyartcd/pyartcd/pipelines/doomsday.py Outdated Show resolved Hide resolved
pyartcd/pyartcd/pipelines/doomsday.py Outdated Show resolved Hide resolved
pyartcd/pyartcd/__main__.py Outdated Show resolved Hide resolved
@ashwindasr
Copy link
Contributor

Tested the command locally and its working as expected. Once the review changes are in, we can test it on prod

major_minor = ".".join(self.version.split(".")[:2])
path = f"{self.workdir}/{major_minor}/{self.version}/{arch}"
mirror_cmd = f"oc adm release mirror quay.io/openshift-release-dev/ocp-release:{self.version}-{arch} --keep-manifest-list --to-dir={path}"
aws_cmd = f"aws s3 sync {path} s3://ocp-doomsday-registry/release-image/{path}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should workdir be part of the bucket?

Copy link
Contributor

@joepvd joepvd Oct 1, 2024

Choose a reason for hiding this comment

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

cmd_assert accepts both a string and a list as command. Think list is preferred. This allows python to do the shell escaping for us.

mirror_cmd = ["oc', 'adm', 'release', 'mirror',
   f'quay.io/openshift-release-dev/ocp-release:{self.version}-{arch}', 
  '--keep-manifest-list',
  '--to-dir={path}']

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should workdir be part of the bucket?

Thanks for pointing that out, complete missed it. Should be fixed now

cmd_assert accepts both a string and a list as command. Think list is preferred. This allows python to do the shell escaping for us.

Also fixed


major_minor = ".".join(self.version.split(".")[:2])
path = f"{self.workdir}/{major_minor}/{self.version}/{arch}"
mirror_cmd = f"oc adm release mirror quay.io/openshift-release-dev/ocp-release:{self.version}-{arch} --keep-manifest-list --to-dir={path}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not part of your porting work but noticing there are more "multi" entries that might need backup?

skopeo list-tags docker://quay.io/openshift-release-dev/ocp-release | grep '4\.16\.13'
        "4.16.13-aarch64",
        "4.16.13-multi",
        "4.16.13-multi-aarch64",
        "4.16.13-multi-ppc64le",
        "4.16.13-multi-s390x",
        "4.16.13-multi-x86_64",
        "4.16.13-ppc64le",
        "4.16.13-s390x",
        "4.16.13-x86_64",

Is 4.16.13-multi-x86_64 implicitly backed up when 4.16.13-multi is treated?

Copy link
Contributor

Choose a reason for hiding this comment

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

@adobes1 lets keep this as a follow up. I'll give you read only access to the AWS cluster, once this PR is merged, make sure that files are being uploaded correctly to the bucket, this week.


try:
if self.runtime.dry_run:
self.runtime.logger.info("[DRY RUN] Would have run %s", mirror_cmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

"copy to local working directory" should be ok in dry-run scenario.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I changed it

@ashwindasr
Copy link
Contributor

rebased to pull in new changes

@ashwindasr ashwindasr force-pushed the migrate-doomsday branch 2 times, most recently from fe0fe42 to 60fc7b3 Compare October 7, 2024 14:55
Copy link
Contributor

openshift-ci bot commented Oct 7, 2024

@adobes1: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security cd6876c link false /test security

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ashwindasr
Copy link
Contributor

ashwindasr commented Oct 7, 2024

The uv installation seems to be causing an issue. In openshift, we rely on the gobal pip packages, but uv uses a local venv. Lets figure it out in a following PR, and merge with pip3 intall for now

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2024
Copy link
Contributor

openshift-ci bot commented Oct 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashwindasr

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 7, 2024
@ashwindasr ashwindasr merged commit f2aee83 into openshift-eng:main Oct 7, 2024
2 of 3 checks passed
@ashwindasr
Copy link
Contributor

@adobes1 the name was not updated everywhere, #1014 as followup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants