-
Notifications
You must be signed in to change notification settings - Fork 20
Fix/docs #734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix/docs #734
Changes from all commits
b62509e
3072bb5
d6b44bd
99bb2d8
6a4e2f2
f4511b1
af96130
f05547e
12fd69c
b41de22
6d917dd
b1643b0
4e91aac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,8 +118,8 @@ def _parse_arguments(self) -> argparse.Namespace: | |
| parser.add_argument( | ||
| "-w", | ||
| "--workspace", | ||
| default=".", | ||
| help="Path to the workspace directory to deploy to. Defaults to the current directory.", | ||
| default="/home/bitbots/bitbots_main", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where do we want to put the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would expect bitbots_main to live in the home dir
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oki! |
||
| help="Path to the workspace directory to deploy to. Defaults to '/home/bitbots/bitbots_main'.", | ||
| ) | ||
| parser.add_argument("--skip-local-repo-check", action="store_true", help="Skip the local repository check.") | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ set -eEo pipefail | |
| # Go to the download button and copy the link address. | ||
| PYLON_DOWNLOAD_URL="https://data.bit-bots.de/pylon_7_4_0_14900_linux_x86_64_debs.tar.gz.gpg" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pylon |
||
| PYLON_VERSION="7.4.0" | ||
| REQUIRED_UBUNTU_VERSION="24.04" | ||
|
|
||
| # 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 on the basler download page (https://www.baslerweb.com/en/downloads/software-downloads/) and agree with it." | ||
|
|
@@ -26,6 +27,20 @@ else | |
| SHOW_PROGRESS="--show-progress" | ||
| fi | ||
|
|
||
| check_os_is_required_ubuntu_version () { | ||
| # Check if the OS is ubuntu | ||
| if [[ "$(lsb_release -is)" != "Ubuntu" ]]; then | ||
| echo "This driver package only supports Ubuntu. Please install Ubuntu $REQUIRED_UBUNTU_VERSION and try again." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if that is true the dependencies of pylon are literally only: which most likely is available on debian as well |
||
| exit 1 | ||
| fi | ||
|
|
||
| # Check if the ubuntu version is the required one | ||
| if [[ "$(lsb_release -rs)" != "$REQUIRED_UBUNTU_VERSION" ]]; then | ||
| echo "This driver package only supports Ubuntu $REQUIRED_UBUNTU_VERSION. Please install Ubuntu $REQUIRED_UBUNTU_VERSION and try again." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is most definitely not true. |
||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| check_internet_connection () { | ||
| # Check if we have an internet connection, except in the ci as azure does not support ping by design | ||
| if [[ $1 != "--ci" ]] && ! ping -q -c 1 -W 1 google.com > /dev/null; then | ||
|
|
@@ -39,6 +54,8 @@ if apt list pylon --installed | grep -q $PYLON_VERSION; then | |
| echo "Pylon driver $PYLON_VERSION is already installed." | ||
| else | ||
| echo "Pylon driver $PYLON_VERSION is not installed. Installing..." | ||
| # Check if the OS is the required ubuntu version | ||
| check_os_is_required_ubuntu_version | ||
| # Check if we have an internet connection | ||
| check_internet_connection "$1" | ||
| # Check if the url exist | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,8 @@ set -eEuo pipefail | |
| # static/global variables | ||
| DIR="$(dirname "$(readlink -f "$0")")" | ||
| BRANCH="${1:-main}" | ||
| REPO_URL="git@github.com:bit-bots/bitbots_main.git" | ||
| REPO_URL_SSH="git@github.com:bit-bots/bitbots_main.git" | ||
| REPO_URL_HTTPS="https://github.com/bit-bots/bitbots_main.git" | ||
|
|
||
| ask_question() { | ||
| while true; do | ||
|
|
@@ -26,16 +27,21 @@ setup_repo() { | |
| echo "Setting up bitbots_main repository..." | ||
|
|
||
| if (( in_repo )); then | ||
| cd "$meta_dir" || exit | ||
| cd "$main_dir" || exit | ||
| git checkout "$BRANCH" | ||
| else | ||
| if [[ ! -d "$PWD/bitbots_main" ]]; then | ||
| git clone "$REPO_URL" | ||
| echo "Cloning repository bitbots_main..." | ||
| # Try to clone via SSH first, fall back to HTTPS if that fails | ||
| if ! git clone "$REPO_URL_SSH"; then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if I like this implicit fallback. It might cause problems later on if people try to push via ssh.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am also not 100% happy with that. Who is the target user of this script?
Compromise: If SSH clone fails, warn about missing keys and link to guide how to set them up. Then ask user, if they intend to fix this or continue with HTTPS.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like that |
||
| echo "SSH clone failed, trying HTTPS..." | ||
| git clone "$REPO_URL_HTTPS" | ||
| fi | ||
| git checkout "$BRANCH" | ||
| fi | ||
|
|
||
| meta_dir="$(realpath "$PWD/bitbots_main")" | ||
| cd "$meta_dir" || exit | ||
| main_dir="$(realpath "$PWD/bitbots_main")" | ||
| cd "$main_dir" || exit | ||
| fi | ||
|
|
||
| echo "Installing dependencies..." | ||
|
|
@@ -45,14 +51,21 @@ setup_repo() { | |
| setup_host() { | ||
| echo "Setting up system dependencies not covered by pixi. This may require sudo rights. For non-Ubuntu systems, please install the required packages manually." | ||
| if (( has_sudo )); then | ||
| $meta_dir/scripts/make_basler.sh | ||
| $main_dir/scripts/make_basler.sh | ||
| basler_installed=1 | ||
| fi | ||
| } | ||
|
|
||
| build_repository() { | ||
| echo "Running full colcon build..." | ||
| echo "Running full build..." | ||
| set +u | ||
|
|
||
| # Append "--packages-skip bitbots_basler_camera" to the build command if setup_host was skipped or failed | ||
| if (( basler_installed )); then | ||
| $HOME/.pixi/bin/pixi run build | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will not work with a global pixi install or other potential installation locations (for whatever reason). Also Indentation |
||
| else | ||
| $HOME/.pixi/bin/pixi run build --packages-skip bitbots_basler_camera | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
| fi | ||
| } | ||
|
|
||
| has_sudo=0 | ||
|
|
@@ -63,13 +76,15 @@ if (( ! has_sudo )); then | |
| echo "Because, you don't have sudo rights, no host dependencies will be installed." | ||
jaagut marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| fi | ||
|
|
||
| basler_installed=0 | ||
|
|
||
| in_repo=1 | ||
| meta_dir="$(realpath "$DIR/../")" | ||
| if [[ ! -d "$meta_dir/.git" ]]; then | ||
| main_dir="$(realpath "$DIR/../")" | ||
| if [[ ! -d "$main_dir/.git" ]]; then | ||
| in_repo=0 | ||
| fi | ||
|
|
||
| setup_ros | ||
| setup_pixi | ||
| setup_repo | ||
| setup_host | ||
| build_repository | ||
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.