Skip to content

Commit e3b4bb7

Browse files
authored
Update README.md add DEVELOPMENT.md (#58)
1 parent bad86d3 commit e3b4bb7

File tree

2 files changed

+83
-60
lines changed

2 files changed

+83
-60
lines changed

DEVELOPMENT.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Development
2+
3+
To setup my workspace I generally pull down:
4+
5+
* `colcon-core` (https://github.com/colcon/colcon-core.git)
6+
* `colcon-ros` (https://github.com/colcon/colcon-ros.git)
7+
* `colcon-bundle` (https://github.com/colcon/colcon-bundle)
8+
* `colcon-ros-bundle` (https://github.com/colcon/colcon-ros-bundle)
9+
10+
There are many more colcon packages, it can be useful to pull them down to look at how different extensions and other
11+
functionality is implemented.
12+
13+
## Developing on OSX
14+
15+
I run these packages inside of docker containers since I'm running OSX and this only supports Ubuntu currently.
16+
17+
Build Container: `docker run -it -v $(pwd):/workspace ros:kinetic-ros-base /bin/bash`
18+
19+
Run Container: `docker run -it -v $(pwd):/workspace ubuntu:xenial /bin/bash`
20+
21+
I generally `cd` into my workspace which has the package folders and then start the container. This docker command
22+
mounts `pwd` to`/workspace`. Once in the container I `cd /workspace` and then execute:
23+
24+
1. `apt-get update`
25+
1. `apt-get install -y python3-pip python3-apt`
26+
1. `pip3 install --upgrade pip`
27+
1. `export PATH=/usr/local/bin/pip3:$PATH`
28+
1. `/usr/local/bin/pip3 install --editable ./colcon-bundle`
29+
1. `/usr/local/bin/pip3 install --editable ./colcon-ros-bundle`
30+
31+
Inside of a ROS1 workspace execute the following:
32+
33+
1. `rosdep install --from-paths src --ignore-src -r -y`
34+
1. `colcon build`
35+
1. `colcon bundle`
36+
37+
## Testing
38+
39+
To run tests execute `pytest` in the root directory. Install dependencies using `pip3 install -r requirements_devel.txt`.
40+
You might need to `apt-get install enchant` to install the spellchecker.
41+
42+
To view stdout from a test while running `pytest` use the `-s` flag.
43+
44+
See `.travis.yml` for more information about what runs in the full test suite.

README.md

+39-60
Original file line numberDiff line numberDiff line change
@@ -4,90 +4,69 @@ This code is in active development and **should not** be considered stable.
44

55
This package is a plugin to [colcon-core](https://github.com/colcon/colcon-core.git). It provides functionality to bundle a built
66
workspace. A bundle is a portable environment which can be moved to a different linux system and executed
7-
as if the contents of the bundle was installed locally.
7+
as if the contents of the bundle were installed locally.
88

99
Currently, ROS Kinetic is supported by installing the `colcon-ros-bundle` package.
1010

11-
# Usage
11+
# Installation
1212

13-
To use `colcon-bundle` after building your workspace execute:
13+
In order to use `colcon-bundle` execute the following (if you do not have root privileges you will need to run the `pip3` commands with `sudo`):
1414

15-
`colcon bundle`
16-
17-
This will parse your dependencies, download apt and pip dependencies, install the dependencies into the bundle, and
18-
then install your built workspace into the bundle. The final output is located at `bundle/output.tar.gz`
19-
20-
21-
## Bundle Execution
22-
23-
The bundle file specification is located [here](BUNDLE_FORMAT.md). In order to execute inside the bundle context
24-
follow the following steps:
25-
26-
1. Extract the main archive.
27-
1. Extract bundle.tar into your desired directory.
28-
1. Set the environment variable BUNDLE_CURRENT_PREFIX to the location of your extracted bundle.tar.
29-
1. Source `$BUNDLE_CURRENT_PREFIX/setup.sh`.
30-
1. The bundle is now activated in your shell's environment. You can execute commands contained within the bundle.
15+
```
16+
sudo apt-get install python3-apt python3-pip
17+
sudo pip3 install -U setuptools pip
18+
sudo pip3 install colcon-ros-bundle
19+
```
3120

21+
# Building a bundle with `colcon bundle`
3222

33-
# Development
23+
To build your ROS workspace into a bundle execute:
3424

35-
To setup my workspace I generally pull down:
36-
37-
* `colcon-core` (https://github.com/colcon/colcon-core.git)
38-
* `colcon-ros` (https://github.com/colcon/colcon-ros.git)
39-
* `colcon-bundle` (https://github.com/colcon/colcon-bundle)
40-
* `colcon-ros-bundle` (https://github.com/colcon/colcon-ros-bundle)
41-
42-
There are many more colcon packages, it can be useful to pull them down to look at how different extensions and other
43-
functionality is implemented.
25+
`colcon bundle`
4426

45-
## Testing
27+
This will parse your dependencies, download apt and pip dependencies, install the dependencies into the bundle, and
28+
then install your built workspace into the bundle. The final output is located at `bundle/output.tar`
4629

47-
To run tests execute `pytest` in the root directory. Install dependencies using `pip3 install -r requirements_devel.txt`.
48-
You might need to `apt-get install enchant` to install the spellchecker.
30+
## In Docker
4931

50-
To view stdout from a test while running `pytest` use the `-s` flag.
32+
The simplest way to get up and running without affecting your local development environment is to use Docker.
5133

52-
## Running on OSX
34+
The contents of an example Dockerfile are below. Create the Dockerfile in your workspace and then execute:
5335

54-
I run these packages inside of docker containers since I'm running OSX and this only supports Ubuntu currently.
36+
`docker build -t colcon-docker .`
5537

56-
Build Container: `docker run -it -v $(pwd):/workspace ros:kinetic-ros-base /bin/bash`
38+
Once your docker image is built you can then run it with your local workspace mounted into the container by executing `docker run -it -v <PATH_TO_WORKSPACE>:/workspace colcon-docker bash`. Once inside the docker container `/workspace` will be bound to your local directory.
5739

58-
Run Container: `docker run -it -v $(pwd):/workspace ubuntu:xenial /bin/bash`
40+
### Dockerfile
5941

60-
I generally `cd` into my workspace which has the package folders and then start the container. This docker command
61-
mounts `pwd` to`/workspace`. Once in the container I `cd /workspace` and then execute:
42+
```
43+
FROM ros:kinetic
6244
63-
1. `apt-get update`
64-
1. `apt-get install -y python3-pip python3-apt`
65-
1. `pip3 install --upgrade pip`
66-
1. `export PATH=/usr/local/bin/pip3:$PATH`
67-
1. `/usr/local/bin/pip3 install --editable ./colcon-bundle`
68-
1. `/usr/local/bin/pip3 install --editable ./colcon-ros-bundle`
45+
RUN apt-get update && apt-get install -y python3-pip python3-apt
6946
70-
Inside of a ROS1 workspace execute the following:
47+
RUN pip3 install -U setuptools pip
48+
RUN pip3 install colcon-ros-bundle
49+
```
7150

72-
1. `rosdep install --from-paths src --ignore-src -r -y`
73-
1. `colcon build`
74-
1. `colcon bundle`
51+
# Bundle Usage
7552

76-
## Running the bundle
53+
When `colcon bundle` is executed in a ROS workspace it will create `bundle/output.tar` that follows the specification located [here](BUNDLE_FORMAT.md).
7754

78-
To run the bundle you should start up a Xenial docker container with the bundle mounted.
79-
Set BUNDLE_CURRENT_PREFIX equal to the location of your extracted bundle
80-
folder. Then source `setup.sh` located at the top level of the bundle.
55+
A bundle is an entire application. In order to execute inside the bundle context follow the following steps:
8156

82-
## Packaging
57+
1. Extract the main archive.
58+
1. Extract `metadata.tar.gz` and look at `overlays.json`.
59+
1. Extract each overlay listed in `overlays.json`.
60+
1. In order execute `BUNDLE_CURRENT_PREFIX=<path to extracted overlay> source <path to extracted overlay>/setup.sh`
61+
1. The bundle is now activated in your shell's environment.
8362

84-
To create a tarball of this python package run: `python setup.py sdist`
63+
# Package Blacklist
8564

86-
This will create a tarball in the `dist/` directory.
65+
When we create the bundle we choose not to include certain packages that are included by default in most
66+
Linux distributions. To create this blacklist for Ubuntu `apt list --installed | sed 's/^\(.*\)\/.*$/\1/'` was run on a base ubuntu:xenial container.
8767

88-
### Package Blacklist
68+
You can override this blacklist by using the `--apt-package-blacklist` argument.
8969

90-
When we create the bundle we choose not to include certain packages that are included by default in most
91-
Linuxd distributions. To create this blacklist for Ubuntu I ran the following on a ubuntu:xenial container.
70+
# `colcon-bundle` Development
9271

93-
`apt list --installed | sed 's/^\(.*\)\/.*$/\1/'` on a base image.
72+
See [DEVELOPMENT.md](DEVELOPMENT.md)

0 commit comments

Comments
 (0)