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

Download subctl downstream if not present #9657

Merged
merged 5 commits into from
May 16, 2024

Conversation

shylesh
Copy link
Contributor

@shylesh shylesh commented Apr 9, 2024

No description provided.

@shylesh shylesh requested a review from a team as a code owner April 9, 2024 23:05
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines label Apr 9, 2024
@shylesh shylesh self-assigned this Apr 9, 2024
@shylesh shylesh added team/ecosystem Ecosystem team related issues/PRs DR Metro and Regional DR related PRs labels Apr 9, 2024
subctl_ver = config.ENV_DATA["subctl_version"]
cmd = (
f"oc image {constants.SUBCTL_DOWNSTREAM_URL}{subctl_ver} "
f'--path="/dist/{subctl_ver}*-linux-amd64.tar.xz":/tmp --confirm'
Copy link
Member

Choose a reason for hiding this comment

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

I think we should get this amd64 dynamically based on currently running platform. As we can run ocs-ci on Apple Silicone chips like M1 - M2 ... we should consider to support also this arm64 binairies.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for now just added the conditional statement for x86_64 processor, I think we need a list of all supported ocs-ci platform names, ofcourse we need to check platforms for which binaries are available.

Copy link
Contributor

@dahorak dahorak left a comment

Choose a reason for hiding this comment

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

Overall LGTM, just one possible typo.

f'--path="/dist/{subctl_ver}*-linux-amd64.tar.xz":/tmp --confirm'
)
run_cmd(cmd)
decompress = f"tar -C /tmp/ -xf /tmp/{subctl_ver}*--linux-amd64.tar.xz"
Copy link
Contributor

Choose a reason for hiding this comment

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

The two dashes (--linux ) are there intentionally?

Suggested change
decompress = f"tar -C /tmp/ -xf /tmp/{subctl_ver}*--linux-amd64.tar.xz"
decompress = f"tar -C /tmp/ -xf /tmp/{subctl_ver}*-linux-amd64.tar.xz"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dahorak , ya typo while copy pasting

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

Signed-off-by: Shylesh Kumar Mohan <[email protected]>
@shylesh shylesh requested a review from a team as a code owner April 16, 2024 21:29
@@ -1,2 +1,3 @@
ENV_DATA:
submariner_source: "downstream"
subctl_version: "subctl-rhel8:v0.16"
Copy link
Contributor

Choose a reason for hiding this comment

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

Latest version is 0.17 and it should be subctl-rhel9 for 0.17

Copy link
Member

Choose a reason for hiding this comment

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

as we are still running on CentOS stream 8 , this might cause the compatibility issues to run on RHEL 8 based system as we recently saw with glibc issue.

We are going to move in matter of weeks to CentOS stream9 , but cannot say when exactly.

It can run without an issue, but might not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tried this on centos stream rlease 9 and its working

