Skip to content

Commit

Permalink
Small fixes (#746)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh authored Aug 20, 2024
2 parents e2d90df + ba823d6 commit 23d5650
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 27 deletions.
53 changes: 31 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Package manager that can be used to install (ROS) dependencies

### Ubuntu 20.04/22.04/24.04

Standard tue-env installation with targets from [tue-env-targets](https://github.com/tue-robotics/tue-env-targets)
Standard `tue-env` installation with targets from [tue-env-targets](https://github.com/tue-robotics/tue-env-targets)

#### Installing the tue-env
#### Installing the `tue-env`

1. Bootstrap the package manager

Expand Down Expand Up @@ -50,7 +50,8 @@ tue-env [ENVIRONMENT] remove-venv [--purge]

#### Custom targets repository

A customized targets repository can be setup with this package manager (currently only one git repository is supported). If `tue-env` is already installed, to set up the targets repository run:
A customized targets repository can be setup with this package manager (currently only one git repository is supported).
If `tue-env` is already installed, to set up the targets' repository run:

```bash
tue-env init ENVIRONMENT DIRECTORY --targets-url=<targets_repo_git_url>
Expand All @@ -66,10 +67,11 @@ tue-env init-targets [ENVIRONMENT] <targets_repo_git_url> # The environment arg
else first setup `tue-env` by manually following the procedure in the bootstrap
script.

You can also set the targets repository in the initial setup by providing it as an argument of the bootstrap script.
You can also set the targets' repository in the initial setup by providing it as an argument of the bootstrap script.
Add `--targets-repo=<targets_repo_git_url>` as argument, this can be any type of url supported by git.

When a targets repository is already initialized. It can be switched by running the same `init-targets` command.
When a targets' repository is already initialized.
It can be switched by running the same `init-targets` command.
This will rename the old targets folder with a timestamp and clone the new targets repo in place.

#### Custom repository list
Expand All @@ -82,7 +84,7 @@ tue-env config [environment] set TUE_REPOS_DO_DIRS PATH1:PATH2:PATH3
tue-env config [environment] set TUE_REPOS_DO_DIRS '${TUE_REPOS_DIR}'/some/path:'${HOME}'some/other/path
```

#### Add SSH key to GitHub to gain access to this repository
#### Add an SSH key to GitHub to gain access to this repository

Add the public part of your ssh-key (`cat ~/.ssh/<KEY_NAME>.pub`, where `<KEY_NAME>` is the name of your ssh-key) to GitHub > Settings > SSH and GPG keys and `New SSH key`

Expand Down Expand Up @@ -112,10 +114,9 @@ tue-get install tue-dev # For TU/e robots(Amigo & Sergio)
tue-get install hero-dev # For Hero
```

**Note:** Any ROS package which has a source installation must be built. In the
current implementation of `tue-get` this doesn't happen automatically. However,
we provide an alias to `catkin build`/`colcon build` as `tue-make` which would build the
`tue-env` workspace.
**Note:** Any ROS package, which has a source installation must be built.
In the current implementation of `tue-get` this doesn't happen automatically.
However, we provide an alias to `catkin build`/`colcon build` as `tue-make` which would build the `tue-env` workspace.

Upon executing the installation instructions mentioned in the previous section, `~/.tue/setup.bash` is automatically added in `.bashrc`. Sourcing `.bashrc` would make `tue-env` available to the bash session.

Expand All @@ -127,22 +128,24 @@ A list of ready to use docker images generated by this repository can be found [

## Different environments

To isolate builds you can use different environments. Each environment will contain a different copy of the repositories used. These environments can also be useful to separate ROS1 from ROS2 installs.
To isolate builds, you can use different environments.
Each environment will contain a different copy of the repositories used.
These environments can also be useful to separate ROS1 from ROS2 installations.

To initialise a new environment (for example the Pico robot):
To initialize a new environment (for example, the Pico robot):

```bash
mkdir ~/ros/pico && tue-env init pico ~/ros/pico
```

Now to switch to this environment and install a package you can:
Now to switch to this environment and install a package, you can:

```bash
tue-env switch pico
tue-get install ros-pico
```

Or use `tue-env set-default` if you want this to be de default.
Or use `tue-env set-default` if you want this to be the default.

## Guidelines on creating a new target

Expand All @@ -166,7 +169,7 @@ A target can consist of the following files:
Installation happens in the above order. First `install.yaml` is parsed and the
instructions in it are executed. Then `install.bash` is executed. This must have
commands/instructions that cannot be specified in the YAML file. Lastly, the
`setup` file is sourced in the bash environment by `setup.bash` of tue-env.
`setup` file is sourced in the bash environment by `setup.bash` of `tue-env`.

Any target dependencies that can be specified in `install.yaml` as other targets
or installable packages must be specified there. They should not be moved to
Expand All @@ -175,7 +178,7 @@ or installable packages must be specified there. They should not be moved to
Some (parts of) targets are not used for testing, but do take a long time
to install. Therefore, it is preferable to skip these (parts of) targets during CI.
To ignore an entire target in CI, add a `.ci_ignore` file to the target. To either
ignore the bash script or the yaml file add respectively `.ci_ignore_bash` or `.ci_ignore_yaml`.
ignore the bash script or the YAML file add respectively `.ci_ignore_bash` or `.ci_ignore_yaml`.

### Naming conventions

Expand Down Expand Up @@ -294,7 +297,8 @@ Depending on Ubuntu distribution:
name: [null/<Name of the candidate>]
```

Both Ubuntu distribution specific as default can be 'null'. Preferred usage is default for current and feature distributions and exceptions for old distributions.
Both the Ubuntu distribution specific as default can be 'null'.
Preferred usage is default for current and feature distributions and exceptions for old distributions.

#### (Target / System / PIP / PIP3 / PPA / Snap / Gem)-now

Expand All @@ -308,8 +312,13 @@ The default installation method for targets of type `system`, `pip(3)`, `ppa`, `
name: <Name of the candidate>
```

`target-now` will install a target directly recursively. So also all its dependencies will be installed directly, by converting them from `XX` to `XX-now`. Except `ROS` and `DPKG` are excluded. ROS dependencies are excluded, because ROS packages should only be used at runtime, because it requires either a compilation and/or resourcing the workspace.
It is preferred to include these `-now` dependencies in `install.yaml`. Only use the corresponding bash function in `install.bash` if no other solution is possible.
`target-now` will install a target directly recursively.
So also all its dependencies will be installed directly, by converting them from `XX` to `XX-now`.
Except `ROS` and `DPKG` are excluded.
ROS dependencies are excluded because ROS packages should only be used at runtime,
because it requires either a compilation and/or resourcing the workspace.
It is preferred to include these `-now` dependencies in `install.yaml`.
Only use the corresponding bash function in `install.bash` if no other solution is possible.

#### GIT

Expand Down Expand Up @@ -363,10 +372,10 @@ generally used methods of installing packages:
| `tue-install-get-releases` | To get a released asset from a github repository and place it in the requested directory |

The input arguments for each of the above-mentioned commands can be found by
simply executing the command in a bash session (provided tue-env is correctly
simply executing the command in a bash session (provided `tue-env` is correctly
installed).

A general remark about the order of preference of package repositories:
A general remark about the preferred order of the package repositories:

system > ppa > pip = pip3 > snap > gem > git > dpkg

Expand All @@ -392,4 +401,4 @@ The following logging functions can be used:

## Bonus features

If the `BTRFS_SNAPSHOT` variable is set, a snapshot is made upon every install, update and remove call of `tue-get`.
If the `BTRFS_SNAPSHOT` variable is set, a snapshot is made upon every installation, update and remove call of `tue-get`.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.25.11
1.25.12
3 changes: 1 addition & 2 deletions installer/parse_install_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ def get_distro_item(
else:
raise ValueError(f"Unknown ROS install type: '{source_type}'")
elif install_type == "ros-remove-source":
command_list = ["tue-install-ros-remove-source"]
command_list.append(type_git(source, ["eol"]))
command_list = ["tue-install-ros-remove-source", type_git(source, ["eol"])]

if "eol" not in source:
raise KeyError("EOL is a mandatory key for install type 'ros-remove-source'")
Expand Down
4 changes: 2 additions & 2 deletions installer/tue-install-impl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ function tue-install-ros-remove-source
if [[ -n ${repos_dir} ]] && [[ -z ${links} ]]
then
tue-install-debug "No symlinks left to the repo or a sub-folder of it, deleting it"
tue-install-pipe rm -rf ${repos_dir}
tue-install-pipe rm -rf "${repos_dir}"
else
tue-install-debug "Keeping the repo as there still exist symlinks to it in the workspace"
fi
Expand All @@ -1649,7 +1649,7 @@ function tue-install-ros-remove-source
# Warn about the eol of removing the source
local today_date eol_date
today_date=$(date +%s)
eol_date=$(date -d ${eol} +%s)
eol_date=$(date -d "${eol}" +%s)

if [[ ${today_date} -ge ${eol_date} ]]
then
Expand Down

0 comments on commit 23d5650

Please sign in to comment.