Skip to content

Commit d6ca715

Browse files
authored
Merge pull request #12 from intel/tmp
WSF release 23.1
2 parents 26fcb73 + 7820ef8 commit d6ca715

File tree

481 files changed

+20064
-3195
lines changed

Some content is hidden

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

481 files changed

+20064
-3195
lines changed

CMakeLists.txt

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,39 @@
22
cmake_minimum_required (VERSION 2.8...3.24)
33

44
Project(workloads NONE)
5+
STRING(ASCII 27 esc)
6+
set(red "${esc}[31m")
7+
set(green "${esc}[32m")
8+
set(strikethrough "${esc}[9m")
9+
set(reset "${esc}[0m")
10+
511
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/script/")
612
include(prerequisite)
713

814
add_custom_target(bom)
9-
add_custom_target(kpi)
1015
enable_testing()
1116

17+
set(PLATFORM_CONV_FROM "")
18+
include(platform OPTIONAL)
19+
20+
if(EXISTS "${CMAKE_SOURCE_DIR}/workload/platforms")
21+
set(platforms "${CMAKE_SOURCE_DIR}/workload/platforms")
22+
else()
23+
set(platforms "${CMAKE_SOURCE_DIR}/platforms")
24+
endif()
25+
1226
if(NOT DEFINED PLATFORM)
13-
execute_process(COMMAND bash -c "head -n 1 '${CMAKE_SOURCE_DIR}/workload/platforms'" OUTPUT_VARIABLE PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE)
27+
execute_process(COMMAND bash -c "head -n 1 '${platforms}'" OUTPUT_VARIABLE PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE)
1428
else()
15-
execute_process(COMMAND bash -c "grep -E '^${PLATFORM}$' '${CMAKE_SOURCE_DIR}/workload/platforms' | head -n 1" OUTPUT_VARIABLE platform OUTPUT_STRIP_TRAILING_WHITESPACE)
29+
execute_process(COMMAND bash -c "grep -E '^${PLATFORM}$' '${platforms}' | head -n 1" OUTPUT_VARIABLE platform OUTPUT_STRIP_TRAILING_WHITESPACE)
1630
if(NOT platform)
1731
message(FATAL_ERROR "Platform ${PLATFORM} not recognized!")
1832
endif()
1933
set(PLATFORM "${platform}")
2034
endif()
2135

