Skip to content
Snippets Groups Projects
Commit c80d9550 authored by Jan David Mol's avatar Jan David Mol
Browse files

Configure host to allow ELK stack to run, if needed

parent 4ac3ed09
Branches
Tags
1 merge request!7Resolve #2021 "03 16 branched from master elk stack"
...@@ -3,11 +3,19 @@ ...@@ -3,11 +3,19 @@
# See https://elk-docker.readthedocs.io/ # See https://elk-docker.readthedocs.io/
# #
# Defines: # Defines:
# - elk-configure-host: Configures the hosts's kernel to be able to use the ELK stack
# - elk: ELK stack # - elk: ELK stack
# #
version: '2' version: '2'
services: services:
elk-configure-host:
image: elk-configure-host
build:
context: elk-configure-host
container_name: ${CONTAINER_NAME_PREFIX}elk-configure-host
network_mode: ${NETWORK_MODE}
elk: elk:
image: sebp/elk image: sebp/elk
container_name: ${CONTAINER_NAME_PREFIX}elk container_name: ${CONTAINER_NAME_PREFIX}elk
...@@ -16,3 +24,5 @@ services: ...@@ -16,3 +24,5 @@ services:
- "5601:5601" - "5601:5601"
- "9200:9200" - "9200:9200"
- "5044:5044" - "5044:5044"
depends_on:
- elk-configure-host
...@@ -2,3 +2,6 @@ FROM nexus.engageska-portugal.pt/ska-docker/tango-itango:latest ...@@ -2,3 +2,6 @@ FROM nexus.engageska-portugal.pt/ska-docker/tango-itango:latest
COPY lofar-requirements.txt /lofar-requirements.txt COPY lofar-requirements.txt /lofar-requirements.txt
RUN pip3 install -r /lofar-requirements.txt RUN pip3 install -r /lofar-requirements.txt
ENV TANGO_LOG_PATH=/var/log/tango
RUN sudo mkdir -p /var/log/tango && sudo chmod a+rwx /var/log/tango
%% Cell type:code id:social-massachusetts tags: %% Cell type:code id:social-massachusetts tags:
``` python ``` python
def force_start(device): def force_start(device):
if device.state() == DevState.FAULT: if device.state() == DevState.FAULT:
device.Off() device.Off()
if device.state() == DevState.OFF: if device.state() == DevState.OFF:
device.initialise() device.initialise()
if device.state() == DevState.INIT: if device.state() == DevState.INIT:
device.Standby() device.Standby()
if device.state() == DevState.STANDBY: if device.state() == DevState.STANDBY:
device.On() device.On()
return device.state() return device.state()
``` ```
%% Cell type:code id:defined-apache tags: %% Cell type:code id:defined-apache tags:
``` python ``` python
sdp = DeviceProxy("SDP/LTS/1")
sdp.force_start()
for d in devices: for d in devices:
print("Device %s is now in state %s" % (d, force_start(d))) print("Device %s is now in state %s" % (d, force_start(d)))
``` ```
%% Output %% Cell type:code id:superior-wheel tags:
Device PCC(lts/pcc/1) is now in state FAULT ``` python
Device SDP(lts/sdp/1) is now in state ON devices
```
%% Cell type:code id:superior-wheel tags: %% Cell type:code id:fifteen-transportation tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment