Skip to content

Commit 0751f57

Browse files
authored
Replaced tuned hard-included repo with a git submodule (#1029)
Until now tuned repo was hard included in the NTO repo. This design could lead to developers mistakenly contribute to assets/tuned. Instead of https://github.com/redhat-performance/tuned, as it is hard to realize it is an external repo. Therefore, we chose to change this design by including the tuned repo as a git submodule, preventing mistakes as I described and better informing tuned is an external repo. Signed-off-by: Ronny Baturov <[email protected]>
1 parent 0d90b86 commit 0751f57

File tree

325 files changed

+15
-29437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

325 files changed

+15
-29437
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "assets/tuned/tuned"]
2+
path = assets/tuned/tuned
3+
url = https://github.com/redhat-performance/tuned.git

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS builder
22
WORKDIR /go/src/github.com/openshift/cluster-node-tuning-operator
33
COPY . .
4+
RUN make update-tuned-submodule
45
RUN make build
56

67
FROM quay.io/centos/centos:stream9 as tuned
@@ -10,7 +11,7 @@ RUN INSTALL_PKGS=" \
1011
gcc git rpm-build make desktop-file-utils patch dnf-plugins-core \
1112
" && \
1213
dnf install --setopt=tsflags=nodocs -y $INSTALL_PKGS && \
13-
cd assets/tuned/daemon && \
14+
cd assets/tuned/tuned && \
1415
LC_COLLATE=C cat ../patches/*.diff | patch -Np1 && \
1516
dnf build-dep tuned.spec -y && \
1617
make rpm PYTHON=/usr/bin/python3 && \

Makefile

+8-9
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ GOFMT_CHECK=$(shell find . -not \( \( -wholename './.*' -o -wholename '*/vendor/
1313
REV=$(shell git describe --long --tags --match='v*' --always --dirty)
1414

1515
# Upstream tuned daemon variables
16-
TUNED_REPO:=https://github.com/redhat-performance/tuned.git
17-
TUNED_COMMIT:=954bc4624db8fb345e9fb264ee2ac09d1736105a
18-
TUNED_DIR:=daemon
16+
TUNED_COMMIT:=HEAD
1917

2018
# API-related variables
2119
API_TYPES_DIR:=pkg/apis
@@ -54,12 +52,13 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
5452
targets/openshift/crd-schema-gen.mk \
5553
)
5654

57-
clone-tuned:
58-
(cd assets/tuned && \
59-
rm -rf $(TUNED_DIR) && \
60-
git clone -n $(TUNED_REPO) $(TUNED_DIR) && \
61-
cd $(TUNED_DIR) && git checkout $(TUNED_COMMIT) && cd .. && \
62-
rm -rf $(TUNED_DIR)/.git)
55+
# This target will be run in the Dockerfile to initialize the tuned submodule by cloning it.
56+
# Moreover, this can be used to update the tuned repo to a specific commit.
57+
update-tuned-submodule:
58+
(git submodule update --init --force && \
59+
cd assets/tuned/tuned && \
60+
git pull origin master && \
61+
git checkout $(TUNED_COMMIT))
6362

6463
build: $(BINDATA) pkg/generated build-performance-profile-creator build-gather-sysinfo
6564
$(GO_BUILD_RECIPE)

assets/tuned/daemon/.fmf/version

-1
This file was deleted.

assets/tuned/daemon/.github/workflows/codeql.yml

-41
This file was deleted.

assets/tuned/daemon/.gitignore

-5
This file was deleted.

assets/tuned/daemon/.packit.yaml

-21
This file was deleted.

assets/tuned/daemon/00_tuned

-29
This file was deleted.

assets/tuned/daemon/92-tuned.install

-49
This file was deleted.

assets/tuned/daemon/AUTHORS

-20
This file was deleted.

assets/tuned/daemon/CONTRIBUTING.md

-66
This file was deleted.

0 commit comments

Comments
 (0)