2236
include(registry OPTIONAL)
23-
execute_process(COMMAND bash -c "GIT_ASKPASS=echo git fetch --tags > /dev/null && git tag" TIMEOUT 5 OUTPUT_VARIABLE tmp RESULT_VARIABLE status OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
37+
execute_process(COMMAND bash -c "GIT_SSH_COMMAND='ssh -o BatchMode=yes' GIT_ASKPASS=echo git fetch --tags > /dev/null && GIT_ASKPASS=echo git tag" TIMEOUT 5 OUTPUT_VARIABLE tmp RESULT_VARIABLE status OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
2438
if (RELEASE MATCHES "^:?v?[0-9]+[.][0-9]+$")
2539
string(REPLACE ":" "" release1 "${RELEASE}")
2640
if ((status EQUAL 0) AND (tmp MATCHES "${release1}"))
@@ -36,7 +50,8 @@ else ()
3650
message("")
3751
message("*************************************************************")
3852
message("")
39-
message("Release ${tmp} detected. Switch to release ${tmp} as follows:")
53+
message("${green}INFO:${reset} Detected release ${tmp}.")
54+
message(" Switch to release ${tmp} as follows:")
4055
message("")
4156
message("git checkout ${tmp}")
4257
message("cmake -DRELEASE=v${tmp} ..")
@@ -47,8 +62,8 @@ else ()
4762
message("")
4863
message("****************************************************************************")
4964
message("")
50-
message("Failed to detect official releases.")
51-
message("Switch to any release as follows:")
65+
message("${red}WARNING:${reset} Failed to detect any official release.")
66+
message(" Switch to any release as follows:")
5267
message("")
5368
message("git checkout <VERSION>")
5469
message("cmake -DREGISTRY=${DEFAULT_REGISTRY} -DRELEASE=v<VERSION> ..")
@@ -61,11 +76,11 @@ if (NOT ${REGISTRY} MATCHES "/$")
6176
set(REGISTRY "${REGISTRY}/")
6277
endif()
6378

64-
set(ENABLE_BUILD ON)
79+
set(BUILDSH_OPTIONS "")
6580
if (REGISTRY STREQUAL "${DEFAULT_REGISTRY}/")
6681
execute_process(COMMAND bash -c "grep -q -F $(echo ${REGISTRY} | cut -f1 -d/) ~/.docker/config.json" RESULT_VARIABLE disable_build OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
6782
if(disable_build)
68-
set(ENABLE_BUILD OFF)
83+
set(BUILDSH_OPTIONS "--read-only-registry")
6984
endif()
7085
endif()
7186

@@ -80,10 +95,23 @@ elseif (NOT ${RELEASE} MATCHES "^:")
8095
endif()
8196
string(TOLOWER "${RELEASE}" RELEASE)
8297

98+
if ((NOT DEFINED BENCHMARK) AND (EXISTS "${CMAKE_SOURCE_DIR}/workload/dummy"))
99+
set(BENCHMARK "dummy")
100+
message("${red}WARNING:${reset} Default to the dummy workload for quick evaluation.")
101+
message(" Enable specific workload with cmake -DBENCHMARK=<name> .. or")
102+
message(" Enable all workloads with cmake -DBENCHMARK= ..")
103+
message("")
104+
endif()
105+
83106
if (NOT DEFINED BACKEND)
84-
set(BACKEND "terraform")
107+
if(EXISTS "${PROJECT_SOURCE_DIR}/script/terraform.cmake")
108+
set(BACKEND "terraform")
109+
endif()
110+
endif()
111+
112+
if(BACKEND)
113+
include(${BACKEND} OPTIONAL)
85114
endif()
86-
include(${BACKEND} OPTIONAL)
87115
set(IMAGEARCH "linux/amd64")
88116
include(multi-arch OPTIONAL)
89117

@@ -94,28 +122,35 @@ foreach(subdir image stack workload dist)
94122
endforeach()
95123

96124
message("")
97-
message("-- Setting: PLATFORM=${PLATFORM}, ARCH=${IMAGEARCH}")
125+
message("-- Setting: PLATFORM=${PLATFORM}${PLATFORM_CONV_FROM}, ARCH=${IMAGEARCH}")
98126
if(NOT DEFINED REGISTRY_AUTH)
99127
message("-- Setting: REGISTRY=${REGISTRY}")
100128
else()
101129
message("-- Setting: REGISTRY=${REGISTRY}, AUTH=${REGISTRY_AUTH}")
102130
endif()
103131
message("-- Setting: RELEASE=${RELEASE}")
104-
message("-- Setting: TIMEOUT=${TIMEOUT}")
132+
if(BACKEND)
133+
message("-- Setting: TIMEOUT=${TIMEOUT}")
134+
endif()
105135
if(ACCEPT_LICENSE)
106136
message("-- Setting: ACCEPT_LICENSE=${ACCEPT_LICENSE}")
107137
endif()
108-
message("-- Setting: BENCHMARK=${BENCHMARK}")
109-
message("-- Setting: BACKEND=${BACKEND}")
138+
if(BACKEND)
139+
message("-- Setting: BENCHMARK=${BENCHMARK}")
140+
message("-- Setting: BACKEND=${BACKEND}")
141+
endif()
110142
if(COMMAND show_backend_settings)
111143
show_backend_settings()
112144
endif()
113145
message("")
114-
if(NOT ENABLE_BUILD)
115-
STRING(ASCII 27 esc)
116-
message("${esc}[32mINFO:${esc}[m Build is disabled as ${DEFAULT_REGISTRY} is readonly.")
146+
if(BUILDSH_OPTIONS MATCHES "--read-only-registry")
147+
message("${red}INFO:${reset} Docker build is disabled as ${DEFAULT_REGISTRY} is readonly.")
117148
message("")
118149
endif()
119150

120-
execute_process(COMMAND bash -c "ln -s -r -f '${PROJECT_SOURCE_DIR}'/script/benchmark/*.sh ." WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
151+
if(EXISTS "${PROJECT_SOURCE_DIR}/script/benchmark")
152+
execute_process(COMMAND bash -c "ln -s -r -f '${PROJECT_SOURCE_DIR}'/script/benchmark/*.sh ." WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
153+
endif()
154+
155+
include(legalnotice OPTIONAL)
121156

doc/cmake.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
### Customize the Build Process:
32

43
You can use the following build options to customize the build process:
@@ -11,12 +10,12 @@ You can use the following build options to customize the build process:
1110
> `RELEASE` must begin with colon `:`
1211
- **BACKEND**: Specify the validation backend: [`docker`](setup-docker.md), [`kubernetes`](setup-kubernetes.md), or [`terraform`](setup-terraform.md).
1312
- **TERRAFORM_OPTIONS**: Specify the `terraform` options.
14-
- **TERRAFORM_SUT**: Specify the target SUT (Sytem Under Test) list.
13+
- **TERRAFORM_SUT**: Specify the target SUT (System Under Test) list.
1514
- **TIMEOUT**: Specify the validation timeout, which contains the execution timeout and docker pull timeout. Default to 28800,300 seconds.
1615
- **BENCHMARK**: Specify a workload pattern. Workloads not matching the pattern will be disabled.
1716
- **SPOT_INSTANCE**: If specified, overwrite the `spot_instance` variable in the Cloud configuration files.
1817

19-
Build examples:
18+
### Build examples:
2019

2120
```bash
2221
cd build
@@ -39,4 +38,3 @@ make bom
3938
- [Docker Engine](setup-docker.md)
4039
- [Kubernetes Cluster](setup-kubernetes.md)
4140
- [Terraform Setup](setup-terraform.md)
42-

doc/ctest.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11

22
### Run Test
33

4-
Use `ctest` to run a single test or batch of tests. You can do this at the top-level `build` directory or under each workload directory. In the latter case, only the tests of the workload will be executed.
4+
Use `./ctest.sh` to run a single test or batch of tests. You can do this at the top-level `build` directory or under each workload directory. In the latter case, only the tests of the workload will be executed.
55

66
```
77
cd build
88
cd workload/dummy
9-
ctest
9+
./ctest.sh -N
1010
```
1111

1212
### CTest Options
1313

14-
There is extensive list of options in `ctest` to control how tests can be executed. See the `ctest` manpage. The followings are most common options.
14+
There is extensive list of options in `./ctest.sh` to control how tests can be executed. See the `./ctest.sh` manpage. The followings are most common options.
1515

1616
- *`-R`*: Select tests based on a regular expression string.
1717
- *`-E`*: Exclude tests based on a regular expression string.
1818
- *`-V`*: Show test execution with details.
1919
- *`-N`*: Dry-run the tests only.
2020

2121
Example: list tests with `boringssl` in name excluding those with `_gated`
22+
2223
```
23-
ctest -R boringssl -E _gated -N
24-
```
24+
./ctest.sh -R boringssl -E _gated -N
2525
26+
```
2627
Example: run only `test_static_boringssl` (exact match)
28+
2729
```
28-
ctest -R '^test_static_boringssl$'
30+
./ctest.sh -R '^test_static_boringssl$'
2931
```
3032

3133
### Customize Configurations
3234

33-
It is possible to specify a global test configuration file to overwrite any configuration parameter of a test case:
35+
It is possible to specify a test configuration file to overwrite any configuration parameter of a test case:
3436

3537
```
36-
TEST_CONFIG=$(pwd)/test_config.yaml ctest -V
38+
./ctest.sh --config=test_config.yaml -V
3739
```
3840

39-
where `TEST_CONFIG` specifies the test configuration file.
40-
4141
The configuration file uses the following format:
4242

4343
```
4444
*_dummy_pi:
4545
SCALE: 3000
46-
4746
```
4847

4948
where `*_dummy_pi` specifies the test case name. You can use `*` to specify a wildcard match. The subsection underneath specifies the configuration variables and values. Any parameters specified in each test case [`validate.sh`](validate.md) can be overwritten.
@@ -62,17 +61,19 @@ A set of utility scripts are linked under your workload build directory to make
6261
Usage: [options]
6362
--nohup Run ctest in the daemon mode for long benchmark
6463
--loop Run the benchmark multiple times sequentially.
65-
--run Run the benchmark multiple times on the same SUT(s), only for cumulus.
64+
--run Run the benchmark multiple times on the same SUT(s).
6665
--burst Run the benchmark multiple times simultaneously.
6766
--config Specify the test-config file.
68-
--options Specify additioanl validation backend options.
67+
--options Specify additional validation backend options.
6968
--set Set the workload parameter values during loop and burst iterations.
7069
--stop Kill all ctest sessions.
7170
--continue Ignore any errors and continue the loop and burst iterations.
7271
--prepare-sut Prepare cloud SUT instances for reuse.
7372
--reuse-sut Reuse previously prepared cloud SUT instances.
7473
--cleanup-sut Cleanup cloud SUT instances.
7574
--dry-run Generate the testcase configurations and then exit.
75+
--testcase Specify the exact testcase name to be executed.
76+
--noenv Clean any external environment variables before proceeding with the tests.
7677
```
7778

7879
The followings are some examples:
@@ -129,7 +130,6 @@ The followings are some examples:
129130
./ctest.sh -R aws --set "AWS_DISK_SIZE=500 1000" --loop 2 --nohup
130131
./ctest.sh -R aws --set "AWS_IOPS=16000 32000" --loop 2 --nohup
131132
./ctest.sh -R aws --set "AWS_NUM_STRIPED_DISKS=1 2" --loop 2 --nohup
132-
133133
```
134134

135135
See Also: [Cloud SUT Reuse](#cloud-sut-reuse)
@@ -151,6 +151,7 @@ Usage: [options] [logs-directory]
151151
--filter _(real|throughput)
152152
Specify a trim filter to shorten spreadsheet name.
153153
--file <filename> Specify the spread sheet filename.
154+
--uri Show the WSF portal URI if present.
154155
```
155156

156157
> The `xls-ai` option writes the KPI data in the `kpi-report.xls` spread sheet as follows:
@@ -171,7 +172,7 @@ Usage: [options] [logs-directory]
171172
172173
### Cloud SUT Reuse
173174

174-
With the cumulus backend, it is possible to reuse the Cloud SUT instances during the benchmark process. This is especially useful in tuning parameters for any workload.
175+
It is possible to reuse the Cloud SUT instances during the benchmark process. This is especially useful in tuning parameters for any workload.
175176

176177
To reuse any SUT instances, you need to first prepare (provision) the Cloud instances, using the `ctest.sh` `--prepare-sut` command as follows:
177178

@@ -205,6 +206,6 @@ SUT reuse is subject to the following limitations:
205206

206207
---
207208

208-
Please cleanup the Cloud instances after use.
209+
After using the Cloud instances, please clean them up.
209210

210211
---

doc/setup-auth.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11

22
### Introduction
33

4-
A private docker registry is optional in most of the validation scenarios except if you want to run the workloads on an On-Premises Kubernetes cluster, or you explicitly setup a docker registry to store any newly built workload images.
4+
A private docker registry is optional in most of the validation scenarios except if you want to run the workloads on an On-Premises Kubernetes cluster, or you explicitly setup a docker registry to store any newly built workload images.
55

6-
This document describes how to authenticate to a docker registry if the registry requires authentication. Skip this document if there is no authentication requirement.
6+
This document describes how to authenticate to a docker registry if the registry requires authentication. Skip this document if there is no authentication requirement.
77

88
### `REGISTRY_AUTH`
99

10-
The [`cmake`](cmake.md) `REGISTRY_AUTH` option specifies how to authenticate to a private docker registry. Currently, `docker` is the only supported value, which uses the docker authentication mechanism.
10+
The [`cmake`](cmake.md) `REGISTRY_AUTH` option specifies how to authenticate to a private docker registry. Currently, `docker` and `pass` are the only supported values, which uses the docker authentication mechanism or docker-credential-pass with pass as password store.
1111

12-
Enable the `REGISTRY_AUTH` option:
12+
#### Docker
13+
14+
Enable the `REGISTRY_AUTH` option:
1315

1416
```
1517
cmake -DREGISTRY=<url> -DREGISTRY_AUTH=docker ..
1618
```
1719

18-
With the above command, the validation scripts will upload the docker authentication information specified in `.docker/config.json` as a Kubernetes `imagePullSecret` to the validation cluster, On-Premises or in Cloud.
20+
With the above command, the validation scripts will upload the docker authentication information specified in `.docker/config.json` as a Kubernetes `imagePullSecret` to the validation cluster, On-Premises or in Cloud.
21+
22+
> `CredHelpers` or `CredStore` in `.docker/config.json` is not supported.
23+
24+
#### Pass
25+
26+
Enable the `REGISTRY_AUTH` option:
1927

20-
> `CredHelpers` or `CredStore` in `.docker/config.json` is not supported.
28+
```
29+
cmake -DREGISTRY=<url> -DREGISTRY_AUTH=pass ..
30+
```
31+
32+
Version for both pass and docker-credential-pass binaries is read automatically. With the above command, the validation scripts will make the `pass` and `gpg` session available on execution machine.
2133

2234
### Authenticate to Cloud Private Registry
2335

@@ -29,15 +41,13 @@ $ aws ecr get-login-password --region <region> | docker login --username AWS --p
2941
$ exit
3042
```
3143

32-
> Note that the build script will auto-create the image repository namespaces.
44+
> Note that the build script will auto-create the image repository namespaces.
3345
3446
#### Google Cloud Container Registry
3547

3648
```
3749
make gcp
38-
$ gcloud iam service-accounts create <NAME>
39-
$ gcloud projects add-iam-policy-binding <PROJECT_ID> --member "serviceAccount:<NAME>@<PROJECT_ID>.iam.gserviceaccount.com" --role "roles/ROLE"
40-
$ gcloud iam service-accounts keys create keyfile.json --iam-account <NAME>@<PROJECT_ID>.iam.gserviceaccount.com
50+
$ gcloud auth activate-service-account --key-file <key-file>
4151
$ gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin <registry-url>
4252
$ exit
4353
```
@@ -52,4 +62,3 @@ make azure
5262
$ az acr login --name <registry-name> --expose-token --output tsv --query accessToken | docker login -username 00000000-0000-0000-0000-000000000000 --password-stdin <registry-url>
5363
$ exit
5464
```
55-

doc/setup-docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
The `docker` engine is a prerequisite to build the workload images. It is also one of the validation backends that can be used to run single-container workloads on your local machine.
2+
The `docker` engine is a prerequisite to build the docker images.
33

44
### Setup Docker
55

0 commit comments

Comments
 (0)