Skip to content

Commit

Permalink
v23.3 external release (#43)
Browse files Browse the repository at this point in the history
* V23.3 external release

* delete sgx files

* Update setup-terraform.md
  • Loading branch information
Tangrui333 authored Sep 28, 2023
1 parent 05887f3 commit c6796ec
Show file tree
Hide file tree
Showing 371 changed files with 15,353 additions and 2,218 deletions.
64 changes: 41 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ if (RELEASE MATCHES "^:?v?[0-9]+[.][0-9]+[.]*[0-9]*$")
if ((status EQUAL 0) AND (tmp MATCHES "${release1}"))
if((NOT DEFINED REGISTRY) OR (NOT REGISTRY))
set(REGISTRY "${DEFAULT_REGISTRY}")
elseif((NOT REGISTRY STREQUAL "${DEFAULT_REGISTRY}") AND DEFAULT_REGISTRY)
message(WARNING "Issue 'cmake -DREGISTRY=${DEFAULT_REGISTRY} ..' to use the official ${RELEASE} images.")
endif()
endif()
else ()
string(REGEX REPLACE ".*\n" "" tmp "${tmp}")
string(REGEX REPLACE "(v?[0-9]*[.][0-9]*)[.].*" "\\1" mtmp "${tmp}")
if (tmp AND (status EQUAL 0))
endif()

string(REGEX REPLACE ".*\n" "" tmp "${tmp}")
string(REGEX REPLACE "(v?[0-9]*[.][0-9]*)[.].*" "\\1" mtmp "${tmp}")
if (tmp AND (status EQUAL 0))
if ((NOT RELEASE STREQUAL ":${tmp}") AND (NOT RELEASE STREQUAL "${tmp}"))
message("")
message("*************************************************************")
message("")
Expand All @@ -62,25 +62,24 @@ else ()
message("${green}INFO:${reset} Detected major release ${mtmp} and minor releases up to ${tmp}.")
message("${green}INFO:${reset} Minor releases do not cover all workloads. See workload README.")
endif()
message("")
message("${green}INFO:${reset} Switch to a major/minor release as follows:")
message("${green}INFO:${reset} git checkout tags/${mtmp}")
message("${green}INFO:${reset} cmake -DRELEASE=${mtmp} ..")
message("")
message("*************************************************************")
message("")
else()
message("")
message("****************************************************************************")
message("")
message("${red}WARNING:${reset} Failed to detect any official release.")
message(" Switch to any release as follows:")
message("")
message("git checkout <VERSION>")
message("cmake -DREGISTRY=${DEFAULT_REGISTRY} -DRELEASE=v<VERSION> ..")
message("")
message("****************************************************************************")
endif()
else()
message("")
message("****************************************************************************")
message("")
message("${red}WARNING:${reset} Failed to detect any official release.")
message(" Switch to any release as follows:")
message("")
message("git checkout <VERSION>")
message("cmake -DREGISTRY=${DEFAULT_REGISTRY} -DRELEASE=v<VERSION> ..")
message("")
message("****************************************************************************")
endif()

if (NOT ${REGISTRY} MATCHES "/$")
Expand All @@ -95,11 +94,11 @@ if (REGISTRY STREQUAL "${DEFAULT_REGISTRY}/")
endif()
endif()

if (NOT DEFINED TIMEOUT)
if ((NOT DEFINED TIMEOUT) OR (TIMEOUT STREQUAL ""))
set(TIMEOUT "28800,600")
endif()

if (NOT DEFINED RELEASE)
if ((NOT DEFINED RELEASE) OR (RELEASE STREQUAL ""))
set(RELEASE ":latest")
elseif (NOT ${RELEASE} MATCHES "^:")
set(RELEASE ":${RELEASE}")
Expand All @@ -108,7 +107,7 @@ string(TOLOWER "${RELEASE}" RELEASE)

if ((NOT DEFINED BENCHMARK) AND (EXISTS "${CMAKE_SOURCE_DIR}/workload/dummy"))
set(BENCHMARK "dummy")
message("${red}WARNING:${reset} Default to the dummy workload for quick evaluation.")
message("${green}INFO:${reset} Default to the dummy workload for quick evaluation.")
message(" Enable specific workload with cmake -DBENCHMARK=<name> .. or")
message(" Enable all workloads with cmake -DBENCHMARK= ..")
message("")
Expand Down Expand Up @@ -153,15 +152,34 @@ endif()
if(COMMAND show_backend_settings)
show_backend_settings()
endif()

message("")
if(BUILDSH_OPTIONS MATCHES "--read-only-registry")
message("${red}INFO:${reset} Docker build is disabled as ${DEFAULT_REGISTRY} is readonly.")
message("")
message("${green}INFO:${reset} Build is disabled as ${DEFAULT_REGISTRY} is a readonly docker registry")
endif()

if(COMMAND detect_backend_warnings)
detect_backend_warnings()
endif()

if (RELEASE MATCHES "^:v[0-9]+[.][0-9]+[.]*[0-9]*$")
string(REPLACE ":" "" release1 "${RELEASE}")
if((NOT REGISTRY STREQUAL "${DEFAULT_REGISTRY}") AND (NOT REGISTRY STREQUAL "${DEFAULT_REGISTRY}/") AND DEFAULT_REGISTRY)
message("${red}WARNING:${reset} Issue 'cmake -DREGISTRY=${DEFAULT_REGISTRY} ..' to use official ${release1} images")
endif()
execute_process(COMMAND bash -c "GIT_SSH_COMMAND='ssh -o BatchMode=yes' GIT_ASKPASS=echo git show-ref -s refs/tags/${release1}" TIMEOUT 5 OUTPUT_VARIABLE tag_commit_id RESULT_VARIABLE status OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
if (status EQUAL 0)
execute_process(COMMAND bash -c "GIT_SSH_COMMAND='ssh -o BatchMode=yes' GIT_ASKPASS=echo git log -1 | head -n1 | cut -f2 -d' '" TIMEOUT 5 OUTPUT_VARIABLE head_commit_id RESULT_VARIABLE head_status OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
if (NOT tag_commit_id STREQUAL head_commit_id)
message("${red}WARNING:${reset} Issue 'git checkout tags/${release1}' to match codebase with release ${release1}")
endif()
endif()
endif()

if(EXISTS "${PROJECT_SOURCE_DIR}/script/benchmark")
execute_process(COMMAND bash -c "ln -s -r -f '${PROJECT_SOURCE_DIR}'/script/benchmark/*.sh ." WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
endif()

message("")
include(legalnotice OPTIONAL)

51 changes: 29 additions & 22 deletions doc/user-guide/executing-workload/cmake.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,51 @@
### Customize the Build Process:
# Cmake Configuration
#
# Apache v2 license
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

You can use the following build options to customize the build process:
This will help to generate native build tool that uses platform independent configuration
files to generate native build tool files. You can execute inside `build` directory.

- **PLATFORM**: Specify the platform names. See [`platforms`][platforms] for the list of platforms.
- **REGISTRY**: Specify the privacy docker registry URL. If specified, all built images will be pushed to given docker registry.
> `REGISTRY` must end with forward slash `/`
- **REGISTRY_AUTH**: Specify the registry authentication method. The only supported value is `docker`, which uses the docker configuration file.
- **RELEASE**: Specify the release version. All built images will be tagged with it. Defaults to `:latest`
> `RELEASE` must begin with colon `:`
- **BACKEND**: Specify the validation backend: [`docker`][docker], [`kubernetes`][kubernetes], or [`terraform`][terraform].
- **TERRAFORM_OPTIONS**: Specify the `terraform` options.
- **TERRAFORM_SUT**: Specify the target SUT (System Under Test) list.
- **TIMEOUT**: Specify the validation timeout, which contains the execution timeout and docker pull timeout. Default to 28800,300 seconds.
- **BENCHMARK**: Specify a workload pattern. Workloads not matching the pattern will be disabled.
- **SPOT_INSTANCE**: If specified, overwrite the `spot_instance` variable in the Cloud configuration files.

### Build examples:
## Build examples

```bash
```shell
cd build
cmake -DREGISTRY=xxyyzz.com:1234 ..
```

### Command Make Targets
## Customize the Build Process

You can use the following build options to customize the build process:

- **PLATFORM**: Specify the platform names. See [`platforms`][platforms] for the list of platforms.
- **REGISTRY**: Must end with forward slash (`/`). Specify the privacy docker registry URL. If specified, all built images will be pushed to given docker registry.
- **REGISTRY_AUTH**: Specify the registry authentication method. The only supported value is `docker`, which uses the docker configuration file.
- **RELEASE**: Must begin with colon (`:`). Specify the release version. All built images will be tagged with it. Defaults to `:latest`
- **BACKEND**: Specify the validation backend: [`docker`][docker], [`kubernetes`][kubernetes], or [`terraform`][terraform].
- **TERRAFORM_OPTIONS**: Specify the `terraform` options.
- **TERRAFORM_SUT**: Specify the target System Under Test (SUT) list.
- **TIMEOUT**: Specify the validation timeout, which contains the execution timeout and docker pull timeout. Default to 28800,300 seconds.
- **BENCHMARK**: Specify a workload pattern. Workloads not matching the pattern will be disabled.
- **SPOT_INSTANCE**: If specified, overwrite the `spot_instance` variable in the Cloud configuration files.

```shell
cmake -DPLATFORM=xyz -DREGISTRY=xxyyzz.com:1234 -DBACKEND=xxyzz ..
```

## Command Make Targets

- **bom**: Print out the BOM list of each workload.
- **clean**: Purge the `logs`.
- **bom**: Print out the BOM list of each workload.
- **clean**: Purge the `logs`.

```bash
```shell
cd build
cmake ..
make bom
```

### See Also
## See Also

- [Docker Engine][Docker Engine]
- [Kubernetes Cluster][Kubernetes Cluster]
Expand Down
Loading

0 comments on commit c6796ec

Please sign in to comment.