Skip to content

[watcher] Create symlink for wsgi script in backwards compatible path - #218

Open
amoralej wants to merge 1 commit into
openstack-k8s-operators:mainfrom
amoralej:wsgi-link
Open

amoralej wants to merge 1 commit into
openstack-k8s-operators:mainfrom
amoralej:wsgi-link

Conversation

@amoralej

@amoralej amoralej commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

As part of eventlet removal, watcher is removing the deprecated wsgi script /usr/bin/watcher-api-wsgi which is the path used as WSGIScriptAlias [1].

This patch is creating a symlink in that path to the watcher/wsgi/api.py which is valid to mod_wsgi to maintain a backwards compatible interface.

[1] https://review.opendev.org/c/openstack/watcher/+/1006113/

(adding depends-on to trigger watcher deployment job which is not merged yet)
Depends-On: #203

@openshift-ci

openshift-ci Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

[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 amoralej for approval. For more information see the Code Review Process.

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

Details 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

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/ecbcbfaa5eac4a03836d72216d59490d

✔️ s2i-openstack-containers-molecule SUCCESS in 2m 06s
✔️ s2i-openstack-container-content-provider SUCCESS in 3h 37m 01s
✔️ s2i-openstack-container-consumer-smoke SUCCESS in 6m 14s
✔️ s2i-openstack-deploy-validation SUCCESS in 1h 22m 11s
❌ watcher-s2i-tempest FAILURE in 1h 45m 07s

@amoralej

Copy link
Copy Markdown
Contributor Author

Tested in https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/build/f3c2bc42c4e541a98b42dec056865319 . Tempest test failure is known issue and unrelated but the API is working fine.

@amoralej

Copy link
Copy Markdown
Contributor Author

check-rdo

@centosinfra-prod-github-app

Copy link
Copy Markdown

# backwards compatibility

RUN rm -f /usr/bin/watcher-api-wsgi && \
ln -s /usr/lib/python3.12/site-packages/watcher/wsgi/api.py /usr/bin/watcher-api-wsgi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need to parameterise python version for future?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if we avoid hardcoding it will also be useful for the future if we use the same file for multiple base images with different python versions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These containerfiles are intended to build only for EL10 with python312 so i didn't want to complicate it much tbh. Said so, we may implement an easy way to manage the python version with:

RUN rm -f /usr/bin/watcher-api-wsgi && \
    ln -s /usr/lib/python*/site-packages/watcher/wsgi/api.py /usr/bin/watcher-api-wsgi && \
    [ -e "/usr/bin/watcher-api-wsgi" ] 

What do you think?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I was checking in nova-api and they added scripts https://github.com/openstack-k8s-operators/s2i-openstack-containers/tree/main/containers/nova/nova-api/scripts which are copied to /usr/bin:

COPY nova-api/scripts/nova-api-wsgi /usr/bin/nova-api-wsgi
RUN chmod 755 /usr/bin/nova-api-wsgi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We want to avoid maintaining a python wrapper script in the repo needlessly, that's why i proposed to do the symlink which should be easier to maintain

@viroel viroel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

from zuul job:
[watcher/watcher-base] [2/2] STEP 12/15: RUN rm -f /usr/bin/watcher-api-wsgi && ln -s /usr/lib/python3.12/site-packages/watcher/wsgi/api.py /usr/bin/watcher-api-wsgi

@viroel

viroel commented Sep 23, 2026

Copy link
Copy Markdown

from zuul job: [watcher/watcher-base] [2/2] STEP 12/15: RUN rm -f /usr/bin/watcher-api-wsgi && ln -s /usr/lib/python3.12/site-packages/watcher/wsgi/api.py /usr/bin/watcher-api-wsgi

In the end the validation job doesn't deploy watcher, so I was able to check that it build only, but we don't have a validation.

@amoralej

Copy link
Copy Markdown
Contributor Author

from zuul job: [watcher/watcher-base] [2/2] STEP 12/15: RUN rm -f /usr/bin/watcher-api-wsgi && ln -s /usr/lib/python3.12/site-packages/watcher/wsgi/api.py /usr/bin/watcher-api-wsgi

In the end the validation job doesn't deploy watcher, so I was able to check that it build only, but we don't have a validation.

I tested before with a depends-on on #203 which is not merged yet. That's the log i pasted in a previous comment. Logs are in https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/ecbcbfaa5eac4a03836d72216d59490d

Failure in tempest is unrelated and has been fixed separatedly. It could be executed again if desired.

@viroel

viroel commented Sep 24, 2026

Copy link
Copy Markdown

from zuul job: [watcher/watcher-base] [2/2] STEP 12/15: RUN rm -f /usr/bin/watcher-api-wsgi && ln -s /usr/lib/python3.12/site-packages/watcher/wsgi/api.py /usr/bin/watcher-api-wsgi

In the end the validation job doesn't deploy watcher, so I was able to check that it build only, but we don't have a validation.

I tested before with a depends-on on #203 which is not merged yet. That's the log i pasted in a previous comment. Logs are in https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/ecbcbfaa5eac4a03836d72216d59490d

Failure in tempest is unrelated and has been fixed separatedly. It could be executed again if desired.

ok, sorry, i missed your comment there.

As part of eventlet removal, watcher is removing the deprecated wsgi script
/usr/bin/watcher-api-wsgi which is the path used as WSGIScriptAlias [1].

This patch is creating a symlink in that path to the watcher/wsgi/api.py
which is valid to mod_wsgi to maintain a backwards compatible interface.

[1] https://review.opendev.org/c/openstack/watcher/+/1006113/

Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
@centosinfra-prod-github-app

Copy link
Copy Markdown

This change depends on a change that failed to merge.

Change #203 is needed.

@amoralej

Copy link
Copy Markdown
Contributor Author

check-rdo

@centosinfra-prod-github-app

Copy link
Copy Markdown

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.

3 participants