From 1c567e157911a461cb4dfa2cff2b9252fd3284c4 Mon Sep 17 00:00:00 2001 From: Jan Gutsche Date: Fri, 26 Jan 2024 19:02:25 +0100 Subject: [PATCH] Make_basler: make progress optional and fix flag --- .github/workflows/build.yml | 2 +- scripts/deploy/tasks/install.py | 12 ++++++++++-- scripts/make_basler.sh | 10 ++++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 298a97411..9abf5f019 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: run: git config --global --add safe.directory /__w/bitbots_main/bitbots_main - name: Pull source code for libraries and install dependencies - run: make install HTTPS=true ARGS="-ci" + run: make install HTTPS=true ARGS="--ci" - name: Set up colcon workspace run: | diff --git a/scripts/deploy/tasks/install.py b/scripts/deploy/tasks/install.py index 1e2a64bbb..7e026b6d6 100644 --- a/scripts/deploy/tasks/install.py +++ b/scripts/deploy/tasks/install.py @@ -27,14 +27,22 @@ def _run(self, connections: Group) -> GroupResult: :return: The results of the task. """ internet_available_results = self._internet_available_on_target(connections) - if not internet_available_results.succeeded: return internet_available_results # Some hosts have an internet connection, make updates and installs apt_upgrade_results = self._apt_upgrade(get_connections_from_succeeded(internet_available_results)) + if not apt_upgrade_results.succeeded: + return apt_upgrade_results + basler_install_results = self._install_basler(get_connections_from_succeeded(apt_upgrade_results)) + if not basler_install_results.succeeded: + return basler_install_results + rosdep_results = self._install_rosdeps(get_connections_from_succeeded(basler_install_results)) + if not rosdep_results.succeeded: + return rosdep_results + pip_upgrade_results = self._pip_upgrade(get_connections_from_succeeded(rosdep_results)) return pip_upgrade_results @@ -100,7 +108,7 @@ def _install_basler(self, connections: Group) -> GroupResult: """ print_debug("Installing basler drivers") - cmd = f"{self._remote_workspace}/src/scripts/make_basler.sh -ci" + cmd = f"{self._remote_workspace}/src/scripts/make_basler.sh --ci" print_debug(f"Calling {cmd}") try: install_results = connections.sudo(cmd, hide=hide_output(), password=self._sudo_password) diff --git a/scripts/make_basler.sh b/scripts/make_basler.sh index ea8e46c32..c595a225d 100755 --- a/scripts/make_basler.sh +++ b/scripts/make_basler.sh @@ -14,9 +14,10 @@ BLAZE_VERSION="1.5.0" # Check let the user confirm that they read the license agreement on the basler website and agree with it. echo "You need to confirm that you read the license agreements for pylon $PYLON_VERSION and the blaze supplementary package $BLAZE_VERSION on the basler download page (https://www.baslerweb.com/en/downloads/software-downloads/) and agree with it." -# Check -ci flag for automatic confirmation in the ci -if [[ $1 == "-ci" ]]; then +# Check --ci flag for automatic confirmation in the ci +if [[ $1 == "--ci" ]]; then echo "Running in a CI environment, continuing..." + SHOW_PROGRESS="" else # Ask the user if they want to continue and break if they don't read -p "Do you want to continue? [y/N] " -n 1 -r @@ -25,6 +26,7 @@ else echo "Aborting..." exit 1 fi + SHOW_PROGRESS="--show-progress" fi # Create function to check if we have an internet connection @@ -49,7 +51,7 @@ else exit 1 fi # Download the pylon driver to temp folder - wget --no-verbose --show-progress $PYLON_DOWNLOAD_URL -O /tmp/pylon_${PYLON_VERSION}.tar.gz + wget --no-verbose $SHOW_PROGRESS $PYLON_DOWNLOAD_URL -O /tmp/pylon_${PYLON_VERSION}.tar.gz # Extract the pylon driver tar -xzf /tmp/pylon_${PYLON_VERSION}.tar.gz -C /tmp # Install the pylon driver @@ -69,7 +71,7 @@ else exit 1 fi # Download the blaze supplementary package to temp folder - wget --no-verbose --show-progress $BLAZE_DOWNLOAD_URL -O /tmp/pylon-blaze-supplementary-package_${BLAZE_VERSION}.deb + wget --no-verbose $SHOW_PROGRESS $BLAZE_DOWNLOAD_URL -O /tmp/pylon-blaze-supplementary-package_${BLAZE_VERSION}.deb # Install the blaze supplementary package sudo apt install /tmp/pylon-blaze-supplementary-package_${BLAZE_VERSION}*.deb -y fi