From 3243bd2a05dbca679567d32898fcb6231c546af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JB=20Onofr=C3=A9?= Date: Thu, 11 Jul 2024 15:34:27 +0200 Subject: [PATCH] Add missing ASF headers (#150) Provide dev/check-license script to perform RAT checks --- .github/workflows/build-push.yml | 19 ++++ .github/workflows/build.yml | 19 ++++ .github/workflows/license.yml | 19 ++++ .github/workflows/loc.yml | 19 ++++ .github/workflows/main.yml | 19 ++++ .github/workflows/ut.yml | 19 ++++ CHANGELOG.md | 19 ++++ CODE_OF_CONDUCT.md | 19 ++++ Docker/Dockerfile | 21 ++++- Docker/Dockerfile_mac | 19 ++++ INSTALL/README.md | 18 ++++ README.md | 19 ++++ api/README.md | 19 ++++ dev/.rat-excludes | 20 +++++ dev/check-license | 86 +++++++++++++++++++ documents/doxygen/DoxygenLayout.xml | 16 ++++ documents/doxygen/doxygen_html_style.css | 16 ++++ documents/file/prometheus.yml | 19 ++++ monitoring/README.md | 19 ++++ monitoring/prometheus/prometheus.yml | 19 ++++ .../consensus/ordering/geo_pbft/README.md | 21 ++++- platform/consensus/ordering/pbft/README.md | 21 ++++- platform/networkstrate/README.md | 19 ++++ platform/statistic/README.md | 19 ++++ scripts/deploy/README.md | 19 ++++ service/tools/contract/README.md | 19 ++++ service/tools/utxo/README.md | 18 ++++ third_party/loc_script/action.yml | 19 ++++ third_party/loc_script/src/index.js | 16 ++++ 29 files changed, 611 insertions(+), 3 deletions(-) create mode 100644 dev/.rat-excludes create mode 100755 dev/check-license diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 0a1c92394..e8e1460ea 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + name: ci on: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 618e908f8..c1d27b4cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + name: bazel-build CI on: diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml index 7243bbb76..9468e3960 100644 --- a/.github/workflows/license.yml +++ b/.github/workflows/license.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + name: Check Apache License on: diff --git a/.github/workflows/loc.yml b/.github/workflows/loc.yml index fe4030910..dc418b1e2 100644 --- a/.github/workflows/loc.yml +++ b/.github/workflows/loc.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + name: LOC on: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6688d39d1..3034255fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + name: Doxygen Action on: diff --git a/.github/workflows/ut.yml b/.github/workflows/ut.yml index 86aa8573a..376bc7f85 100644 --- a/.github/workflows/ut.yml +++ b/.github/workflows/ut.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + name: Unite Test on: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b19049d9..cefce5db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ + + # Change Log ### Resielientdb v1.10.0 ([2024-4-16](https://github.com/resilientdb/resilientdb/releases/tag/v1.10.0-rc01)) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 3c9385001..f53ce4f0e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,22 @@ + + # Contributor Covenant Code of Conduct ## Our Pledge diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 31571586e..c5f82544a 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive @@ -34,4 +53,4 @@ RUN bazel --version RUN bazel build @com_github_bazelbuild_buildtools//buildifier:buildifier RUN bazel build service/tools/kv/api_tools/kv_service_tools -ENTRYPOINT ["./entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["./entrypoint.sh"] diff --git a/Docker/Dockerfile_mac b/Docker/Dockerfile_mac index 211976d87..fb629b399 100644 --- a/Docker/Dockerfile_mac +++ b/Docker/Dockerfile_mac @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + # Use a base image for ARM64 architecture FROM arm64v8/ubuntu:20.04 diff --git a/INSTALL/README.md b/INSTALL/README.md index 6ab68a4c2..969142a20 100755 --- a/INSTALL/README.md +++ b/INSTALL/README.md @@ -1,3 +1,21 @@ + # Prerequire python3.10 diff --git a/README.md b/README.md index 9bae516d2..57c613e8d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ + + ![](https://img.shields.io/github/v/release/resilientdb/resilientdb) ![](https://img.shields.io/badge/language-c++-orange.svg) ![](https://img.shields.io/badge/platform-Ubuntu20.0+-lightgrey.svg) diff --git a/api/README.md b/api/README.md index e3d99ad14..d25474f30 100644 --- a/api/README.md +++ b/api/README.md @@ -1,3 +1,22 @@ + + # ResilientDB kv-Service Python API(Get and Set Command) ## Description diff --git a/dev/.rat-excludes b/dev/.rat-excludes new file mode 100644 index 000000000..aa54fb8a2 --- /dev/null +++ b/dev/.rat-excludes @@ -0,0 +1,20 @@ +.bazelrc +.bazelversion +.clang-format +.licenserc.yaml +repositories.bzl +.gitignore +.git +.rat-excludes +DISCLAIMER-WIP +CNAME +WORKSPACE +build +.*\.conf +.*\.config +.*\.pub +.*\.pri +.*\.BUILD +Doxyfile +header +.*\.sol diff --git a/dev/check-license b/dev/check-license new file mode 100755 index 000000000..e929e68bf --- /dev/null +++ b/dev/check-license @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# + + +acquire_rat_jar () { + + URL="https://repo.maven.apache.org/maven2/org/apache/rat/apache-rat/${RAT_VERSION}/apache-rat-${RAT_VERSION}.jar" + + JAR="$rat_jar" + + # Download rat launch jar if it hasn't been downloaded yet + if [ ! -f "$JAR" ]; then + # Download + printf "Attempting to fetch rat\n" + JAR_DL="${JAR}.part" + if [ $(command -v curl) ]; then + curl -L --silent "${URL}" > "$JAR_DL" && mv "$JAR_DL" "$JAR" + elif [ $(command -v wget) ]; then + wget --quiet ${URL} -O "$JAR_DL" && mv "$JAR_DL" "$JAR" + else + printf "You do not have curl or wget installed, please install rat manually.\n" + exit -1 + fi + fi + + unzip -tq "$JAR" &> /dev/null + if [ $? -ne 0 ]; then + # We failed to download + rm "$JAR" + printf "Our attempt to download rat locally to ${JAR} failed. Please install rat manually.\n" + exit -1 + fi +} + +# Go to the Spark project root directory +FWDIR="$(cd "`dirname "$0"`"/..; pwd)" +cd "$FWDIR" + +if test -x "$JAVA_HOME/bin/java"; then + declare java_cmd="$JAVA_HOME/bin/java" +else + declare java_cmd=java +fi + +export RAT_VERSION=0.16.1 +export rat_jar="$FWDIR"/lib/apache-rat-${RAT_VERSION}.jar +mkdir -p "$FWDIR"/lib + +[[ -f "$rat_jar" ]] || acquire_rat_jar || { + echo "Download failed. Obtain the rat jar manually and place it at $rat_jar" + exit 1 +} + +mkdir -p build +$java_cmd -jar "$rat_jar" --scan-hidden-directories -E "$FWDIR"/dev/.rat-excludes -d "$FWDIR" > build/rat-results.txt + +if [ $? -ne 0 ]; then + echo "RAT exited abnormally" + exit 1 +fi + +ERRORS="$(cat build/rat-results.txt | grep -e "??")" + +if test ! -z "$ERRORS"; then + echo "Could not find Apache license headers in the following files:" + echo "$ERRORS" + exit 1 +else + echo -e "RAT checks passed." +fi diff --git a/documents/doxygen/DoxygenLayout.xml b/documents/doxygen/DoxygenLayout.xml index 34a428d5c..50f95acc5 100644 --- a/documents/doxygen/DoxygenLayout.xml +++ b/documents/doxygen/DoxygenLayout.xml @@ -1,3 +1,19 @@ + diff --git a/documents/doxygen/doxygen_html_style.css b/documents/doxygen/doxygen_html_style.css index b4d993b73..93cbf2e14 100644 --- a/documents/doxygen/doxygen_html_style.css +++ b/documents/doxygen/doxygen_html_style.css @@ -1,3 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ img[src="logo.png"]{ width: 250px; height: 83px; diff --git a/documents/file/prometheus.yml b/documents/file/prometheus.yml index ed541052e..e2204277a 100644 --- a/documents/file/prometheus.yml +++ b/documents/file/prometheus.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + # my global config global: scrape_interval: 5s # Set the scrape interval to every 5 seconds. Default is every 1 minute. diff --git a/monitoring/README.md b/monitoring/README.md index 2e8c4cc9f..ddd425729 100644 --- a/monitoring/README.md +++ b/monitoring/README.md @@ -1,3 +1,22 @@ + + # Download Prometheus wget https://github.com/prometheus/prometheus/releases/download/v2.47.0/prometheus-2.47.0.linux-amd64.tar.gz tar xvf prometheus-2.47.0.linux-amd64.tar.gz diff --git a/monitoring/prometheus/prometheus.yml b/monitoring/prometheus/prometheus.yml index 8463c6963..39c18fcfa 100644 --- a/monitoring/prometheus/prometheus.yml +++ b/monitoring/prometheus/prometheus.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + # my global config global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. diff --git a/platform/consensus/ordering/geo_pbft/README.md b/platform/consensus/ordering/geo_pbft/README.md index 15faa978d..c0848e9e2 100644 --- a/platform/consensus/ordering/geo_pbft/README.md +++ b/platform/consensus/ordering/geo_pbft/README.md @@ -1,4 +1,23 @@ + + # GeoBFT Consensus Structure Diagram
-
\ No newline at end of file + diff --git a/platform/consensus/ordering/pbft/README.md b/platform/consensus/ordering/pbft/README.md index 84298a9bd..cf0c14238 100644 --- a/platform/consensus/ordering/pbft/README.md +++ b/platform/consensus/ordering/pbft/README.md @@ -1,3 +1,22 @@ + + # PBFT Consensus Flow Charts ## New Client Request @@ -28,4 +47,4 @@ ## Ordering Thread
-
\ No newline at end of file + diff --git a/platform/networkstrate/README.md b/platform/networkstrate/README.md index 1cf6f81cf..cc55725b4 100644 --- a/platform/networkstrate/README.md +++ b/platform/networkstrate/README.md @@ -1,3 +1,22 @@ + +
NexresRPC Server is a modern high-performance asynchronous IO Remote Procedure Call(RPC) framework that supports any service running in Byzantine Environment. diff --git a/platform/statistic/README.md b/platform/statistic/README.md index b211157a3..4e666983f 100644 --- a/platform/statistic/README.md +++ b/platform/statistic/README.md @@ -1,3 +1,22 @@ + + # Introduction Nexres dynamic dashboard is a Grafana base dashboard for Nexres. It aims to provide a simple real-time interface for developers to monitor and diagnose Nexres. The data is stored in the Prometheus time-series database and queried by Grafana using PromeQL. The system usage data is provided by Prometheus third-party exporter Node Exporter. diff --git a/scripts/deploy/README.md b/scripts/deploy/README.md index bf8e54e31..ee41cae3a 100644 --- a/scripts/deploy/README.md +++ b/scripts/deploy/README.md @@ -1,3 +1,22 @@ + + This directory includes deployment scripts that help to deploy ResilientDB on multiple machines. At present, these scripts only support deploying KV service and KV Performance server. # Usage diff --git a/service/tools/contract/README.md b/service/tools/contract/README.md index d3a86f1a6..54457cc2b 100644 --- a/service/tools/contract/README.md +++ b/service/tools/contract/README.md @@ -1,3 +1,22 @@ + + start the server: ./service/tools/contract/service_tools/start_contract_service.sh diff --git a/service/tools/utxo/README.md b/service/tools/utxo/README.md index 0fc6306c6..5db5fd786 100644 --- a/service/tools/utxo/README.md +++ b/service/tools/utxo/README.md @@ -1,3 +1,21 @@ + install bech32: diff --git a/third_party/loc_script/action.yml b/third_party/loc_script/action.yml index 1946350d1..5e1acd7d5 100644 --- a/third_party/loc_script/action.yml +++ b/third_party/loc_script/action.yml @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + # This script is from https://github.com/shadowmoose/GHA-LoC-Badge/blob/master/action.yml name: 'lines of code Badge' diff --git a/third_party/loc_script/src/index.js b/third_party/loc_script/src/index.js index 09dc4d273..24faf0394 100644 --- a/third_party/loc_script/src/index.js +++ b/third_party/loc_script/src/index.js @@ -1,3 +1,19 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--%> // This script is from https://github.com/shadowmoose/GHA-LoC-Badge/blob/master/src/index.js const { badgen } = require('badgen');