Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: CI

# Note: As of Jan 2025, contains several issues which prevent the workflow to be run automatically, namely:
# - The lack of docker-compose in the test environment.
# - The lack of docker compose in the test environment.
# - The lack of access to private repositories (which are submodules of the mTMS repository).
# For those reasons, disable running the workflow automatically.

Expand Down Expand Up @@ -45,10 +45,10 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker images
run: docker-compose -f ${{ env.COMPOSE_FILE }} build --cache-from type=local,src=/tmp/.buildx-cache --cache-to type=local,dest=/tmp/.buildx-cache
run: docker compose -f ${{ env.COMPOSE_FILE }} build --cache-from type=local,src=/tmp/.buildx-cache --cache-to type=local,dest=/tmp/.buildx-cache

- name: Start containers
run: docker-compose -f ${{ env.COMPOSE_FILE }} up -d
run: docker compose -f ${{ env.COMPOSE_FILE }} up -d

- name: Run Cypress tests
uses: cypress-io/github-action@v4
Expand All @@ -70,7 +70,7 @@ jobs:
path: front/cypress/videos

- name: Create Docker compose logs
run: docker-compose -f ${{ env.COMPOSE_FILE }} logs > docker-compose.log
run: docker compose -f ${{ env.COMPOSE_FILE }} logs > docker-compose.log
if: failure()

- name: Upload Docker compose logs
Expand Down
4 changes: 2 additions & 2 deletions ansible/files/mtms.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ LimitMEMLOCK=10000000000

WorkingDirectory={{ repo_root }}

ExecStart=docker-compose up
ExecStop=docker-compose down --remove-orphans
ExecStart=docker compose up
ExecStop=docker compose down --remove-orphans

Restart=always

Expand Down
10 changes: 8 additions & 2 deletions ansible/install-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
docker_repo: "https://download.docker.com/linux/ubuntu"
docker_repo_file: "/etc/apt/sources.list.d/docker.list"
docker_keyring: "/usr/share/keyrings/docker-archive-keyring.gpg"
docker_compose_version: "v2.5.0"
docker_compose_binary: "/usr/local/bin/docker-compose"
docker_compose_version: "v5.0.2"
docker_compose_binary: "/usr/local/lib/docker/cli-plugins/docker-compose"
target_user: "mtms" # Change this to your desired username

tasks:
Expand Down Expand Up @@ -78,6 +78,12 @@
state: present
update_cache: no
tags: install_docker

- name: Ensure docker cli plugin directory exists
file:
path: /usr/local/lib/docker/cli-plugins
state: directory
mode: '0755'

- name: Install Docker Compose binary
get_url:
Expand Down
31 changes: 16 additions & 15 deletions ansible/install-mtms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,22 @@
insertafter: EOF

########################################################################
# 6. Install busylight-for-humans
# 6. Install extra packages
########################################################################
- name: Install extra packages
apt:
name:
- python3-pip
- python3.10-venv # Required for building ROS2 packages for MATLAB
state: present

- name: Install Python packages
pip:
name:
- Cython # Required for building ROS2 packages for neuronavigation

########################################################################
# 7. Install busylight-for-humans
########################################################################
- name: Install busylight-for-humans
pip:
Expand All @@ -272,20 +287,6 @@
- name: Reload udev rules
shell: udevadm control -R

########################################################################
# 7. Install extra packages
########################################################################
- name: Install extra packages
apt:
name:
- python3.10-venv # Required for building ROS2 packages for MATLAB
state: present

- name: Install Python packages
pip:
name:
- Cython # Required for building ROS2 packages for neuronavigation

########################################################################
# 8. Install Sphinx requirements
########################################################################
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-mtms
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ else
docker compose -f $MTMS_ROOT/docker-compose.yml build "$CONTAINER_NAME"
fi

# Check the exit status of the last command (docker-compose build).
# Check the exit status of the last command (docker compose build).
if [ $? -ne 0 ]; then
echo "Build failed. Not restarting the containers."
exit 1
Expand Down
6 changes: 3 additions & 3 deletions scripts/log-mtms
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ RESET_COLOR_CMD="sed \"s/$/${COLOR_RESET}/\" --unbuffered"
FORMAT_CMD="$REMOVE_SUFFIX_CMD | $FORMAT_TIMESTAMP_CMD | $CLEAN_LABELS_CMD | $REMOVE_ROS_TIMESTAMPS_CMD | $PAD_MESSAGE_TYPES_CMD | $HIGHLIGHT_AFTER_THIRD_COLON_CMD | $ADD_DEFAULT_COLOR_CMD | $RESET_COLOR_CMD"


# Use docker-compose logs if a container name is provided, otherwise use journalctl. This is because it is
# Use docker compose logs if a container name is provided, otherwise use journalctl. This is because it is
# difficult to filter the last n lines of logs outputted by a given container using journalctl.
if [ -n "$CONTAINER_NAME" ] && [ "$TIME_FILTERS" = false ]; then
CMD="docker-compose -f $MTMS_ROOT/docker-compose.yml logs --timestamps --tail $TAIL_LINES"
CMD="docker compose -f $MTMS_ROOT/docker compose.yml logs --timestamps --tail $TAIL_LINES"
[ "$FOLLOW" = true ] && CMD="$CMD -f"
CMD="$CMD $CONTAINER_NAME"

# XXX: Use a custom script to convert UTC to local time. This is a workaround for docker-compose not
# XXX: Use a custom script to convert UTC to local time. This is a workaround for docker compose not
# supporting local timezones in logs.
CMD="$CMD | docker-compose-logs-localtime"

Expand Down
2 changes: 1 addition & 1 deletion scripts/start_neuronavigation.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ REM bound to change; for instance, we currently have to run neuronavigation outs
REM Optitrack motion tracking. Once Optitrack works with Docker, the contents of this script could be changed to
REM something like:
REM
REM docker-compose up neuronavigation
REM docker compose up neuronavigation

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64

Expand Down