if processor == "x86_64":
binary_pltfrm = "amd64"
cmd = (
f"oc image {constants.SUBCTL_DOWNSTREAM_URL}{subctl_ver} "
Copy link
Contributor Author

Choose a reason for hiding this comment

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

missing extract option in the cmd

Copy link
Member

Choose a reason for hiding this comment

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

We will need to use:
--filter-by-os
With value
linux/arm64 - Apple M chips
linux/amd64 - regular x86_64

Some example from local testing:

$ oc image extract --filter-by-os linux/arm64 --registry-config ./path-to/pull-secret-ocs-ci registry.redhat.io/rhacm2/subctl-rhel8:v0.14 --confirm --path "/dist/subctl-v0.14*-linux-*.tar.xz":./
$ ls -l
total 43752
-rw-r-----@ 1 pbalogh  staff    11M Nov 16 00:32 subctl-v0.14.7-linux-amd64.tar.xz
-rw-r-----@ 1 pbalogh  staff   9.9M Nov 16 00:31 subctl-v0.14.7-linux-arm64.tar.xz

The previous file was subctl-v0.14.7-linux-amd64.tar.xz was actually downloaded before when I tried without specifying the --filter-by-os linux/arm64

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

petr-balogh
petr-balogh previously approved these changes Apr 22, 2024
prsurve
prsurve previously approved these changes Apr 29, 2024
@keesturam
Copy link
Member

@shylesh @sidhant-agrawal can you pls verify this PR so we can merge the changes?

@openshift-ci openshift-ci bot removed the lgtm label May 15, 2024
Signed-off-by: Shylesh Kumar Mohan <[email protected]>
Signed-off-by: Shylesh Kumar Mohan <[email protected]>
@openshift-ci openshift-ci bot added the lgtm label May 16, 2024
@petr-balogh
Copy link
Member

@shylesh - is this verified please?

@shylesh shylesh added the Verified Mark when PR was verified and log provided label May 16, 2024
@shylesh
Copy link
Contributor Author

shylesh commented May 16, 2024

03:24:16 - MainThread - ocs_ci.utility.utils - INFO - C[amagrawa-pr-hub] - Executing command: ./bin/subctl
03:24:16 - MainThread - conftest - INFO - C[amagrawa-pr-hub] - subctl binary not found, downloading now...
03:24:16 - MainThread - ocs_ci.utility.utils - INFO - C[amagrawa-pr-hub] - Executing command: oc image extract --filter-by-os linux/amd64 --registry-config /home/jenkins/workspace/qe-rdr-setup/ocs-ci/data/pull-secret registry.redhat.io/rhacm2/subctl-rhel9:v0.17 --path="/dist/subctl-v0.17*-linux-amd64.tar.xz":/tmp --confirm
03:24:54 - MainThread - ocs_ci.utility.utils - INFO - C[amagrawa-pr-hub] - Executing command: tar -C /tmp/ -xf /tmp/subctl-v0.17*-linux-amd64.tar.xz
03:24:55 - MainThread - ocs_ci.utility.utils - INFO - C[amagrawa-pr-hub] - Executing command: install -m744 /tmp/subctl-v0.17*/subctl-v0.17*-linux-amd64 ./bin
03:24:55 - MainThread - ocs_ci.utility.utils - INFO - C[amagrawa-pr-hub] - Executing command: mv ./bin/subctl-* ./bin/subctl
------------------------------------------------------- live log logreport --------------------------------------------------------
03:24:55 - MainThread - ocs_ci.framework.pytest_customization.reports - INFO - C[amagrawa-pr-hub] - duration reported by tests/functional/disaster-recovery/regional-dr/test_subctl.py::TestSubctl::test_subctl immediately after test execution: 41.8

@shylesh
Copy link
Contributor Author

shylesh commented May 16, 2024

@shylesh - is this verified please?

done

Copy link

openshift-ci bot commented May 16, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: am-agrawa, petr-balogh, shylesh, sidhant-agrawal

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

@shylesh shylesh merged commit 8cccb77 into red-hat-storage:master May 16, 2024
5 of 6 checks passed
amr1ta pushed a commit to amr1ta/ocs-ci that referenced this pull request May 28, 2024
* Download subctl downstream if not present

* Address review comments

* Address review comments: Update subctl version for rhel9

* Fix subctl download issue

* fix /bin/subctl path issues
---------

Signed-off-by: Shylesh Kumar Mohan <[email protected]>
petr-balogh pushed a commit to petr-balogh/ocs-ci that referenced this pull request May 29, 2024
* Download subctl downstream if not present

* Address review comments

* Address review comments: Update subctl version for rhel9

* Fix subctl download issue

* fix /bin/subctl path issues
---------

Signed-off-by: Shylesh Kumar Mohan <[email protected]>
shylesh added a commit to shylesh/ocs-ci that referenced this pull request Jun 3, 2024
* Download subctl downstream if not present

* Address review comments

* Address review comments: Update subctl version for rhel9

* Fix subctl download issue

* fix /bin/subctl path issues
---------

Signed-off-by: Shylesh Kumar Mohan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DR Metro and Regional DR related PRs lgtm size/M PR that changes 30-99 lines team/ecosystem Ecosystem team related issues/PRs Verified Mark when PR was verified and log provided
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants