aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md81
-rw-r--r--moon_manager/tests/unit_python/api/test_pdp.py62
-rw-r--r--moon_manager/tests/unit_python/conftest.py61
-rw-r--r--tests/README.md77
-rw-r--r--tests/functional/README.md27
-rw-r--r--tests/functional/run_tests.sh3
-rw-r--r--tests/python_unit/README.md5
-rw-r--r--tests/python_unit/run_tests.sh12
-rw-r--r--tools/moon_jenkins/Dockerfile9
-rw-r--r--tools/moon_jenkins/Jenkinsfile24
-rw-r--r--tools/moon_jenkins/README.md37
-rw-r--r--tools/moon_jenkins/docker-compose.yml22
-rw-r--r--tools/moon_jenkins/images/Create Multibranch Pipeline.pngbin0 -> 55639 bytes
-rw-r--r--tools/moon_jenkins/images/Git Source Multibranch Pipeline.pngbin0 -> 31054 bytes
-rw-r--r--tools/moon_jenkins/images/Multibranch Pipeline Log.pngbin0 -> 55231 bytes
-rw-r--r--tools/moon_jenkins/images/Select Source Multibranch Pipeline.pngbin0 -> 23375 bytes
-rw-r--r--tools/moon_jenkins/plugins.txt100
-rw-r--r--tools/moon_jenkins/security.groovy20
-rw-r--r--tools/moon_jenkins/setenv.groovy34
-rw-r--r--tools/moon_kubernetes/README.md33
20 files changed, 451 insertions, 156 deletions
diff --git a/README.md b/README.md
index ecb868b3..22ae99e9 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,16 @@
# Moon
__Version 4.3__
-
This directory contains all the modules for running the Moon platform.
-## Platform Setup
+
+## Platform
+### Setup
- [Docker installation](tools/moon_kubernetes/README.md)
- [kubeadm installation](tools/moon_kubernetes/README.md)
- [Moon deployment](tools/moon_kubernetes/README.md)
- [OpenStack deployment](tools/openstack/README.md)
-
-## Micro-service Architecture
+### Micro-service Architecture
The Moon platform is composed on the following components/containers:
- *consul*: a Consul configuration server
- *db*: a MySQL database server
@@ -23,83 +23,30 @@ The Moon platform is composed on the following components/containers:
## Manipulation
### moon_gui
-The Moon platform comes with a graphical user interface which can be used with
-a web browser at this URL `http://$MOON_HOST:30002`
-
-You will be asked to put a login and password. Those elements are the login and password
-of the Keystone server, if you didn't modify the Keystone server, you will find the
-login and password here `http://$MOON_HOST:30005/ui/#/dc1/kv/openstack/keystone/edit`
+The web access of Moon is through the URL `http://$MOON_HOST:30002` with the login and password of Keystone.
+The default login and password can be found here: `http://$MOON_HOST:30005/ui/#/dc1/kv/openstack/keystone/edit`.
**WARNING: the password is in clear text, this is a known security issue.**
### moon_manager
-The Moon platform can also be requested through its API `http://$MOON_HOST:30001`
+The REST access of Moon is through `http://$MOON_HOST:30001`
-**WARNING: By default, no login/password will be needed because of
-the configuration which is in DEV mode.**
+**WARNING: By default, no login/password will be needed because of the configuration which is in DEV mode.**
-If you want more security, you have to update the configuration of the Keystone server here:
-`http://$MOON_HOST:30005/ui/#/dc1/kv/openstack/keystone/edit`
-by modifying the `check_token` argument to `yes`.
-If you write this modification, your requests to Moon API must always include a valid token
-taken from the Keystone server. This token must be place in the header of the request
-(`X-Auth-Token`).
+For more security, update `http://$MOON_HOST:30005/ui/#/dc1/kv/openstack/keystone/edit` by modifying the `check_token` argument to `yes`
+Requests to Moon API must include a valid token taken from Keystone in the header of `X-Auth-Token`.
-### End-to-end Functional Test
-Check if the Manager API is running:
+Check if the Manager API is running with:
```bash
curl http://$MOON_HOST:30001
curl http://$MOON_HOST:30001/pdp
curl http://$MOON_HOST:30001/policies
```
-### Consul Check
-Check the Consul service for
-- *Components/Manager*, e.g.
-```json
-{
- "port": 8082,
- "bind": "0.0.0.0",
- "hostname": "manager",
- "container": "wukongsun/moon_manager:v4.3.1",
- "external": {
- "port": 30001,
- "hostname": "$MOON_HOST"
- }
-}
-```
-- *OpenStack/Keystone*: e.g.
-```json
-{
- "url": "http://keystone:5000/v3",
- "user": "admin",
- "password": "p4ssw0rd",
- "domain": "default",
- "project": "admin",
- "check_token": false,
- "certificate": false,
- "external": {
- "url": "http://$MOON_HOST:30006/v3"
- }
-}
-```
-
-### Tests
-Launch functional [test scenario](tests/functional/scenario_enabled) :
-```bash
-sudo pip install python_moonclient --upgrade
-cd $MOON_HOME/tests/functional/scenario_tests
-moon_create_pdp --consul-host=$MOON_HOST --consul-port=30005 -v rbac_large.py
-moon_get_keystone_project --consul-host=$MOON_HOST --consul-port=30005
-moon_get_pdp --consul-host=$MOON_HOST --consul-port=30005
-moon_map_pdp_to_project "<pdp_id>" "<keystone_project_id>"
-moon_send_authz_to_wrapper --consul-host=$MOON_HOST --consul-port=30005 --authz-host=$WRAPPER_HOST --authz-port=$WRAPPER_PORT -v rbac_large.py
-```
-To retrieve the wrapper information, use the following command:
-```bash
-kubectl get -n moon services | grep wrapper
-```
+## Tests
+- [Python Unit Test](tests/python_unit/README.md)
+- [Functional Test](tests/functional/README.md)
## Annexe
diff --git a/moon_manager/tests/unit_python/api/test_pdp.py b/moon_manager/tests/unit_python/api/test_pdp.py
new file mode 100644
index 00000000..a2d0cb5a
--- /dev/null
+++ b/moon_manager/tests/unit_python/api/test_pdp.py
@@ -0,0 +1,62 @@
+import json
+import api.utilities as utilities
+import pytest
+
+
+def get_pdp(client):
+ req = client.get("/pdp")
+ pdp = utilities.get_json(req.data)
+ return req, pdp
+
+
+def add_pdp(client, data):
+ req = client.post("/pdp", data=json.dumps(data),
+ headers={'Content-Type': 'application/json'})
+ pdp = utilities.get_json(req.data)
+ return req, pdp
+
+
+def delete_pdp(client, key):
+ req = client.delete("/pdp/{}".format(key))
+ return req
+
+
+def delete_pdp_without_id(client):
+ req = client.delete("/pdp/{}".format(""))
+ return req
+
+
+def test_get_pdp():
+ client = utilities.register_client()
+ req, pdp = get_pdp(client)
+ assert req.status_code == 200
+ assert isinstance(pdp, dict)
+ assert "pdps" in pdp
+
+
+def test_add_pdp():
+ data = {
+ "name": "testuser",
+ "security_pipeline": ["policy_id_1", "policy_id_2"],
+ "keystone_project_id": "keystone_project_id",
+ "description": "description of testuser"
+ }
+ client = utilities.register_client()
+ req, pdp = add_pdp(client, data)
+ assert req.status_code == 200
+ assert isinstance(pdp, dict)
+ value = list(pdp["pdps"].values())[0]
+ assert "pdps" in pdp
+ assert value['name'] == "testuser"
+ assert value["description"] == "description of {}".format("testuser")
+ assert value["keystone_project_id"] == "keystone_project_id"
+
+
+def test_delete_pdp():
+ client = utilities.register_client()
+ request, pdp = get_pdp(client)
+ for key, value in pdp['pdps'].items():
+ if value['name'] == "testuser":
+ success_req = delete_pdp(client, key)
+ break
+ assert success_req.status_code == 200
diff --git a/moon_manager/tests/unit_python/conftest.py b/moon_manager/tests/unit_python/conftest.py
index 3f73f2da..902a41a2 100644
--- a/moon_manager/tests/unit_python/conftest.py
+++ b/moon_manager/tests/unit_python/conftest.py
@@ -35,7 +35,7 @@ CONF = {
"bind": "0.0.0.0",
"port": 8083,
"container": "wukongsun/moon_orchestrator:v4.3",
- "hostname": "interface"
+ "hostname": "orchestrator"
},
"pipeline": {
"interface": {
@@ -114,7 +114,7 @@ CONF = {
},
"messenger": {
"url": "rabbit://moon:p4sswOrd1@messenger:5672/moon"
- }
+ },
}
COMPONENTS = (
@@ -123,22 +123,50 @@ COMPONENTS = (
"database",
"slave",
"components/manager",
+ "components/orchestrator"
)
+PODS = {
+ "pods": {
+ "721760dd-de5f-11e7-8001-3863bbb766f3": [
+ {
+ "pdp_id": "b3d3e18abf3340e8b635fd49e6634ccd",
+ "port": 8080,
+ "genre": "interface",
+ "name": "interface-paltry",
+ "keystone_project_id": "a64beb1cc224474fb4badd43173e7101",
+ "namespace": "moon",
+ "container": "wukongsun/moon_interface:v4.3"
+ },
+ {
+ "pdp_id": "b3d3e18abf3340e8b635fd49e6634ccd",
+ "meta_rule_id": "f8f49a779ceb47b3ac810f01ef71b4e0",
+ "port": 8081,
+ "genre": "authz",
+ "name": "authz-economic",
+ "policy_id": "f8f49a779ceb47b3ac810f01ef71b4e0",
+ "keystone_project_id": "a64beb1cc224474fb4badd43173e7101",
+ "namespace": "moon",
+ "container": "wukongsun/moon_authz:v4.3"
+ }
+ ]
+ }
+}
+
def get_b64_conf(component=None):
if component in CONF:
return base64.b64encode(
json.dumps(
- CONF[component]).encode('utf-8')+b"\n").decode('utf-8')
+ CONF[component]).encode('utf-8') + b"\n").decode('utf-8')
elif "/" in component:
key1, _, key2 = component.partition("/")
return base64.b64encode(
json.dumps(
- CONF[key1][key2]).encode('utf-8')+b"\n").decode('utf-8')
+ CONF[key1][key2]).encode('utf-8') + b"\n").decode('utf-8')
else:
return base64.b64encode(
- json.dumps(CONF).encode('utf-8')+b"\n").decode('utf-8')
+ json.dumps(CONF).encode('utf-8') + b"\n").decode('utf-8')
@pytest.fixture(autouse=True)
@@ -150,7 +178,7 @@ def no_requests(monkeypatch):
m.register_uri(
'GET', 'http://consul:8500/v1/kv/{}'.format(component),
json=[{'Key': component, 'Value': get_b64_conf(component)}]
- )
+ )
m.register_uri(
'POST', 'http://keystone:5000/v3/auth/tokens',
headers={'X-Subject-Token': "111111111"}
@@ -169,10 +197,22 @@ def no_requests(monkeypatch):
)
m.register_uri(
'POST', 'http://keystone:5000/v3/users/',
- json={"users": [{
- "id": "1111111111111"
- }]}
+ json={"users": [{"id": "1111111111111"}]}
)
+ m.register_uri(
+ 'POST', 'http://orchestrator:8083/pods',
+ json=PODS,
+ headers={"content-type": "application/json"}
+ )
+ m.register_uri(
+ 'GET', 'http://orchestrator:8083/pods',
+ json=PODS
+ )
+ m.register_uri(
+ 'DELETE', 'http://orchestrator:8083/pods/{}'.format(list([PODS['pods'].keys()])[0]),
+ headers={"content-type": "application/json"}
+ )
+
print("Start populating the DB.")
from python_moondb.db_manager import init_engine, main
engine = init_engine()
@@ -181,7 +221,6 @@ def no_requests(monkeypatch):
print("End populating the DB.")
yield m
-
# @pytest.fixture(autouse=True, scope="session")
# def manage_database():
# from moon_db.db_manager import init_engine, run
@@ -189,5 +228,3 @@ def no_requests(monkeypatch):
# run("upgrade", logging.getLogger("db_manager"), engine)
# yield
# print("Will close the DB")
-
-
diff --git a/tests/README.md b/tests/README.md
deleted file mode 100644
index c1437a2d..00000000
--- a/tests/README.md
+++ /dev/null
@@ -1,77 +0,0 @@
-# Moon Tests
-## Functional Tests
-### Test Platform Setup
-#### Docker Installation
-```bash
-apt update
-apt install -y docker.io
-```
-
-#### Kubeadm Installation
-see: https://kubernetes.io/docs/setup/independent/install-kubeadm/
-```bash
-apt-get update && apt-get install -y apt-transport-https
-curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
-cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
-deb http://apt.kubernetes.io/ kubernetes-xenial main
-EOF
-apt-get update
-apt-get install -y kubelet kubeadm kubectl
-```
-
-#### K8S Initialisation
-```bash
-cd $MOON_HOME
-bash tools/moon_kubernetes/init_k8s.sh
-```
-
-Wait until all the kubeadm containers are in the `running` state:
-```bash
-watch kubectl get po --namespace=kube-system
-```
-
-You must see something like this:
-
- $ kubectl get po --namespace=kube-system
- NAME READY STATUS RESTARTS AGE
- calico-etcd-7qgjb 1/1 Running 0 1h
- calico-node-f8zvm 2/2 Running 1 1h
- calico-policy-controller-59fc4f7888-ns9kv 1/1 Running 0 1h
- etcd-varuna 1/1 Running 0 1h
- kube-apiserver-varuna 1/1 Running 0 1h
- kube-controller-manager-varuna 1/1 Running 0 1h
- kube-dns-bfbb49cd7-rgqxn 3/3 Running 0 1h
- kube-proxy-x88wg 1/1 Running 0 1h
- kube-scheduler-varuna 1/1 Running 0 1h
-
-
-#### Deploy Moon
-```bash
-cd $MOON_HOME
-sudo bash tools/moon_kubernetes/start_moon.sh
-```
-
-Wait until all the Moon containers are in the `running` state:
-```bash
-watch kubectl get po --namespace=moon
-```
-
-You must see something like this:
-
- $ kubectl get po --namespace=moon
- NAME READY STATUS RESTARTS AGE
- consul-57b6d66975-9qnfx 1/1 Running 0 52m
- db-867f9c6666-bq8cf 1/1 Running 0 52m
- gui-bc9878b58-q288x 1/1 Running 0 51m
- keystone-7d9cdbb69f-bl6ln 1/1 Running 0 52m
- manager-5bfbb96988-2nvhd 1/1 Running 0 51m
- manager-5bfbb96988-fg8vj 1/1 Running 0 51m
- manager-5bfbb96988-w9wnk 1/1 Running 0 51m
- orchestrator-65d8fb4574-tnfx2 1/1 Running 0 51m
- wrapper-astonishing-748b7dcc4f-ngsvp 1/1 Running 0 51m
-
-### Launch Functional for Target Module
-```bash
-cd $MOON_HOME
-sudo bash $TARGET_MODULE/tests/functional_pod/run_functional_tests.sh
-```
diff --git a/tests/functional/README.md b/tests/functional/README.md
new file mode 100644
index 00000000..4cac22b6
--- /dev/null
+++ b/tests/functional/README.md
@@ -0,0 +1,27 @@
+# Moon Functional Test
+
+[Test Platform Setup](../../tools/moon_kubernetes/README.md)
+
+
+### Pod Functional Test
+Launch functional [test scenario](tests/functional/scenario_enabled) :
+```bash
+sudo pip install python_moonclient --upgrade
+cd $MOON_HOME/tests/functional/scenario_tests
+moon_create_pdp --consul-host=$MOON_HOST --consul-port=30005 -v rbac_large.py
+moon_get_keystone_project --consul-host=$MOON_HOST --consul-port=30005
+moon_get_pdp --consul-host=$MOON_HOST --consul-port=30005
+moon_map_pdp_to_project "<pdp_id>" "<keystone_project_id>"
+moon_send_authz_to_wrapper --consul-host=$MOON_HOST --consul-port=30005 --authz-host=$WRAPPER_HOST --authz-port=$WRAPPER_PORT -v rbac_large.py
+```
+
+To retrieve the wrapper information, use the following command:
+```bash
+kubectl get -n moon services | grep wrapper
+```
+
+Launch functional tests:
+```bash
+cd $MOON_HOME
+sudo bash $TARGET_MODULE/tests/functional_pod/run_functional_tests.sh
+```
diff --git a/tests/functional/run_tests.sh b/tests/functional/run_tests.sh
new file mode 100644
index 00000000..ced0f9f7
--- /dev/null
+++ b/tests/functional/run_tests.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+echo "starting Moon Functional Tests"
diff --git a/tests/python_unit/README.md b/tests/python_unit/README.md
new file mode 100644
index 00000000..a399f834
--- /dev/null
+++ b/tests/python_unit/README.md
@@ -0,0 +1,5 @@
+# Python Unit Test
+
+```bash
+bash run_tests.sh
+```
diff --git a/tests/python_unit/run_tests.sh b/tests/python_unit/run_tests.sh
new file mode 100644
index 00000000..33c1ab98
--- /dev/null
+++ b/tests/python_unit/run_tests.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+echo "starting Moon Functional Tests"
+
+cd python_moonutilities
+docker run --rm --volume $(pwd):/data wukongsun/moon_python_unit_test:latest
+
+cd ../python_moondb
+docker run --rm --volume $(pwd):/data wukongsun/moon_python_unit_test:latest
+
+cd ../python_moonclient
+docker run --rm --volume $(pwd):/data wukongsun/moon_python_unit_test:latest \ No newline at end of file
diff --git a/tools/moon_jenkins/Dockerfile b/tools/moon_jenkins/Dockerfile
new file mode 100644
index 00000000..573d4ac8
--- /dev/null
+++ b/tools/moon_jenkins/Dockerfile
@@ -0,0 +1,9 @@
+FROM jenkinsci/blueocean
+
+ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
+
+COPY security.groovy /usr/share/jenkins/ref/init.groovy.d/security.groovy
+COPY setenv.groovy /usr/share/jenkins/ref/init.groovy.d/setenv.groovy
+
+COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
+RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt \ No newline at end of file
diff --git a/tools/moon_jenkins/Jenkinsfile b/tools/moon_jenkins/Jenkinsfile
new file mode 100644
index 00000000..7e0e07c0
--- /dev/null
+++ b/tools/moon_jenkins/Jenkinsfile
@@ -0,0 +1,24 @@
+pipeline {
+ agent {
+ docker {
+ image 'wukongsun/moon_python_unit_test'
+ args '-e moon_home=${moon_home}'
+ }
+ }
+ stages {
+ stage('Python Unit Test') {
+ steps {
+ script {
+ sh("cd ${moon_home}/tests/python_unit")
+ sh("bash run_tests")
+ }
+ }
+ }
+ stage('Functional Test') {
+ script {
+ sh("cd ${moon_home}/tests/functional")
+ sh("bash run_tests")
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/tools/moon_jenkins/README.md b/tools/moon_jenkins/README.md
new file mode 100644
index 00000000..684b351c
--- /dev/null
+++ b/tools/moon_jenkins/README.md
@@ -0,0 +1,37 @@
+# Moon Jenkins
+The aim of this repo is to give a quick way to start with jenkins in containers.
+These were the aims of the automation:
+- minimal interaction with Jenkins GUI - the plugins in plugins.txt are installed automatically, the admin user is setup based on environment variables, proxy variables are inherited from environment
+- the build of the custom image is integrated in the same workflow
+
+## Prerequisites
+- one host running a newer version of the docker-engine
+- docker-compose 1.18.0
+
+## Usage
+- Setup secrets:
+```bash
+export JENKINS_USER=admin
+export JENKINS_PASSWORD=admin
+```
+- Deploy jenkins:
+```bash
+docker-compose up -d
+ ```
+- Test: Jenkins GUI can be available on `http://<docker host IP>:8080`
+
+
+## Pipeline Creation
+You may find bellow an example of pipeline creation using BlueOcean interface.
+As example I used a clone (https://github.com/brutus333/moon.git) of the moon project (https://git.opnfv.org/moon/)
+
+Click on "Create a new job" in the classical Jenkins UI and follow the steps highlighted bellow:
+
+![Create Multibranch Pipeline](images/Create%20Multibranch%20Pipeline.png)
+![Select Source](images/Select%20Source%20Multibranch%20Pipeline.png)
+![Configure Source](images/Git%20Source%20Multibranch%20Pipeline.png)
+![Multibranch Pipeline Log](images/Multibranch%20Pipeline%20Log.png)
+
+Clicking on BlueOcean shows the pipeline in the blueocean interface:
+
+![Blue Ocean Pipeline success](images/blue%20ocean%20success%20pipeline.png)
diff --git a/tools/moon_jenkins/docker-compose.yml b/tools/moon_jenkins/docker-compose.yml
new file mode 100644
index 00000000..2329f7bd
--- /dev/null
+++ b/tools/moon_jenkins/docker-compose.yml
@@ -0,0 +1,22 @@
+version: '3.1'
+
+services:
+
+ jenkins:
+ build:
+ context: .
+ args:
+ image: blueocean:v0.3
+ ports:
+ - 8080:8080
+ - 50000:50000
+ environment:
+ - jenkins_user=${JENKINS_USER}
+ - jenkins_password=${JENKINS_PASSWORD}
+ volumes:
+ - jenkins-data:/var/jenkins_home
+ - /var/run/docker.sock:/var/run/docker.sock
+ user: root
+
+volumes:
+ jenkins-data:
diff --git a/tools/moon_jenkins/images/Create Multibranch Pipeline.png b/tools/moon_jenkins/images/Create Multibranch Pipeline.png
new file mode 100644
index 00000000..c71415c0
--- /dev/null
+++ b/tools/moon_jenkins/images/Create Multibranch Pipeline.png
Binary files differ
diff --git a/tools/moon_jenkins/images/Git Source Multibranch Pipeline.png b/tools/moon_jenkins/images/Git Source Multibranch Pipeline.png
new file mode 100644
index 00000000..dd37f217
--- /dev/null
+++ b/tools/moon_jenkins/images/Git Source Multibranch Pipeline.png
Binary files differ
diff --git a/tools/moon_jenkins/images/Multibranch Pipeline Log.png b/tools/moon_jenkins/images/Multibranch Pipeline Log.png
new file mode 100644
index 00000000..a1905934
--- /dev/null
+++ b/tools/moon_jenkins/images/Multibranch Pipeline Log.png
Binary files differ
diff --git a/tools/moon_jenkins/images/Select Source Multibranch Pipeline.png b/tools/moon_jenkins/images/Select Source Multibranch Pipeline.png
new file mode 100644
index 00000000..eadbe916
--- /dev/null
+++ b/tools/moon_jenkins/images/Select Source Multibranch Pipeline.png
Binary files differ
diff --git a/tools/moon_jenkins/plugins.txt b/tools/moon_jenkins/plugins.txt
new file mode 100644
index 00000000..2463d029
--- /dev/null
+++ b/tools/moon_jenkins/plugins.txt
@@ -0,0 +1,100 @@
+ssh-credentials
+git
+blueocean-dashboard
+pipeline-model-api
+pipeline-graph-analysis
+workflow-support
+display-url-api
+blueocean-config
+workflow-cps
+branch-api
+blueocean-i18n
+workflow-job
+blueocean-bitbucket-pipeline
+favorite
+docker-commons
+pipeline-input-step
+blueocean-pipeline-api-impl
+workflow-api
+jackson2-api
+git-client
+blueocean-pipeline-scm-api
+blueocean
+pipeline-build-step
+jquery-detached
+matrix-project
+antisamy-markup-formatter
+pipeline-model-extensions
+docker-workflow
+github
+git-server
+authentication-tokens
+workflow-cps-global-lib
+pipeline-model-definition
+workflow-scm-step
+pipeline-model-declarative-agent
+cloudbees-bitbucket-branch-source
+script-security
+scm-api
+blueocean-rest
+variant
+sse-gateway
+htmlpublisher
+matrix-auth
+pubsub-light
+blueocean-github-pipeline
+token-macro
+credentials
+mercurial
+plain-credentials
+blueocean-events
+github-api
+blueocean-git-pipeline
+structs
+durable-task
+pipeline-milestone-step
+blueocean-pipeline-editor
+blueocean-web
+pipeline-stage-tags-metadata
+ace-editor
+blueocean-commons
+blueocean-jira
+blueocean-rest-impl
+workflow-step-api
+blueocean-personalization
+workflow-basic-steps
+blueocean-display-url
+jira
+pipeline-stage-step
+jsch
+blueocean-jwt
+cloudbees-folder
+credentials-binding
+github-branch-source
+apache-httpcomponents-client-4-api
+blueocean-autofavorite
+workflow-multibranch
+mailer
+workflow-durable-task-step
+junit
+command-launcher
+bouncycastle-api
+build-timeout
+timestamper
+resource-disposer
+ws-cleanup
+ant
+gradle
+pipeline-rest-api
+handlebars
+momentjs
+pipeline-stage-view
+workflow-aggregator
+pipeline-github-lib
+mapdb-api
+subversion
+ssh-slaves
+pam-auth
+ldap
+email-ext
+locale
diff --git a/tools/moon_jenkins/security.groovy b/tools/moon_jenkins/security.groovy
new file mode 100644
index 00000000..0fb5ff6e
--- /dev/null
+++ b/tools/moon_jenkins/security.groovy
@@ -0,0 +1,20 @@
+#!groovy
+
+import jenkins.model.*
+import hudson.security.*
+
+def instance = Jenkins.getInstance()
+
+def user = System.getenv()['jenkins_user']
+def pass = System.getenv()['jenkins_password']
+// Create user account
+def hudsonRealm = new HudsonPrivateSecurityRealm(false)
+hudsonRealm.createAccount(user,pass)
+instance.setSecurityRealm(hudsonRealm)
+
+// Enable matrix auth strategy and set my_user as admin
+def strategy = new GlobalMatrixAuthorizationStrategy()
+strategy.add(Jenkins.ADMINISTER, user)
+instance.setAuthorizationStrategy(strategy)
+
+instance.save()
diff --git a/tools/moon_jenkins/setenv.groovy b/tools/moon_jenkins/setenv.groovy
new file mode 100644
index 00000000..ab2dc137
--- /dev/null
+++ b/tools/moon_jenkins/setenv.groovy
@@ -0,0 +1,34 @@
+#!groovy
+
+import jenkins.*
+import jenkins.model.*
+import hudson.*
+import hudson.model.*
+
+instance = Jenkins.getInstance()
+globalNodeProperties = instance.getGlobalNodeProperties()
+
+envVarsNodePropertyList = globalNodeProperties.getAll(hudson.slaves.EnvironmentVariablesNodeProperty.class)
+
+newEnvVarsNodeProperty = null
+envVars = null
+
+if (envVarsNodePropertyList == null || envVarsNodePropertyList.size() == 0) {
+ newEnvVarsNodeProperty = new hudson.slaves.EnvironmentVariablesNodeProperty();
+ globalNodeProperties.add(newEnvVarsNodeProperty)
+ envVars = newEnvVarsNodeProperty.getEnvVars()
+} else {
+ envVars = envVarsNodePropertyList.get(0).getEnvVars()
+}
+
+http_proxy = System.getenv()['http_proxy']
+https_proxy = System.getenv()['https_proxy']
+
+if (http_proxy) {
+ envVars.put("http_proxy", System.getenv()['http_proxy'])
+}
+if (https_proxy) {
+ envVars.put("https_proxy", System.getenv()['https_proxy'])
+}
+
+instance.save()
diff --git a/tools/moon_kubernetes/README.md b/tools/moon_kubernetes/README.md
index 73d342fa..2077e580 100644
--- a/tools/moon_kubernetes/README.md
+++ b/tools/moon_kubernetes/README.md
@@ -78,6 +78,39 @@ You must see something like this:
manager-5bfbb96988-w9wnk 1/1 Running 0 51m
orchestrator-65d8fb4574-tnfx2 1/1 Running 0 51m
wrapper-astonishing-748b7dcc4f-ngsvp 1/1 Running 0 51m
+
+
+### Troubleshoot
+check *Consul* for:
+- *Components/Manager*, e.g.
+```json
+{
+ "port": 8082,
+ "bind": "0.0.0.0",
+ "hostname": "manager",
+ "container": "wukongsun/moon_manager:v4.3.1",
+ "external": {
+ "port": 30001,
+ "hostname": "$MOON_HOST"
+ }
+}
+```
+- *OpenStack/Keystone*: e.g.
+```json
+{
+ "url": "http://keystone:5000/v3",
+ "user": "admin",
+ "password": "p4ssw0rd",
+ "domain": "default",
+ "project": "admin",
+ "check_token": false,
+ "certificate": false,
+ "external": {
+ "url": "http://$MOON_HOST:30006/v3"
+ }
+}
+```
+
### Docker-K8S Port Mapping
```yamlex