-
Notifications
You must be signed in to change notification settings - Fork 166
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
Changes from 1 commit
594b658
91b3bf7
e06cbba
755e05a
6456d41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
ENV_DATA: | ||
submariner_source: "downstream" | ||
subctl_version: "subctl-rhel8:v0.16" | ||
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -157,6 +157,27 @@ def download_binary(self): | |||||
os.path.expanduser("~/.local/bin/subctl"), | ||||||
os.path.join(config.RUN["bin_dir"], "subctl"), | ||||||
) | ||||||
elif self.source == "downstream": | ||||||
self.download_downstream_binary | ||||||
|
||||||
def download_downstream_binary(self): | ||||||
subctl_ver = config.ENV_DATA["subctl_version"] | ||||||
cmd = ( | ||||||
f"oc image {constants.SUBCTL_DOWNSTREAM_URL}{subctl_ver} " | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing extract option in the cmd There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will need to use: 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||||||
f'--path="/dist/{subctl_ver}*-linux-amd64.tar.xz":/tmp --confirm' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||
) | ||||||
run_cmd(cmd) | ||||||
decompress = f"tar -C /tmp/ -xf /tmp/{subctl_ver}*--linux-amd64.tar.xz" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The two dashes (
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dahorak , ya typo while copy pasting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||||||
run_cmd(decompress) | ||||||
target_dir = os.path.expanduser("~/.local/bin/subctl") | ||||||
install_cmd = ( | ||||||
f"install -m744 /tmp/{subctl_ver}*/{subctl_ver}*-linux-amd64 {target_dir} " | ||||||
) | ||||||
run_cmd(install_cmd) | ||||||
shutil.copyfile( | ||||||
os.path.expanduser(f"{target_dir}"), | ||||||
os.path.join(config.RUN["bin_dir"], "subctl"), | ||||||
) | ||||||
|
||||||
def submariner_configure_upstream(self): | ||||||
""" | ||||||
|
There was a problem hiding this comment.
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.17There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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