Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Feature/couger01/dm 18753 #15

Merged
merged 25 commits into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
51ea7fd
Added initial simulator docker files
couger01 Apr 29, 2019
972e887
Make ATMCSSimulator automatically start when containers startup.
tribeiro May 2, 2019
20be6f9
Fixed broken dockerfiles for at_dome_sim, at_dome_trajectory_sim and …
couger01 May 2, 2019
6cb3629
Updates ATAOS Dockerfile to use version 0.2.1 and to start the CSC as…
tribeiro May 3, 2019
4bb8c7b
Docker compose for simulators
jbuffill May 3, 2019
d262e45
Create README.md
jbuffill May 3, 2019
50e43b7
Specify container names in Compose file
jbuffill May 3, 2019
98bf9d0
Added tags to Compose file; updates for setup files
jbuffill May 6, 2019
40a1f32
edited LSST_DDS_DOMAIN variable
jbuffill May 7, 2019
e939fbf
another edit to LSST_DDS_DOMAIN variable
jbuffill May 7, 2019
935aecb
Update README.md
jbuffill May 7, 2019
25df35d
Update README.md
jbuffill May 7, 2019
cc508c0
Update README.md
jbuffill May 7, 2019
6d0d305
Update README.md
aanania May 8, 2019
967af2f
Added simulation-tests dockerfile
couger01 May 8, 2019
f0485c7
Added description of success and failure conditions
couger01 May 8, 2019
dd4baba
Remove Unnecessary steps from simulators
couger01 May 8, 2019
e7cb0dd
Update README.md
jbuffill May 9, 2019
347e70c
Update README.md
jbuffill May 9, 2019
6592323
Update README.md
jbuffill May 9, 2019
758b6f6
Update README.md
jbuffill May 9, 2019
fef346a
Merge branch 'develop' into feature/couger01/dm-18753
tribeiro May 13, 2019
52dbfb5
ataos fix & athexapod simulator
couger01 May 13, 2019
78558e6
Merge pull request #14 from lsst-ts/repo-name-fix
couger01 May 13, 2019
6280b52
Added specific tags to base image for simulators
couger01 May 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
113 changes: 113 additions & 0 deletions Compose/Simulators/README.md
@@ -0,0 +1,113 @@
# TS Simulators
A docker compose file (in yaml format) that invokes the T&S simulators required to run integration scripts.

## Usage

Clone the ts_Dockefiles repository:
```sh
$ git clone -b feature/couger01/dm-18753 https://github.com/lsst-ts/ts_Dockerfiles.git
```

Navigate to the Compose/Simulators directory:
```sh
$ cd Compose/Simulators
```

Invoke the simulators in dettached mode file:
```sh
$ docker-compose up -d
```

Check Containers:
```sh
// Check Names, Image Id & Size
$ docker-compose images

// Check ID
$ docker ps

// Check Status
$ docker-compose ps

// Check Specific Logs
$ docker-compose logs -f <container-name>

// Check All Logs
$ docker-compose logs

// Grab the IP address of a running container
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container-name OR id>

// View the details of docker network
$ docker network inspect <my-bridge-network>

// View container usage of cpu, memory, etc.
$ docker stats $(docker ps --format={{.Names}})
```

Manipulate Containers:
```sh
// Execute a command inside the running container (interactive mode)
$ docker exec -it <container-id> <command>

// Execute a command inside the running container (detached mode)
$ docker exec -d <container-id> <command>

// Stop Specific Container
$ docker-compose stop <container-name>

// Remove Specific Container
$ docker-compose rm <container-name>

// Start Specific Containers
$ docker-compose start <container-name>

// Stop & Remove Specific Container
$ docker-compose down

// Stop All Containers
$ docker-compose stop

// Remove All Container
$ docker-compose rm <container-name>

// Start All Containers
$ docker-compose start <container-name>

// Stop & Remove All Container
$ docker-compose down
```

## Running Integration Tests

```sh
docker-compose run --rm simulation-tests
python ~/scripts/atptgatmcsintegration.py
python ~/scripts/dometrajectorymcs.py
```

If successful, logs will indicate that the script state was complete.
Else, there may be intermittent failures, due to timeouts.
In that case, try running the script again.

```sh
<SCRIPT_STATE:Complete>
```

---

## License

LSST Data Management System Software
Copyright © 2008-2019 AURA/LSST.

