Skip to content

NO-JIRA: Project cleanups #1120

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

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions Dockerfile.rhel8

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion assets/tuned/manifests/ds-tuned.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 13 additions & 14 deletions hack/dockerfile_install_support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}
Expand All @@ -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
2 changes: 1 addition & 1 deletion pkg/apis/tuned/v1/tuned_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions pkg/tuned/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package version

const (
OperandFilename = "openshift-tuned"
OperandFilename = "ocp-tuned"
OperatorFilename = "cluster-node-tuning-operator"
ReleaseVersionEnvVarName = "RELEASE_VERSION"
)
Expand Down