diff --git a/Dockerfile.rhel8 b/Dockerfile.rhel8 deleted file mode 100644 index 05c3c8a9dd..0000000000 --- a/Dockerfile.rhel8 +++ /dev/null @@ -1,35 +0,0 @@ -FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.14 AS builder -WORKDIR /go/src/github.com/openshift/cluster-node-tuning-operator -COPY . . -RUN make build - -FROM registry.ci.openshift.org/ocp/4.14:base -COPY --from=builder /go/src/github.com/openshift/cluster-node-tuning-operator/_output/cluster-node-tuning-operator /usr/bin/ -COPY --from=builder /go/src/github.com/openshift/cluster-node-tuning-operator/_output/performance-profile-creator /usr/bin/ -COPY --from=builder /go/src/github.com/openshift/cluster-node-tuning-operator/_output/gather-sysinfo /usr/bin/ -COPY manifests/*.yaml manifests/image-references /manifests/ -ENV APP_ROOT=/var/lib/ocp-tuned -ENV PATH=${APP_ROOT}/bin:${PATH} -ENV HOME=${APP_ROOT} -ENV SYSTEMD_IGNORE_CHROOT=1 -WORKDIR ${APP_ROOT} -COPY assets/bin /usr/local/bin -RUN INSTALL_PKGS=" \ - tuned tuned-profiles-atomic tuned-profiles-cpu-partitioning tuned-profiles-mssql tuned-profiles-nfv tuned-profiles-nfv-guest \ - tuned-profiles-nfv-host tuned-profiles-openshift tuned-profiles-oracle tuned-profiles-postgresql tuned-profiles-realtime \ - tuned-profiles-sap tuned-profiles-sap-hana tuned-profiles-spectrumscale \ - nmap-ncat procps-ng pciutils" && \ - mkdir -p /etc/grub.d/ /boot /var/lib/ocp-tuned && \ - dnf install --setopt=tsflags=nodocs -y $INSTALL_PKGS && \ - rm -rf /etc/tuned/recommend.d && \ - echo auto > /etc/tuned/profile_mode && \ - sed -Ei 's|^#?\s*enable_unix_socket\s*=.*$|enable_unix_socket = 1|;s|^#?\s*rollback\s*=.*$|rollback = not_on_exit|;s|^#?\s*profile_dirs\s*=.*$|profile_dirs = /var/lib/ocp-tuned/profiles,/usr/lib/tuned|' \ - /etc/tuned/tuned-main.conf && \ - touch /etc/sysctl.conf && \ - dnf clean all && \ - rm -rf /var/cache/yum ~/patches /root/rpms && \ - useradd -r -u 499 cluster-node-tuning-operator -ENTRYPOINT ["/usr/bin/cluster-node-tuning-operator"] -LABEL io.k8s.display-name="OpenShift cluster-node-tuning-operator" \ - io.k8s.description="This is a component of OpenShift and manages the lifecycle of node-level tuning." \ - io.openshift.release.operator=true diff --git a/assets/performanceprofile/configs/ocp-tuned-one-shot.service b/assets/performanceprofile/configs/ocp-tuned-one-shot.service index d0ad4b719d..60f39e364c 100644 --- a/assets/performanceprofile/configs/ocp-tuned-one-shot.service +++ b/assets/performanceprofile/configs/ocp-tuned-one-shot.service @@ -36,7 +36,7 @@ ExecStart=/usr/bin/podman run \ --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/assets/tuned/manifests/ds-tuned.yaml b/assets/tuned/manifests/ds-tuned.yaml index 13bb57e5e0..c94842f797 100644 --- a/assets/tuned/manifests/ds-tuned.yaml +++ b/assets/tuned/manifests/ds-tuned.yaml @@ -23,7 +23,7 @@ spec: spec: serviceAccountName: tuned containers: - - command: ["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster","-v=0"] + - command: ["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster","-v=0"] resources: requests: cpu: 10m diff --git a/hack/dockerfile_install_support.sh b/hack/dockerfile_install_support.sh index 99fa8aa3c0..62e40d1ff0 100644 --- a/hack/dockerfile_install_support.sh +++ b/hack/dockerfile_install_support.sh @@ -3,6 +3,12 @@ set -euo pipefail set -o xtrace +INSTALL_PKGS="nmap-ncat procps-ng pciutils" + +# TuneD pre-installation steps +cp -r /root/assets/bin/* /usr/local/bin +mkdir -p /etc/grub.d/ /boot /run/ocp-tuned + source /etc/os-release if [[ "${ID}" == "centos" ]]; then @@ -13,19 +19,12 @@ if [[ "${ID}" == "centos" ]]; then LC_COLLATE=C cat ../patches/*.diff | patch -Np1 dnf build-dep tuned.spec -y make rpm PYTHON=/usr/bin/python3 - rm -rf /root/rpmbuild/RPMS/noarch/{tuned-gtk*,tuned-utils*,tuned-profiles-compat*}; + rm -rf /root/rpmbuild/RPMS/noarch/{tuned-gtk*,tuned-utils*,tuned-profiles-compat*} dnf --setopt=protected_packages= history -y undo 0 # Remove builddep - INSTALL_PKGS="nmap-ncat procps-ng pciutils" - cp -r /root/assets/bin/* /usr/local/bin cp -r /root/rpmbuild/RPMS/noarch /root/rpms - mkdir -p /etc/grub.d/ /boot /var/lib/ocp-tuned dnf install --setopt=tsflags=nodocs -y ${INSTALL_PKGS} - rpm -V ${INSTALL_PKGS} dnf --setopt=tsflags=nodocs -y install /root/rpms/*.rpm - rm -rf /etc/tuned/recommend.d - echo auto > /etc/tuned/profile_mode - sed -Ei 's|^#?\s*enable_unix_socket\s*=.*$|enable_unix_socket = 1|;s|^#?\s*rollback\s*=.*$|rollback = not_on_exit|;s|^#?\s*profile_dirs\s*=.*$|profile_dirs = /usr/lib/tuned/profiles,/usr/lib/tuned,/var/lib/ocp-tuned/profiles|' /etc/tuned/tuned-main.conf; # Clean up build tools to remove image footprint dnf remove --setopt=protected_packages= -y ${BUILD_INSTALL_PKGS} @@ -38,14 +37,14 @@ else tuned tuned-profiles-atomic tuned-profiles-cpu-partitioning tuned-profiles-mssql tuned-profiles-nfv tuned-profiles-nfv-guest \ tuned-profiles-nfv-host tuned-profiles-openshift tuned-profiles-oracle tuned-profiles-postgresql tuned-profiles-realtime \ tuned-profiles-sap tuned-profiles-sap-hana tuned-profiles-spectrumscale \ - nmap-ncat procps-ng pciutils" - cp -r /root/assets/bin/* /usr/local/bin - mkdir -p /etc/grub.d/ /boot /var/lib/ocp-tuned + $INSTALL_PKGS" dnf install --setopt=tsflags=nodocs -y ${INSTALL_PKGS} - rm -rf /etc/tuned/recommend.d - echo auto > /etc/tuned/profile_mode - sed -Ei 's|^#?\s*enable_unix_socket\s*=.*$|enable_unix_socket = 1|;s|^#?\s*rollback\s*=.*$|rollback = not_on_exit|;s|^#?\s*profile_dirs\s*=.*$|profile_dirs = /usr/lib/tuned/profiles,/usr/lib/tuned,/var/lib/ocp-tuned/profiles|' /etc/tuned/tuned-main.conf; fi +# TuneD post-installation steps +rm -rf /etc/tuned/recommend.d +echo auto > /etc/tuned/profile_mode +sed -Ei 's|^#?\s*enable_unix_socket\s*=.*$|enable_unix_socket = 1|;s|^#?\s*rollback\s*=.*$|rollback = not_on_exit|;s|^#?\s*profile_dirs\s*=.*$|profile_dirs = /usr/lib/tuned/profiles,/usr/lib/tuned,/var/lib/ocp-tuned/profiles|' \ + /etc/tuned/tuned-main.conf touch /etc/sysctl.conf diff --git a/pkg/apis/tuned/v1/tuned_types.go b/pkg/apis/tuned/v1/tuned_types.go index 0e8a74d9bf..50af69fb95 100644 --- a/pkg/apis/tuned/v1/tuned_types.go +++ b/pkg/apis/tuned/v1/tuned_types.go @@ -20,7 +20,7 @@ const ( TunedClusterOperatorResourceName = "node-tuning" // Name of the NTO operand for versioning in ClusterOperator. - TunedOperandName = "openshift-tuned" + TunedOperandName = "ocp-tuned" // TunedBootcmdlineAnnotationKey is a Node-specific annotation denoting kernel command-line parameters // calculated by TuneD for the current profile applied to that Node. diff --git a/pkg/tuned/controller.go b/pkg/tuned/controller.go index 2c60506ba4..420a9ecf17 100644 --- a/pkg/tuned/controller.go +++ b/pkg/tuned/controller.go @@ -80,7 +80,7 @@ const ( // be generous and give it 10s. tunedGracefulExitWait = time.Second * time.Duration(10) ocpTunedHome = "/var/lib/ocp-tuned" - ocpTunedRunDir = "/run/ocp-tuned" + ocpTunedRunDir = "/run/" + programName ocpTunedProvider = ocpTunedHome + "/provider" // With the less aggressive rate limiter, retries will happen at 100ms*2^(retry_n-1): // 100ms, 200ms, 400ms, 800ms, 1.6s, 3.2s, 6.4s, 12.8s, 25.6s, 51.2s, 102.4s, 3.4m, 6.8m, 13.7m, 27.3m @@ -206,7 +206,7 @@ type Controller struct { tunedCmd *exec.Cmd // external command (tuned) being prepared or run tunedExit chan bool // bi-directional channel to signal and register TuneD daemon exit - stopCh <-chan struct{} // receive-only channel to stop the openshift-tuned controller + stopCh <-chan struct{} // receive-only channel to stop the ocp-tuned controller changeCh chan Change // bi-directional channel to wake-up the main thread to process accrued changes changeChRet chan bool // bi-directional channel to announce success/failure of change processing tunedMainCfg *ini.File // global TuneD configuration as defined in tuned-main.conf @@ -845,7 +845,7 @@ func (c *Controller) tunedReload() error { } if c.tunedCmd == nil { - // TuneD hasn't been started by openshift-tuned, start it. + // TuneD hasn't been started by ocp-tuned, start it. tunedStart() return nil } @@ -1440,7 +1440,7 @@ func (c *Controller) informerEventHandler(workqueueKey wqKeyKube) cache.Resource if workqueueKey.kind == wqKindProfile && workqueueKey.name == c.nodeName { // When moving this code elsewhere, consider whether it is desirable // to disable system tuned on nodes that should not be managed by - // openshift-tuned. + // ocp-tuned. disableSystemTuned() } diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-ctrcfg/openshift-bootstrap-master_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-ctrcfg/openshift-bootstrap-master_machineconfig.yaml index ed168e7bf3..8cd628b7f1 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-ctrcfg/openshift-bootstrap-master_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-ctrcfg/openshift-bootstrap-master_machineconfig.yaml @@ -204,7 +204,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-ctrcfg/openshift-bootstrap-worker_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-ctrcfg/openshift-bootstrap-worker_machineconfig.yaml index 5e3339eeea..3c50f947a5 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-ctrcfg/openshift-bootstrap-worker_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-ctrcfg/openshift-bootstrap-worker_machineconfig.yaml @@ -204,7 +204,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_machineconfig.yaml index 0fed5d04f6..cca7c9ee1a 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_machineconfig.yaml @@ -204,7 +204,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_machineconfig.yaml index 5e3339eeea..3c50f947a5 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_machineconfig.yaml @@ -204,7 +204,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_machineconfig.yaml index 0fed5d04f6..cca7c9ee1a 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_machineconfig.yaml @@ -204,7 +204,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_machineconfig.yaml index 5e3339eeea..3c50f947a5 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_machineconfig.yaml @@ -204,7 +204,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/default/cpuFrequency/manual_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/default/cpuFrequency/manual_machineconfig.yaml index d461b98de7..7234cb89aa 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/default/cpuFrequency/manual_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/default/cpuFrequency/manual_machineconfig.yaml @@ -206,7 +206,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml index fa3493f8bc..f5863b49d9 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml @@ -222,7 +222,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_machineconfig.yaml index 5854d49390..74baace214 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_machineconfig.yaml @@ -221,7 +221,7 @@ spec: --volume /run/tuned:/run/tuned:rslave \ --volume /run/systemd:/run/systemd:rslave \ --volume /sys:/sys:rslave \ - --entrypoint '["/usr/bin/cluster-node-tuning-operator","openshift-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ + --entrypoint '["/usr/bin/cluster-node-tuning-operator","ocp-tuned","--in-cluster=false","--one-shot=true","-v=1"]' \ $NTO_IMAGE Environment=PODMAN_SYSTEMD_UNIT=%n EnvironmentFile=-/var/lib/ocp-tuned/image.env diff --git a/version/version.go b/version/version.go index fee2fd57cd..7327de094f 100644 --- a/version/version.go +++ b/version/version.go @@ -1,7 +1,7 @@ package version const ( - OperandFilename = "openshift-tuned" + OperandFilename = "ocp-tuned" OperatorFilename = "cluster-node-tuning-operator" ReleaseVersionEnvVarName = "RELEASE_VERSION" )