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

[VNC]Cleanup configuration #525

Conversation

gibizer
Copy link
Contributor

@gibizer gibizer commented Sep 12, 2023

While reviewing other PRs we noticed that there is some unused template
parameters for the vnc configurations. So I started cleaning up it. Then
I noticed that never filled template parameters in our nova.conf related
to vnc. So this PR cleans up the [vnc] section and the related config
generation code. To be able to follow our template I split the template
to compute and vncproxy parts and made sure that only the relevant
configs are applied for each service. Also fixed a small bug that
ignored config generation errors.

@gibizer gibizer changed the title [NoVNC]Do not create internal service [VNC]Do not create internal service Sep 12, 2023
@gibizer
Copy link
Contributor Author

gibizer commented Sep 20, 2023

After #522 lands the core of this PR will not be needed as #522 already removes the internal endpoint. But there are cleanups in the PR that still needed.

Also there is extra cleanup discovered that can be done here:

I think novncproxy_host novncproxy_port and server_listen can be dropped from the template as they are unused when the config is rendered. I will do a cleanup separtely.

@gibizer gibizer force-pushed the remove-internal-novnc-service branch from 5bde428 to aa83737 Compare September 22, 2023 11:31
@gibizer
Copy link
Contributor Author

gibizer commented Sep 22, 2023

We know that tempest will only be green again after openstack-k8s-operators/openstack-operator#457 is landed.

@gibizer
Copy link
Contributor Author

gibizer commented Sep 25, 2023

/test nova-operator-build-deploy-tempest

@gibizer gibizer changed the title [VNC]Do not create internal service [VNC]Cleanup configuration Sep 26, 2023
{{ if eq .service_name "nova-compute"}}
{{ if (index . "novncproxy_base_url") }}
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be even more simplified to :

{{if eq .service_name "nova-novncproxy"}}
[vnc]
enabled = True
novncproxy_host = "::0"
novncproxy_port = 6080
{{else if (index . "novncproxy_base_url") }}
[vnc]
enabled = True
novncproxy_base_url = {{ .novncproxy_base_url }}
server_listen = "::0"
{{/* https://docs.openstack.org/oslo.config/latest/configuration/format.html#substitution    */}}
# note we may want to use console_host instead of my_ip however it wont be resolved via
# dns currently so we need to use my_ip for now.
# https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.console_host
server_proxyclient_address = "$my_ip"
{{else}}
[vnc]
enabled = False
{{end}}

or

{{if eq .service_name "nova-novncproxy"}}
[vnc]
enabled = True
novncproxy_host = "::0"
novncproxy_port = 6080
{{else if (index . "novncproxy_base_url") }}
[vnc]
enabled = True
novncproxy_base_url = {{ .novncproxy_base_url }}
server_listen = "::0"
{{/* https://docs.openstack.org/oslo.config/latest/configuration/format.html#substitution    */}}
# note we may want to use console_host instead of my_ip however it wont be resolved via
# dns currently so we need to use my_ip for now.
# https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.console_host
server_proxyclient_address = "$my_ip"
{{else if eq .service_name "nova-compute"}}
[vnc]
enabled = False
{{end}}

In both cases we have one logic block with fewer {{end}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While it is less nesting it does not really express the same thing. We need [vnc] section for two types of services novnc and compute. And in case of a compute we either need to enable the vnc support (if we have the novncproxy_base_url) or disable it. We should not generate a [vnc] section for other services ever, not even if for some broken reason they get novncproxy_base_url template parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think log term we would be better to have a split configuration template but I need to discuss at with @SeanMooney

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is further complicated now that the ironic virt driver support landed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I managed to flatten it during the rebase

While reviewing other PRs we noticed that there is some unused template
parameters for the vnc configurations. So I started cleaning up it. Then
I noticed that never filled template parameters in our nova.conf related
to vnc. So this PR cleans up the [vnc] section and the related config
generation code. To be able to follow our template I split the template
to compute and vncproxy parts and made sure that only the relevant
configs are applied for each service. Also fixed a small bug that
ignored config generation errors.
@gibizer gibizer force-pushed the remove-internal-novnc-service branch from aa83737 to 863615c Compare September 28, 2023 11:24
Copy link
Contributor

@mrkisaolamb mrkisaolamb left a comment

Choose a reason for hiding this comment

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

lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gibizer, mrKisaoLamb

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:
  • OWNERS [gibizer,mrKisaoLamb]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@softwarefactory-project-zuul
Copy link

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://review.rdoproject.org/zuul/buildset/717ac83266f44020a431248f8fa43e55

nova-operator-content-provider FAILURE in 12m 12s
⚠️ nova-operator-kuttl SKIPPED Skipped due to failed job nova-operator-content-provider

@gibizer
Copy link
Contributor Author

gibizer commented Sep 28, 2023

I think the dataplane-operator version in openstack-operator is so old that we lost the bundle image for that commit from quay.io. :/

@gibizer
Copy link
Contributor Author

gibizer commented Sep 28, 2023

/retest
recreated the missing dataplane-opertor bundle

@gibizer
Copy link
Contributor Author

gibizer commented Sep 28, 2023

recheck

@openshift-merge-robot openshift-merge-robot merged commit 8734257 into openstack-k8s-operators:main Sep 28, 2023
2 checks passed
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 28, 2023

@gibizer: 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/nova-operator-build-deploy-tempest 863615c link false /test nova-operator-build-deploy-tempest

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/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants