Skip to content

Commit

Permalink
Add documents for setting up a docker based development environment (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
nwangtw authored and thinker0 committed Mar 21, 2020
1 parent cfbd8ff commit e8d0bdc
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 11 deletions.
37 changes: 35 additions & 2 deletions website2/docs/compiling-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For developing Heron, you will need to compile it for the environment that you
want to use it in. If you'd like to use Docker to create that build environment,
Heron provides a convenient script to make that process easier.

Currently, only Ubuntu 14.04, Ubuntu 15.10, and CentOS 7 are supported, but if you
Currently, only Ubuntu 14.04, Ubuntu 18.04, and CentOS 7 are supported, but if you
need another platform there are instructions for adding new ones
[below](#contributing-new-environments).

Expand Down Expand Up @@ -60,7 +60,7 @@ Running the script by itself will display usage information:
```
Usage: docker/build-artifacts.sh <platform> <version_string> [source-tarball] <output-directory>
Platforms Supported: darwin, ubuntu14.04, ubuntu15.10, centos7
Platforms Supported: darwin, ubuntu14.04, ubuntu18.04, centos7
Example:
./build-artifacts.sh ubuntu14.04 0.12.0 .
Expand Down Expand Up @@ -113,6 +113,39 @@ heron-layer-0.12.0-ubuntu14.04.tar
heron-tools-0.12.0-ubuntu14.04.tar.gz
```

## Set Up A Docker Based Development Environment

In case you want to have a development environment instead of making a full build,
Heron provides two helper scripts for you. It could be convenient if you don't want
to set up all the libraries and tools on your machine directly.

The following commands are to create a new docker image with a development environment
and start the container based on it:
```bash
$ cd /path/to/heron/repo
$ docker/scripts/dev-env-create.sh heron-dev
```

After the commands, a new docker container is started with all the libraries and tools
installed. The operation system is Ubuntu 18.04 by default. Now you can build Heron
like:
```bash
\# bazel build --config=ubuntu scripts/packages:binpkgs
\# bazel build --config=ubuntu scripts/packages:tarpkgs
```

The current folder is mapped to the '/heron' directory in the container and any changes
you make on the host machine will be reflected in the container. Note that when you exit
the container and re-run the script, a new container will be started with a fresh new
environment.

When a development environment container is running, you can use the follow script
to start a new terminal in the container.
```bash
$ cd /path/to/heron/repo
$ docker/scripts/dev-env-run.sh heron-dev
```

## Contributing New Environments

You'll notice that there are multiple
Expand Down
8 changes: 4 additions & 4 deletions website2/docs/compiling-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ sidebar_label: Compiling on Linux

Heron can currently be built on the following Linux platforms:

* [Ubuntu 14.04](#building-on-ubuntu-18.04)
* [Ubuntu 18.04](#building-on-ubuntu-18.04)
* [CentOS 7](#building-on-centos-7)

## Building on Ubuntu 14.04
## Building on Ubuntu 18.04

To build Heron on a fresh Ubuntu 18.04 installation:

Expand Down Expand Up @@ -96,13 +96,13 @@ $ ./bazel_configure.py
### Step 10 --- Build the project

```bash
$ bazel build --config=ubuntu heron/...
$ bazel build --config=ubuntu heron/...
```

### Step 11 --- Build the packages

```bash
$ bazel build --config=ubuntu scripts/packages:binpkgs
$ bazel build --config=ubuntu scripts/packages:binpkgs
$ bazel build --config=ubuntu scripts/packages:tarpkgs
```

Expand Down
2 changes: 1 addition & 1 deletion website2/docs/compiling-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Heron build system. For step-by-step build instructions for a specific platform,
the following guides are available:

* [Building on Linux Platforms](compiling-linux)
* [Building on Mac OS X](compiling-mac)
* [Building on Mac OS X](compiling-osx)

Heron can be built either [in its entirety](#building-all-components), as [individual components](#building-specific-components).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ original_id: compiling-overview
-->

Heron is currently available for [Mac OS X 10.14](compiling-osx),
[Ubuntu 14.04](compiling-linux), and [CentOS
[Ubuntu 18.04](compiling-linux), and [CentOS
7](compiling-linux#building-on-centos-7). This guide describes the basics of the
Heron build system. For step-by-step build instructions for a specific platform,
the following guides are available:

* [Building on Linux Platforms](compiling-linux)
* [Building on Mac OS X](compiling-mac)
* [Building on Mac OS X](compiling-osx)
* [Building in Docker Container](compiling-docker)

Heron can be built either [in its entirety](#building-all-components), as [individual components](#building-specific-components).

Expand Down Expand Up @@ -93,8 +94,8 @@ OS-specific configuration using the `--config` flag. The following OS values
are supported:

* `darwin` (Mac OS X)
* `ubuntu` (Ubuntu 14.04)
* `centos5` (CentOS 5)
* `ubuntu` (Ubuntu)
* `centos` (CentOS)

For example, on Mac OS X (`darwin`), the following command will build all
packages:
Expand Down

0 comments on commit e8d0bdc

Please sign in to comment.