Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
e1374df9
Commit
e1374df9
authored
3 years ago
by
Jasper Annyas
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-379
:Added small review changes and notebook
parent
0c12e90b
No related branches found
No related tags found
1 merge request
!125
L2SS-379: Add a device to monitor/manage the docker containers.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
devices/devices/docker_device.py
+2
-2
2 additions, 2 deletions
devices/devices/docker_device.py
docker-compose/device-docker.yml
+2
-2
2 additions, 2 deletions
docker-compose/device-docker.yml
jupyter-notebooks/Docker_notebook.ipynb
+139
-0
139 additions, 0 deletions
jupyter-notebooks/Docker_notebook.ipynb
with
143 additions
and
4 deletions
devices/devices/docker_device.py
+
2
−
2
View file @
e1374df9
...
@@ -68,8 +68,8 @@ class Docker(hardware_device):
...
@@ -68,8 +68,8 @@ class Docker(hardware_device):
archiver_maria_db_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
archiver-maria-db
"
},
datatype
=
numpy
.
bool_
,
access
=
AttrWriteType
.
READ_WRITE
)
archiver_maria_db_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
archiver-maria-db
"
},
datatype
=
numpy
.
bool_
,
access
=
AttrWriteType
.
READ_WRITE
)
databaseds_R
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
databaseds
"
},
datatype
=
numpy
.
bool_
)
databaseds_R
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
databaseds
"
},
datatype
=
numpy
.
bool_
)
databaseds_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
databaseds
"
},
datatype
=
numpy
.
bool_
,
access
=
AttrWriteType
.
READ_WRITE
)
databaseds_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
databaseds
"
},
datatype
=
numpy
.
bool_
,
access
=
AttrWriteType
.
READ_WRITE
)
device_
pcc
_R
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-
pcc
"
},
datatype
=
numpy
.
bool_
)
device_
recv
_R
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-
recv
"
},
datatype
=
numpy
.
bool_
)
device_
pcc
_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-
pcc
"
},
datatype
=
numpy
.
bool_
,
access
=
AttrWriteType
.
READ_WRITE
)
device_
recv
_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-
recv
"
},
datatype
=
numpy
.
bool_
,
access
=
AttrWriteType
.
READ_WRITE
)
device_sdp_R
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-sdp
"
},
datatype
=
numpy
.
bool_
)
device_sdp_R
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-sdp
"
},
datatype
=
numpy
.
bool_
)
device_sdp_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-sdp
"
},
datatype
=
numpy
.
bool_
,
access
=
AttrWriteType
.
READ_WRITE
)
device_sdp_RW
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-sdp
"
},
datatype
=
numpy
.
bool_
,
access
=
AttrWriteType
.
READ_WRITE
)
device_sst_R
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-sst
"
},
datatype
=
numpy
.
bool_
)
device_sst_R
=
attribute_wrapper
(
comms_annotation
=
{
"
container
"
:
"
device-sst
"
},
datatype
=
numpy
.
bool_
)
...
...
This diff is collapsed.
Click to expand it.
docker-compose/device-docker.yml
+
2
−
2
View file @
e1374df9
...
@@ -25,7 +25,7 @@ services:
...
@@ -25,7 +25,7 @@ services:
networks
:
networks
:
-
control
-
control
ports
:
ports
:
-
"
570
7
:570
7
"
# unique port for this DS
-
"
570
5
:570
5
"
# unique port for this DS
volumes
:
volumes
:
-
${TANGO_LOFAR_CONTAINER_MOUNT}
-
${TANGO_LOFAR_CONTAINER_MOUNT}
-
/var/run/docker.sock:/var/run/docker.sock:rw
# we want to control our sibling containers, NOT do docker-in-docker (dind)
-
/var/run/docker.sock:/var/run/docker.sock:rw
# we want to control our sibling containers, NOT do docker-in-docker (dind)
...
@@ -40,5 +40,5 @@ services:
...
@@ -40,5 +40,5 @@ services:
-
--
-
--
# configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA
# configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA
# can't know about our Docker port forwarding
# can't know about our Docker port forwarding
-
python3 -u ${TANGO_LOFAR_CONTAINER_DIR}/devices/devices/docker_device.py LTS -v -ORBendPoint giop:tcp:0:570
7
-ORBendPointPublish giop:tcp:${HOSTNAME}:570
7
-
python3 -u ${TANGO_LOFAR_CONTAINER_DIR}/devices/devices/docker_device.py LTS -v -ORBendPoint giop:tcp:0:570
5
-ORBendPointPublish giop:tcp:${HOSTNAME}:570
5
restart
:
on-failure
restart
:
on-failure
This diff is collapsed.
Click to expand it.
jupyter-notebooks/Docker_notebook.ipynb
0 → 100644
+
139
−
0
View file @
e1374df9
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "waiting-chance",
"metadata": {},
"outputs": [],
"source": [
"import time"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "moving-alexandria",
"metadata": {},
"outputs": [],
"source": [
"d=DeviceProxy(\"LTS/Docker/1\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "ranking-aluminum",
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Device is now in on state\n"
]
}
],
"source": [
"state = str(d.state())\n",
"\n",
"\n",
"if state == \"OFF\" or state == \"FAULT\":\n",
" d.initialise()\n",
" time.sleep(1)\n",
"state = str(d.state())\n",
"if state == \"STANDBY\":\n",
" d.on()\n",
"state = str(d.state())\n",
"if state == \"ON\":\n",
" print(\"Device is now in on state\")\n",
"else:\n",
" print(\"warning, expected device to be in on state, is: \", state)\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "0caa8146",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"version_R *L2SS-379-docker-device [0c12e90b1c311df82edf9ebd0b0e9a3a530f0a81]\n",
"archiver_maria_db_R True\n",
"archiver_maria_db_RW False\n",
"databaseds_R True\n",
"databaseds_RW False\n",
"device_recv_R False\n",
"device_recv_RW False\n",
"device_sdp_R True\n",
"device_sdp_RW False\n",
"device_sst_R True\n",
"device_sst_RW False\n",
"device_xst_R False\n",
"device_xst_RW False\n",
"device_unb2_R True\n",
"device_unb2_RW False\n",
"device_docker_R True\n",
"dsconfig_R True\n",
"dsconfig_RW False\n",
"elk_R True\n",
"elk_RW False\n",
"grafana_R True\n",
"grafana_RW False\n",
"hdbpp_cm_R True\n",
"hdbpp_cm_RW False\n",
"hdbpp_es_R True\n",
"hdbpp_es_RW False\n",
"itango_R True\n",
"itango_RW False\n",
"jupyter_R True\n",
"jupyter_RW False\n",
"prometheus_R True\n",
"prometheus_RW False\n",
"tangodb_R True\n",
"tangodb_RW False\n",
"tango_prometheus_exporter_R False\n",
"tango_prometheus_exporter_RW False\n",
"tango_rest_R True\n",
"tango_rest_RW False\n",
"State <function __get_command_func.<locals>.f at 0x7f84a8b4fb70>\n",
"Status <function __get_command_func.<locals>.f at 0x7f84a8b4fb70>\n"
]
}
],
"source": [
"attr_names = d.get_attribute_list()\n",
"\n",
"\n",
"for i in attr_names:\n",
" exec(\"value = print(i, d.{})\".format(i))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "StationControl",
"language": "python",
"name": "stationcontrol"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:waiting-chance tags:
```
python
import
time
```
%% Cell type:code id:moving-alexandria tags:
```
python
d
=
DeviceProxy
(
"
LTS/Docker/1
"
)
```
%% Cell type:code id:ranking-aluminum tags:
```
python
state
=
str
(
d
.
state
())
if
state
==
"
OFF
"
or
state
==
"
FAULT
"
:
d
.
initialise
()
time
.
sleep
(
1
)
state
=
str
(
d
.
state
())
if
state
==
"
STANDBY
"
:
d
.
on
()
state
=
str
(
d
.
state
())
if
state
==
"
ON
"
:
print
(
"
Device is now in on state
"
)
else
:
print
(
"
warning, expected device to be in on state, is:
"
,
state
)
```
%% Output
Device is now in on state
%% Cell type:code id:0caa8146 tags:
```
python
attr_names
=
d
.
get_attribute_list
()
for
i
in
attr_names
:
exec
(
"
value = print(i, d.{})
"
.
format
(
i
))
```
%% Output
version_R *L2SS-379-docker-device [0c12e90b1c311df82edf9ebd0b0e9a3a530f0a81]
archiver_maria_db_R True
archiver_maria_db_RW False
databaseds_R True
databaseds_RW False
device_recv_R False
device_recv_RW False
device_sdp_R True
device_sdp_RW False
device_sst_R True
device_sst_RW False
device_xst_R False
device_xst_RW False
device_unb2_R True
device_unb2_RW False
device_docker_R True
dsconfig_R True
dsconfig_RW False
elk_R True
elk_RW False
grafana_R True
grafana_RW False
hdbpp_cm_R True
hdbpp_cm_RW False
hdbpp_es_R True
hdbpp_es_RW False
itango_R True
itango_RW False
jupyter_R True
jupyter_RW False
prometheus_R True
prometheus_RW False
tangodb_R True
tangodb_RW False
tango_prometheus_exporter_R False
tango_prometheus_exporter_RW False
tango_rest_R True
tango_rest_RW False
State <function __get_command_func.<locals>.f at 0x7f84a8b4fb70>
Status <function __get_command_func.<locals>.f at 0x7f84a8b4fb70>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment