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

Commit

Permalink
Merge pull request #15 from lsst-ts/feature/couger01/dm-18753
Browse files Browse the repository at this point in the history
Feature/couger01/dm 18753
  • Loading branch information
couger01 committed May 13, 2019
2 parents 8334ab8 + 6280b52 commit a9f5913
Show file tree
Hide file tree
Showing 15 changed files with 392 additions and 16 deletions.
113 changes: 113 additions & 0 deletions Compose/Simulators/README.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a9f5913

Please sign in to comment.