Add openstack-tobiko container built from source - #82
Conversation
ee31bef to
f452228
Compare
| curl -fsSL \ | ||
| "https://mirror.openshift.com/pub/openshift-v4/${arch}/clients/ocp/stable/openshift-client-linux.tar.gz" \ | ||
| | tar -zx -C /usr/local/bin oc kubectl |
There was a problem hiding this comment.
This will file in hermetic builds, is this intended to be built in this kind of environments as konflux?
There was a problem hiding this comment.
I've updated the patch with:
COPY tobiko/openshift-client-linux-${TARGETARCH}.tar.gz /tmp/openshift-client-linux.tar.gz
and create the artifact file,
following the Konflux way: download a file before the image build, then use only that local copy.
|
|
||
| # Full git checkout so run_tobiko.sh can git pull / checkout TOBIKO_VERSION | ||
| # and tox can run tests from the source tree (TCIB layout). | ||
| COPY --from=build /src/tobiko /usr/local/src/tobiko |
There was a problem hiding this comment.
Does the container requires to have all the tobiko sources in the runtime container?
There was a problem hiding this comment.
Yes, because:
- test_operator uses TOBIKO_VERSION and TOBIKO_PATCH_REFSPEC to set the version of tobiko or include additional patch.
- It's for running tobiko tests, it uses tox from the tobiko repo.
There was a problem hiding this comment.
The tobiko repo should get built into a wheel and then installed in the runtime layer IINM
Why does tobiko need tox to run? Is it to isolate the environment? Because putting it in a container should do that.
There was a problem hiding this comment.
using tox would be incorrect because it wont end up using the correct dependencies as part to the hermetic build in konflux as well
i agree with emma that tobiko shoudl be packaged as a wheel and installed like the services and its requirements shoudl be installed into the final runtime contiaenr without a venv
this contianer will be run via the test-operator and the the test selection and execution should be done via its CR not via tox targets.
tox shoudl not be required or installed in the final runtime contaienr but shoudl not be used as part fo the build step either.
There was a problem hiding this comment.
by the way i see that this approch si based on teh tcib images but when we are doign a hemitc build under konflux we shoudl nto depend on having netwrok access
but conversly at runtime we also cannot rely on network access because this has to also work in a disconencted envrionment.
so run_tobiko.sh need to be able to run without installign anything and without assuming it executed as root to be able to chown tobiko:tobiko -R tobiko
all of thei fiels (ssh keys config, clouds.yamls) ectra shoudl be bind mounted into the correct location by the test-operator with the approate group and permssiosn set.
the run_tobiko.sh shoudl only invoke tobiko directly (without tox) and ensure the logs are in the approate loction
it shoudl not git cloen or modify file ownership or prepare venv in its standard operating mode.
that can optionally be supproted the same way run_tempest supprot cloning git repos at runtime for ci tests
https://github.com/openstack-k8s-operators/s2i-openstack-containers/blob/main/containers/tempest/tempest/scripts/run_tempest.sh#L340
but that shoudl not be how this works by default.
that really only intended for one of tests or plugins that did not have rpms in the past, the latter of which is not really relevent for s2i and it woudl only be used for case where we do not want to ship the relevent plugin to a customer.
There was a problem hiding this comment.
by the way the upstream docker files is much closer to the correct shape then this current file
https://github.com/redhat-openstack/tobiko/blob/master/Dockerfile#L19-L103
as is its run_tests.py tool
https://github.com/redhat-openstack/tobiko/blob/master/tools/run_tests.py
i think buildign form that would be a much better foundation then the current tcib images and adapting it to the convetison fo this repo
There was a problem hiding this comment.
WRT usage of TOBIKO_VERSION and TOBIKO_PATCH_REFSPEC . So, this isinstalling a specific version of tobiko in the container (i.e. in this case it's tobiko-0.8.31), but then run-tobiko.sh can checkout any other version or refspec and use it to run the tests via tox with its own dependencies etc... that may be different that the ones in the container. It's a pretty strange pattern tbh.
The idea of containers is to provide repeatable execution as the code running should be pinned to specific code. When there is a new code, a new container should be created and used.
I understand there must be historical reasons to do it this way, but it sounds as an antipattern for containers. I'm not sure we can change this at this point but it may be a good timing to consider.
About hermetic builds, I'm not sure if this container is to be built via hermetic builds.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
There was a problem hiding this comment.
You can remove this file.
If .git* is being ignored, check for some wider-scoped exclude
There was a problem hiding this comment.
I've followed the same as tempest structure -> https://github.com/openstack-k8s-operators/s2i-openstack-containers/tree/main/containers/tempest/src
| if [[ ! -z "${USE_EXTERNAL_FILES}" ]]; then | ||
| if [[ -f "${TOBIKO_DIR}/external_files/clouds.yaml" ]]; then | ||
| mkdir -p "${TOBIKO_DIR}/.config/openstack" | ||
| cp "${TOBIKO_DIR}/external_files/clouds.yaml" "${TOBIKO_DIR}/.config/openstack/" |
There was a problem hiding this comment.
I understand that this is coming from the TCIB script, however, I am concerned about the clouds.yaml being exposed in the external_files like this.
The clouds.yaml should be mounted into the appropriate place in the container at runtime, and this script should not be concerned about the clouds.yaml at all. If it's in the right place, then openstack should just work and use the credentials
There was a problem hiding this comment.
isn't that what it's doing? I'm not sure i'm missing something but iiuc, this is just copying the file from a external_files dir which as been placed into the container as a mount or copied via kolla interface and copying it under .config/openstack. The file is not exposed in this or tobiko repos, but managed in the operator?
There was a problem hiding this comment.
Said that, it'd be nice if the operator would leave the files in the expected locations, but i'm not sure this have security implications.
There was a problem hiding this comment.
It was set like that in tcib repo -> https://github.com/openstack-k8s-operators/tcib/blob/main/container-images/tcib/base/tobiko/run_tobiko.sh#L48
But I'll remove that part of external_files
There was a problem hiding this comment.
will it work at all without it?
There was a problem hiding this comment.
I'm not sure, but I think for now, I'll leave like that. I saw in tempest has the same config: https://github.com/openstack-k8s-operators/s2i-openstack-containers/blob/main/containers/tempest/tempest/scripts/run_tempest.sh#L558
| approvers: | ||
| - lpiwowar | ||
| - adrianfusco | ||
| - arxcruz | ||
| - kstrenkova | ||
|
|
||
| reviewers: | ||
| - evallesp | ||
| - rebtoor | ||
| - Valkyrie00 | ||
| - imatza-rh | ||
| - posikoya |
There was a problem hiding this comment.
Do all these people need to be in owners? Are they all still maintaining tobiko?
There was a problem hiding this comment.
I've copied it from test-operator -> https://github.com/openstack-k8s-operators/test-operator/blob/main/OWNERS_ALIASES#L8
| - `openstack-manila-api`; | ||
| - `openstack-manila-scheduler`; | ||
| - `openstack-manila-share`; | ||
| - `openstack-tempest`; |
There was a problem hiding this comment.
- tempest is out of scope for this change.
- Please also update containers/image-mappings.yaml
There was a problem hiding this comment.
Hi, I've removed the tempest line, about pto2, tobiko is not for d/s
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Add a from-source tobiko build so Tobiko follows the same UBI and lockfile path as tempest. The image copies the pinned x/tobiko tree, installs tox, and uses the TCIB run_tobiko.sh entrypoint so existing TOBIKO_TESTENV, version, patch, and USE_EXTERNAL_FILES workflows keep working. Layout matches tempest (scripts, sudoers, ENTRYPOINT, src gitignore). Assisted-By: Cursor-Grok 4.6
|
The OWNERS file contains untrusted users, which makes it INVALID. The following users are mentioned in OWNERS file(s) but are untrusted for the following reasons. One way to make the user trusted is to add them as members of the openstack-k8s-operators org. You can then trigger verification by writing
|
Add a from-source tobiko build so Tobiko follows the same UBI
and lockfile path as tempest.
The image copies the pinned x/tobiko tree, installs tox, and uses the
TCIB run_tobiko.sh entrypoint so existing TOBIKO_TESTENV, version,
patch, and USE_EXTERNAL_FILES workflows keep working. Layout matches
tempest (scripts, sudoers, ENTRYPOINT, src gitignore). OWNERS come
from test-operator.
Assisted-By: Cursor-Grok 4.6