diff --git a/.deployment/docker-compose.yml b/.deployment/docker-compose.yml index ebe2b67..523accc 100644 --- a/.deployment/docker-compose.yml +++ b/.deployment/docker-compose.yml @@ -47,7 +47,7 @@ services: - ./:/data/ environment: roster.uri: http://roster:8082 - spring.data.mongodb.uri: mongodb://root:password@tapas-db:27017 + spring.data.mongodb.uri: mongodb://root:password@mongodb:27017 labels: - "traefik.enable=true" - "traefik.http.routers.tapas-tasks.rule=Host(`tapas-tasks.${PUB_IP}.nip.io`)" @@ -85,11 +85,11 @@ services: volumes: - ./:/data/ environment: - task.list.uri: http://tapas-tasks:8081 - executor.robot.uri: http://executor-robot:8084 - executor.computation.uri: http://executor-computation:8085 + task-list.uri: http://tapas-tasks:8081 + executor-robot.uri: http://executor-robot:8084 + executor-computation.uri: http://executor-computation:8085 mqtt.broker.uri: tcp://broker.hivemq.com:1883 - spring.data.mongodb.uri: mongodb://root:password@tapas-db:27017 + spring.data.mongodb.uri: mongodb://root:password@mongodb:27017 labels: - "traefik.enable=true" - "traefik.http.routers.roster.rule=Host(`roster.${PUB_IP}.nip.io`)" @@ -109,7 +109,7 @@ services: - ./:/data/ environment: mqtt.broker.uri: tcp://broker.hivemq.com:1883 - spring.data.mongodb.uri: mongodb://root:password@tapas-db:27017 + spring.data.mongodb.uri: mongodb://root:password@mongodb:27017 labels: - "traefik.enable=true" - "traefik.http.routers.executor-pool.rule=Host(`executor-pool.${PUB_IP}.nip.io`)" @@ -130,8 +130,8 @@ services: volumes: - ./:/data/ environment: - EXECUTOR_POOL_URI: http://executor-pool:8083 - ROSTER_URI: http://roster:8082 + executor_pool_uri: http://executor-pool:8083 + roster_uri: http://roster:8082 labels: - "traefik.enable=true" - "traefik.http.routers.executor-computation.rule=Host(`executor-computation.${PUB_IP}.nip.io`)" @@ -151,8 +151,8 @@ services: volumes: - ./:/data/ environment: - EXECUTOR_POOL_URI: http://executor-pool:8083 - ROSTER_URI: http://roster:8082 + executor_pool_uri: http://executor-pool:8083 + roster_uri: http://roster:8082 labels: - "traefik.enable=true" - "traefik.http.routers.executor-robot.rule=Host(`executor-robot.${PUB_IP}.nip.io`)" diff --git a/.experiments/executor-computation/chaostoolkit.log b/.experiments/executor-computation/chaostoolkit.log deleted file mode 100644 index 58b69b8..0000000 --- a/.experiments/executor-computation/chaostoolkit.log +++ /dev/null @@ -1,266 +0,0 @@ -[2021-11-28 16:28:04 DEBUG] [cli:103] ############################################################################### -[2021-11-28 16:28:04 DEBUG] [cli:104] Running command 'run' -[2021-11-28 16:28:04 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-28 16:28:05 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 16:28:05 DEBUG] [caching:24] Building activity cache... -[2021-11-28 16:28:05 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 16:28:05 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-28 16:28:05 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 16:28:05 DEBUG] [secret:78] Loading secrets... -[2021-11-28 16:28:05 DEBUG] [secret:104] Done loading secrets -[2021-11-28 16:28:05 INFO] [experiment:109] Experiment looks valid -[2021-11-28 16:28:05 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 16:28:05 DEBUG] [caching:24] Building activity cache... -[2021-11-28 16:28:05 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 16:28:05 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 16:28:05 DEBUG] [secret:78] Loading secrets... -[2021-11-28 16:28:05 DEBUG] [secret:104] Done loading secrets -[2021-11-28 16:28:05 INFO] [run:319] Running experiment: What is the impact of an expired certificate on our application chain? -[2021-11-28 16:28:05 DEBUG] [__init__:49] Initializing controls -[2021-11-28 16:28:05 INFO] [run:336] Steady-state strategy: default -[2021-11-28 16:28:05 INFO] [run:340] Rollbacks strategy: default -[2021-11-28 16:28:05 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 16:28:05 INFO] [run:599] Playing your experiment's method now... -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:28:05 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-28 16:28:05 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 16:28:05 DEBUG] [activity:260] Activity failed - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn - conn = connection.create_connection( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection - raise err - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection - sock.connect(sa) - ConnectionRefusedError: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen - httplib_response = self._make_request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request - conn.request(method, url, **httplib_request_kw) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request - super(HTTPConnection, self).request(method, url, body=body, headers=headers) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1279, in request - self._send_request(method, url, body, headers, encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1325, in _send_request - self.endheaders(body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1274, in endheaders - self._send_output(message_body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1034, in _send_output - self.send(msg) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 974, in send - self.connect() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect - conn = self._new_conn() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn - raise NewConnectionError( - urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 439, in send - resp = conn.urlopen( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen - retries = retries.increment( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment - raise MaxRetryError(_pool, url, error or ResponseError(cause)) - urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8085): Max retries exceeded with url: /actuator/chaosmonkey/enable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 24, in enable_chaosmonkey - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8085): Max retries exceeded with url: /actuator/chaosmonkey/enable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/activity.py", line 253, in run_activity - result = run_python_activity(activity, configuration, secrets) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 58, in run_python_activity - raise ActivityFailed( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 24, in enable_chaosmonkey - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - chaoslib.exceptions.ActivityFailed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8085): Max retries exceeded with url: /actuator/chaosmonkey/enable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-28 16:28:05 ERROR] [activity:213] => failed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8085): Max retries exceeded with url: /actuator/chaosmonkey/enable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:28:05 INFO] [activity:188] Action: configure_assaults -[2021-11-28 16:28:05 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 16:28:05 DEBUG] [activity:260] Activity failed - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn - conn = connection.create_connection( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection - raise err - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection - sock.connect(sa) - ConnectionRefusedError: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen - httplib_response = self._make_request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request - conn.request(method, url, **httplib_request_kw) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request - super(HTTPConnection, self).request(method, url, body=body, headers=headers) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1279, in request - self._send_request(method, url, body, headers, encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1325, in _send_request - self.endheaders(body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1274, in endheaders - self._send_output(message_body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1034, in _send_output - self.send(msg) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 974, in send - self.connect() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect - conn = self._new_conn() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn - raise NewConnectionError( - urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 439, in send - resp = conn.urlopen( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen - retries = retries.increment( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment - raise MaxRetryError(_pool, url, error or ResponseError(cause)) - urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8085): Max retries exceeded with url: /actuator/chaosmonkey/assaults (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 83, in change_assaults_configuration - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8085): Max retries exceeded with url: /actuator/chaosmonkey/assaults (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/activity.py", line 253, in run_activity - result = run_python_activity(activity, configuration, secrets) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 58, in run_python_activity - raise ActivityFailed( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 83, in change_assaults_configuration - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - chaoslib.exceptions.ActivityFailed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8085): Max retries exceeded with url: /actuator/chaosmonkey/assaults (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-28 16:28:05 ERROR] [activity:213] => failed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8085): Max retries exceeded with url: /actuator/chaosmonkey/assaults (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 16:28:05 INFO] [run:885] Let's rollback... -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 16:28:05 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 16:28:05 INFO] [run:450] Experiment ended with status: completed -[2021-11-28 16:28:05 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 16:28:05 DEBUG] [__init__:82] Cleaning up controls -[2021-11-28 16:28:05 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 16:54:22 DEBUG] [cli:103] ############################################################################### -[2021-11-28 16:54:22 DEBUG] [cli:104] Running command 'run' -[2021-11-28 16:54:22 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-28 16:54:23 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-28 16:54:23 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 16:54:23 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 16:54:23 DEBUG] [caching:24] Building activity cache... -[2021-11-28 16:54:23 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 16:54:23 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-28 16:54:23 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 16:54:23 DEBUG] [secret:78] Loading secrets... -[2021-11-28 16:54:23 DEBUG] [secret:104] Done loading secrets -[2021-11-28 16:54:23 INFO] [experiment:109] Experiment looks valid -[2021-11-28 16:54:23 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 16:54:23 DEBUG] [caching:24] Building activity cache... -[2021-11-28 16:54:23 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 16:54:23 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 16:54:23 DEBUG] [secret:78] Loading secrets... -[2021-11-28 16:54:23 DEBUG] [secret:104] Done loading secrets -[2021-11-28 16:54:23 INFO] [run:319] Running experiment: What is the impact of an expired certificate on our application chain? -[2021-11-28 16:54:23 DEBUG] [__init__:49] Initializing controls -[2021-11-28 16:54:23 INFO] [run:336] Steady-state strategy: default -[2021-11-28 16:54:23 INFO] [run:340] Rollbacks strategy: default -[2021-11-28 16:54:23 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-28 16:54:23 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 16:54:23 INFO] [run:599] Playing your experiment's method now... -[2021-11-28 16:54:23 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 16:54:23 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:54:23 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-28 16:54:23 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 16:54:24 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-28T15:54:24.502699Z"}' -[2021-11-28 16:54:24 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:54:24 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:54:24 INFO] [activity:188] Action: configure_assaults -[2021-11-28 16:54:24 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 16:54:25 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-28 16:54:25 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:54:25 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 16:54:25 INFO] [run:885] Let's rollback... -[2021-11-28 16:54:25 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 16:54:25 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-28 16:54:25 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 16:54:25 INFO] [run:450] Experiment ended with status: completed -[2021-11-28 16:54:25 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 16:54:25 DEBUG] [__init__:82] Cleaning up controls -[2021-11-28 16:54:25 DEBUG] [caching:42] Clearing activities cache diff --git a/.experiments/executor-computation/disable.json b/.experiments/executor-computation/disable.json deleted file mode 100644 index 62034df..0000000 --- a/.experiments/executor-computation/disable.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": "Disable chaos monkey", - "description": "Disable", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [], - "rollbacks": [ - { - "name": "disable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator" - }, - "func": "disable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ] -} diff --git a/.experiments/executor-computation/exception.json b/.experiments/executor-computation/exception.json deleted file mode 100644 index 837dc38..0000000 --- a/.experiments/executor-computation/exception.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "title": "Testing exceptions", - "description": "Testing exceptions!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": false, - "killApplicationActive": false, - "restartApplicationActive": false, - "exceptionsActive": true, - "exception": { - "type": "java.lang.RuntimeException", - "arguments": [ - { - "className": "java.lang.String", - "value": "Exception assault has been carried out" - } - ] - } - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/executor-computation/journal.json b/.experiments/executor-computation/journal.json deleted file mode 100644 index d2e34fe..0000000 --- a/.experiments/executor-computation/journal.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "chaoslib-version": "1.23.0", - "platform": "macOS-12.0-arm64-arm-64bit", - "node": "Marcels-MBP-M1", - "experiment": { - "title": "What is the impact of an expired certificate on our application chain?", - "description": "If a certificate expires, we should gracefully deal with the issue.", - "tags": [ - "tls" - ], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": true, - "exceptionsActive": false, - "killApplicationActive": false, - "restartApplicationActive": false - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [], - "dry": null - }, - "start": "2021-11-28T15:54:23.134945", - "status": "completed", - "deviated": false, - "steady_states": { - "before": null, - "after": null, - "during": [] - }, - "run": [ - { - "activity": { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - "output": "{\"status\":\"Chaos Monkey is enabled\",\"enabledAt\":\"2021-11-28T15:54:24.502699Z\"}", - "status": "succeeded", - "start": "2021-11-28T15:54:23.135657", - "end": "2021-11-28T15:54:24.853870", - "duration": 1.718213 - }, - { - "activity": { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": true, - "exceptionsActive": false, - "killApplicationActive": false, - "restartApplicationActive": false - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - "output": "Assault config has changed", - "status": "succeeded", - "start": "2021-11-28T15:54:24.854282", - "end": "2021-11-28T15:54:25.705360", - "duration": 0.851078 - } - ], - "rollbacks": [], - "end": "2021-11-28T15:54:25.706100", - "duration": 2.609093189239502 -} \ No newline at end of file diff --git a/.experiments/executor-computation/kill-restart.json b/.experiments/executor-computation/kill-restart.json deleted file mode 100644 index a2788a6..0000000 --- a/.experiments/executor-computation/kill-restart.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "title": "Testing kill & restart", - "description": "Testing behavoir when killing and restarting the application", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 5000, - "latencyActive": false, - "exceptionsActive": false, - "killApplicationActive": true, - "restartApplicationActive": true - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/executor-computation/latency.json b/.experiments/executor-computation/latency.json deleted file mode 100644 index 269bf1e..0000000 --- a/.experiments/executor-computation/latency.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "title": "Testing latency", - "description": "Testing latency!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": true, - "exceptionsActive": false, - "killApplicationActive": false, - "restartApplicationActive": false - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/executor-computation/memory.json b/.experiments/executor-computation/memory.json deleted file mode 100644 index 265675e..0000000 --- a/.experiments/executor-computation/memory.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "title": "Testing memory", - "description": "Testing memory!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8085/actuator", - "assaults_configuration": { - "level": 5, - "latencyActive": false, - "killApplicationActive": false, - "restartApplicationActive": false, - "exceptionsActive": false, - "memoryActive": true, - "memoryMillisecondsHoldFilledMemory": 90000, - "memoryMillisecondsWaitNextIncrease": 100, - "memoryFillIncrementFraction": 0.9, - "memoryFillTargetFraction": 0.95, - "runtimeAssaultCronExpression": "*/1 * * * * ?" - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/readme.md b/.experiments/readme.md deleted file mode 100644 index aecb0d6..0000000 --- a/.experiments/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -# Create python env - -python3 -m venv ~/.venvs/chaostk - -# Activate python env -source ~/.venvs/chaostk/bin/activate - -# Run tests -chaos run latency.json -chaos run kill-restart.json - -# Disable tests - -chaos run disable.json diff --git a/.experiments/roster/chaostoolkit.log b/.experiments/roster/chaostoolkit.log deleted file mode 100644 index b2ad093..0000000 --- a/.experiments/roster/chaostoolkit.log +++ /dev/null @@ -1,135 +0,0 @@ -[2021-11-28 14:43:28 DEBUG] [cli:103] ############################################################################### -[2021-11-28 14:43:28 DEBUG] [cli:104] Running command 'run' -[2021-11-28 14:43:28 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-28 14:43:42 DEBUG] [cli:103] ############################################################################### -[2021-11-28 14:43:42 DEBUG] [cli:104] Running command 'run' -[2021-11-28 14:43:42 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-28 14:43:42 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-28 14:43:42 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 14:43:42 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 14:43:42 DEBUG] [caching:24] Building activity cache... -[2021-11-28 14:43:42 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 14:43:42 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-28 14:43:42 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 14:43:42 DEBUG] [secret:78] Loading secrets... -[2021-11-28 14:43:42 DEBUG] [secret:104] Done loading secrets -[2021-11-28 14:43:42 INFO] [experiment:109] Experiment looks valid -[2021-11-28 14:43:42 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 14:43:42 DEBUG] [caching:24] Building activity cache... -[2021-11-28 14:43:42 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 14:43:42 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 14:43:42 DEBUG] [secret:78] Loading secrets... -[2021-11-28 14:43:42 DEBUG] [secret:104] Done loading secrets -[2021-11-28 14:43:42 INFO] [run:319] Running experiment: What is the impact of an expired certificate on our application chain? -[2021-11-28 14:43:42 DEBUG] [__init__:49] Initializing controls -[2021-11-28 14:43:42 INFO] [run:336] Steady-state strategy: default -[2021-11-28 14:43:42 INFO] [run:340] Rollbacks strategy: default -[2021-11-28 14:43:42 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-28 14:43:42 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 14:43:42 INFO] [run:599] Playing your experiment's method now... -[2021-11-28 14:43:42 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 14:43:42 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 14:43:42 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-28 14:43:42 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 14:43:43 DEBUG] [activity:260] Activity failed - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 36, in enable_chaosmonkey - raise FailedActivity(f"Enable ChaosMonkey failed: {response.text}") - chaoslib.exceptions.ActivityFailed: Enable ChaosMonkey failed: {"timestamp":"2021-11-28T13:43:43.069+00:00","status":404,"error":"Not Found","message":"No message available","path":"/actuator/chaosmonkey/enable"} - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/activity.py", line 253, in run_activity - result = run_python_activity(activity, configuration, secrets) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 58, in run_python_activity - raise ActivityFailed( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 36, in enable_chaosmonkey - raise FailedActivity(f"Enable ChaosMonkey failed: {response.text}") - chaoslib.exceptions.ActivityFailed: chaoslib.exceptions.ActivityFailed: Enable ChaosMonkey failed: {"timestamp":"2021-11-28T13:43:43.069+00:00","status":404,"error":"Not Found","message":"No message available","path":"/actuator/chaosmonkey/enable"} -[2021-11-28 14:43:43 ERROR] [activity:213] => failed: chaoslib.exceptions.ActivityFailed: Enable ChaosMonkey failed: {"timestamp":"2021-11-28T13:43:43.069+00:00","status":404,"error":"Not Found","message":"No message available","path":"/actuator/chaosmonkey/enable"} -[2021-11-28 14:43:43 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 14:43:43 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 14:43:43 INFO] [activity:188] Action: configure_assaults -[2021-11-28 14:43:43 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 14:43:43 DEBUG] [activity:260] Activity failed - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 96, in change_assaults_configuration - raise FailedActivity( - chaoslib.exceptions.ActivityFailed: Change ChaosMonkey Assaults Configuration failed: {"timestamp":"2021-11-28T13:43:43.203+00:00","status":404,"error":"Not Found","message":"No message available","path":"/actuator/chaosmonkey/assaults"} - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/activity.py", line 253, in run_activity - result = run_python_activity(activity, configuration, secrets) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 58, in run_python_activity - raise ActivityFailed( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 96, in change_assaults_configuration - raise FailedActivity( - chaoslib.exceptions.ActivityFailed: chaoslib.exceptions.ActivityFailed: Change ChaosMonkey Assaults Configuration failed: {"timestamp":"2021-11-28T13:43:43.203+00:00","status":404,"error":"Not Found","message":"No message available","path":"/actuator/chaosmonkey/assaults"} -[2021-11-28 14:43:43 ERROR] [activity:213] => failed: chaoslib.exceptions.ActivityFailed: Change ChaosMonkey Assaults Configuration failed: {"timestamp":"2021-11-28T13:43:43.203+00:00","status":404,"error":"Not Found","message":"No message available","path":"/actuator/chaosmonkey/assaults"} -[2021-11-28 14:43:43 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 14:43:43 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 14:43:43 INFO] [run:885] Let's rollback... -[2021-11-28 14:43:43 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 14:43:43 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-28 14:43:43 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 14:43:43 INFO] [run:450] Experiment ended with status: completed -[2021-11-28 14:43:43 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 14:43:43 DEBUG] [__init__:82] Cleaning up controls -[2021-11-28 14:43:43 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 16:24:55 DEBUG] [cli:103] ############################################################################### -[2021-11-28 16:24:55 DEBUG] [cli:104] Running command 'run' -[2021-11-28 16:24:55 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-28 16:24:55 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-28 16:24:55 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 16:24:55 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 16:24:55 DEBUG] [caching:24] Building activity cache... -[2021-11-28 16:24:55 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 16:24:55 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-28 16:24:55 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 16:24:55 DEBUG] [secret:78] Loading secrets... -[2021-11-28 16:24:55 DEBUG] [secret:104] Done loading secrets -[2021-11-28 16:24:55 INFO] [experiment:109] Experiment looks valid -[2021-11-28 16:24:55 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 16:24:55 DEBUG] [caching:24] Building activity cache... -[2021-11-28 16:24:55 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 16:24:55 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 16:24:55 DEBUG] [secret:78] Loading secrets... -[2021-11-28 16:24:55 DEBUG] [secret:104] Done loading secrets -[2021-11-28 16:24:55 INFO] [run:319] Running experiment: What is the impact of an expired certificate on our application chain? -[2021-11-28 16:24:55 DEBUG] [__init__:49] Initializing controls -[2021-11-28 16:24:55 INFO] [run:336] Steady-state strategy: default -[2021-11-28 16:24:55 INFO] [run:340] Rollbacks strategy: default -[2021-11-28 16:24:55 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-28 16:24:55 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 16:24:55 INFO] [run:599] Playing your experiment's method now... -[2021-11-28 16:24:55 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 16:24:55 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:24:55 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-28 16:24:55 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 16:24:56 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-28T15:24:56.52458Z"}' -[2021-11-28 16:24:56 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:24:56 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:24:56 INFO] [activity:188] Action: configure_assaults -[2021-11-28 16:24:56 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 16:24:57 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-28 16:24:57 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 16:24:57 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 16:24:57 INFO] [run:885] Let's rollback... -[2021-11-28 16:24:57 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 16:24:57 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-28 16:24:57 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 16:24:57 INFO] [run:450] Experiment ended with status: completed -[2021-11-28 16:24:57 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 16:24:57 DEBUG] [__init__:82] Cleaning up controls -[2021-11-28 16:24:57 DEBUG] [caching:42] Clearing activities cache diff --git a/.experiments/roster/disable.json b/.experiments/roster/disable.json deleted file mode 100644 index 0079712..0000000 --- a/.experiments/roster/disable.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": "Disable chaos monkey", - "description": "Disable", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [], - "rollbacks": [ - { - "name": "disable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator" - }, - "func": "disable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ] -} diff --git a/.experiments/roster/exception.json b/.experiments/roster/exception.json deleted file mode 100644 index 4f81e1c..0000000 --- a/.experiments/roster/exception.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "title": "Testing exceptions", - "description": "Testing exceptions!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": false, - "killApplicationActive": false, - "restartApplicationActive": false, - "exceptionsActive": true, - "exception": { - "type": "java.lang.RuntimeException", - "arguments": [ - { - "className": "java.lang.String", - "value": "Exception assault has been carried out" - } - ] - } - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/roster/journal.json b/.experiments/roster/journal.json deleted file mode 100644 index 360012d..0000000 --- a/.experiments/roster/journal.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "chaoslib-version": "1.23.0", - "platform": "macOS-12.0-arm64-arm-64bit", - "node": "Marcels-MBP-M1", - "experiment": { - "title": "What is the impact of an expired certificate on our application chain?", - "description": "If a certificate expires, we should gracefully deal with the issue.", - "tags": [ - "tls" - ], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": true, - "exceptionsActive": false, - "killApplicationActive": false, - "restartApplicationActive": false - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [], - "dry": null - }, - "start": "2021-11-28T15:24:55.984078", - "status": "completed", - "deviated": false, - "steady_states": { - "before": null, - "after": null, - "during": [] - }, - "run": [ - { - "activity": { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - "output": "{\"status\":\"Chaos Monkey is enabled\",\"enabledAt\":\"2021-11-28T15:24:56.52458Z\"}", - "status": "succeeded", - "start": "2021-11-28T15:24:55.984855", - "end": "2021-11-28T15:24:56.785205", - "duration": 0.80035 - }, - { - "activity": { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": true, - "exceptionsActive": false, - "killApplicationActive": false, - "restartApplicationActive": false - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - "output": "Assault config has changed", - "status": "succeeded", - "start": "2021-11-28T15:24:56.785494", - "end": "2021-11-28T15:24:57.394090", - "duration": 0.608596 - } - ], - "rollbacks": [], - "end": "2021-11-28T15:24:57.394597", - "duration": 1.4326798915863037 -} \ No newline at end of file diff --git a/.experiments/roster/kill-restart.json b/.experiments/roster/kill-restart.json deleted file mode 100644 index 26be1ba..0000000 --- a/.experiments/roster/kill-restart.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "title": "Testing kill & restart", - "description": "Testing behavoir when killing and restarting the application", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 5000, - "latencyActive": false, - "exceptionsActive": false, - "killApplicationActive": true, - "restartApplicationActive": true - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/roster/latency.json b/.experiments/roster/latency.json deleted file mode 100644 index d755109..0000000 --- a/.experiments/roster/latency.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "title": "Testing latency", - "description": "Testing latency!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": true, - "exceptionsActive": false, - "killApplicationActive": false, - "restartApplicationActive": false - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/roster/memory.json b/.experiments/roster/memory.json deleted file mode 100644 index 216c26b..0000000 --- a/.experiments/roster/memory.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "title": "Testing memory", - "description": "Testing memory!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8082/actuator", - "assaults_configuration": { - "level": 5, - "latencyActive": false, - "killApplicationActive": false, - "restartApplicationActive": false, - "exceptionsActive": false, - "memoryActive": true, - "memoryMillisecondsHoldFilledMemory": 90000, - "memoryMillisecondsWaitNextIncrease": 100, - "memoryFillIncrementFraction": 0.9, - "memoryFillTargetFraction": 0.95, - "runtimeAssaultCronExpression": "*/1 * * * * ?" - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/tapas-tasks/chaostoolkit.log b/.experiments/tapas-tasks/chaostoolkit.log deleted file mode 100644 index 496062e..0000000 --- a/.experiments/tapas-tasks/chaostoolkit.log +++ /dev/null @@ -1,936 +0,0 @@ -[2021-11-27 11:35:02 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:35:02 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:35:02 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:35:02 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:35:02 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:35:02 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:35:02 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:35:02 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:35:02 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:35:02 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:35:02 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:35:02 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:35:02 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:35:02 ERROR] [cli:251] hypothesis requires a title -[2021-11-27 11:35:02 DEBUG] [cli:252] hypothesis requires a title -[2021-11-27 11:35:57 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:35:57 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:35:57 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:35:58 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:35:58 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:35:58 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:35:58 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:35:58 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:35:58 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:35:58 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:35:58 ERROR] [cli:251] experiment requires a description -[2021-11-27 11:35:58 DEBUG] [cli:252] experiment requires a description -[2021-11-27 11:36:18 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:36:18 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:36:18 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:36:18 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:36:18 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:36:18 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:36:18 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:36:18 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:36:18 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:36:18 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:36:18 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:36:18 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:36:18 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:36:18 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:36:18 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:36:18 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:36:18 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:36:18 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:36:18 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:36:18 INFO] [run:319] Running experiment: Testing kill & restart -[2021-11-27 11:36:18 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:36:18 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:36:18 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:36:18 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:36:18 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:36:18 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:36:18 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:36:18 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:18 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-27 11:36:18 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:36:19 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-27T10:36:19.060458Z"}' -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:19 INFO] [activity:188] Action: configure_assaults -[2021-11-27 11:36:19 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:36:19 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:36:19 INFO] [run:885] Let's rollback... -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:36:19 INFO] [rollback:30] Rollback: disable_chaosmonkey -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:19 INFO] [activity:188] Action: disable_chaosmonkey -[2021-11-27 11:36:19 DEBUG] [python:33] Activity 'disable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:36:19 DEBUG] [activity:260] Activity failed - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn - conn = connection.create_connection( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection - raise err - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection - sock.connect(sa) - ConnectionRefusedError: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen - httplib_response = self._make_request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request - conn.request(method, url, **httplib_request_kw) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request - super(HTTPConnection, self).request(method, url, body=body, headers=headers) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1279, in request - self._send_request(method, url, body, headers, encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1325, in _send_request - self.endheaders(body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1274, in endheaders - self._send_output(message_body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1034, in _send_output - self.send(msg) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 974, in send - self.connect() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect - conn = self._new_conn() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn - raise NewConnectionError( - urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 439, in send - resp = conn.urlopen( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen - retries = retries.increment( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment - raise MaxRetryError(_pool, url, error or ResponseError(cause)) - urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 53, in disable_chaosmonkey - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/activity.py", line 253, in run_activity - result = run_python_activity(activity, configuration, secrets) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 58, in run_python_activity - raise ActivityFailed( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 53, in disable_chaosmonkey - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - chaoslib.exceptions.ActivityFailed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-27 11:36:19 ERROR] [activity:213] => failed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:36:19 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:36:19 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:36:19 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:36:19 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:36:54 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:36:54 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:36:54 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:36:54 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:36:54 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:36:54 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:36:54 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:36:54 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:36:54 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:36:54 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:36:54 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:36:54 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:36:54 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:36:54 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:36:54 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:36:54 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:36:54 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:36:54 INFO] [run:319] Running experiment: Testing kill & restart -[2021-11-27 11:36:54 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:36:54 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:36:54 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:36:54 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:36:54 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:54 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-27 11:36:54 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:36:54 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-27T10:36:54.668324Z"}' -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:54 INFO] [activity:188] Action: configure_assaults -[2021-11-27 11:36:54 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:36:54 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:36:54 INFO] [run:885] Let's rollback... -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:36:54 INFO] [rollback:30] Rollback: disable_chaosmonkey -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:54 INFO] [activity:188] Action: disable_chaosmonkey -[2021-11-27 11:36:54 DEBUG] [python:33] Activity 'disable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:36:54 DEBUG] [activity:260] Activity failed - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn - conn = connection.create_connection( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection - raise err - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection - sock.connect(sa) - ConnectionRefusedError: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen - httplib_response = self._make_request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request - conn.request(method, url, **httplib_request_kw) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request - super(HTTPConnection, self).request(method, url, body=body, headers=headers) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1279, in request - self._send_request(method, url, body, headers, encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1325, in _send_request - self.endheaders(body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1274, in endheaders - self._send_output(message_body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1034, in _send_output - self.send(msg) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 974, in send - self.connect() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect - conn = self._new_conn() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn - raise NewConnectionError( - urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 439, in send - resp = conn.urlopen( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen - retries = retries.increment( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment - raise MaxRetryError(_pool, url, error or ResponseError(cause)) - urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 53, in disable_chaosmonkey - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/activity.py", line 253, in run_activity - result = run_python_activity(activity, configuration, secrets) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 58, in run_python_activity - raise ActivityFailed( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 53, in disable_chaosmonkey - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - chaoslib.exceptions.ActivityFailed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-27 11:36:54 ERROR] [activity:213] => failed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:36:54 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:36:54 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:36:54 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:36:54 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:36:59 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:36:59 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:36:59 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:37:00 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:37:00 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:37:00 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:37:00 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:37:00 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:37:00 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:37:00 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:37:00 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:37:00 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:37:00 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:37:00 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:37:00 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:37:00 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:37:00 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:37:00 INFO] [run:319] Running experiment: Testing kill & restart -[2021-11-27 11:37:00 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:37:00 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:37:00 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:37:00 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:37:00 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:37:00 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-27 11:37:00 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:37:00 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-27T10:37:00.591716Z"}' -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:37:00 INFO] [activity:188] Action: configure_assaults -[2021-11-27 11:37:00 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:37:00 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:37:00 INFO] [run:885] Let's rollback... -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:37:00 INFO] [rollback:30] Rollback: disable_chaosmonkey -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:37:00 INFO] [activity:188] Action: disable_chaosmonkey -[2021-11-27 11:37:00 DEBUG] [python:33] Activity 'disable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:37:00 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is disabled","disabledAt":"2021-11-27T10:37:00.650024Z"}' -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:37:00 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:37:00 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:37:00 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:37:00 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:38:39 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:38:39 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:38:39 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:38:40 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:38:40 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:38:40 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:38:40 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:38:40 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:38:40 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:38:40 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:38:40 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:38:40 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:38:40 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:38:40 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:38:40 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:38:40 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:38:40 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:38:40 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:38:40 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:38:40 INFO] [run:319] Running experiment: Testing kill & restart -[2021-11-27 11:38:40 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:38:40 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:38:40 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:38:40 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:38:40 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:38:40 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:38:40 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:38:40 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:38:40 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-27 11:38:40 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:38:41 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-27T10:38:40.795245Z"}' -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:38:41 INFO] [activity:188] Action: configure_assaults -[2021-11-27 11:38:41 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:38:41 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:38:41 INFO] [run:885] Let's rollback... -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:38:41 INFO] [rollback:30] Rollback: disable_chaosmonkey -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:38:41 INFO] [activity:188] Action: disable_chaosmonkey -[2021-11-27 11:38:41 DEBUG] [python:33] Activity 'disable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:38:41 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is disabled","disabledAt":"2021-11-27T10:38:41.923689Z"}' -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:38:41 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:38:41 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:38:41 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:38:41 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:42:14 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:42:14 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:42:14 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:42:15 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:42:15 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:42:15 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:42:15 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:42:15 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:42:15 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:42:15 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:42:15 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:42:15 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:42:15 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:42:15 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:42:15 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:42:15 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:42:15 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:42:15 INFO] [run:319] Running experiment: Testing kill & restart -[2021-11-27 11:42:15 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:42:15 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:42:15 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:42:15 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:42:15 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:42:15 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-27 11:42:15 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:42:15 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-27T10:42:15.310527Z"}' -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:42:15 INFO] [activity:188] Action: configure_assaults -[2021-11-27 11:42:15 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:42:15 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:42:15 INFO] [run:885] Let's rollback... -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:42:15 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:42:15 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:42:15 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:42:15 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:42:15 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:43:22 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:43:22 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:43:22 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:43:23 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:43:23 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:43:23 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:43:23 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:43:23 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:43:23 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:43:23 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:43:23 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:43:23 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:43:23 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:43:23 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:43:23 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:43:23 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:43:23 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:43:23 INFO] [run:319] Running experiment: What is the impact of an expired certificate on our application chain? -[2021-11-27 11:43:23 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:43:23 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:43:23 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:43:23 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:43:23 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:43:23 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-27 11:43:23 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:43:23 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-27T10:43:23.565576Z"}' -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:43:23 INFO] [activity:188] Action: configure_assaults -[2021-11-27 11:43:23 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:43:23 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:43:23 INFO] [run:885] Let's rollback... -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:43:23 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:43:23 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:43:23 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:43:23 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:43:23 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:43:50 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:43:50 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:43:50 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:43:50 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:43:50 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:43:50 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:43:50 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:43:50 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:43:50 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:43:50 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:43:50 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:43:50 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:43:50 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:43:50 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:43:50 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:43:50 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:43:50 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:43:50 INFO] [run:319] Running experiment: What is the impact of an expired certificate on our application chain? -[2021-11-27 11:43:50 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:43:50 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:43:50 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:43:50 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:43:50 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:43:50 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-27 11:43:50 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:43:50 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-27T10:43:50.888054Z"}' -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:43:50 INFO] [activity:188] Action: configure_assaults -[2021-11-27 11:43:50 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:43:50 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:43:50 INFO] [run:885] Let's rollback... -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:43:50 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:43:50 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:43:50 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:43:50 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:43:50 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:47:20 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:47:20 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:47:20 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:47:21 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:47:21 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:47:21 DEBUG] [caching:35] Cached 0 activities -[2021-11-27 11:47:21 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:47:21 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:47:21 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:47:21 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:47:21 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:47:21 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:47:21 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:47:21 DEBUG] [caching:35] Cached 0 activities -[2021-11-27 11:47:21 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:47:21 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:47:21 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:47:21 INFO] [run:319] Running experiment: Disable chaos monkey -[2021-11-27 11:47:21 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:47:21 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:47:21 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:47:21 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:47:21 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:47:21 INFO] [activity:113] No declared activities, let's move on. -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:47:21 INFO] [run:885] Let's rollback... -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:47:21 INFO] [rollback:30] Rollback: disable_chaosmonkey -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:47:21 INFO] [activity:188] Action: disable_chaosmonkey -[2021-11-27 11:47:21 DEBUG] [python:33] Activity 'disable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:47:21 DEBUG] [activity:260] Activity failed - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn - conn = connection.create_connection( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection - raise err - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection - sock.connect(sa) - ConnectionRefusedError: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen - httplib_response = self._make_request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request - conn.request(method, url, **httplib_request_kw) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request - super(HTTPConnection, self).request(method, url, body=body, headers=headers) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1279, in request - self._send_request(method, url, body, headers, encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1325, in _send_request - self.endheaders(body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1274, in endheaders - self._send_output(message_body, encode_chunked=encode_chunked) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1034, in _send_output - self.send(msg) - File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 974, in send - self.connect() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect - conn = self._new_conn() - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn - raise NewConnectionError( - urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 439, in send - resp = conn.urlopen( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen - retries = retries.increment( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment - raise MaxRetryError(_pool, url, error or ResponseError(cause)) - urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 53, in disable_chaosmonkey - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/activity.py", line 253, in run_activity - result = run_python_activity(activity, configuration, secrets) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 58, in run_python_activity - raise ActivityFailed( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaoslib/provider/python.py", line 56, in run_python_activity - return func(**arguments) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py", line 53, in disable_chaosmonkey - response = api.call_api( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/api.py", line 56, in call_api - return requests.request( - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/api.py", line 61, in request - return session.request(method=method, url=url, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 542, in request - resp = self.send(prep, **send_kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/sessions.py", line 655, in send - r = adapter.send(request, **kwargs) - File "/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/requests/adapters.py", line 516, in send - raise ConnectionError(e, request=request) - chaoslib.exceptions.ActivityFailed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-27 11:47:21 ERROR] [activity:213] => failed: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /actuator/chaosmonkey/disable (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:47:21 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:47:21 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:47:21 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:47:21 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:47:29 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:47:29 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:47:29 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:47:30 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:47:30 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:47:30 DEBUG] [caching:35] Cached 0 activities -[2021-11-27 11:47:30 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:47:30 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:47:30 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:47:30 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:47:30 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:47:30 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:47:30 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:47:30 DEBUG] [caching:35] Cached 0 activities -[2021-11-27 11:47:30 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:47:30 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:47:30 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:47:30 INFO] [run:319] Running experiment: Disable chaos monkey -[2021-11-27 11:47:30 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:47:30 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:47:30 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:47:30 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:47:30 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:47:30 INFO] [activity:113] No declared activities, let's move on. -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:47:30 INFO] [run:885] Let's rollback... -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:47:30 INFO] [rollback:30] Rollback: disable_chaosmonkey -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:47:30 INFO] [activity:188] Action: disable_chaosmonkey -[2021-11-27 11:47:30 DEBUG] [python:33] Activity 'disable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:47:30 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is disabled","disabledAt":"2021-11-27T10:47:30.172107Z"}' -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:47:30 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:47:30 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:47:30 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:47:30 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:49:33 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:49:33 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:49:33 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:49:33 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:49:33 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:49:33 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:49:33 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:49:33 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:49:33 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:49:33 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:49:33 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:49:33 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:49:33 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:49:33 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:49:33 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:49:33 DEBUG] [caching:35] Cached 2 activities -[2021-11-27 11:49:33 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:49:33 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:49:33 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:49:33 INFO] [run:319] Running experiment: What is the impact of an expired certificate on our application chain? -[2021-11-27 11:49:33 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:49:33 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:49:33 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:49:33 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:49:33 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:49:33 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:49:33 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:49:33 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:49:33 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-27 11:49:33 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:49:33 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-27T10:49:33.912573Z"}' -[2021-11-27 11:49:33 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:49:33 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:49:33 INFO] [activity:188] Action: configure_assaults -[2021-11-27 11:49:33 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:49:34 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-27 11:49:34 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:49:34 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:49:34 INFO] [run:885] Let's rollback... -[2021-11-27 11:49:34 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:49:34 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-27 11:49:34 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:49:34 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:49:34 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:49:34 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:49:34 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:50:00 DEBUG] [cli:103] ############################################################################### -[2021-11-27 11:50:00 DEBUG] [cli:104] Running command 'run' -[2021-11-27 11:50:00 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-27 11:50:01 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-27 11:50:01 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:50:01 DEBUG] [caching:35] Cached 0 activities -[2021-11-27 11:50:01 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-27 11:50:01 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:50:01 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:50:01 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:50:01 INFO] [experiment:109] Experiment looks valid -[2021-11-27 11:50:01 DEBUG] [caching:42] Clearing activities cache -[2021-11-27 11:50:01 DEBUG] [caching:24] Building activity cache... -[2021-11-27 11:50:01 DEBUG] [caching:35] Cached 0 activities -[2021-11-27 11:50:01 DEBUG] [configuration:54] Loading configuration... -[2021-11-27 11:50:01 DEBUG] [secret:78] Loading secrets... -[2021-11-27 11:50:01 DEBUG] [secret:104] Done loading secrets -[2021-11-27 11:50:01 INFO] [run:319] Running experiment: Disable chaos monkey -[2021-11-27 11:50:01 DEBUG] [__init__:49] Initializing controls -[2021-11-27 11:50:01 INFO] [run:336] Steady-state strategy: default -[2021-11-27 11:50:01 INFO] [run:340] Rollbacks strategy: default -[2021-11-27 11:50:01 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:50:01 INFO] [run:599] Playing your experiment's method now... -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:50:01 INFO] [activity:113] No declared activities, let's move on. -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-27 11:50:01 INFO] [run:885] Let's rollback... -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:50:01 INFO] [rollback:30] Rollback: disable_chaosmonkey -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:50:01 INFO] [activity:188] Action: disable_chaosmonkey -[2021-11-27 11:50:01 DEBUG] [python:33] Activity 'disable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-27 11:50:01 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is disabled","disabledAt":"2021-11-27T10:50:01.207712Z"}' -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-27 11:50:01 INFO] [run:450] Experiment ended with status: completed -[2021-11-27 11:50:01 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-27 11:50:01 DEBUG] [__init__:82] Cleaning up controls -[2021-11-27 11:50:01 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 18:00:15 DEBUG] [cli:103] ############################################################################### -[2021-11-28 18:00:15 DEBUG] [cli:104] Running command 'run' -[2021-11-28 18:00:15 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-28 18:00:15 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-28 18:00:15 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 18:00:15 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 18:00:15 DEBUG] [caching:24] Building activity cache... -[2021-11-28 18:00:15 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 18:00:15 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-28 18:00:15 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 18:00:15 DEBUG] [secret:78] Loading secrets... -[2021-11-28 18:00:15 DEBUG] [secret:104] Done loading secrets -[2021-11-28 18:00:15 INFO] [experiment:109] Experiment looks valid -[2021-11-28 18:00:15 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 18:00:15 DEBUG] [caching:24] Building activity cache... -[2021-11-28 18:00:15 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 18:00:15 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 18:00:15 DEBUG] [secret:78] Loading secrets... -[2021-11-28 18:00:15 DEBUG] [secret:104] Done loading secrets -[2021-11-28 18:00:15 INFO] [run:319] Running experiment: Testing latency -[2021-11-28 18:00:15 DEBUG] [__init__:49] Initializing controls -[2021-11-28 18:00:15 INFO] [run:336] Steady-state strategy: default -[2021-11-28 18:00:15 INFO] [run:340] Rollbacks strategy: default -[2021-11-28 18:00:15 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-28 18:00:15 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 18:00:15 INFO] [run:599] Playing your experiment's method now... -[2021-11-28 18:00:15 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 18:00:15 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:00:15 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-28 18:00:15 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 18:00:17 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-28T17:00:16.734825Z"}' -[2021-11-28 18:00:17 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:00:17 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:00:17 INFO] [activity:188] Action: configure_assaults -[2021-11-28 18:00:17 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 18:00:19 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-28 18:00:19 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:00:19 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 18:00:19 INFO] [run:885] Let's rollback... -[2021-11-28 18:00:19 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 18:00:19 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-28 18:00:19 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 18:00:19 INFO] [run:450] Experiment ended with status: completed -[2021-11-28 18:00:19 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 18:00:19 DEBUG] [__init__:82] Cleaning up controls -[2021-11-28 18:00:19 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 18:07:50 DEBUG] [cli:103] ############################################################################### -[2021-11-28 18:07:50 DEBUG] [cli:104] Running command 'run' -[2021-11-28 18:07:50 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-28 18:07:50 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-28 18:07:50 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 18:07:50 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 18:07:50 DEBUG] [caching:24] Building activity cache... -[2021-11-28 18:07:50 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 18:07:50 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-28 18:07:50 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 18:07:50 DEBUG] [secret:78] Loading secrets... -[2021-11-28 18:07:50 DEBUG] [secret:104] Done loading secrets -[2021-11-28 18:07:50 INFO] [experiment:109] Experiment looks valid -[2021-11-28 18:07:50 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 18:07:50 DEBUG] [caching:24] Building activity cache... -[2021-11-28 18:07:50 DEBUG] [caching:35] Cached 2 activities -[2021-11-28 18:07:50 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 18:07:50 DEBUG] [secret:78] Loading secrets... -[2021-11-28 18:07:51 DEBUG] [secret:104] Done loading secrets -[2021-11-28 18:07:51 INFO] [run:319] Running experiment: Testing latency -[2021-11-28 18:07:51 DEBUG] [__init__:49] Initializing controls -[2021-11-28 18:07:51 INFO] [run:336] Steady-state strategy: default -[2021-11-28 18:07:51 INFO] [run:340] Rollbacks strategy: default -[2021-11-28 18:07:51 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 18:07:51 INFO] [run:599] Playing your experiment's method now... -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:07:51 INFO] [activity:188] Action: enable_chaosmonkey -[2021-11-28 18:07:51 DEBUG] [python:33] Activity 'enable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 18:07:51 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is enabled","enabledAt":"2021-11-28T17:07:51.182021Z"}' -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:07:51 INFO] [activity:188] Action: configure_assaults -[2021-11-28 18:07:51 DEBUG] [python:33] Activity 'configure_assaults' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 18:07:51 DEBUG] [activity:205] => succeeded with 'Assault config has changed' -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 18:07:51 INFO] [run:885] Let's rollback... -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 18:07:51 INFO] [rollback:27] No declared rollbacks, let's move on. -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 18:07:51 INFO] [run:450] Experiment ended with status: completed -[2021-11-28 18:07:51 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 18:07:51 DEBUG] [__init__:82] Cleaning up controls -[2021-11-28 18:07:51 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 18:09:39 DEBUG] [cli:103] ############################################################################### -[2021-11-28 18:09:39 DEBUG] [cli:104] Running command 'run' -[2021-11-28 18:09:39 DEBUG] [cli:108] Using settings file '/Users/maece/.chaostoolkit/settings.yaml' -[2021-11-28 18:09:40 DEBUG] [settings:30] The Chaos Toolkit settings file could not be found at '/Users/maece/.chaostoolkit/settings.yaml'. -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'loader' -[2021-11-28 18:09:40 DEBUG] [caching:24] Building activity cache... -[2021-11-28 18:09:40 DEBUG] [caching:35] Cached 0 activities -[2021-11-28 18:09:40 INFO] [experiment:58] Validating the experiment's syntax -[2021-11-28 18:09:40 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 18:09:40 DEBUG] [secret:78] Loading secrets... -[2021-11-28 18:09:40 DEBUG] [secret:104] Done loading secrets -[2021-11-28 18:09:40 INFO] [experiment:109] Experiment looks valid -[2021-11-28 18:09:40 DEBUG] [caching:42] Clearing activities cache -[2021-11-28 18:09:40 DEBUG] [caching:24] Building activity cache... -[2021-11-28 18:09:40 DEBUG] [caching:35] Cached 0 activities -[2021-11-28 18:09:40 DEBUG] [configuration:54] Loading configuration... -[2021-11-28 18:09:40 DEBUG] [secret:78] Loading secrets... -[2021-11-28 18:09:40 DEBUG] [secret:104] Done loading secrets -[2021-11-28 18:09:40 INFO] [run:319] Running experiment: Disable chaos monkey -[2021-11-28 18:09:40 DEBUG] [__init__:49] Initializing controls -[2021-11-28 18:09:40 INFO] [run:336] Steady-state strategy: default -[2021-11-28 18:09:40 INFO] [run:340] Rollbacks strategy: default -[2021-11-28 18:09:40 INFO] [run:345] No steady state hypothesis defined. That's ok, just exploring. -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 18:09:40 INFO] [run:599] Playing your experiment's method now... -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 18:09:40 INFO] [activity:113] No declared activities, let's move on. -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'method' -[2021-11-28 18:09:40 INFO] [run:885] Let's rollback... -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 18:09:40 INFO] [rollback:30] Rollback: disable_chaosmonkey -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:09:40 INFO] [activity:188] Action: disable_chaosmonkey -[2021-11-28 18:09:40 DEBUG] [python:33] Activity 'disable_chaosmonkey' loaded from '/Users/maece/.venvs/chaostk/lib/python3.9/site-packages/chaosspring/actions.py' -[2021-11-28 18:09:40 DEBUG] [activity:205] => succeeded with '{"status":"Chaos Monkey is disabled","disabledAt":"2021-11-28T17:09:40.443253Z"}' -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'activity' -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'rollback' -[2021-11-28 18:09:40 INFO] [run:450] Experiment ended with status: completed -[2021-11-28 18:09:40 DEBUG] [__init__:389] No controls to apply on 'experiment' -[2021-11-28 18:09:40 DEBUG] [__init__:82] Cleaning up controls -[2021-11-28 18:09:40 DEBUG] [caching:42] Clearing activities cache diff --git a/.experiments/tapas-tasks/disable.json b/.experiments/tapas-tasks/disable.json deleted file mode 100644 index 2eafa32..0000000 --- a/.experiments/tapas-tasks/disable.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": "Disable chaos monkey", - "description": "Disable", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [], - "rollbacks": [ - { - "name": "disable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator" - }, - "func": "disable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ] -} diff --git a/.experiments/tapas-tasks/exception.json b/.experiments/tapas-tasks/exception.json deleted file mode 100644 index 8302ebe..0000000 --- a/.experiments/tapas-tasks/exception.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "title": "Testing exceptions", - "description": "Testing exceptions!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": false, - "killApplicationActive": false, - "restartApplicationActive": false, - "exceptionsActive": true, - "exception": { - "type": "java.lang.RuntimeException", - "arguments": [ - { - "className": "java.lang.String", - "value": "Exception assault has been carried out" - } - ] - } - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/tapas-tasks/journal.json b/.experiments/tapas-tasks/journal.json deleted file mode 100644 index abfb4b6..0000000 --- a/.experiments/tapas-tasks/journal.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "chaoslib-version": "1.23.0", - "platform": "macOS-12.0-arm64-arm-64bit", - "node": "Marcels-MBP-M1", - "experiment": { - "title": "Disable chaos monkey", - "description": "Disable", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [], - "rollbacks": [ - { - "name": "disable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator" - }, - "func": "disable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "dry": null - }, - "start": "2021-11-28T17:09:40.224824", - "status": "completed", - "deviated": false, - "steady_states": { - "before": null, - "after": null, - "during": [] - }, - "run": [], - "rollbacks": [ - { - "activity": { - "name": "disable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator" - }, - "func": "disable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - "output": "{\"status\":\"Chaos Monkey is disabled\",\"disabledAt\":\"2021-11-28T17:09:40.443253Z\"}", - "status": "succeeded", - "start": "2021-11-28T17:09:40.226419", - "end": "2021-11-28T17:09:40.531586", - "duration": 0.305167 - } - ], - "end": "2021-11-28T17:09:40.531671", - "duration": 0.33724117279052734 -} \ No newline at end of file diff --git a/.experiments/tapas-tasks/kill-restart.json b/.experiments/tapas-tasks/kill-restart.json deleted file mode 100644 index 3145cb6..0000000 --- a/.experiments/tapas-tasks/kill-restart.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "title": "Testing kill & restart", - "description": "Testing behavoir when killing and restarting the application", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 5000, - "latencyActive": false, - "exceptionsActive": false, - "killApplicationActive": true, - "restartApplicationActive": true - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/tapas-tasks/latency.json b/.experiments/tapas-tasks/latency.json deleted file mode 100644 index dc80c2f..0000000 --- a/.experiments/tapas-tasks/latency.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "title": "Testing latency", - "description": "Testing latency!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator", - "assaults_configuration": { - "level": 5, - "latencyRangeStart": 2000, - "latencyRangeEnd": 15000, - "latencyActive": true, - "exceptionsActive": false, - "killApplicationActive": false, - "restartApplicationActive": false - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/.experiments/tapas-tasks/memory.json b/.experiments/tapas-tasks/memory.json deleted file mode 100644 index 813e302..0000000 --- a/.experiments/tapas-tasks/memory.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "title": "Testing memory", - "description": "Testing memory!", - "tags": [], - "steady-state-hypothesis": { - "title": "Hypothesis", - "probes": [] - }, - "method": [ - { - "name": "enable_chaosmonkey", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator" - }, - "func": "enable_chaosmonkey", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - }, - { - "name": "configure_assaults", - "provider": { - "arguments": { - "base_url": "http://localhost:8081/actuator", - "assaults_configuration": { - "level": 5, - "latencyActive": false, - "killApplicationActive": false, - "restartApplicationActive": false, - "exceptionsActive": false, - "memoryActive": true, - "memoryMillisecondsHoldFilledMemory": 90000, - "memoryMillisecondsWaitNextIncrease": 100, - "memoryFillIncrementFraction": 0.9, - "memoryFillTargetFraction": 0.95, - "runtimeAssaultCronExpression": "*/1 * * * * ?" - } - }, - "func": "change_assaults_configuration", - "module": "chaosspring.actions", - "type": "python" - }, - "type": "action" - } - ], - "rollbacks": [] -} diff --git a/doc/architecture/decisions/0002-seperate-service-for-executor-pool.md b/doc/architecture/decisions/0002-seperate-service-for-executor-pool.md deleted file mode 100644 index 5624c0b..0000000 --- a/doc/architecture/decisions/0002-seperate-service-for-executor-pool.md +++ /dev/null @@ -1,21 +0,0 @@ -# 2. Seperate service for Executor Pool - -Date: 2021-11-21 - -## Status - -Accepted - -## Context - -The Executor Pool has to keep track of which Executors are online and what task types they can execute. The Roster keeps track of tasks that need to be executed and assigns Executors to tasks. The Executor Pool functionalty could be implemented in a seperate service or as a part of the Roster. - -## Decision - -The executor pool will be implemented as a seperate service. (TODO decision might change. Need to reevaluate) - -TODO explain why. - -## Consequences - -TODO \ No newline at end of file diff --git a/doc/architecture/decisions/0002-seperate-service-for-executors-and-pool.md b/doc/architecture/decisions/0002-seperate-service-for-executors-and-pool.md new file mode 100644 index 0000000..37594fa --- /dev/null +++ b/doc/architecture/decisions/0002-seperate-service-for-executors-and-pool.md @@ -0,0 +1,23 @@ +# 2. Seperate service for Executors and Executor Pool + +Date: 2021-11-21 + +## Status + +Accepted + +## Context + +The executor pool has a complete list of all executors and knows if they are available or not, executors can execute tasks that match their type. The executors can therefore be part of the executor pool service, or each executor is a standalone service, as well as the executor pool. + +## Decision + +We will use a separate microservice for each executor and one service for the executor pool. +Having the executor pool and the executors as separate services would increase fault tolerance. If the executor pool goes down, the executors would stay online and execute their tasks without being affected by the executor pool’s outage. Likewise, if an executor goes down it does not impact other executors or the executor pool. +Different executors can have different execution times and a different load. This means the executors scale differently. Thus, we need a separate service for each executor. +Executors of different kinds will also scale differently than the executor pool and new executors of new types might be added at some point, further increasing the need for separate services to guarantee scalability and evolvability. +New executors will be added/removed during runtime. Therefore, we need a high extensibility. + +## Consequences + +Executors will be added/removed quite frequently, making the deployment of the system easier and less risk-prone if each executor is a separate service, also separated from the executor pool, which just keeps track of the executors and their status. However, having these separate services, the complexity might increase, and the testability of the system will decrease. diff --git a/doc/architecture/decisions/0008-switch-to-an-event-driven-microservices-architecture.md b/doc/architecture/decisions/0008-switch-to-an-event-driven-microservices-architecture.md index 1284cbb..48e63cc 100644 --- a/doc/architecture/decisions/0008-switch-to-an-event-driven-microservices-architecture.md +++ b/doc/architecture/decisions/0008-switch-to-an-event-driven-microservices-architecture.md @@ -6,7 +6,7 @@ Date: 2021-11-21 Proposed -Supercedes [5. Event driven communication](0005-event-driven-communication.md) TODO Fix this. Should only supercede it if this has been accepted. This should also subercede 0013 - Microservice Architecture if accepted. +Supercedes [5. Event driven communication](0005-event-driven-communication.md) ## Context diff --git a/doc/architecture/decisions/0012-seperate-service-for-each-executor.md b/doc/architecture/decisions/0012-seperate-service-for-each-executor.md deleted file mode 100644 index 22406de..0000000 --- a/doc/architecture/decisions/0012-seperate-service-for-each-executor.md +++ /dev/null @@ -1,27 +0,0 @@ -# 12. seperate service for each executor - -Date: 2021-11-21 - -## Status - -Accepted - -## Context - -Executors must receive tasks of different types and execute them. The executors could either all be implemented within one service or as multiple services, one for each type of executor. - -## Decision - -We will have a seperate service for each type of executor. - -Firstly, execution time differs significantly between task types. Therefore, having seperate services will allow the executos to scale differently based on their tasks' specific needs. - -Secondly, the systems functioning should not be disrupted in case an Executor fails. Having each type of executor in a seperate service will increase fault tolerance in this regard. - -Lastly, extensibilty is one of the systems most important non-functional requirement and providers of executors need to be able to easily add executors to the executor pool. These factors are also positively impacted by having seperate services. - -There should not be any shared data between the executors. Additionally, there should be no flow of information between them. Thus, there should be no issues due to workflow and data concerns due to this decision. - -## Consequences - -Executors share a lot of functionality when it comes to connecting to the rest of the system. Therefore, this decision means that we will either have to duplicate the code that implements the common functionality, or we have to have a way to share the code (e.g. through a common library) \ No newline at end of file diff --git a/doc/architecture/decisions/0013-microservice-architecture.md b/doc/architecture/decisions/0013-microservice-architecture.md deleted file mode 100644 index 6e77fd7..0000000 --- a/doc/architecture/decisions/0013-microservice-architecture.md +++ /dev/null @@ -1,23 +0,0 @@ -# 13. microservice architecture - -Date: 2021-12-02 - -## Status - -Accepted - -## Context - -The system is made up of five distinct bounded contexts, namely the Task Domain, the Roster Domain, the Executor Pool Domain, the Executor Domain, and the Auction Domain. The way that these bounded contexts function together to fulfil the system requirements can be based on many different architectures. (Feedback needed. Should we name specific 'next-best' alternative architectures to compare, or just leave it as is since technically all architectures were considered) - -## Decision - -The system will follow the Microservice architecture. - -Scalability and fault tolerance are two of the systems top 3 -ilities. Moreover, elasticity and evolvability are two of the systems other main -ilities. These are all non-functional requirements that the Microservice architecture excels at. - -We do not expect to have a single monolithic database, so this is not a concern. - -## Consequences - -There is a considerable amount of communication between bounded contexts. This could cause responsiveness and performance issues due to added latency. This could therefore mean we would need to use asynchronous REST calls or publish-subscribe communication to mitigate these issues as much of the communication does not have to be synchronous. diff --git a/doc/architecture/decisions/0014-data-ownership.md b/doc/architecture/decisions/0014-data-ownership.md deleted file mode 100644 index 291cc24..0000000 --- a/doc/architecture/decisions/0014-data-ownership.md +++ /dev/null @@ -1,19 +0,0 @@ -# 14. data ownership - -Date: 2021-12-02 - -## Status - -Accepted - -## Context - -The issue motivating this decision, and any context that influences or constrains the decision. - -## Decision - -The change that we're proposing or have agreed to implement. - -## Consequences - -What becomes easier or more difficult to do and any risks introduced by the change that will need to be mitigated. diff --git a/doc/workflow.bpmn b/doc/workflow.bpmn index cd2bb05..6d68a24 100644 --- a/doc/workflow.bpmn +++ b/doc/workflow.bpmn @@ -1,13 +1,13 @@ - + - - + + @@ -16,80 +16,11 @@ - - - - - - - - - - - - - - - - - - - - - - - Flow_1x5tn8d - - - Flow_0q27k8x - - - Flow_1x5tn8d - Flow_0q27k8x - Flow_0p2cvuq - - - Flow_0p2cvuq - Flow_0t619kx - Flow_0jdop0s - - - Flow_0t619kx - - - Flow_0jdop0s - - - Flow_020rl47 - - - - - - Flow_0drypjw - - - Flow_020rl47 - - - Flow_04yudlk - - - Flow_0drypjw - - - Flow_04yudlk - - - - - - - - - + + + @@ -100,7 +31,7 @@ Flow_159tlyd - + Flow_01pbz6s @@ -118,45 +49,25 @@ Flow_1rxws1j - - Flow_0z1xo5y + + Flow_1rie16h - - Flow_0z1xo5y - - - - - Flow_19flgkm - - - Flow_1ufcjqo - - - Flow_0yt3znc - Flow_19flgkm - Flow_1ufcjqo - - - Flow_0yt3znc - - - - - - - - - - + + + + + + - + + Flow_0nuuhk7 + Flow_0nuuhk7 Flow_197gie6 @@ -166,11 +77,12 @@ Flow_197gie6 - + Flow_0ruufha Flow_1duwugb - + + Flow_19m4xhk @@ -181,838 +93,243 @@ Flow_0b4g73l - - Flow_0wnknbm - - - Flow_0wnknbm - - - Flow_02boegx - - - Flow_02boegx - Flow_1x2ab5q - - - Flow_0rh699s - - - Flow_123h648 - - - Flow_123h648 - Flow_0rh699s - Flow_1x2ab5q - - - Flow_0nuuhk7 - - - - - - - - - - - - - - - Flow_018ptp2 - - - Flow_1wnl1dp - - - Flow_1wnl1dp - Flow_018ptp2 - Flow_0mdt1ms - - - Flow_0mdt1ms - - - - - - Flow_1c284l8 - - - Flow_1c284l8 - Flow_04emv5h - - - Flow_04emv5h - Flow_0zar2lz - Flow_1se7kv7 - - - Flow_1se7kv7 - Flow_0xfuedn - - - Flow_0xfuedn - Flow_1iyxahk - Flow_1v97ns8 - - - Flow_0zar2lz - - - Flow_1v97ns8 - - - Flow_1iyxahk - - - - - - - - - - - - - - - Flow_0zwkg3r - - - Flow_0zwkg3r - - - Flow_13wk2ub - - - Flow_08pa8sd - - - Flow_08pa8sd - Flow_0n0c3ba - Flow_1xk3spy - - - Flow_1xk3spy - - - Flow_0n0c3ba - - - Flow_13wk2ub - - - - - - - + + + + + - + - - - + + + + + + + - + - - - + + + + - + - - + + - - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - + - + - + - + - + - + - - - - + - + - - - - - - - - - - - - - - - - - + + - + + + + - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + - + - - - + + + - - - + + + - - - - - - - + + + - + - - - - - - - - - + + + + + - + + + + - + - + - + - - - - - - - - - - + - + - - - - - + + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - + + + - - - - - - - + + + - + - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - - - - - - - + + - - + + - + - - + + - + - - - + + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/doc/workflow.png b/doc/workflow.png index 448ce5a..4946693 100644 Binary files a/doc/workflow.png and b/doc/workflow.png differ diff --git a/docker-compose-local.yml b/docker-compose-local.yml new file mode 100644 index 0000000..1ddfc24 --- /dev/null +++ b/docker-compose-local.yml @@ -0,0 +1,60 @@ +# Dockerfile/Docker-Compose file based on an initial version authored by Alexander Lontke (ASSE, Fall Semester 2021) + +version: "3.7" + +services: + app: + build: + context: ./app + dockerfile: Dockerfile + # Use environment variables instead of application.properties + environment: + - KEY=VALUE + ports: #Just needed when testing from outside the docker network + - "8080:8080" + networks: + - tapas-network + + tapas-tasks: + build: + context: ./tapas-tasks + dockerfile: Dockerfile + # Use environment variables instead of application.properties + environment: + - KEY=VALUE + ports: #Just needed when testing from outside + - "8081:8081" + networks: + - tapas-network + + tapas-auction-house: + build: + context: ./tapas-auction-house + dockerfile: Dockerfile + # Use environment variables instead of application.properties + environment: + - KEY=VALUE + ports: #Just needed when testing from outside + - "8082:8082" + networks: + - tapas-network + + mongodb: + image: mongo + container_name: mongodb + restart: unless-stopped + environment: + MONGO_INITDB_ROOT_USERNAME: root + MONGO_INITDB_ROOT_PASSWORD: 8nP7s0a # Can not be changed again later on + volumes: + - database:/data/db + networks: + - tapas-network + +#Volume for mongodb. One per server. +volumes: + database: + +networks: + tapas-network: + driver: bridge diff --git a/docker-compose.yaml b/docker-compose.yaml index c53981f..0612f50 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,65 @@ version: "3.6" services: + # tapas-tasks: + # container_name: tapas-tasks + # build: + # context: "./tapas-tasks" + # dockerfile: "Dockerfile" + # target: development + # ports: + # - "8081:8081" + # - "5005:5005" + # volumes: + # - ./tapas-tasks/src:/opt/app/src + # - ./tapas-tasks/target:/opt/app/target + # assignment: + # container_name: assignment + # build: + # context: "./assignment" + # dockerfile: "Dockerfile" + # target: development + # ports: + # - "8082:8082" + # - "5006:5005" + # volumes: + # - ./assignment/src:/opt/app/src + # - ./assignment/target:/opt/app/target + # executor-pool: + # container_name: executor-pool + # build: + # context: "./executor-pool" + # dockerfile: "Dockerfile" + # target: development + # ports: + # - "8083:8083" + # - "5007:5005" + # volumes: + # - ./executor-pool/src:/opt/app/src + # - ./executor-pool/target:/opt/app/target + # executor1: + # container_name: executor1 + # build: + # context: "./executor1" + # dockerfile: "Dockerfile" + # target: development + # ports: + # - "8084:8084" + # - "5008:5005" + # volumes: + # - ./executor1/src:/opt/app/src + # - ./executor1/target:/opt/app/target + # executor2: + # container_name: executor2 + # build: + # context: "./executor2" + # dockerfile: "Dockerfile" + # target: development + # ports: + # - "8085:8085" + # - "5009:5005" + # volumes: + # - ./executor2/src:/opt/app/src + # - ./executor2/target:/opt/app/target tapas-db: image: mongo restart: unless-stopped @@ -15,72 +75,3 @@ services: restart: unless-stopped ports: - "1883:1883" - tapas-tasks: - container_name: tapas-tasks - build: - context: "./tapas-tasks" - dockerfile: "Dockerfile" - target: development - ports: - - "8081:8081" - - "5005:5005" - depends_on: - - tapas-db - # - hivemq - volumes: - - ./tapas-tasks/src:/opt/app/src - - ./tapas-tasks/target:/opt/app/target - roster: - container_name: roster - build: - context: "." - dockerfile: "./roster/Dockerfile" - target: development - depends_on: - - tapas-db - # - hivemq - ports: - - "8082:8082" - - "5006:5005" - volumes: - - ./roster/src:/opt/app/src - - ./roster/target:/opt/app/target - executor-pool: - container_name: executor-pool - build: - context: "./executor-pool" - dockerfile: "Dockerfile" - target: development - depends_on: - - tapas-db - # - hivemq - ports: - - "8083:8083" - - "5007:5005" - volumes: - - ./executor-pool/src:/opt/app/src - - ./executor-pool/target:/opt/app/target - executor-computation: - container_name: executor-computation - build: - context: "." - dockerfile: "./executor-computation/Dockerfile" - target: development - ports: - - "8085:8085" - - "5008:5005" - volumes: - - ./executor-computation/src:/opt/app/src - - ./executor-computation/target:/opt/app/target - executor-robot: - container_name: executor-robot - build: - context: "." - dockerfile: "./executor-robot/Dockerfile" - target: development - ports: - - "8084:8084" - - "5009:5005" - volumes: - - ./executor-robot/src:/opt/app/src - - ./executor-robot/target:/opt/app/target diff --git a/executor-base/pom.xml b/executor-base/pom.xml index 19dd365..4ea8d2a 100644 --- a/executor-base/pom.xml +++ b/executor-base/pom.xml @@ -66,21 +66,6 @@ common 0.0.1-SNAPSHOT - - - org.springframework.boot - spring-boot-starter-actuator - - - de.codecentric - chaos-monkey-spring-boot - 2.5.4 - - - - org.springframework.boot - spring-boot-test - diff --git a/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/ExecutionFinishedEventAdapter.java b/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/ExecutionFinishedEventAdapter.java index f683b81..4321f72 100644 --- a/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/ExecutionFinishedEventAdapter.java +++ b/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/ExecutionFinishedEventAdapter.java @@ -15,8 +15,8 @@ import ch.unisg.executorbase.executor.domain.ExecutionFinishedEvent; public class ExecutionFinishedEventAdapter implements ExecutionFinishedEventPort { - String server = System.getenv("ROSTER_URI") == null ? - "http://localhost:8082" : System.getenv("ROSTER_URI"); + String server = System.getenv("roster_uri") == null ? + "http://localhost:8082" : System.getenv("roster_uri"); Logger logger = Logger.getLogger(ExecutionFinishedEventAdapter.class.getName()); diff --git a/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/GetAssignmentAdapter.java b/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/GetAssignmentAdapter.java index 4df08dd..9d8013b 100644 --- a/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/GetAssignmentAdapter.java +++ b/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/GetAssignmentAdapter.java @@ -23,8 +23,8 @@ import org.json.JSONObject; @Primary public class GetAssignmentAdapter implements GetAssignmentPort { - String server = System.getenv("ROSTER_URI") == null ? - "http://localhost:8082" : System.getenv("ROSTER_URI"); + String server = System.getenv("roster_uri") == null ? + "http://localhost:8082" : System.getenv("roster_uri"); Logger logger = Logger.getLogger(GetAssignmentAdapter.class.getName()); diff --git a/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/NotifyExecutorPoolAdapter.java b/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/NotifyExecutorPoolAdapter.java index 4663d72..bb38e66 100644 --- a/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/NotifyExecutorPoolAdapter.java +++ b/executor-base/src/main/java/ch/unisg/executorBase/executor/adapter/out/web/NotifyExecutorPoolAdapter.java @@ -22,8 +22,8 @@ import ch.unisg.executorbase.executor.domain.ExecutorType; @Primary public class NotifyExecutorPoolAdapter implements NotifyExecutorPoolPort { - String server = System.getenv("EXECUTOR_POOL_URI") == null ? - "http://localhost:8083" : System.getenv("EXECUTOR_POOL_URI"); + String server = System.getenv("executor_pool_uri") == null ? + "http://localhost:8083" : System.getenv("executor_pool_uri"); Logger logger = Logger.getLogger(NotifyExecutorPoolAdapter.class.getName()); diff --git a/executor-base/src/main/resources/application.properties b/executor-base/src/main/resources/application.properties index fa1e940..5056e10 100644 --- a/executor-base/src/main/resources/application.properties +++ b/executor-base/src/main/resources/application.properties @@ -1,15 +1,3 @@ server.port=8081 roster.url=http://127.0.0.1:8082 executor.pool.url=http://127.0.0.1:8083 - -spring.profiles.active=chaos-monkey -chaos.monkey.enabled=false -management.endpoint.chaosmonkey.enabled=true -management.endpoint.chaosmonkeyjmx.enabled=true -# include specific endpoints -management.endpoints.web.exposure.include=health,info,chaosmonkey -chaos.monkey.watcher.controller=true -chaos.monkey.watcher.restController=true -chaos.monkey.watcher.service=true -chaos.monkey.watcher.repository=true -chaos.monkey.watcher.component=true diff --git a/executor-computation/Dockerfile b/executor-computation/Dockerfile index 2186f3e..db90fb6 100644 --- a/executor-computation/Dockerfile +++ b/executor-computation/Dockerfile @@ -2,30 +2,17 @@ FROM openjdk:11 AS development WORKDIR /opt/app -ENV EXECUTOR_POOL_URI=http://executor-pool:8083 -ENV ROSTER_URI=http://roster:8082 +# ENV SPRING_DATASOURCE_URL=jdbc:mysql://backend-db:3306/db -COPY executor-computation/.mvn ./.mvn -COPY executor-computation/mvnw executor-computation/pom.xml executor-computation/mvnw.cmd ./ +COPY .mvn/ .mvn +COPY mvnw pom.xml mvnw.cmd ./ RUN apt-get clean && apt-get update && apt-get install dos2unix RUN dos2unix mvnw -COPY common/pom.xml /opt/app/common/ -COPY common/src /opt/app/common/src -COPY common/*target /opt/app/common/target +RUN ./mvnw dependency:go-offline -COPY executor-base/pom.xml /opt/app/executor-base/ -COPY executor-base/src /opt/app/executor-base/src -COPY executor-base/*target /opt/app/executor-base/target - -COPY executor-computation/src /opt/app/src -COPY executor-computation/*target /opt/app/target - -RUN ./mvnw -f /opt/app/common/pom.xml clean install - -RUN ./mvnw -f /opt/app/executor-base/pom.xml clean install - -RUN ./mvnw clean install +COPY src /opt/app/src +COPY *target /opt/app/target CMD ["./mvnw", "spring-boot:run", "-Dspring-boot.run.jvmArguments=\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\"", "-Dspring.devtools.restart.enabled=true"] diff --git a/executor-computation/pom.xml b/executor-computation/pom.xml index 8692c3e..c319081 100644 --- a/executor-computation/pom.xml +++ b/executor-computation/pom.xml @@ -52,21 +52,6 @@ json 20210307 - - - org.springframework.boot - spring-boot-starter-actuator - - - de.codecentric - chaos-monkey-spring-boot - 2.5.4 - - - - org.springframework.boot - spring-boot-test - diff --git a/executor-computation/src/main/java/ch/unisg/executorcomputation/ExecutorcomputationApplication.java b/executor-computation/src/main/java/ch/unisg/executorcomputation/ExecutorcomputationApplication.java index fe25430..81975ba 100644 --- a/executor-computation/src/main/java/ch/unisg/executorcomputation/ExecutorcomputationApplication.java +++ b/executor-computation/src/main/java/ch/unisg/executorcomputation/ExecutorcomputationApplication.java @@ -1,7 +1,5 @@ package ch.unisg.executorcomputation; -import java.util.concurrent.TimeUnit; - import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -11,14 +9,6 @@ import ch.unisg.executorcomputation.executor.domain.Executor; public class ExecutorcomputationApplication { public static void main(String[] args) { - - try { - TimeUnit.SECONDS.sleep(40); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - SpringApplication.run(ExecutorcomputationApplication.class, args); Executor.getExecutor(); } diff --git a/executor-computation/src/main/resources/application.properties b/executor-computation/src/main/resources/application.properties index c65664e..cd2d02b 100644 --- a/executor-computation/src/main/resources/application.properties +++ b/executor-computation/src/main/resources/application.properties @@ -1,14 +1 @@ server.port=8085 - -spring.profiles.active=chaos-monkey -chaos.monkey.enabled=false -management.endpoint.chaosmonkey.enabled=true -management.endpoint.chaosmonkeyjmx.enabled=true -# include specific endpoints -management.endpoints.web.exposure.include=health,info,chaosmonkey -chaos.monkey.watcher.controller=true -chaos.monkey.watcher.restController=true -chaos.monkey.watcher.service=true -chaos.monkey.watcher.repository=true -chaos.monkey.watcher.component=true - diff --git a/executor-pool/Dockerfile b/executor-pool/Dockerfile index 3590f11..db90fb6 100644 --- a/executor-pool/Dockerfile +++ b/executor-pool/Dockerfile @@ -2,9 +2,7 @@ FROM openjdk:11 AS development WORKDIR /opt/app -ENV ROSTER_URI=http://roster:8082 -ENV SPRING_DATA_MONGODB_URI=mongodb://root:password@tapas-db:27017 -ENV MQTT_BROKER_URI=tcp://hivemq:1883 +# ENV SPRING_DATASOURCE_URL=jdbc:mysql://backend-db:3306/db COPY .mvn/ .mvn COPY mvnw pom.xml mvnw.cmd ./ @@ -12,9 +10,9 @@ COPY mvnw pom.xml mvnw.cmd ./ RUN apt-get clean && apt-get update && apt-get install dos2unix RUN dos2unix mvnw +RUN ./mvnw dependency:go-offline + COPY src /opt/app/src COPY *target /opt/app/target -RUN ./mvnw clean install - CMD ["./mvnw", "spring-boot:run", "-Dspring-boot.run.jvmArguments=\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\"", "-Dspring.devtools.restart.enabled=true"] diff --git a/executor-pool/pom.xml b/executor-pool/pom.xml index 04cb71b..92ee171 100644 --- a/executor-pool/pom.xml +++ b/executor-pool/pom.xml @@ -79,12 +79,6 @@ org.springframework.boot spring-boot-starter-data-mongodb - - com.tngtech.archunit - archunit-junit4 - 0.22.0 - test - diff --git a/executor-pool/src/main/java/ch/unisg/executorpool/ExecutorPoolApplication.java b/executor-pool/src/main/java/ch/unisg/executorpool/ExecutorPoolApplication.java index c9137a0..89847bb 100644 --- a/executor-pool/src/main/java/ch/unisg/executorpool/ExecutorPoolApplication.java +++ b/executor-pool/src/main/java/ch/unisg/executorpool/ExecutorPoolApplication.java @@ -1,7 +1,5 @@ package ch.unisg.executorpool; -import java.util.concurrent.TimeUnit; - import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; @@ -21,14 +19,6 @@ public class ExecutorPoolApplication { private LoadExecutorPort loadExecutorPort; public static void main(String[] args) { - - try { - TimeUnit.SECONDS.sleep(10); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - SpringApplication.run(ExecutorPoolApplication.class, args); } diff --git a/executor-pool/src/main/java/ch/unisg/executorpool/domain/ExecutorClass.java b/executor-pool/src/main/java/ch/unisg/executorpool/domain/ExecutorClass.java index 021b58b..5da6fe7 100644 --- a/executor-pool/src/main/java/ch/unisg/executorpool/domain/ExecutorClass.java +++ b/executor-pool/src/main/java/ch/unisg/executorpool/domain/ExecutorClass.java @@ -18,7 +18,7 @@ public class ExecutorClass { this.executorTaskType = executorTaskType; } - public static ExecutorClass createExecutorClass(ExecutorUri executorUri, ExecutorTaskType executorTaskType){ + protected static ExecutorClass createExecutorClass(ExecutorUri executorUri, ExecutorTaskType executorTaskType){ System.out.println("New Executor: " + executorUri.value.toString() + " " + executorTaskType.getValue()); return new ExecutorClass(executorUri, executorTaskType); } diff --git a/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolServiceTest.java b/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolServiceTest.java deleted file mode 100644 index 3f6f70e..0000000 --- a/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolServiceTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package ch.unisg.executorpool; - -import static org.mockito.Mockito.times; - -import java.net.URI; - -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; -import static org.mockito.BDDMockito.*; -import static org.assertj.core.api.Assertions.*; - -import ch.unisg.executorpool.application.port.in.AddNewExecutorToExecutorPoolCommand; -import ch.unisg.executorpool.application.port.out.AddExecutorPort; -import ch.unisg.executorpool.application.port.out.ExecutorAddedEventPort; -import ch.unisg.executorpool.application.service.AddNewExecutorToExecutorPoolService; -import ch.unisg.executorpool.domain.ExecutorAddedEvent; -import ch.unisg.executorpool.domain.ExecutorClass; -import ch.unisg.executorpool.domain.ExecutorPool; -import ch.unisg.executorpool.domain.ExecutorClass.ExecutorUri; - -public class AddNewExecutorToExecutorPoolServiceTest { - - private final AddExecutorPort addExecutorPort = Mockito.mock(AddExecutorPort.class); - private final ExecutorAddedEventPort newExecutorAddedEventPort = Mockito.mock(ExecutorAddedEventPort.class); - private final AddNewExecutorToExecutorPoolService addNewExecutorToExecutorPoolService = new AddNewExecutorToExecutorPoolService( - newExecutorAddedEventPort, addExecutorPort); - - @Test - void addingSucceeds() { - - ExecutorClass newExecutor = givenAnExecutorWithTypeAndUri(new ExecutorClass.ExecutorTaskType("test-type"), - new ExecutorClass.ExecutorUri(URI.create("example.org"))); - - ExecutorPool executorPool = givenAnEmptyExecutorPool(ExecutorPool.getExecutorPool()); - - AddNewExecutorToExecutorPoolCommand addNewExecutorToExecutorPoolCommand = new AddNewExecutorToExecutorPoolCommand( - newExecutor.getExecutorUri(), newExecutor.getExecutorTaskType()); - - ExecutorClass addedExecutor = addNewExecutorToExecutorPoolService.addNewExecutorToExecutorPool(addNewExecutorToExecutorPoolCommand); - - assertThat(addedExecutor).isNotNull(); - assertThat(executorPool.getListOfExecutors().getValue()).hasSize(1); - - then(newExecutorAddedEventPort).should(times(1)).publishExecutorAddedEvent(any(ExecutorAddedEvent.class)); - - } - - - private ExecutorPool givenAnEmptyExecutorPool(ExecutorPool executorPool) { - executorPool.getListOfExecutors().getValue().clear(); - return executorPool; - } - - private ExecutorClass givenAnExecutorWithTypeAndUri(ExecutorClass.ExecutorTaskType executorTaskType, - ExecutorUri executorUri) { - - ExecutorClass executor = Mockito.mock(ExecutorClass.class); - given(executor.getExecutorTaskType()).willReturn(executorTaskType); - given(executor.getExecutorUri()).willReturn(executorUri); - return executor; - } - - - -} diff --git a/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolSystemTest.java b/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolSystemTest.java deleted file mode 100644 index 5c39427..0000000 --- a/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolSystemTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package ch.unisg.executorpool; - -import org.json.JSONException; -import org.json.JSONObject; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import static org.assertj.core.api.BDDAssertions.*; - -import ch.unisg.executorpool.adapter.common.formats.ExecutorJsonRepresentation; -import ch.unisg.executorpool.application.port.out.AddExecutorPort; -import ch.unisg.executorpool.domain.ExecutorPool; -import ch.unisg.executorpool.domain.ExecutorClass; -import ch.unisg.executorpool.domain.ExecutorClass.ExecutorTaskType; -import ch.unisg.executorpool.domain.ExecutorClass.ExecutorUri; - - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class AddNewExecutorToExecutorPoolSystemTest { - - @Autowired - private TestRestTemplate restTemplate; - - @Autowired - private AddExecutorPort addExecutorPort; - - @Test - void AddNewExecutorToExecutorPool() throws JSONException { - - ExecutorTaskType executorTaskType = new ExecutorTaskType("system-integration-test-type"); - ExecutorUri executorUri = new ExecutorUri(java.net.URI.create("example.org")); - - ResponseEntity response = whenAddNewExecutorToEmptyPool(executorTaskType, executorUri); - - JSONObject responseJson = new JSONObject(response.getBody().toString()); - String respExecutorUri = responseJson.getString("executorUri"); - String respExecutorTaskType = responseJson.getString("executorTaskType"); - - then(response.getStatusCode()).isEqualTo(HttpStatus.CREATED); - then(respExecutorUri).isEqualTo(executorUri.getValue().toString()); - then(respExecutorTaskType).isEqualTo(executorTaskType.getValue()); - then(ExecutorPool.getExecutorPool().getListOfExecutors().getValue()).hasSize(1); - - } - - private ResponseEntity whenAddNewExecutorToEmptyPool(ExecutorTaskType executorTaskType, - ExecutorUri executorUri) throws JSONException { - - ExecutorPool.getExecutorPool().getListOfExecutors().getValue().clear(); - - HttpHeaders headers = new HttpHeaders(); - headers.add("Content-Type", ExecutorJsonRepresentation.EXECUTOR_MEDIA_TYPE); - - String jsonPayLoad = new JSONObject().put("executorTaskType", executorTaskType.getValue()) - .put("executorUri", executorUri.getValue()).toString(); - - - HttpEntity request = new HttpEntity<>(jsonPayLoad,headers); - - return restTemplate.exchange("/executor-pool/AddExecutor", HttpMethod.POST, request, Object.class); - - } - -} diff --git a/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolWebControllerTest.java b/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolWebControllerTest.java deleted file mode 100644 index 40b7307..0000000 --- a/executor-pool/src/test/java/ch/unisg/executorpool/AddNewExecutorToExecutorPoolWebControllerTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package ch.unisg.executorpool; - -import java.util.Optional; - -import ch.unisg.executorpool.application.port.out.LoadExecutorPort; -import org.bson.json.JsonObject; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; -import static org.mockito.BDDMockito.eq; -import static org.mockito.BDDMockito.then; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.test.web.servlet.MockMvc; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import ch.unisg.executorpool.adapter.common.formats.ExecutorJsonRepresentation; -import ch.unisg.executorpool.adapter.in.web.AddNewExecutorToExecutorPoolWebController; -import ch.unisg.executorpool.adapter.out.persistence.mongodb.ExecutorRepository; -import ch.unisg.executorpool.application.port.in.AddNewExecutorToExecutorPoolCommand; -import ch.unisg.executorpool.application.port.in.AddNewExecutorToExecutorPoolUseCase; -import ch.unisg.executorpool.domain.ExecutorClass; -import ch.unisg.executorpool.domain.ExecutorClass.ExecutorTaskType; -import ch.unisg.executorpool.domain.ExecutorClass.ExecutorUri; -import org.json.JSONObject; - - -@WebMvcTest(controllers = AddNewExecutorToExecutorPoolWebController.class) -public class AddNewExecutorToExecutorPoolWebControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private AddNewExecutorToExecutorPoolUseCase addNewExecutorToExecutorPoolUseCase; - - @MockBean - ExecutorRepository executorRepository; - - @MockBean - LoadExecutorPort loadExecutorPort; - - @Test - void testAddNewExecutorToExecutorPool() throws Exception { - - String executorTaskType = "test-request-type"; - String executorUri = "example.org"; - - String jsonPayLoad = new JSONObject().put("executorTaskType", executorTaskType).put("executorUri", executorUri).toString(); - - ExecutorClass executorStub = ExecutorClass.createExecutorClass(new ExecutorUri(java.net.URI.create(executorUri)), - new ExecutorClass.ExecutorTaskType(executorTaskType)); - - AddNewExecutorToExecutorPoolCommand addNewExecutorToExecutorPoolCommand = new AddNewExecutorToExecutorPoolCommand( - new ExecutorUri(java.net.URI.create(executorUri)), new ExecutorTaskType(executorTaskType)); - - Mockito.when(addNewExecutorToExecutorPoolUseCase - .addNewExecutorToExecutorPool(addNewExecutorToExecutorPoolCommand)) - .thenReturn(executorStub); - - mockMvc.perform(post("/executor-pool/AddExecutor") - .contentType(ExecutorJsonRepresentation.EXECUTOR_MEDIA_TYPE) - .content(jsonPayLoad)) - .andExpect(status().isCreated()); - - then(addNewExecutorToExecutorPoolUseCase).should() - .addNewExecutorToExecutorPool(eq(new AddNewExecutorToExecutorPoolCommand( - new ExecutorUri(java.net.URI.create(executorUri)), new ExecutorTaskType(executorTaskType)))); - - - } - - -} diff --git a/executor-pool/src/test/java/ch/unisg/executorpool/DependencyRuleTests.java b/executor-pool/src/test/java/ch/unisg/executorpool/DependencyRuleTests.java deleted file mode 100644 index d59f52f..0000000 --- a/executor-pool/src/test/java/ch/unisg/executorpool/DependencyRuleTests.java +++ /dev/null @@ -1,20 +0,0 @@ -package ch.unisg.executorpool; - -import com.tngtech.archunit.core.importer.ClassFileImporter; -import org.junit.jupiter.api.Test; - -import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; - -public class DependencyRuleTests { - @Test - void testPackageDependencies() { - noClasses() - .that() - .resideInAPackage("ch.unisg.executorpool.domain..") - .should() - .dependOnClassesThat() - .resideInAnyPackage("ch.unisg.executorpool.application..") - .check(new ClassFileImporter() - .importPackages("ch.unisg.executorpool..")); - } -} diff --git a/executor-pool/src/test/java/ch/unisg/executorpool/ExecutorPoolApplicationTests.java b/executor-pool/src/test/java/ch/unisg/executorpool/ExecutorPoolApplicationTests.java new file mode 100644 index 0000000..77e1032 --- /dev/null +++ b/executor-pool/src/test/java/ch/unisg/executorpool/ExecutorPoolApplicationTests.java @@ -0,0 +1,13 @@ +package ch.unisg.executorpool; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class ExecutorPoolApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/executor-pool/src/test/java/ch/unisg/executorpool/ExecutorPoolTest.java b/executor-pool/src/test/java/ch/unisg/executorpool/ExecutorPoolTest.java deleted file mode 100644 index a9df873..0000000 --- a/executor-pool/src/test/java/ch/unisg/executorpool/ExecutorPoolTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package ch.unisg.executorpool; - -import java.net.URI; -import java.util.Optional; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.*; - -import ch.unisg.executorpool.domain.ExecutorClass; -import ch.unisg.executorpool.domain.ExecutorPool; -import ch.unisg.executorpool.domain.ExecutorClass.ExecutorUri; -import ch.unisg.executorpool.domain.ExecutorClass.ExecutorTaskType; - -public class ExecutorPoolTest { - - private static final URI URI = null; - - @Test - void addNewExecutorToExecutorPoolSuccess() { - ExecutorPool executorPool = ExecutorPool.getExecutorPool(); - executorPool.getListOfExecutors().getValue().clear(); - ExecutorClass newExecutor = executorPool.addNewExecutor(new ExecutorUri(java.net.URI.create("example.com")) , - new ExecutorTaskType("test-type")); - - assertThat(newExecutor.getExecutorTaskType().getValue()).isEqualTo("test-type"); - assertThat(executorPool.getListOfExecutors().getValue()).hasSize(1); - assertThat(executorPool.getListOfExecutors().getValue().get(0)).isEqualTo(newExecutor); - } - - @Test - void retrieveExecutorSuccess() { - ExecutorPool executorPool = ExecutorPool.getExecutorPool(); - executorPool.getListOfExecutors().getValue().clear(); - ExecutorClass newExecutor = executorPool.addNewExecutor(new ExecutorUri(java.net.URI.create("example.com")) , new ExecutorTaskType("test-type")); - - var retrievedExecutors = executorPool.getAllExecutorsByType(newExecutor.getExecutorTaskType()); - - assertThat(retrievedExecutors.size()).isEqualTo(1); - assertThat(retrievedExecutors.get(0)).isEqualTo(newExecutor); - } - - @Test - void retrieveExecutorFailure() { - ExecutorPool executorPool = ExecutorPool.getExecutorPool(); - executorPool.getListOfExecutors().getValue().clear(); - executorPool.addNewExecutor(new ExecutorUri(java.net.URI.create("example.com")) , new ExecutorTaskType("test-type")); - - var fakeType = new ExecutorTaskType("fake-type"); - - var retrievedExecutor = executorPool.getAllExecutorsByType(fakeType); - - assertThat(retrievedExecutor.size()).isEqualTo(0); - } - - - - -} diff --git a/executor-robot/Dockerfile b/executor-robot/Dockerfile index 2186f3e..db90fb6 100644 --- a/executor-robot/Dockerfile +++ b/executor-robot/Dockerfile @@ -2,30 +2,17 @@ FROM openjdk:11 AS development WORKDIR /opt/app -ENV EXECUTOR_POOL_URI=http://executor-pool:8083 -ENV ROSTER_URI=http://roster:8082 +# ENV SPRING_DATASOURCE_URL=jdbc:mysql://backend-db:3306/db -COPY executor-computation/.mvn ./.mvn -COPY executor-computation/mvnw executor-computation/pom.xml executor-computation/mvnw.cmd ./ +COPY .mvn/ .mvn +COPY mvnw pom.xml mvnw.cmd ./ RUN apt-get clean && apt-get update && apt-get install dos2unix RUN dos2unix mvnw -COPY common/pom.xml /opt/app/common/ -COPY common/src /opt/app/common/src -COPY common/*target /opt/app/common/target +RUN ./mvnw dependency:go-offline -COPY executor-base/pom.xml /opt/app/executor-base/ -COPY executor-base/src /opt/app/executor-base/src -COPY executor-base/*target /opt/app/executor-base/target - -COPY executor-computation/src /opt/app/src -COPY executor-computation/*target /opt/app/target - -RUN ./mvnw -f /opt/app/common/pom.xml clean install - -RUN ./mvnw -f /opt/app/executor-base/pom.xml clean install - -RUN ./mvnw clean install +COPY src /opt/app/src +COPY *target /opt/app/target CMD ["./mvnw", "spring-boot:run", "-Dspring-boot.run.jvmArguments=\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\"", "-Dspring.devtools.restart.enabled=true"] diff --git a/executor-robot/src/main/java/ch/unisg/executorrobot/ExecutorrobotApplication.java b/executor-robot/src/main/java/ch/unisg/executorrobot/ExecutorrobotApplication.java index 79a204f..fcee5ee 100644 --- a/executor-robot/src/main/java/ch/unisg/executorrobot/ExecutorrobotApplication.java +++ b/executor-robot/src/main/java/ch/unisg/executorrobot/ExecutorrobotApplication.java @@ -1,7 +1,5 @@ package ch.unisg.executorrobot; -import java.util.concurrent.TimeUnit; - import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -11,14 +9,6 @@ import ch.unisg.executorrobot.executor.domain.Executor; public class ExecutorrobotApplication { public static void main(String[] args) { - - try { - TimeUnit.SECONDS.sleep(40); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - SpringApplication.run(ExecutorrobotApplication.class, args); Executor.getExecutor(); } diff --git a/mocks/.gitignore b/mocks/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/mocks/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/mocks/auction-house/discoveryEndpoin2.js b/mocks/auction-house/discoveryEndpoin2.js new file mode 100644 index 0000000..c201942 --- /dev/null +++ b/mocks/auction-house/discoveryEndpoin2.js @@ -0,0 +1,35 @@ +// Require the framework and instantiate it +const fastify = require("fastify")({ logger: true }); + +// Declare a route +fastify.get("/discovery/", async (request, reply) => { + return { + auctionHouseInfo: [ + { + auctionHouseURI: "http://localhost:3501", + webSubURI: "http://example.org", + taskTypes: ["COMPUTATION", "RANDOMTEXT"], + timeStamp: "2021-12-24 12:00:00", + groupName: "Group3", + }, + { + auctionHouseURI: "http://localhost:3502", + webSubURI: "http://facemash.com", + taskTypes: ["BIGROBOT"], + timeStamp: "2021-12-24 12:00:00", + groupName: "Group2", + }, + ], + }; +}); + +// Run the server! +const start = async () => { + try { + await fastify.listen(3501); + } catch (err) { + fastify.log.error(err); + process.exit(1); + } +}; +start(); diff --git a/mocks/auction-house/discoveryEndpoin3.js b/mocks/auction-house/discoveryEndpoin3.js new file mode 100644 index 0000000..20ea367 --- /dev/null +++ b/mocks/auction-house/discoveryEndpoin3.js @@ -0,0 +1,35 @@ +// Require the framework and instantiate it +const fastify = require("fastify")({ logger: true }); + +// Declare a route +fastify.get("/discovery/", async (request, reply) => { + return { + auctionHouseInfo: [ + { + auctionHouseURI: "http://localhost:3502", + webSubURI: "http://example.org", + taskTypes: ["COMPUTATION", "RANDOMTEXT"], + timeStamp: "2021-12-24 12:00:00", + groupName: "Group3", + }, + { + auctionHouseURI: "http://localhost:3501", + webSubURI: "http://facemash.com", + taskTypes: ["BIGROBOT"], + timeStamp: "2021-12-26 12:00:00", + groupName: "GroupHAHAHA222", + }, + ], + }; +}); + +// Run the server! +const start = async () => { + try { + await fastify.listen(3502); + } catch (err) { + fastify.log.error(err); + process.exit(1); + } +}; +start(); diff --git a/mocks/auction-house/discoveryEndpoint.js b/mocks/auction-house/discoveryEndpoint.js new file mode 100644 index 0000000..c7c5b44 --- /dev/null +++ b/mocks/auction-house/discoveryEndpoint.js @@ -0,0 +1,35 @@ +// Require the framework and instantiate it +const fastify = require("fastify")({ logger: true }); + +// Declare a route +fastify.get("/discovery/", async (request, reply) => { + return { + auctionHouseInfo: [ + { + auctionHouseURI: "http://localhost:3500", + webSubURI: "http://example.org", + taskTypes: ["COMPUTATION", "RANDOMTEXT"], + timeStamp: "2021-12-24 12:00:00", + groupName: "Group3", + }, + { + auctionHouseURI: "http://localhost:3501", + webSubURI: "http://facemash.com", + taskTypes: ["BIGROBOT"], + timeStamp: "2021-12-24 12:00:00", + groupName: "Group2", + }, + ], + }; +}); + +// Run the server! +const start = async () => { + try { + await fastify.listen(3500); + } catch (err) { + fastify.log.error(err); + process.exit(1); + } +}; +start(); diff --git a/mocks/package.json b/mocks/package.json new file mode 100644 index 0000000..be8a94c --- /dev/null +++ b/mocks/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "fastify": "^3.24.1" + } +} diff --git a/mocks/yarn.lock b/mocks/yarn.lock new file mode 100644 index 0000000..8ba3100 --- /dev/null +++ b/mocks/yarn.lock @@ -0,0 +1,322 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@fastify/ajv-compiler@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@fastify/ajv-compiler/-/ajv-compiler-1.1.0.tgz#5ce80b1fc8bebffc8c5ba428d5e392d0f9ed10a1" + integrity sha512-gvCOUNpXsWrIQ3A4aXCLIdblL0tDq42BG/2Xw7oxbil9h11uow10ztS2GuFazNBfjbrsZ5nl+nPl5jDSjj5TSg== + dependencies: + ajv "^6.12.6" + +abstract-logging@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/abstract-logging/-/abstract-logging-2.0.1.tgz#6b0c371df212db7129b57d2e7fcf282b8bf1c839" + integrity sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA== + +ajv@^6.11.0, ajv@^6.12.6: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^8.1.0: + version "8.8.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" + integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= + +atomic-sleep@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" + integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== + +avvio@^7.1.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/avvio/-/avvio-7.2.2.tgz#58e00e7968870026cd7b7d4f689d596db629e251" + integrity sha512-XW2CMCmZaCmCCsIaJaLKxAzPwF37fXi1KGxNOvedOpeisLdmxZnblGc3hpHWYnlP+KOUxZsazh43WXNHgXpbqw== + dependencies: + archy "^1.0.0" + debug "^4.0.0" + fastq "^1.6.1" + queue-microtask "^1.1.2" + +cookie@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" + integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== + +debug@^4.0.0: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== + dependencies: + ms "2.1.2" + +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + +fast-decode-uri-component@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz#46f8b6c22b30ff7a81357d4f59abfae938202543" + integrity sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg== + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-json-stringify@^2.5.2: + version "2.7.12" + resolved "https://registry.yarnpkg.com/fast-json-stringify/-/fast-json-stringify-2.7.12.tgz#5bb7941695b52f545191bc396396230633f43592" + integrity sha512-4hjwZDPmgj/ZUKXhEWovGPciE/5mWtAIQQxN+2VBDFun7DRTk2oOItbu9ZZp6kqj+eZ/u7z+dgBgM74cfGRnBQ== + dependencies: + ajv "^6.11.0" + deepmerge "^4.2.2" + rfdc "^1.2.0" + string-similarity "^4.0.1" + +fast-redact@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.0.2.tgz#c940ba7162dde3aeeefc522926ae8c5231412904" + integrity sha512-YN+CYfCVRVMUZOUPeinHNKgytM1wPI/C/UCLEi56EsY2dwwvI00kIJHJoI7pMVqGoMew8SMZ2SSfHKHULHXDsg== + +fast-safe-stringify@^2.0.8: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + +fastify-error@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/fastify-error/-/fastify-error-0.3.1.tgz#8eb993e15e3cf57f0357fc452af9290f1c1278d2" + integrity sha512-oCfpcsDndgnDVgiI7bwFKAun2dO+4h84vBlkWsWnz/OUK9Reff5UFoFl241xTiLeHWX/vU9zkDVXqYUxjOwHcQ== + +fastify-warning@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/fastify-warning/-/fastify-warning-0.2.0.tgz#e717776026a4493dc9a2befa44db6d17f618008f" + integrity sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw== + +fastify@^3.24.1: + version "3.24.1" + resolved "https://registry.yarnpkg.com/fastify/-/fastify-3.24.1.tgz#979d34e096f40b7a90e90733efbbdae81623034e" + integrity sha512-ZL0V6u37d65tAY8lMwVMFtFvnEeJcG80QBNSdChqCm4i4x+is/38OU14gzJuRXhpenTL+pTJzNcu5Kn1ouzM3Q== + dependencies: + "@fastify/ajv-compiler" "^1.0.0" + abstract-logging "^2.0.0" + avvio "^7.1.2" + fast-json-stringify "^2.5.2" + fastify-error "^0.3.0" + fastify-warning "^0.2.0" + find-my-way "^4.1.0" + flatstr "^1.0.12" + light-my-request "^4.2.0" + pino "^6.13.0" + proxy-addr "^2.0.7" + rfdc "^1.1.4" + secure-json-parse "^2.0.0" + semver "^7.3.2" + tiny-lru "^7.0.0" + +fastq@^1.6.1: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +find-my-way@^4.1.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/find-my-way/-/find-my-way-4.4.0.tgz#e4a115031d1c5c538d028d06b666e2174462bc07" + integrity sha512-hpntHvK0iOHp3pqWRRUEzioar4tp8euBD8DkPG3VauOriZLgwGZLTNp6yZSrdctJ8RCDS7zhZSR2V+yOaBbNow== + dependencies: + fast-decode-uri-component "^1.0.1" + fast-deep-equal "^3.1.3" + safe-regex2 "^2.0.0" + semver-store "^0.3.0" + +flatstr@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/flatstr/-/flatstr-1.0.12.tgz#c2ba6a08173edbb6c9640e3055b95e287ceb5931" + integrity sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw== + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +light-my-request@^4.2.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/light-my-request/-/light-my-request-4.7.0.tgz#5bacd17fa0eaf96fe5eed1682c5e0d361953cf46" + integrity sha512-LTa8YZp3K2AUpqUnwwKajoIHcsKOBnzwJNQSrk7unziPwo6CjOYjyO0F9wfkxFvP+nBsCGe3eMPnedVgIIgdAw== + dependencies: + ajv "^8.1.0" + cookie "^0.4.0" + fastify-warning "^0.2.0" + set-cookie-parser "^2.4.1" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +pino-std-serializers@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz#b56487c402d882eb96cd67c257868016b61ad671" + integrity sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg== + +pino@^6.13.0: + version "6.13.3" + resolved "https://registry.yarnpkg.com/pino/-/pino-6.13.3.tgz#60b93bcda1541f92fb37b3f2be0a25cf1d05b6fe" + integrity sha512-tJy6qVgkh9MwNgqX1/oYi3ehfl2Y9H0uHyEEMsBe74KinESIjdMrMQDWpcZPpPicg3VV35d/GLQZmo4QgU2Xkg== + dependencies: + fast-redact "^3.0.0" + fast-safe-stringify "^2.0.8" + fastify-warning "^0.2.0" + flatstr "^1.0.12" + pino-std-serializers "^3.1.0" + quick-format-unescaped "^4.0.3" + sonic-boom "^1.0.2" + +proxy-addr@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +queue-microtask@^1.1.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +quick-format-unescaped@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" + integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +ret@~0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.2.2.tgz#b6861782a1f4762dce43402a71eb7a283f44573c" + integrity sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ== + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rfdc@^1.1.4, rfdc@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" + integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + +safe-regex2@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/safe-regex2/-/safe-regex2-2.0.0.tgz#b287524c397c7a2994470367e0185e1916b1f5b9" + integrity sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ== + dependencies: + ret "~0.2.0" + +secure-json-parse@^2.0.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.4.0.tgz#5aaeaaef85c7a417f76271a4f5b0cc3315ddca85" + integrity sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg== + +semver-store@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/semver-store/-/semver-store-0.3.0.tgz#ce602ff07df37080ec9f4fb40b29576547befbe9" + integrity sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg== + +semver@^7.3.2: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + +set-cookie-parser@^2.4.1: + version "2.4.8" + resolved "https://registry.yarnpkg.com/set-cookie-parser/-/set-cookie-parser-2.4.8.tgz#d0da0ed388bc8f24e706a391f9c9e252a13c58b2" + integrity sha512-edRH8mBKEWNVIVMKejNnuJxleqYE/ZSdcT8/Nem9/mmosx12pctd80s2Oy00KNZzrogMZS5mauK2/ymL1bvlvg== + +sonic-boom@^1.0.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.4.1.tgz#d35d6a74076624f12e6f917ade7b9d75e918f53e" + integrity sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg== + dependencies: + atomic-sleep "^1.0.0" + flatstr "^1.0.12" + +string-similarity@^4.0.1: + version "4.0.4" + resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.4.tgz#42d01ab0b34660ea8a018da8f56a3309bb8b2a5b" + integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== + +tiny-lru@^7.0.0: + version "7.0.6" + resolved "https://registry.yarnpkg.com/tiny-lru/-/tiny-lru-7.0.6.tgz#b0c3cdede1e5882aa2d1ae21cb2ceccf2a331f24" + integrity sha512-zNYO0Kvgn5rXzWpL0y3RS09sMK67eGaQj9805jlK9G6pSadfriTczzLHFXa/xcW4mIRfmlB9HyQ/+SgL0V1uow== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/roster/Dockerfile b/roster/Dockerfile index fab5287..db90fb6 100644 --- a/roster/Dockerfile +++ b/roster/Dockerfile @@ -2,30 +2,17 @@ FROM openjdk:11 AS development WORKDIR /opt/app -ENV TASK_LIST_URI=jhttp://tapas-tasks:8081 -ENV EXECUTOR_ROBOT_URI=http://executor-robot:8084 -ENV EXECUTOR_COMPUTATION_URI=http://executor-computation:8085 -ENV MQTT_BROKER_URI=tcp://hivemq:1883 -ENV SPRING_DATA_MONGODB_URI=mongodb://root:password@tapas-db:27017 +# ENV SPRING_DATASOURCE_URL=jdbc:mysql://backend-db:3306/db -COPY roster/.mvn ./.mvn -COPY roster/mvnw roster/pom.xml roster/mvnw.cmd ./ +COPY .mvn/ .mvn +COPY mvnw pom.xml mvnw.cmd ./ RUN apt-get clean && apt-get update && apt-get install dos2unix RUN dos2unix mvnw -COPY common/pom.xml /opt/app/common/ -COPY common/src /opt/app/common/src -COPY common/*target /opt/app/common/target +RUN ./mvnw dependency:go-offline -COPY roster/src /opt/app/src -COPY roster/*target /opt/app/target - -RUN ./mvnw -f /opt/app/common/pom.xml clean install - -RUN ./mvnw clean install +COPY src /opt/app/src +COPY *target /opt/app/target CMD ["./mvnw", "spring-boot:run", "-Dspring-boot.run.jvmArguments=\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\"", "-Dspring.devtools.restart.enabled=true"] - - - diff --git a/roster/pom.xml b/roster/pom.xml index bfcbbd2..0f5c39e 100644 --- a/roster/pom.xml +++ b/roster/pom.xml @@ -83,12 +83,6 @@ org.springframework.boot spring-boot-starter-data-mongodb - - com.tngtech.archunit - archunit-junit4 - 0.22.0 - test - diff --git a/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishNewTaskEventAdapter.java b/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishNewTaskEventAdapter.java index 3349522..c16961f 100644 --- a/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishNewTaskEventAdapter.java +++ b/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishNewTaskEventAdapter.java @@ -19,10 +19,10 @@ import ch.unisg.roster.roster.domain.event.NewTaskEvent; @Primary public class PublishNewTaskEventAdapter implements NewTaskEventPort { - @Value("${executor.robot.uri}") + @Value("${executor-robot.uri}") private String server; - @Value("${executor.computation.uri}") + @Value("${executor-computation.uri}") private String server2; Logger logger = Logger.getLogger(PublishNewTaskEventAdapter.class.getName()); diff --git a/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishTaskAssignedEventAdapter.java b/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishTaskAssignedEventAdapter.java index d83c9c2..105d464 100644 --- a/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishTaskAssignedEventAdapter.java +++ b/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishTaskAssignedEventAdapter.java @@ -20,7 +20,7 @@ import ch.unisg.roster.roster.domain.event.TaskAssignedEvent; @Primary public class PublishTaskAssignedEventAdapter implements TaskAssignedEventPort { - @Value("${task.list.uri}") + @Value("${task-list.uri}") private String server; Logger logger = Logger.getLogger(PublishTaskAssignedEventAdapter.class.getName()); diff --git a/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishTaskCompletedEventAdapter.java b/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishTaskCompletedEventAdapter.java index 8ea95ec..50d72ae 100644 --- a/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishTaskCompletedEventAdapter.java +++ b/roster/src/main/java/ch/unisg/roster/roster/adapter/out/web/PublishTaskCompletedEventAdapter.java @@ -20,7 +20,7 @@ import ch.unisg.roster.roster.domain.event.TaskCompletedEvent; @Primary public class PublishTaskCompletedEventAdapter implements TaskCompletedEventPort { - @Value("${task.list.uri}") + @Value("${task-list.uri}") private String server; Logger logger = Logger.getLogger(PublishTaskCompletedEventAdapter.class.getName()); diff --git a/roster/src/main/resources/application.properties b/roster/src/main/resources/application.properties index ea6544a..d90d1c3 100644 --- a/roster/src/main/resources/application.properties +++ b/roster/src/main/resources/application.properties @@ -1,21 +1,8 @@ server.port=8082 -executor.robot.uri=http://127.0.0.1:8084 -executor.computation.uri=http://127.0.0.1:8085 -task.list.uri=http://127.0.0.1:8081 +executor-robot.uri=http://127.0.0.1:8084 +executor-computation.uri=http://127.0.0.1:8085 +task-list.uri=http://127.0.0.1:8081 mqtt.broker.uri=tcp://localhost:1883 spring.data.mongodb.uri=mongodb://root:password@localhost:27017/ spring.data.mongodb.database=tapas-roster - - -spring.profiles.active=chaos-monkey -chaos.monkey.enabled=false -management.endpoint.chaosmonkey.enabled=true -management.endpoint.chaosmonkeyjmx.enabled=true -# include specific endpoints -management.endpoints.web.exposure.include=health,info,chaosmonkey -chaos.monkey.watcher.controller=true -chaos.monkey.watcher.restController=true -chaos.monkey.watcher.service=true -chaos.monkey.watcher.repository=true -chaos.monkey.watcher.component=true diff --git a/roster/src/test/java/ch/unisg/roster/DependencyRuleTests.java b/roster/src/test/java/ch/unisg/roster/DependencyRuleTests.java deleted file mode 100644 index fd64ed5..0000000 --- a/roster/src/test/java/ch/unisg/roster/DependencyRuleTests.java +++ /dev/null @@ -1,20 +0,0 @@ -package ch.unisg.roster; - -import com.tngtech.archunit.core.importer.ClassFileImporter; -import org.junit.jupiter.api.Test; - -import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; - -public class DependencyRuleTests { - @Test - void testPackageDependencies() { - noClasses() - .that() - .resideInAPackage("ch.unisg.roster.roster.domain..") - .should() - .dependOnClassesThat() - .resideInAnyPackage("ch.unisg.roster.roster.application..") - .check(new ClassFileImporter() - .importPackages("ch.unisg.roster.roster..")); - } -} diff --git a/roster/src/test/java/ch/unisg/roster/RosterApplicationTests.java b/roster/src/test/java/ch/unisg/roster/RosterApplicationTests.java new file mode 100644 index 0000000..5ee712b --- /dev/null +++ b/roster/src/test/java/ch/unisg/roster/RosterApplicationTests.java @@ -0,0 +1,13 @@ +package ch.unisg.roster; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class RosterApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java index ee66761..6aa001d 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java @@ -2,6 +2,7 @@ package ch.unisg.tapas; import ch.unisg.tapas.auctionhouse.adapter.common.clients.TapasMqttClient; import ch.unisg.tapas.auctionhouse.adapter.in.messaging.mqtt.AuctionEventsMqttDispatcher; +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscovery; import ch.unisg.tapas.auctionhouse.adapter.common.clients.WebSubSubscriber; import ch.unisg.tapas.common.AuctionHouseResourceDirectory; import ch.unisg.tapas.common.ConfigProperties; @@ -16,6 +17,9 @@ import org.springframework.core.env.ConfigurableEnvironment; import java.net.URI; import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; /** * Main TAPAS Auction House application. @@ -24,7 +28,7 @@ import java.util.List; public class TapasAuctionHouseApplication { private static final Logger LOGGER = LogManager.getLogger(TapasAuctionHouseApplication.class); - public static String RESOURCE_DIRECTORY = "https://api.interactions.ics.unisg.ch/auction-houses/"; + public static String RESOURCE_DIRECTORY = "http://localhost:3500"; public static String DEFAULT_MQTT_BROKER = "tcp://broker.hivemq.com:1883"; private static ConfigurableEnvironment ENVIRONMENT; @@ -36,20 +40,23 @@ public class TapasAuctionHouseApplication { // TODO Set start up of message services with config // We will use these bootstrap methods in Week 6: - // bootstrapMarketplaceWithWebSub(); + bootstrapMarketplaceWithWebSub(); bootstrapMarketplaceWithMqtt(); + + ScheduledExecutorService executor = Executors.newScheduledThreadPool(1); + executor.scheduleAtFixedRate(crawlerRunnable, 30, 30, TimeUnit.SECONDS); } /** * Discovers auction houses and subscribes to WebSub notifications */ private static void bootstrapMarketplaceWithWebSub() { - List auctionHouseEndpoints = discoverAuctionHouseEndpoints(); + discoverAuctionHouseEndpoints(); - WebSubSubscriber subscriber = new WebSubSubscriber(); + // WebSubSubscriber subscriber = new WebSubSubscriber(); - for (String endpoint : auctionHouseEndpoints) { - subscriber.subscribeToAuctionHouseEndpoint(URI.create(endpoint)); - } + // for (String endpoint : auctionHouseEndpoints) { + // subscriber.subscribeToAuctionHouseEndpoint(URI.create(endpoint)); + // } } /** @@ -74,11 +81,22 @@ public class TapasAuctionHouseApplication { } } - private static List discoverAuctionHouseEndpoints() { + private static void discoverAuctionHouseEndpoints() { AuctionHouseResourceDirectory rd = new AuctionHouseResourceDirectory( URI.create(RESOURCE_DIRECTORY) ); - return rd.retrieveAuctionHouseEndpoints(); + AuctionHouseDiscovery.getInstance().addAuctionHouseDiscoveryInformation(rd.retrieveAuctionHouseEndpoints()); } + + + private static Runnable crawlerRunnable = new Runnable() { + public void run() { + AuctionHouseResourceDirectory rd = new AuctionHouseResourceDirectory( + URI.create(RESOURCE_DIRECTORY) + ); + + AuctionHouseDiscovery.getInstance().addAuctionHouseDiscoveryInformation(rd.retrieveAuctionHouseEndpoints()); + } + }; } diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/common/formats/AuctionHouseDiscoveryJsonRepresentation.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/common/formats/AuctionHouseDiscoveryJsonRepresentation.java new file mode 100644 index 0000000..6daee90 --- /dev/null +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/common/formats/AuctionHouseDiscoveryJsonRepresentation.java @@ -0,0 +1,48 @@ +package ch.unisg.tapas.auctionhouse.adapter.common.formats; + +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscoveryInformation; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.Getter; +import lombok.Setter; + +public class AuctionHouseDiscoveryJsonRepresentation { + public static final String MEDIA_TYPE = "application/auctionhousediscovery+json"; + + @Getter @Setter + private String auctionHouseUri; + + @Getter @Setter + private String webSubUri; + + @Getter @Setter + private List taskTypes; + + @Getter @Setter + private String timeStamp; + + @Getter @Setter + private String groupName; + + public AuctionHouseDiscoveryJsonRepresentation() {} + + public AuctionHouseDiscoveryJsonRepresentation(AuctionHouseDiscoveryInformation auctionHouseDiscoveryInformation){ + this.auctionHouseUri = auctionHouseDiscoveryInformation.getAuctionHouseUri().getValue().toString(); + this.webSubUri = auctionHouseDiscoveryInformation.getWebSubUri().getValue().toString(); + this.taskTypes = auctionHouseDiscoveryInformation.getTaskTypes().getValue(); + this.timeStamp = auctionHouseDiscoveryInformation.getTimeStamp().getValue().toString(); + this.groupName = auctionHouseDiscoveryInformation.getGroupName().getValue(); + } + + public static String serialize(AuctionHouseDiscoveryInformation auctionHouseDiscoveryInformation) throws JsonProcessingException { + AuctionHouseDiscoveryJsonRepresentation representation = new AuctionHouseDiscoveryJsonRepresentation(auctionHouseDiscoveryInformation); + + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + return mapper.writeValueAsString(representation); + } +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/web/AuctionHouseDiscoveryWebController.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/web/AuctionHouseDiscoveryWebController.java new file mode 100644 index 0000000..22fbb09 --- /dev/null +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/web/AuctionHouseDiscoveryWebController.java @@ -0,0 +1,51 @@ +package ch.unisg.tapas.auctionhouse.adapter.in.web; + +import ch.unisg.tapas.auctionhouse.adapter.common.formats.AuctionHouseDiscoveryJsonRepresentation; +import ch.unisg.tapas.auctionhouse.application.port.in.AuctionHouseDiscoveryUseCase; +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscoveryInformation; + +import java.util.List; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Controller that handles HTTP requests for the auction house discovery. This controller implements + * the {@link AuctionHouseDiscoveryUseCase} use case using the {@link AuctionHouseDiscoveryCommand} command. + */ +@RestController +public class AuctionHouseDiscoveryWebController { + private final AuctionHouseDiscoveryUseCase auctionHouseDiscoveryUseCase; + + public AuctionHouseDiscoveryWebController(AuctionHouseDiscoveryUseCase auctionHouseDiscoveryUseCase) { + this.auctionHouseDiscoveryUseCase = auctionHouseDiscoveryUseCase; + } + + @GetMapping(path="/discovery/", consumes = AuctionHouseDiscoveryJsonRepresentation.MEDIA_TYPE) + public ResponseEntity auctionHouseDiscovery() { + List auctionHouseDiscoveryInformation = auctionHouseDiscoveryUseCase.auctionHouseDiscovery(); + + ObjectMapper mapper = new ObjectMapper(); + ObjectNode response = mapper.createObjectNode(); + ArrayNode array = response.putArray("auctionHouseInfo"); + + + for (AuctionHouseDiscoveryInformation info : auctionHouseDiscoveryInformation) { + array.add(mapper.valueToTree(new AuctionHouseDiscoveryJsonRepresentation(info))); + } + + HttpHeaders responseHeaders = new HttpHeaders(); + responseHeaders.add(HttpHeaders.CONTENT_TYPE, AuctionHouseDiscoveryJsonRepresentation.MEDIA_TYPE); + + return new ResponseEntity<>(response.toString(), responseHeaders, HttpStatus.OK); + } +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionHouseDiscoveryHttpAdapter.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionHouseDiscoveryHttpAdapter.java new file mode 100644 index 0000000..e37c989 --- /dev/null +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionHouseDiscoveryHttpAdapter.java @@ -0,0 +1,76 @@ +package ch.unisg.tapas.auctionhouse.adapter.out.web; + +import ch.unisg.tapas.auctionhouse.application.port.out.AuctionHouseDiscoveryPort; +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscoveryInformation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.json.JSONArray; +import org.json.JSONObject; + +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.sql.Timestamp; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +public class AuctionHouseDiscoveryHttpAdapter implements AuctionHouseDiscoveryPort { + private static final Logger LOGGER = LogManager.getLogger(AuctionHouseDiscoveryHttpAdapter.class); + + public List fetchAuctionHouseInformation(URI auctionHouseURI){ + + System.out.println(auctionHouseURI); + + try{ + var client = HttpClient.newHttpClient(); + var request = HttpRequest.newBuilder() + .uri(auctionHouseURI) + .GET() + .build(); + var response = client.send(request, HttpResponse.BodyHandlers.ofString()); + LOGGER.info(response.body()); + var responseBody = new JSONObject(response.body()); + + var arrayOfInformation = responseBody.getJSONArray("auctionHouseInfo"); + var returnList = new LinkedList(); + + for(int i = 0; i < arrayOfInformation.length(); i++) + { + var informationJSON = arrayOfInformation.getJSONObject(i); + var information = new AuctionHouseDiscoveryInformation( + new AuctionHouseDiscoveryInformation.AuctionHouseUri(URI.create(informationJSON.getString("auctionHouseURI"))), + new AuctionHouseDiscoveryInformation.WebSubUri(URI.create(informationJSON.getString("webSubURI"))), + new AuctionHouseDiscoveryInformation.TaskTypes(getTaskTypes(informationJSON.getJSONArray("taskTypes"))), + new AuctionHouseDiscoveryInformation.TimeStamp(Timestamp.valueOf(informationJSON.getString("timeStamp"))), + new AuctionHouseDiscoveryInformation.GroupName(informationJSON.getString("groupName")) + ); + returnList.add(information); + } + + return returnList; + + } catch (IOException e) { + e.printStackTrace(); + return Collections.emptyList(); + } catch (InterruptedException e) { + e.printStackTrace(); + return Collections.emptyList(); + } + + } + + private List getTaskTypes(JSONArray arrayOfTypes){ + var listOfTypes = new LinkedList(); + + for(int i = 0; i < arrayOfTypes.length(); i++) + { + listOfTypes.add(arrayOfTypes.getString(i)); + } + + return listOfTypes; + } + +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/port/in/AuctionHouseDiscoveryUseCase.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/port/in/AuctionHouseDiscoveryUseCase.java new file mode 100644 index 0000000..c90b54b --- /dev/null +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/port/in/AuctionHouseDiscoveryUseCase.java @@ -0,0 +1,9 @@ +package ch.unisg.tapas.auctionhouse.application.port.in; + +import java.util.List; + +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscoveryInformation; + +public interface AuctionHouseDiscoveryUseCase { + List auctionHouseDiscovery(); +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/port/out/AuctionHouseDiscoveryPort.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/port/out/AuctionHouseDiscoveryPort.java new file mode 100644 index 0000000..962f893 --- /dev/null +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/port/out/AuctionHouseDiscoveryPort.java @@ -0,0 +1,10 @@ +package ch.unisg.tapas.auctionhouse.application.port.out; + +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscoveryInformation; + +import java.net.URI; +import java.util.List; + +public interface AuctionHouseDiscoveryPort { + List fetchAuctionHouseInformation(URI auctionHouseURI); +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/service/AuctionHouseDiscoveryService.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/service/AuctionHouseDiscoveryService.java new file mode 100644 index 0000000..5fb2c94 --- /dev/null +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/application/service/AuctionHouseDiscoveryService.java @@ -0,0 +1,19 @@ +package ch.unisg.tapas.auctionhouse.application.service; + +import java.util.List; + +import org.springframework.stereotype.Component; + +import ch.unisg.tapas.auctionhouse.application.port.in.AuctionHouseDiscoveryUseCase; +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscovery; +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscoveryInformation; + +@Component +public class AuctionHouseDiscoveryService implements AuctionHouseDiscoveryUseCase { + + @Override + public List auctionHouseDiscovery() { + return AuctionHouseDiscovery.getInstance().getAuctionHouseDiscoveryList(); + } + +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/domain/AuctionHouseDiscovery.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/domain/AuctionHouseDiscovery.java new file mode 100644 index 0000000..5088ff1 --- /dev/null +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/domain/AuctionHouseDiscovery.java @@ -0,0 +1,73 @@ +package ch.unisg.tapas.auctionhouse.domain; + +import java.net.URI; +import java.net.URISyntaxException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import lombok.Getter; + +public class AuctionHouseDiscovery { + + private static final AuctionHouseDiscovery auctionHouseDiscovery = new AuctionHouseDiscovery(); + + private final List tasktypes = new ArrayList() { + { + add("computation"); + add("smallrobot"); + } + }; + + @Getter + private List auctionHouseDiscoveryList = new ArrayList<>() { + }; + + private AuctionHouseDiscovery() { + try { + // Add our information to list + auctionHouseDiscoveryList.add(new AuctionHouseDiscoveryInformation( + new AuctionHouseDiscoveryInformation.AuctionHouseUri(new URI("http://localhost:8086")), + new AuctionHouseDiscoveryInformation.WebSubUri(new URI("http://localhost:8086/websub")), + new AuctionHouseDiscoveryInformation.TaskTypes(tasktypes), + new AuctionHouseDiscoveryInformation.TimeStamp(new Timestamp(new Date().getTime())), + new AuctionHouseDiscoveryInformation.GroupName("Group 1") + )); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public static AuctionHouseDiscovery getInstance() { + return auctionHouseDiscovery; + } + + public List getAuctionHouseDiscoveryInformation() { + return auctionHouseDiscoveryList; + } + + public void addAuctionHouseDiscoveryInformation(List informations) { + + outerloop: + for (AuctionHouseDiscoveryInformation discovery : informations) { + for (AuctionHouseDiscoveryInformation endpoint : auctionHouseDiscoveryList) { + // Check if discovery is already in our discovery list + if (endpoint.getAuctionHouseUri().getValue().toString().equals(discovery.getAuctionHouseUri().getValue().toString())) { + // Check if the new discovery is more recent than the current + if (endpoint.getTimeStamp().getValue().before(discovery.getTimeStamp().getValue())) { + // Endpoint information is older. Remove and add the new discovery to the list + auctionHouseDiscoveryList.remove(endpoint); + break; + } else { + continue outerloop; + } + } + } + auctionHouseDiscoveryList.add(discovery); + } + + } + +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/domain/AuctionHouseDiscoveryInformation.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/domain/AuctionHouseDiscoveryInformation.java new file mode 100644 index 0000000..3ca9c53 --- /dev/null +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/domain/AuctionHouseDiscoveryInformation.java @@ -0,0 +1,65 @@ +package ch.unisg.tapas.auctionhouse.domain; + +import lombok.Getter; +import lombok.Value; + +import java.net.URI; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +//TODO: change to array type +public class AuctionHouseDiscoveryInformation { + + @Getter + private final AuctionHouseUri auctionHouseUri; + + @Getter + private final WebSubUri webSubUri; + + @Getter + private final TaskTypes taskTypes; + + @Getter + private final TimeStamp timeStamp; + + //Had to initialize this in the constructor, but it's not required, so I'm not sure + //if this is correct + @Getter + private final GroupName groupName; + + public AuctionHouseDiscoveryInformation(AuctionHouseUri auctionHouseUri, WebSubUri webSubUri, + TaskTypes taskTypes, TimeStamp timeStamp, GroupName groupName){ + this.auctionHouseUri = auctionHouseUri; + this.webSubUri = webSubUri; + this.taskTypes = taskTypes; + this.timeStamp = timeStamp; + this.groupName = groupName; //see above + } + + + @Value + public static class AuctionHouseUri { + private URI value; + } + + @Value + public static class WebSubUri { + private URI value; + } + + @Value + public static class TaskTypes { + private List value; + } + + @Value + public static class TimeStamp { + private Timestamp value; + } + + @Value + public static class GroupName { + private String value; + } +} diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/common/AuctionHouseResourceDirectory.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/common/AuctionHouseResourceDirectory.java index c4809ef..e44690f 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/common/AuctionHouseResourceDirectory.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/common/AuctionHouseResourceDirectory.java @@ -3,8 +3,13 @@ package ch.unisg.tapas.common; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import ch.unisg.tapas.auctionhouse.adapter.out.web.AuctionHouseDiscoveryHttpAdapter; +import ch.unisg.tapas.auctionhouse.application.port.out.AuctionHouseDiscoveryPort; +import ch.unisg.tapas.auctionhouse.domain.AuctionHouseDiscoveryInformation; + import java.io.IOException; import java.net.URI; +import java.net.URISyntaxException; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; @@ -26,32 +31,68 @@ public class AuctionHouseResourceDirectory { this.rdEndpoint = rdEndpoint; } + private AuctionHouseDiscoveryPort auctionHouseDiscoveryport = new AuctionHouseDiscoveryHttpAdapter(); + + private List auctionHouseEndpoints = new ArrayList<>(); + + // List to keep track of already fetched endpoints + private List fetchedEndpoints = new ArrayList<>(); + /** * Retrieves the endpoints of all auctions houses registered with this directory. * @return */ - public List retrieveAuctionHouseEndpoints() { - List auctionHouseEndpoints = new ArrayList<>(); + public List retrieveAuctionHouseEndpoints() { - try { - HttpRequest request = HttpRequest.newBuilder() - .uri(rdEndpoint).GET().build(); + fetchedEndpoints.clear(); + auctionHouseEndpoints.clear(); - HttpResponse response = HttpClient.newBuilder().build() - .send(request, HttpResponse.BodyHandlers.ofString()); - - // For simplicity, here we just hard code the current representation used by our - // resource directory for auction houses - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode payload = objectMapper.readTree(response.body()); - - for (JsonNode node : payload) { - auctionHouseEndpoints.add(node.get("endpoint").asText()); - } - } catch (IOException | InterruptedException e) { - e.printStackTrace(); - } + fetchedEndpoints.add(rdEndpoint); + // Start recusive fetching of auctionhouses + fetchEndpoints(getInformation(rdEndpoint)); return auctionHouseEndpoints; } + + // Recursive function to fetch all endpoints + private void fetchEndpoints(List auctionHouses) { + + for (AuctionHouseDiscoveryInformation ah : auctionHouses) { + if (!fetchedEndpoints.contains(ah.getAuctionHouseUri().getValue())) { + fetchedEndpoints.add(ah.getAuctionHouseUri().getValue()); + fetchEndpoints(getInformation(ah.getAuctionHouseUri().getValue())); + } + } + + } + + private List getInformation(URI uri) { + List discoveries; + try { + discoveries = auctionHouseDiscoveryport.fetchAuctionHouseInformation(new URI(uri.toString() + "/discovery/")); + outerloop: + for (AuctionHouseDiscoveryInformation discovery : discoveries) { + for (AuctionHouseDiscoveryInformation endpoint : auctionHouseEndpoints) { + // Check if discovery is already in our endpoint list + if (endpoint.getAuctionHouseUri().getValue().toString().equals(discovery.getAuctionHouseUri().getValue().toString())) { + // Check if the new discovery is more recent than the current + if (endpoint.getTimeStamp().getValue().before(discovery.getTimeStamp().getValue())) { + // Endpoint information is older. Remove and add the new discovery to the list + auctionHouseEndpoints.remove(endpoint); + break; + } else { + continue outerloop; + } + } + } + auctionHouseEndpoints.add(discovery); + } + return discoveries; + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // When an error happens return empty list + return new ArrayList(); + } } diff --git a/tapas-tasks/Dockerfile b/tapas-tasks/Dockerfile index ffea3e9..db90fb6 100644 --- a/tapas-tasks/Dockerfile +++ b/tapas-tasks/Dockerfile @@ -2,8 +2,7 @@ FROM openjdk:11 AS development WORKDIR /opt/app -ENV ROSTER_URI=http://roster:8082 -ENV SPRING_DATA_MONGODB_URI=mongodb://root:password@tapas-db:27017 +# ENV SPRING_DATASOURCE_URL=jdbc:mysql://backend-db:3306/db COPY .mvn/ .mvn COPY mvnw pom.xml mvnw.cmd ./ @@ -11,9 +10,9 @@ COPY mvnw pom.xml mvnw.cmd ./ RUN apt-get clean && apt-get update && apt-get install dos2unix RUN dos2unix mvnw +RUN ./mvnw dependency:go-offline + COPY src /opt/app/src COPY *target /opt/app/target -RUN ./mvnw clean install - CMD ["./mvnw", "spring-boot:run", "-Dspring-boot.run.jvmArguments=\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\"", "-Dspring.devtools.restart.enabled=true"] diff --git a/tapas-tasks/src/main/java/ch/unisg/tapastasks/TapasTasksApplication.java b/tapas-tasks/src/main/java/ch/unisg/tapastasks/TapasTasksApplication.java index 1df34a9..78a6145 100644 --- a/tapas-tasks/src/main/java/ch/unisg/tapastasks/TapasTasksApplication.java +++ b/tapas-tasks/src/main/java/ch/unisg/tapastasks/TapasTasksApplication.java @@ -13,6 +13,8 @@ public class TapasTasksApplication { SpringApplication tapasTasksApp = new SpringApplication(TapasTasksApplication.class); tapasTasksApp.run(args); + + } } diff --git a/tapas-tasks/src/main/java/ch/unisg/tapastasks/tasks/application/service/RetrieveTaskFromTaskListService.java b/tapas-tasks/src/main/java/ch/unisg/tapastasks/tasks/application/service/RetrieveTaskFromTaskListService.java index 696514b..39026f5 100644 --- a/tapas-tasks/src/main/java/ch/unisg/tapastasks/tasks/application/service/RetrieveTaskFromTaskListService.java +++ b/tapas-tasks/src/main/java/ch/unisg/tapastasks/tasks/application/service/RetrieveTaskFromTaskListService.java @@ -28,6 +28,6 @@ public class RetrieveTaskFromTaskListService implements RetrieveTaskFromTaskList Optional taskFromRepo = Optional.ofNullable(loadTaskFromRepositoryPort.loadTask(query.getTaskId(), taskList.getTaskListName())); - return task; + return taskFromRepo; } } diff --git a/tapas-tasks/src/main/resources/application.properties b/tapas-tasks/src/main/resources/application.properties index 2a86652..69f84ad 100644 --- a/tapas-tasks/src/main/resources/application.properties +++ b/tapas-tasks/src/main/resources/application.properties @@ -6,7 +6,7 @@ baseuri=https://tapas-tasks.86-119-34-23.nip.io/ roster.uri=http://127.0.0.1:8082 spring.profiles.active=chaos-monkey -chaos.monkey.enabled=false +chaos.monkey.enabled=true management.endpoint.chaosmonkey.enabled=true management.endpoint.chaosmonkeyjmx.enabled=true # include specific endpoints @@ -16,3 +16,24 @@ chaos.monkey.watcher.restController=true chaos.monkey.watcher.service=true chaos.monkey.watcher.repository=true chaos.monkey.watcher.component=true + +#Chaos Monkey configs taken from here: https://www.baeldung.com/spring-boot-chaos-monkey + +#Latency Assault +#chaos.monkey.assaults.latencyActive=true +#chaos.monkey.assaults.latencyRangeStart=3000 +#chaos.monkey.assaults.latencyRangeEnd=15000 + +#Exception Assault +#chaos.monkey.assaults.latencyActive=false +#chaos.monkey.assaults.exceptionsActive=true +#chaos.monkey.assaults.killApplicationActive=false + +#AppKiller Assault +#chaos.monkey.assaults.latencyActive=false +#chaos.monkey.assaults.exceptionsActive=false +#chaos.monkey.assaults.killApplicationActive=true + +#Chaos Monkey assaults via REST to endpoint /actuator/chaosmonkey/assaults/ +#https://softwarehut.com/blog/tech/chaos-monkey +#https://codecentric.github.io/chaos-monkey-spring-boot/latest/ diff --git a/tapas-tasks/src/test/java/ch/unisg/tapastasks/TapasTasksApplicationTests.java b/tapas-tasks/src/test/java/ch/unisg/tapastasks/TapasTasksApplicationTests.java new file mode 100644 index 0000000..a343151 --- /dev/null +++ b/tapas-tasks/src/test/java/ch/unisg/tapastasks/TapasTasksApplicationTests.java @@ -0,0 +1,18 @@ +package ch.unisg.tapastasks; + +import ch.unisg.tapastasks.tasks.application.port.out.AddTaskPort; +import ch.unisg.tapastasks.tasks.application.port.out.NewTaskAddedEventPort; +import ch.unisg.tapastasks.tasks.application.port.out.TaskListLock; +import ch.unisg.tapastasks.tasks.application.service.AddNewTaskToTaskListService; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class TapasTasksApplicationTests { + + @Test + void contextLoads() { + + } + +}