Merge "Disable the lone 3 scale jobs still running"
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/pipeline/voltha/playground/physical-build.groovy b/jjb/pipeline/voltha/playground/physical-build.groovy
index 5779ac1..856006e 100644
--- a/jjb/pipeline/voltha/playground/physical-build.groovy
+++ b/jjb/pipeline/voltha/playground/physical-build.groovy
@@ -33,13 +33,32 @@
// -----------------------------------------------------------------------
def getIam(String func)
{
+ /*
+ [TODO]
+ -----------------------------------------------------------------------
+ java stack trace is hosed due to jenkins internal meddeling to support
+ serializable. Lets see if groovy Throwable wrapper can produce a
+ better answer.
+ -----------------------------------------------------------------------
+
+ try
+ {
+ throw new Exception('Generating a stacktrace')
+ }
+ catch (Throwable err)
+ {
+ // https://docs.groovy-lang.org/2.4.7/html/api/org/codehaus/groovy/GroovyException.html
+ err.printStackTrace()
+ stack = err.getStackTrace()
+ }
+
// Cannot rely on a stack trace due to jenkins manipulation
String src = [
'jjb',
'pipeline',
'voltha',
'playground',
- 'voltha-tt-physical-functional-tests.groovy'
+ 'physical-build.groovy'
].join('/')
String iam = [src, func].join('::')
@@ -78,24 +97,25 @@
{
stage('Download Code')
{
- iam(this)
+ steps
{
- enter = true
- label = getIam()
- }
+ iam(this)
+ {
+ enter = true
+ label = getIam()
+ }
- steps {
getVolthaCode([
branch: "${branch}",
volthaSystemTestsChange: "${volthaSystemTestsChange}",
volthaHelmChartsChange: "${volthaHelmChartsChange}",
])
- }
- iam(this)
- {
- leave = true
- label = getIam()
+ iam(this)
+ {
+ leave = true
+ label = getIam()
+ }
}
}
diff --git a/jjb/pipeline/voltha/playground/voltha-tt-physical-functional-tests.groovy b/jjb/pipeline/voltha/playground/voltha-tt-physical-functional-tests.groovy
index f0965ff..39e543f 100644
--- a/jjb/pipeline/voltha/playground/voltha-tt-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha/playground/voltha-tt-physical-functional-tests.groovy
@@ -73,14 +73,14 @@
// -----------------------------------------------------------------------
stage('Clone voltha-system-tests')
{
+ iam(this)
+ {
+ enter = true
+ label = getIam()
+ }
+
steps
{
- iam(this)
- {
- enter = true
- label = getIam()
- }
-
step([$class: 'WsCleanup'])
checkout([
$class: 'GitSCM',
@@ -109,13 +109,13 @@
exit 1 # verify fail
fi
""")
+ } // step
iam(this)
{
leave = true
label = getIam()
}
- } // step
} // steps
} // stage
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index 79a5215..e77f8fd 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -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'
@@ -295,6 +295,7 @@
pipeline-script: 'voltha/voltha-2.11/voltha-scale-test.groovy'
build-node: 'voltha-scale-1'
time-trigger: "H H/4 * * *"
+ disable-job: true
olts: 2
pons: 16
onus: 32
@@ -319,6 +320,7 @@
pipeline-script: 'voltha/voltha-2.11/voltha-scale-test.groovy'
build-node: 'voltha-scale-1'
time-trigger: "H H/4 * * *"
+ disable-job: true
olts: 2
pons: 16
onus: 32
@@ -344,6 +346,7 @@
pipeline-script: 'voltha/voltha-2.11/voltha-scale-test.groovy'
build-node: 'voltha-scale-1'
time-trigger: "H H/4 * * *"
+ disable-job: true
olts: 2
pons: 16
onus: 32
diff --git a/jjb/voltha-test/voltha.yaml b/jjb/voltha-test/voltha.yaml
index 95e33b1..2186099 100644
--- a/jjb/voltha-test/voltha.yaml
+++ b/jjb/voltha-test/voltha.yaml
@@ -79,9 +79,9 @@
test-repo: 'voltha-system-tests'
profile: 'Default'
- # flex OCP pod with olt/onu - 1T4GEM tech profile and timer based job
+ # [VOL-4939] - flex OCP pod with olt/onu - 1T4GEM tech profile and timer based job
- 'build_voltha_pod_release_timer':
- disable-job: false
+ disable-job: true
build-node: 'qa-testvm-pod'
config-pod: 'flex-ocp-cord'
release: '2.11'
@@ -93,7 +93,7 @@
num-of-atomix: '3'
pipeline-script: 'voltha/voltha-2.11/physical-build.groovy'
- # flex OCP pod with olt/onu - 1T4GEM tech profile and timer based job
+ # [VOL-4939] - flex OCP pod with olt/onu - 1T4GEM tech profile and timer based job
- 'build_voltha_pod_release_timer':
disable-job: true
build-node: 'qa-testvm-pod'
@@ -118,9 +118,9 @@
test-repo: 'voltha-system-tests'
profile: '1T4GEM'
- # flex pod1 test job - released versions: uses tech profile on voltha branch
+ # [VOL-4939] - flex pod1 test job - released versions: uses tech profile on voltha branch
- 'build_voltha_pod_test':
- disable-job: false
+ disable-job: true
build-node: 'qa-testvm-pod'
config-pod: 'flex-ocp-cord'
release: '2.11'
@@ -176,9 +176,9 @@
num-of-atomix: '3'
pipeline-script: 'voltha/voltha-2.8/physical-build.groovy'
- # flex OCP pod with olt/onu - Released versions Default tech profile and timer based job
+ # [VOL-4939] - flex OCP pod with olt/onu - Released versions Default tech profile and timer based job
- 'build_voltha_pod_release_timer':
- disable-job: false
+ disable-job: true
build-node: 'qa-testvm-pod'
config-pod: 'flex-ocp-cord'
release: '2.11'
@@ -206,9 +206,9 @@
test-repo: 'voltha-system-tests'
profile: 'TP'
- # flex pod1 test job - released versions: uses tech profile on voltha branch
+ # [VOL-4939] - flex pod1 test job - released versions: uses tech profile on voltha branch
- 'build_voltha_pod_test':
- disable-job: false
+ disable-job: true
build-node: 'qa-testvm-pod'
config-pod: 'flex-ocp-cord'
release: '2.11'
@@ -220,9 +220,9 @@
test-repo: 'voltha-system-tests'
profile: 'TP'
- # flex OCP pod with olt/onu - Released versions Default tech profile and timer based job
+ # [CORD-4941] - flex OCP pod with olt/onu - Released versions Default tech profile and timer based job
- 'build_voltha_pod_release_timer':
- disable-job: false
+ disable-job: true
build-node: 'qa-testvm-pod'
config-pod: 'flex-ocp-cord-multi-uni'
release: 'master'
@@ -238,9 +238,9 @@
enableMultiUni: true
uniPortMask: '0x0003'
- # flex pod1 test job - released versions: uses tech profile on voltha branch
+ # [CORD-4941] - flex pod1 test job - released versions: uses tech profile on voltha branch
- 'build_voltha_pod_test':
- disable-job: false
+ disable-job: true
build-node: 'qa-testvm-pod'
config-pod: 'flex-ocp-cord-multi-uni'
release: 'master'
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]
diff --git a/vars/iam.groovy b/vars/iam.groovy
index 75f204d..cafd8f2 100644
--- a/vars/iam.groovy
+++ b/vars/iam.groovy
@@ -110,9 +110,18 @@
// tans = fans
// }
// -----------------------------------------------------------------------
-Boolean call(def self, Map argv)
+Boolean call\
+ (
+ def body, // jenkins closure attached to the call iam() {closure}
+ def self, // jenkins env object for access to primitives like echo()
+ )
{
- argv = argv ?: [:] // {ternary,elvis} operator
+ // evaluate the body block and collect configuration into the object
+ Map argv = [:] // {ternary,elvis} operator
+ body.resolveStrategy = Closure.DELEGATE_FIRST
+ body.delegate = config
+ body()
+
String iam = getIam(argv, 'main')
println("** ${iam}: argv=${argv}")
@@ -123,6 +132,7 @@
// [WIP] type(self) needed to quiet lint complaint.
// npm-groovy-lint: def for method parameter type should not be used NoDef
print(" ** $iam: Type of self variable is =" + self.getClass())
+ print(" ** $iam: Type of body variable is =" + body.getClass())
// if (! self instanceof jenkins_object) { throw }
if (process(argv))
@@ -150,5 +160,11 @@
return(true)
}
-// [EOF]
+/*
+ * -----------------------------------------------------------------------
+[SEE ALSO]
+ o https://rtyler.github.io/jenkins.io/doc/book/pipeline/shared-libraries/#defining-a-more-structured-dsl
+ * -----------------------------------------------------------------------
+ */
+// [EOF]