From c0c307b940515e902de422aa5c16241b13149f01 Mon Sep 17 00:00:00 2001 From: sally Date: Thu, 22 Jun 2017 16:11:29 +0800 Subject: [PATCH] [CE-57] Add license header This not include src folder This not include user-dashboard folder Change-Id: I9ef8528f14408319e93130ea3735d4ff50848630 Signed-off-by: sally --- MAINTAINERS.md | 2 ++ Makefile | 5 +++++ README.md | 4 +--- api/dashboard.yaml | 5 +++++ api/restserver_v1.md | 3 ++- api/restserver_v1.yaml | 5 +++++ api/restserver_v2.md | 6 +++--- docker-compose-build-js.yml | 5 +++++ docker-compose-npm-install.yml | 5 +++++ docker-compose-watch-mode.yml | 5 +++++ docker-compose.yml | 5 +++++ docs/CONTRIBUTING.md | 4 +++- docs/arch.md | 6 +++--- docs/awsinstall.md | 3 ++- docs/dashboard.md | 12 +++--------- docs/db.md | 6 ++++-- docs/index.md | 4 +--- docs/installation.md | 5 ++--- docs/monitoring.md | 3 ++- docs/production_config.md | 4 +++- docs/reactjs.md | 4 +++- docs/scenario.md | 3 ++- docs/terminology.md | 6 ++---- docs/tutorial.md | 3 ++- nginx/nginx.conf | 3 +++ scripts/build_reactjs.sh | 5 +++++ scripts/header.sh | 5 +++++ scripts/npm_install.sh | 5 +++++ scripts/redeploy.sh | 5 +++++ scripts/setup.sh | 5 +++++ scripts/start.sh | 5 +++++ scripts/start_cadvisor.sh | 5 +++++ scripts/start_mongoexpress.sh | 5 +++++ scripts/start_netdata.sh | 5 +++++ scripts/stop.sh | 5 +++++ scripts/update_docker_images.sh | 5 +++++ scripts/watch_mode.sh | 5 +++++ .../worker_node_setup/setup_docker_worker_node.sh | 5 +++++ scripts/worker_node_setup/setup_k8s_worker_node.sh | 5 +++++ scripts/worker_node_setup/setup_swarm_worker_node.sh | 5 +++++ src/agent/docker/__init__.py | 3 +++ test/function_verify.py | 7 +++++-- test/unit/demo_test.py | 8 +++++--- test/user_operations.sh | 5 ++++- tox.ini | 5 +++++ 45 files changed, 175 insertions(+), 44 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 7066764c..b4b110a4 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -4,3 +4,5 @@ |---|---|---|---|---| | Baohua Yang | baohua | yeasy | baohua | yangbaohua@gmail.com | | Haitao Yue | hightall | hightall | hightall | hightallyht@gmail.com | + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. diff --git a/Makefile b/Makefile index 4b4de39b..aa191a91 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ + +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# GREEN := $(shell tput -Txterm setaf 2) WHITE := $(shell tput -Txterm setaf 7) YELLOW := $(shell tput -Txterm setaf 3) diff --git a/README.md b/README.md index 6b82ec45..13e41990 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ Cello is a blockchain provision and operational system, which helps provide Bloc **Note:** This is a **read-only mirror** of the formal [Gerrit](https://gerrit.hyperledger.org/r/#/admin/projects/cello) repository. Find more details at [Cello Wiki](https://wiki.hyperledger.org/projects/cello). - ## Introduction Using Cello, everyone can: @@ -50,5 +49,4 @@ Can you find anyone better at playing chains? :) ## Incubation Notice This project is a Hyperledger project in _Incubation_. It was proposed to the community and documented [here](https://docs.google.com/document/d/1E2i5GRqWsIag7KTxjQ_jQdDiWcuikv3KqXeuw7NaceM/edit), and was approved by [Hyperledger TSC at 2017-01-07](https://lists.hyperledger.org/pipermail/hyperledger-tsc/2017-January/000535.html). Information on what _Incubation_ entails can be found in the [Hyperledger Project Lifecycle document](https://goo.gl/4edNRc). -## License -The Hyperledger Cello project uses the [Apache License Version 2.0](LICENSE) software license. +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/api/dashboard.yaml b/api/dashboard.yaml index 8f69b8ef..1ca26c3e 100644 --- a/api/dashboard.yaml +++ b/api/dashboard.yaml @@ -1,3 +1,8 @@ + +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # this is an example of the Cello API # as a demonstration of an API spec in YAML swagger: '2.0' diff --git a/api/restserver_v1.md b/api/restserver_v1.md index 90536c52..b27056bd 100644 --- a/api/restserver_v1.md +++ b/api/restserver_v1.md @@ -36,7 +36,8 @@ GET /v1/cluster_release?user_id=xxxxxxxx ``` The server will drop the corresponding cluster, recreate it and put into available pool for future requests. - ## Admin Those APIs should not be called by outside applications. Just for information, please see [api-admin.yaml](api-admin.yaml) + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/api/restserver_v1.yaml b/api/restserver_v1.yaml index a30c34e7..c571949f 100644 --- a/api/restserver_v1.yaml +++ b/api/restserver_v1.yaml @@ -1,3 +1,8 @@ + +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # this is an example of the Cello API # as a demonstration of an API spec in YAML swagger: '2.0' diff --git a/api/restserver_v2.md b/api/restserver_v2.md index e262f742..79868a6d 100644 --- a/api/restserver_v2.md +++ b/api/restserver_v2.md @@ -25,7 +25,7 @@ Or GET /cluster_op?action=xxx&key=value ``` -The supported actions can be +The supported actions can be * `apply`: apply a chain * `release`: release a chain, possibly only one peer * `start`: start a chain, possibly only one peer @@ -109,7 +109,6 @@ user_id:xxxxxxxx The server will drop the corresponding cluster, recreate it and put into available pool for future requests. - #### Cluster Start, Stop or Restart Take `start` for example, you can specify the node_id if to operate one node. @@ -152,7 +151,6 @@ size:4, Query the clusters for a user. - ``` POST /clusters { @@ -167,3 +165,5 @@ GET /cluster/xxxxxxx ``` Will return the json object whose data may contain detailed information of cluster. + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docker-compose-build-js.yml b/docker-compose-build-js.yml index 66fd11d5..821b5c83 100644 --- a/docker-compose-build-js.yml +++ b/docker-compose-build-js.yml @@ -1,4 +1,9 @@ # This compose file will deploy the services, and bootup a mongo server. + +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # Local `/opt/cello/mongo` will be used for the db storage. # dashboard: dashboard service of cello, listen on 8080 # app: app service of cello, listen on 80 diff --git a/docker-compose-npm-install.yml b/docker-compose-npm-install.yml index 297e83f1..e317a521 100644 --- a/docker-compose-npm-install.yml +++ b/docker-compose-npm-install.yml @@ -1,4 +1,9 @@ # This compose file will deploy the services, and bootup a mongo server. + +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # Local `/opt/cello/mongo` will be used for the db storage. # dashboard: dashboard service of cello, listen on 8080 # app: app service of cello, listen on 80 diff --git a/docker-compose-watch-mode.yml b/docker-compose-watch-mode.yml index afc11407..3bf938a6 100644 --- a/docker-compose-watch-mode.yml +++ b/docker-compose-watch-mode.yml @@ -1,4 +1,9 @@ # This compose file will deploy the services, and bootup a mongo server. + +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # Local `/opt/cello/mongo` will be used for the db storage. # dashboard: dashboard service of cello, listen on 8080 # app: app service of cello, listen on 80 diff --git a/docker-compose.yml b/docker-compose.yml index 15d709fa..b2191116 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,9 @@ # This compose file will deploy the services, and bootup a mongo server. + +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # Local `/opt/cello/mongo` will be used for the db storage. # dashboard: dashboard service of cello, listen on 8080 # app: app service of cello, listen on 80 diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 2fd40759..47574101 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -32,7 +32,7 @@ The project employs [Gerrit](https://gerrit.hyperledger.org) as the code commit/ *Before committing code, please go to [Jira](https://jira.hyperledger.org/projects/CE) to create a new task or check if there's related existing one, then assign yourself as the assignee. Notice each task will get a Jira number like [CE-26](https://jira.hyperledger.org/browse/CE-26). -* Clone the project to your working directory with your `LFID`. +* Clone the project to your working directory with your `LFID`. ```sh $ git clone ssh://LFID@gerrit.hyperledger.org:29418/cello && scp -p -P 29418 LFID@gerrit.hyperledger.org:hooks/commit-msg cello/.git/hooks/ @@ -105,3 +105,5 @@ Notice you will get a [gerrit item url](http://gerrit.hyperledger.org/r/7915), o After the ci checking passed, add [reviewers](https://wiki.hyperledger.org/projects/cello#contributors) to the reviewer list and also post the gerrit item url at the [RocketChat channel](https://chat.hyperledger.org/channel/cello). The patch will be merged into the `master` branch after passing the review, then mark the Jira item as `Done`. * If you need to refine the patch further as the reviewers may suggest, you can change on the same branch, and commit the new code with `git commit -a --amend`, and then use the `git review` command again. + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/arch.md b/docs/arch.md index de1eb84a..0da1eb22 100644 --- a/docs/arch.md +++ b/docs/arch.md @@ -2,13 +2,11 @@ Here we discuss the architecture design for the mangement services on the Master node. - - ## Philosophy and principles The architecture will follow the following principles: * Micro-service: Means we decouple various functions to individual micro services. No service will crash others whatever it does. -* Fault-resilience: Means the service should be tolerant for fault, such as database crash. +* Fault-resilience: Means the service should be tolerant for fault, such as database crash. * Scalability: Try best to distribute the services, to mitigate centralized bottle neck. ## Functional Layers @@ -44,3 +42,5 @@ I choose it for: * Good enough in performance * Flexible for extending * Stable in code + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/awsinstall.md b/docs/awsinstall.md index ff42bf59..ee5310dd 100644 --- a/docs/awsinstall.md +++ b/docs/awsinstall.md @@ -4,7 +4,7 @@ 1. If you dont have an Amazon AWS account, create one. -2. After logging into AWS console, in the services section, select EC2. +2. After logging into AWS console, in the services section, select EC2. 3. Create atleast 2 instances.One for master node and one for host. Click launch instance. Select Ubuntu 14.04 image as shown in figure ![Select Image](imgs/AWS-setup/1-selectimage.JPG). @@ -49,3 +49,4 @@ Server: 13. You should be able to open the link *http://MasternodeIP:8080* .You can login and add hosts. Once the hosts are added, you can create blockchains. +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/dashboard.md b/docs/dashboard.md index 4f2e4437..8eb69a59 100644 --- a/docs/dashboard.md +++ b/docs/dashboard.md @@ -13,15 +13,12 @@ The left panel gives quick link to various functions, including `overview`, `sys | Inused Clusters | `/clusters?type=inused` | Operate on user occupied chains in the system | | Released History | `/clusters?type=released` | See cluster releasing history data | - ## Overview ![Dashboard Overview](imgs/dashboard_overview.png) - The default overview page show the overall status of the system, e.g., how many hosts are deployed within the system, how many clusters are running on those hosts. And there are status numbers for both hosts and clusters. - ## System Status Page ![dashboard status](imgs/dashboard_status.png) @@ -38,7 +35,7 @@ In the Action dropdown menu, you can * Fillup: Fill a host with chains till it's full `capacity`. * Clean: Clean all unused chains at the host. -* Config: Set configurations of the host, e.g., `name` or `capacity`. +* Config: Set configurations of the host, e.g., `name` or `capacity`. * Reset: Reset everything on the host, useful when u meet problems of running chains on the host. Notice a host can be `reset` only when there's no inused chains on it. * Delete: Remove the host from the pool, then the system will not care about it. @@ -48,19 +45,17 @@ You can click the `Add Host` button to add more hosts into the pool. ![dashboard add-host](imgs/dashboard_add_host.png) - ## Active Chains The `Active Chains` page shows all existing running chains in the system, with their Name, Type, Status, Health, Size and Host. Those inused chains will have a grey line. - ![dashboard clusters](imgs/dashboard_clusters.png) In the Action dropdown menu, you can * Start: Start a chain that is not running. * Stop: Stop a running chain to stopped status. -* Restart: Restart a chain. +* Restart: Restart a chain. * Delete: Delete the chain. * Release: Release a user-occupuied chain back to the pool, which will be deleted later. @@ -68,7 +63,6 @@ You can click the `Add Chain` button to add more chains into the pool if there a ![dashboard add-cluster](imgs/dashboard_add_cluster.png) - ## Inused Chains Filter out those running chains that are occupied by users. @@ -78,4 +72,4 @@ Filter out those running chains that are occupied by users. Record all the user releasing chain history. - +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/db.md b/docs/db.md index 0e0a70b8..fc4e72c5 100644 --- a/docs/db.md +++ b/docs/db.md @@ -3,7 +3,7 @@ We have several collections, as follows. ## Host -Track the information of a Host. +Track the information of a Host. A typical host may look like: @@ -22,7 +22,7 @@ xxx | host_0 | tcp://10.0.0.1:2375 | 20160430101010 | 20 | active | [c1,c2 * log_level (str): logging level for chains on the host, e.g., 'debug', 'info', 'warn', 'error' * log_type (str): logging type for chains on the host, 'local' or 'syslog' * log_server (str): log server address, only valid when `log_type` is 'syslog' -* autofill (str): whether to autofill the server to its capacity with chains, 'true' or 'false' +* autofill (str): whether to autofill the server to its capacity with chains, 'true' or 'false' * schedulable (str): whether to schedule a chain request to that host, 'true' or 'false', useful when maintain the host ## Cluster @@ -49,3 +49,5 @@ xxx | {} | cluster_A | "" | host_xx | tcp://10.0.0.1:2375 | pbft * size (int): Peer nodes number of the chain * containers (list): List of the ids of those containers for the chain * health (str): 'OK' (healthy status) or 'Fail' (Not healthy) + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 29f163b7..466291de 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,6 @@ Cello is a blockchain provision and operational system, which helps provide Bloc **Note:** This is a **read-only mirror** of the formal [Gerrit](https://gerrit.hyperledger.org/r/#/admin/projects/cello) repository. Find more details at [Cello Wiki](https://wiki.hyperledger.org/projects/cello). - ## Introduction Using Cello, everyone can: @@ -50,5 +49,4 @@ Can you find anyone better at playing chains? :) ## Incubation Notice This project is a Hyperledger project in _Incubation_. It was proposed to the community and documented [here](https://docs.google.com/document/d/1E2i5GRqWsIag7KTxjQ_jQdDiWcuikv3KqXeuw7NaceM/edit), and was approved by [Hyperledger TSC at 2017-01-07](https://lists.hyperledger.org/pipermail/hyperledger-tsc/2017-January/000535.html). Information on what _Incubation_ entails can be found in the [Hyperledger Project Lifecycle document](https://goo.gl/4edNRc). -## License -The Hyperledger Cello project uses the [Apache License Version 2.0](LICENSE) software license. +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. diff --git a/docs/installation.md b/docs/installation.md index 60e06965..f1dd6088 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -11,7 +11,6 @@ Cello follows a typical Master-Worker architecture. Hence there will be two type For each Node, it is suggested as a Linux-based (e.g., Ubuntu 14.04+) server/vm: - ## Worker Node Currently we support Docker Host or Swarm Cluster as Worker Node. More types will be added soon. @@ -159,7 +158,6 @@ $ make start To stop or restart the whole services, run `make stop` or `make restart`. - #### Redploy a service To redeploy one specific service, e.g., dashboard, please run @@ -191,6 +189,7 @@ The mongo container will use local `/opt/cello/mongo` directory for persistent s Please keep it safe by backups or using more high-available solutions. - *Licensed under Creative Commons Attribution 4.0 International License https://creativecommons.org/licenses/by/4.0/* + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. diff --git a/docs/monitoring.md b/docs/monitoring.md index f56694a3..b472f73d 100644 --- a/docs/monitoring.md +++ b/docs/monitoring.md @@ -1,4 +1,3 @@ - #Monitoring services The monitoring services build in real time an archive of observations obtained from the analisys of the communication flows of the CELL application services. The observations could be checked in real time (directly in memory) against attacks, anomalies or errors. @@ -14,3 +13,5 @@ to the configuration file: /src/common/utils.py Admin can add to the file /src/monitoring/config.py the following flags: * MONITOR_DB= * MONITOR_LEVEL=FULL | SIMPLE | NONE + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/production_config.md b/docs/production_config.md index 91141398..422c831f 100644 --- a/docs/production_config.md +++ b/docs/production_config.md @@ -39,4 +39,6 @@ Log * Configuration: Set all parameters to production, including image, compose, and application. * Security: Use firewall to filter traffic, enable TLS and authentication. * Backup: Enable automatic data backup. -* Monitoring: Enable monitoring services.out and login, then check with `ulimit -n`. \ No newline at end of file +* Monitoring: Enable monitoring services.out and login, then check with `ulimit -n`. + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/reactjs.md b/docs/reactjs.md index 69ac5bb4..253acacb 100644 --- a/docs/reactjs.md +++ b/docs/reactjs.md @@ -30,4 +30,6 @@ In the production environment ```sh $ make build-js -``` \ No newline at end of file +``` + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/scenario.md b/docs/scenario.md index e71ce2c5..447e7e31 100644 --- a/docs/scenario.md +++ b/docs/scenario.md @@ -47,7 +47,6 @@ User sends request to apply a cluster, Cello will try to find available chains i If found one, construct the response, otherwise, construct an error response. - ### release a cluster User sends request to release a cluster, Cello will check if the request is valid. @@ -55,3 +54,5 @@ User sends request to release a cluster, Cello will check if the request is vali If found applied chain, then release and recreate it with the same name, at the same host, and potentially move it to released db collections. If not found, then just ignore or response. + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/terminology.md b/docs/terminology.md index cb7fefe3..579912bf 100644 --- a/docs/terminology.md +++ b/docs/terminology.md @@ -1,14 +1,11 @@ # Terminology - ## Overview * Cluster | Chain: A blockchain with unique access API address, including several peer nodes. May support Hyperledger Fabric, SawthoothLake and Iroha. * Host: A resource server, usually it can be a naive Docker host or a Swarm cluster. * Master Node: Running the cello platform, to manage the compute nodes. * Compute | Worker Node: The servers to have blockchains running inside. - - ## Hosts A host is a worker node, which can be a native Docker Host or a Swarm Cluster currently. Usually a host has several properties: @@ -21,7 +18,6 @@ A host is a worker node, which can be a native Docker Host or a Swarm Cluster cu * Schedulable: The chains on this hosts are available to be scheduled to users. * Autofill: Always automatically fill the hosts full with chains. - ## Chain A chain is typically a blockchain cluster, e.g., a fabric network, with properties including: @@ -30,3 +26,5 @@ A chain is typically a blockchain cluster, e.g., a fabric network, with properti * Host: Which host the chain locates. * Size: How number nodes does the chain have. * Consensus: What kind of consensus does the chain adopts, depending on the blockchain technology. + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/tutorial.md b/docs/tutorial.md index 3138b1bf..1655db66 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -25,7 +25,6 @@ Suppose it's a Native Docker server to import as a host, input those fields After successful adding, you can find the `docker_host` shown in the Host page, with 0 chains and Cap is 5. - ## Create a chain in the pool Now we have the free host in the pool, new chains can be create. @@ -52,3 +51,5 @@ It will be difficult if you have numbers of chains to create manually. Cello pro Try these methods as you like. If you want to know more advanced operational skills, please continue to the [Dashboard](./dashboard.md). + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 6c920605..bd9a7a70 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,3 +1,6 @@ +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 # This file should be put under /etc/nginx/conf.d/ # Or place as /etc/nginx/nginx.conf diff --git a/scripts/build_reactjs.sh b/scripts/build_reactjs.sh index ab88f3f7..40ab969b 100755 --- a/scripts/build_reactjs.sh +++ b/scripts/build_reactjs.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + # This script will (re)start all services. # It should be triggered at the upper directory, and safe to repeat. diff --git a/scripts/header.sh b/scripts/header.sh index 93215c81..7b351ac0 100644 --- a/scripts/header.sh +++ b/scripts/header.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + PROJECT=cello ## DO NOT MODIFY THE FOLLOWING PART, UNLESS YOU KNOW WHAT IT MEANS ## diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh index 7d04f4a3..1e294eb8 100755 --- a/scripts/npm_install.sh +++ b/scripts/npm_install.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + # This script will (re)start all services. # It should be triggered at the upper directory, and safe to repeat. diff --git a/scripts/redeploy.sh b/scripts/redeploy.sh index fd08d919..51edb0d1 100644 --- a/scripts/redeploy.sh +++ b/scripts/redeploy.sh @@ -1,4 +1,9 @@ #!/usr/bin/env bash + +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # This script will only build and redeploy the specific service. # It should be triggered at the upper directory diff --git a/scripts/setup.sh b/scripts/setup.sh index 17c3383d..4ba4d7a2 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -1,4 +1,9 @@ #!/usr/bin/env bash + +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # This script will try setup a valid environment for the docker-compose running. # It should be triggered at the upper directory, and safe to repeat. diff --git a/scripts/start.sh b/scripts/start.sh index 0c1f4d20..9fb3ef32 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + # This script will (re)start all services. # It should be triggered at the upper directory, and safe to repeat. diff --git a/scripts/start_cadvisor.sh b/scripts/start_cadvisor.sh index 93926914..fca9c043 100644 --- a/scripts/start_cadvisor.sh +++ b/scripts/start_cadvisor.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + echo "Starting cadvisor..." docker run -d \ diff --git a/scripts/start_mongoexpress.sh b/scripts/start_mongoexpress.sh index 12400410..f80f2b21 100644 --- a/scripts/start_mongoexpress.sh +++ b/scripts/start_mongoexpress.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # NOT run this in production environment. # This script will start a mongo-express node for debugging. # It should be triggered at the upper directory diff --git a/scripts/start_netdata.sh b/scripts/start_netdata.sh index cffe020f..8ec41f8f 100644 --- a/scripts/start_netdata.sh +++ b/scripts/start_netdata.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + docker run -d \ --net=host \ --cap-add SYS_PTRACE \ diff --git a/scripts/stop.sh b/scripts/stop.sh index 631c5f7e..07d4a58c 100755 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + # This script will (re)start all services. # It should be triggered at the upper directory, and safe to repeat. diff --git a/scripts/update_docker_images.sh b/scripts/update_docker_images.sh index bc0b6e7b..9397e009 100644 --- a/scripts/update_docker_images.sh +++ b/scripts/update_docker_images.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + echo "Pull yeasy/hyperledger:latest and retagging" docker pull yeasy/hyperledger:latest && \ docker rmi hyperledger/fabric-baseimage:latest && \ diff --git a/scripts/watch_mode.sh b/scripts/watch_mode.sh index 36c9f025..286b7c7d 100755 --- a/scripts/watch_mode.sh +++ b/scripts/watch_mode.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + # This script will (re)start all services. # It should be triggered at the upper directory, and safe to repeat. diff --git a/scripts/worker_node_setup/setup_docker_worker_node.sh b/scripts/worker_node_setup/setup_docker_worker_node.sh index 17ea1d3a..fd843866 100644 --- a/scripts/worker_node_setup/setup_docker_worker_node.sh +++ b/scripts/worker_node_setup/setup_docker_worker_node.sh @@ -1,3 +1,8 @@ + +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # This script will help setup Docker at a server, then the server can be used as a worker node. # TODO: \ No newline at end of file diff --git a/scripts/worker_node_setup/setup_k8s_worker_node.sh b/scripts/worker_node_setup/setup_k8s_worker_node.sh index 98dd5bb9..f516cbb7 100644 --- a/scripts/worker_node_setup/setup_k8s_worker_node.sh +++ b/scripts/worker_node_setup/setup_k8s_worker_node.sh @@ -1,3 +1,8 @@ + +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # This script will help setup a Kubernetes cluster at servers, then the cluster can be used as a worker node. # TODO: \ No newline at end of file diff --git a/scripts/worker_node_setup/setup_swarm_worker_node.sh b/scripts/worker_node_setup/setup_swarm_worker_node.sh index 2f945c67..d2ebba74 100644 --- a/scripts/worker_node_setup/setup_swarm_worker_node.sh +++ b/scripts/worker_node_setup/setup_swarm_worker_node.sh @@ -1,3 +1,8 @@ + +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # This script will help setup a Swarm cluster at servers, then the cluster can be used as a worker node. # TODO: \ No newline at end of file diff --git a/src/agent/docker/__init__.py b/src/agent/docker/__init__.py index e69de29b..6b9968ae 100644 --- a/src/agent/docker/__init__.py +++ b/src/agent/docker/__init__.py @@ -0,0 +1,3 @@ +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 diff --git a/test/function_verify.py b/test/function_verify.py index a7710eae..853a680d 100644 --- a/test/function_verify.py +++ b/test/function_verify.py @@ -1,3 +1,8 @@ + +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# # 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 @@ -20,7 +25,6 @@ API_URL = 'http://127.0.0.1:5000' - def query_value(chaincode_name, arg_list): """ Query a list of values. @@ -46,7 +50,6 @@ def query_value(chaincode_name, arg_list): return result - # Usage: # * python function_test.py [API_URL=http://127.0.0.1:5000] will deploy first # * python function_test.py [API_URL=http://127.0.0.1:5000] [chaincode_name] diff --git a/test/unit/demo_test.py b/test/unit/demo_test.py index ec50f5b0..e3952cae 100644 --- a/test/unit/demo_test.py +++ b/test/unit/demo_test.py @@ -1,10 +1,13 @@ -import unittest +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +import unittest def add_one(x): return x + 1 - class ChaincodeTest(unittest.TestCase): """ Test chaincode deploy, invoke and query """ @@ -17,6 +20,5 @@ def tearDown(self): def test_add_one(self): self.assertEqual(add_one(3), 4) - if __name__ == '__main__': unittest.main() diff --git a/test/user_operations.sh b/test/user_operations.sh index d608dc79..819330aa 100644 --- a/test/user_operations.sh +++ b/test/user_operations.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash - +# Copyright IBM Corp., All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# actions="apply release" users="a b c d e f g h i j k l m n o p q r s t u v w x y z" diff --git a/tox.ini b/tox.ini index aa73c2c3..f2365808 100644 --- a/tox.ini +++ b/tox.ini @@ -1,3 +1,8 @@ + +# Copyright IBM Corp, All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# [tox] minversion=2.3.1 envlist = py35, flake8