This product includes software developed by the
LSST Project (http://www.lsst.org/) with contributions made at LSST partner
institutions. The list of partner institutions is found at:
http://www.lsst.org/lsst/about/contributors .

Use and redistribution of this software is covered by the GNU Public License
Version 3 (GPLv3) or later, as detailed below. A copy of the GPLv3 is also
available at [GNU Licenses](http://www.gnu.org/licenses/).


74 changes: 74 additions & 0 deletions Compose/Simulators/docker-compose.yaml
@@ -0,0 +1,74 @@
version: '3.6'

services:

atmcs-sim:
image: lsstts/at_mcs_sim:3.9-0.4
container_name: atmcs-sim
environment:
- LSST_DDS_DOMAIN=atsimulatorcsc
network_mode: "bridge"

entrypoint: ["/home/saluser/.setup.sh"]

atdome-sim:
image: lsstts/at_dome_sim:3.9-0.5
container_name: atdome-sim
environment:
- LSST_DDS_DOMAIN=atsimulatorcsc
network_mode: "bridge"

entrypoint: ["/home/saluser/.setup.sh"]

atdometrajectory-sim:
image: lsstts/at_dome_trajectory_sim:3.9-0.6a
container_name: atdometrajectory-sim
environment:
- LSST_DDS_DOMAIN=atsimulatorcsc
network_mode: "bridge"

entrypoint: ["/home/saluser/.setup.sh"]

atpneumatics-sim:
image: lsstts/at_pneumatics_sim:3.9-0.2
container_name: atpneumatics-sim
environment:
- LSST_DDS_DOMAIN=atsimulatorcsc
network_mode: "bridge"

entrypoint: ["/home/saluser/.setup.sh"]

ataos-sim:
image: lsstts/ataos:v0.2.1
container_name: ataos-sim
environment:
- LSST_DDS_DOMAIN=atsimulatorcsc
network_mode: "bridge"

entrypoint: ["/home/saluser/.setup.sh"]

atptg-sim:
image: tiagorib/ptkernel:develop
container_name: atptg-sim
environment:
- LSST_DDS_DOMAIN=atsimulatorcsc
network_mode: "bridge"

athexapod-sim:
image: lsstts/ts_athexapod
container_name: athexapod-sim
environment:
- LSST_DDS_DOMAIN=atsimulatorcsc
network_mode: "bridge"

hexapod-sim:
image: couger01/hexapod_simulator
container_name: hexapod-sim
network_mode: "bridge"

simulation-tests:
image: lsstts/simulation_tests:latest
container_name: simulation-tests
environment:
- LSST_DDS_DOMAIN=atsimulatorcsc
network_mode: "bridge"
10 changes: 10 additions & 0 deletions at_dome_sim/Dockerfile
@@ -0,0 +1,10 @@
FROM lsstts/develop-env:20190508

WORKDIR /home/saluser/repos
RUN cd ts_config_attcs && git pull

WORKDIR /home/saluser
COPY setup.sh /home/saluser/.setup.sh

ENTRYPOINT ["/bin/bash", "--"]
CMD ["/home/saluser/.setup.sh"]
26 changes: 26 additions & 0 deletions at_dome_sim/setup.sh
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Source this file when starting the container to set it up

echo "#"
echo "# Loading LSST Stack"
. /opt/lsst/software/stack/loadLSST.bash
setup lsst_distrib
echo "#"
echo "# Loading sal environment"
. repos/ts_sal/setup.env
echo "#"
echo "# Setting up sal, salobj and scriptqueue"

setup ts_xml -t current
setup ts_sal -t current
setup ts_salobj -t current
setup ts_scriptqueue -t current
setup ts_config_attcs -t current

setup ts_ATDome -t $USER

cd /home/saluser/repos/ts_ATDome/bin/

echo "# Starting ATDome Simulator CSC"
python ./run_atdome.py -s
10 changes: 10 additions & 0 deletions at_dome_trajectory_sim/Dockerfile
@@ -0,0 +1,10 @@
FROM lsstts/develop-env:20190508

USER saluser
WORKDIR /home/saluser/repos

WORKDIR /home/saluser
COPY setup.sh /home/saluser/.setup.sh

ENTRYPOINT ["/bin/bash", "--"]
CMD ["/home/saluser/.setup.sh"]
26 changes: 26 additions & 0 deletions at_dome_trajectory_sim/setup.sh
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Source this file when starting the container to set it up

echo "#"
echo "# Loading LSST Stack"
. /opt/lsst/software/stack/loadLSST.bash
setup lsst_distrib
echo "#"
echo "# Loading sal environment"
. repos/ts_sal/setup.env
echo "#"
echo "# Setting up sal, salobj and scriptqueue"

setup ts_xml -t current
setup ts_sal -t current
setup ts_salobj -t current
setup ts_scriptqueue -t current
setup ts_config_attcs -t current

setup ts_ATDomeTrajectory -t $USER

cd /home/saluser/repos/ts_ATDomeTrajectory/bin/

echo "# Starting ATDomeTrajectory Simulator CSC"
python ./run_atdometrajectory.py
8 changes: 8 additions & 0 deletions at_mcs_sim/Dockerfile
@@ -0,0 +1,8 @@
FROM lsstts/develop-env:20190508
WORKDIR /home/saluser/repos
WORKDIR /home/saluser

COPY setup.sh /home/saluser/.setup.sh

ENTRYPOINT ["/bin/bash", "--"]
CMD ["/home/saluser/.setup.sh"]
23 changes: 23 additions & 0 deletions at_mcs_sim/setup.sh
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# Source this file when starting the container to set it up

echo "#"
echo "# Loading LSST Stack"
. /opt/lsst/software/stack/loadLSST.bash
setup lsst_distrib
echo "#"
echo "# Loading sal environment"
. repos/ts_sal/setup.env
echo "#"
echo "# Setting up sal, salobj and ATMCSSimulator"

setup ts_xml -t current
setup ts_sal -t current
setup ts_salobj -t current

setup ts_ATMCSSimulator -t $USER

echo "# Starting ATMCSSimulator CSC"

/home/saluser/repos/ts_ATMCSSimulator/bin/run_atmcs_simulator.py
10 changes: 10 additions & 0 deletions at_pneumatics_sim/Dockerfile
@@ -0,0 +1,10 @@
FROM lsstts/develop-env:20190508

WORKDIR /home/saluser/repos
RUN git clone https://github.com/lsst-ts/ts_ATPneumaticsSimulator.git && cd ts_ATPneumaticsSimulator && git checkout v0.2.0 && source /opt/lsst/software/stack/loadLSST.bash && source /home/saluser/repos/ts_sal/setup.env && setup sconsUtils -t current && setup ts_sal -t current && setup ts_salobj -t current && make_salpy_libs.py ATPneumatics && eups declare -r . ts_ATPneumaticsSimulator -t $USER && setup ts_ATPneumaticsSimulator -t $USER && scons

WORKDIR /home/saluser
COPY setup.sh /home/saluser/.setup.sh

ENTRYPOINT ["/bin/bash", "--"]
CMD ["/home/saluser/.setup.sh"]
25 changes: 25 additions & 0 deletions at_pneumatics_sim/setup.sh
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# Source this file when starting the container to set it up

echo "#"
echo "# Loading LSST Stack"
. /opt/lsst/software/stack/loadLSST.bash
setup lsst_distrib
echo "#"
echo "# Loading sal environment"
. repos/ts_sal/setup.env
echo "#"
echo "# Setting up sal, salobj and scriptqueue"

setup ts_xml -t current
setup ts_sal -t current
setup ts_salobj -t current
setup ts_scriptqueue -t current

setup ts_ATPneumaticsSimulator -t $USER

cd /home/saluser/repos/ts_ATPneumaticsSimulator/bin/

echo "# Starting ATPneumatics Simulator CSC"
python ./run_atpneumatics_simulator.py
21 changes: 8 additions & 13 deletions ataos/Dockerfile
@@ -1,4 +1,4 @@
FROM lsst/queue:latest
FROM lsstts/develop-env:20190418

LABEL maintainer Tiago Ribeiro <tribeiro@lsst.org>

Expand All @@ -7,26 +7,21 @@ USER saluser
WORKDIR /home/saluser/repos
RUN git clone https://github.com/lsst-ts/ts_ataos.git

WORKDIR /home/saluser/repos/ts_ataos
RUN git fetch && git checkout "tags/v0.2.1" -b "v0.2.1"
WORKDIR /home/saluser

WORKDIR /home/saluser/repos/ts_salobj
RUN source /opt/lsst/software/stack/loadLSST.bash && setup lsst_distrib && \
source /home/saluser/repos/ts_sal/setup.env && \
setup ts_sal -t $USER && \
make_salpy_libs.py ATAOS ATPtg ATPneumatics ATHexapod ATCamera

#USER root
#RUN yum install -y "http://10.0.100.1/lsstrepo/ATAOS-3.9.0-1el7.centos.x86_64.rpm"

USER saluser

setup ts_sal -t current && \
make_salpy_libs.py ATAOS ATMCS ATPneumatics ATHexapod ATCamera ATPtg

WORKDIR /home/saluser/repos/ts_ataos
RUN git fetch && git checkout "tags/v0.2" -b "v0.2"
RUN source /opt/lsst/software/stack/loadLSST.bash && setup lsst_distrib && \
source /home/saluser/repos/ts_sal/setup.env && \
setup ts_salobj -t $USER && \
eups declare -r . ts_ataos -t $USER && setup ts_ataos -t $USER && \
setup ts_salobj -t current && \
setup ts_sal -t current && \
eups declare -r . ts_ataos -t current && setup ts_ataos -t current && \
scons

WORKDIR /home/saluser/
Expand Down
10 changes: 7 additions & 3 deletions ataos/setup.sh
100644 → 100755
Expand Up @@ -10,8 +10,12 @@ echo "#"
echo "# Loading sal environment"
. repos/ts_sal/setup.env
echo "#"
echo "# Setting up sal, salobj and scriptqueue"
echo "# Setting up sal, salobj and ataos"

setup ts_ataos -t $USER
setup ts_salobj -t current
setup ts_ataos -t current

/bin/bash --rcfile /home/saluser/.bashrc
cd /home/saluser/repos/ts_ataos/bin/
echo "# Starting ATAOS CSC"

python ./ataos_csc.py
5 changes: 5 additions & 0 deletions simulation_tests/Dockerfile
@@ -0,0 +1,5 @@
FROM lsstts/develop-env:20190508
WORKDIR /home/saluser/repos
COPY dometrajectorymcs.py /home/saluser/scripts/
COPY atptgatmcsintegration.py /home/saluser/scripts/
WORKDIR /home/saluser