Also disable master-2-16-32-{att,dt,tt} jobs that hang on inactive blade hardware
Makefile
makefiles/target/
-----------------
o Refactor Makefile, move target logic into makefiles/targets/{target-name}.mk
o Add context specific help -> makefile target: help-{target-name}
Change-Id: Ib00975e56488c7c23ebc01963002be59a7e3c97c
diff --git a/Makefile b/Makefile
index 75ed605..2a9bb30 100644
--- a/Makefile
+++ b/Makefile
@@ -37,30 +37,21 @@
# JJB_VERSION ?= 4.1.0
JOBCONFIG_DIR ?= job-configs
+# -----------------------------------------------------------------------
+# horrible dep: (ie -- .PHONY: $(JOBCONFIG_DIR))
+# o Directory inode always changing due to (time-last-accessed++).
+# o Dependent Targets always re-made due to setale dependency.
+# o Use file inside directory as dep rather than a directory.
+# -----------------------------------------------------------------------
$(JOBCONFIG_DIR):
mkdir $@
-## -----------------------------------------------------------------------
-## Intent: Sanity check incoming JJB config changes.
-## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
-## -----------------------------------------------------------------------
-# lint : lint-jjb
-lint-tox:
- tox -e py310
-
-## -----------------------------------------------------------------------
-## -----------------------------------------------------------------------
-.PHONY: test
-test: $(venv-activate-script) $(JOBCONFIG_DIR)
- $(activate) \
- && pipdeptree \
- && jenkins-jobs -l DEBUG test --recursive --config-xml -o "$(JOBCONFIG_DIR)" jjb/ ;
-
-## -----------------------------------------------------------------------
-## -----------------------------------------------------------------------
-.PHONY: clean
-clean:
- $(RM) -r $(JOBCONFIG_DIR)
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+include $(MAKEDIR)/targets/check.mk
+include $(MAKEDIR)/targets/tox.mk# # python unit testing
+include $(MAKEDIR)/targets/test.mk
## Display make help late
include $(ONF_MAKE)/help/trailer.mk
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index 09d8582..e77f8fd 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -52,7 +52,7 @@
name: 'voltha-scale-measurements-master-2-16-32-att-subscribers'
build-node: 'voltha-scale-1'
time-trigger: "H H/4 * * *"
- disable-job: false
+ disable-job: true
olts: 2
pons: 16
onus: 32
@@ -92,7 +92,7 @@
name: 'voltha-scale-measurements-master-2-16-32-dt-subscribers'
build-node: 'voltha-scale-1'
time-trigger: "H H/4 * * *"
- disable-job: false
+ disable-job: true
olts: 2
pons: 16
onus: 32
@@ -114,7 +114,7 @@
name: 'voltha-scale-measurements-master-2-16-32-tt-subscribers'
build-node: 'voltha-scale-1'
time-trigger: "H H/4 * * *"
- disable-job: false
+ disable-job: true
olts: 2
pons: 16
onus: 32
@@ -141,6 +141,7 @@
name: 'voltha-scale-measurements-master-2-16-32-tt-subscribers-maclearner'
build-node: 'voltha-scale-1'
time-trigger: "H H/4 * * *"
+ disable-job: true
olts: 2
pons: 16
onus: 32
@@ -159,7 +160,6 @@
--set onos-classic.image.repository=andreacampanella/voltha-onos --set onos-classic.image.tag=maclearner
--set bbsim-sadis-server.images.bbsim_sadis_server.tag=master
-
# 4k ONTs jobs
- 'voltha-scale-measurements':
name: 'voltha-scale-measurements-master-2-64-32-dt-subscribers'
diff --git a/makefiles/help/include.mk b/makefiles/help/include.mk
index 3134a38..01efdc1 100644
--- a/makefiles/help/include.mk
+++ b/makefiles/help/include.mk
@@ -65,16 +65,43 @@
## - help-simple or help-verbose
## o Current logic displays extended help by default.
## -----------------------------------------------------------------------
+## Usage: see makefiles/targets/test.mk
+## test-verbose += help-check# # append help target to help-verbose
+## -----------------------------------------------------------------------
ifdef VERBOSE
- help :: help-verbose
+ help-verbose += help-verbose
+ help :: $(help-verbose)
else
help :: help-simple
endif
## -----------------------------------------------------------------------
+## Intent: Display context specific help for named targets.
+## -----------------------------------------------------------------------
+## [TODO] Display a list of help-* tokens for target specific content:
+## % make help-check
+## % make help-test
+## -----------------------------------------------------------------------
+## [TODO] Define LEVEL= or helper targets (help-lint-{level})
+## for extended help w/o information overload
+## [0] help # make help
+## [1] help-lint # make help-verbose or (VERBOSE=1)
+## [2] help-lint-shell # make help-lint VERBOSE=1 (??)
+## [2] help-lint-yaml
+## -----------------------------------------------------------------------
+help-index ::
+ @echo
+ @echo '[HELP] - An index of help context for common targets'
+ @echo ' help-index This message'
+ $(HIDE)\
+ for name in $(sort $(help-verbose)); do\
+ echo " $$name";\
+ done
+
+## -----------------------------------------------------------------------
## Intent: Display simple extended target help
## -----------------------------------------------------------------------
-help-simple ::
+help-simple :: help-index
@echo
@echo '[VIEW]'
@echo ' reload Setup to auto-reload sphinx doc changes in browser'
diff --git a/makefiles/include.mk b/makefiles/include.mk
index 339d367..be08b19 100644
--- a/makefiles/include.mk
+++ b/makefiles/include.mk
@@ -34,9 +34,26 @@
include $(ONF_MAKE)/lint/include.mk
include $(ONF_MAKE)/git-submodules.mk
include $(ONF_MAKE)/gerrit/include.mk
+
include $(ONF_MAKE)/todo.mk
include $(ONF_MAKE)/help/variables.mk
+##-------------------##
+##---] TARGETS [---##
+##-------------------##
+include $(ONF_MAKE)/targets/clean.mk
+# include $(ONF_MAKE)/targets/check.mk
+include $(ONF_MAKE)/targets/sterile.mk
+# include $(ONF_MAKE)/targets/test.mk
+
$(if $(DEBUG),$(warning LEAVE))
+## --------------------------------------------------------------------------
+## structure to support pre/post target handling w/o inlining in Makefile (?)
+## --------------------------------------------------------------------------
+## include makefiles/include.mk
+## include makefiles/main/enter.mk
+## [... include *.mk ...]
+## include makefiles/main/leave.mk
+
# [EOF]
diff --git a/makefiles/lint/yaml.mk b/makefiles/lint/yaml.mk
index 566ac18..ab5b9d6 100644
--- a/makefiles/lint/yaml.mk
+++ b/makefiles/lint/yaml.mk
@@ -33,9 +33,11 @@
## % make lint UNSTABLE=1
## % make lint-yaml-all
## -----------------------------------------------------------------------
+lint-yaml-mode := $(if $(have-yaml-files),modified,all)
+lint-yaml : lint-yaml-$(lint-yaml-mode)
+
ifndef NO-LINT-YAML
- lint-yaml-mode := $(if $(have-yaml-files),modified,all)
- lint : lint-yaml-$(lint-yaml-mode)
+ lint : lint-yaml# # Enable as a default lint target
endif# NO-LINT-YAML
## -----------------------------------------------------------------------
@@ -74,7 +76,7 @@
@echo ' lint-yaml Syntax check python using the yaml command'
ifdef VERBOSE
@echo ' lint-yaml-all yaml checking: exhaustive'
- @echo ' lint-yaml-modified yaml checking: only modified'
+ @echo ' lint-yaml-modified yaml checking: only locally modified'
endif
$(if $(DEBUG),$(warning LEAVE))
diff --git a/makefiles/targets/check.mk b/makefiles/targets/check.mk
new file mode 100644
index 0000000..2145343
--- /dev/null
+++ b/makefiles/targets/check.mk
@@ -0,0 +1,38 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+.PHONY: check
+check : lint lint-yaml lint-jjb
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help-verbose += help-check
+help-check ::
+ @echo
+ @echo '[MAKE: check]'
+ @echo ' check pre-commit checking, with extra targets (default:NO, jenkins:FAIL)'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/targets/clean.mk b/makefiles/targets/clean.mk
new file mode 100644
index 0000000..f504dec
--- /dev/null
+++ b/makefiles/targets/clean.mk
@@ -0,0 +1,40 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## Intent: Remove makefile generated content
+## -----------------------------------------------------------------------
+.PHONY: clean
+clean ::
+ $(RM) -r $(JOBCONFIG_DIR)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help-verbose += help-clean
+help-clean ::
+ @echo
+ @echo '[MAKE: clean]'
+ @echo ' clean Remove makefile generated content'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/targets/sterile.mk b/makefiles/targets/sterile.mk
new file mode 100644
index 0000000..1eb7035
--- /dev/null
+++ b/makefiles/targets/sterile.mk
@@ -0,0 +1,45 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## Intent: Revert sandbox into a pristine checkout stage
+## -----------------------------------------------------------------------
+## Note: Sterile target behavior differs from clean around handling of
+## persistent content. For ex removal of a python virtualenv adds
+## extra overhead to development iteration:
+## make clean - preserve a virtual env
+## make sterile - force reinstallation
+## -----------------------------------------------------------------------
+.PHONY: sterile
+sterile :: clean
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help-verbose += help-sterile
+help-sterile ::
+ @echo
+ @echo '[MAKE: sterile]'
+ @echo ' sterile make clean, also remove persistent content (~venv)'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/targets/test.mk b/makefiles/targets/test.mk
new file mode 100644
index 0000000..d70fa4a
--- /dev/null
+++ b/makefiles/targets/test.mk
@@ -0,0 +1,41 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+.PHONY: test
+test: $(venv-activate-script) $(JOBCONFIG_DIR)
+ $(activate) \
+ && pipdeptree \
+ && jenkins-jobs -l DEBUG test --recursive --config-xml -o "$(JOBCONFIG_DIR)" jjb/ ;
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help-verbose += help-test
+help-test ::
+ @echo
+ @echo '[MAKE: test]'
+ @echo ' test Perform testing that a jenkins job pull request will invoke'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/targets/tox.mk b/makefiles/targets/tox.mk
new file mode 100644
index 0000000..b3a638b
--- /dev/null
+++ b/makefiles/targets/tox.mk
@@ -0,0 +1,41 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-FileCopyrightText: 2022 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+## -----------------------------------------------------------------------
+## Intent: Sanity check incoming JJB config changes.
+## Todo: Depend on makefiles/lint/jjb.mk :: lint-jjb
+## -----------------------------------------------------------------------
+# lint : lint-jjb
+lint-tox: lint-jjb
+ tox -e py310
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help-verbose += help-tox
+help-tox ::
+ @echo
+ @echo '[MAKE: tox]'
+ @echo ' lint-tox Python unit testing, sanity check incoming JJB changes.'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]