|
@@ -25,8 +25,9 @@ Docker heavily is used at the ozone development with three principal use-cases:
|
|
* __dev__:
|
|
* __dev__:
|
|
* We use docker to start local pseudo-clusters (docker provides unified environment, but no image creation is required)
|
|
* We use docker to start local pseudo-clusters (docker provides unified environment, but no image creation is required)
|
|
* __test__:
|
|
* __test__:
|
|
- * We create docker images from the dev branches to test ozone in kubernetes and other container orchestator system
|
|
|
|
- * We provide _apache/ozone_ images for each release to make it easier the evaluation of Ozone. These images are __not__ created __for production__ usage.
|
|
|
|
|
|
+ * We create docker images from the dev branches to test ozone in kubernetes and other container orchestrator system
|
|
|
|
+ * We provide _apache/ozone_ images for each release to make it easier for evaluation of Ozone.
|
|
|
|
+ These images are __not__ created __for production__ usage.
|
|
|
|
|
|
<div class="alert alert-warning" role="alert">
|
|
<div class="alert alert-warning" role="alert">
|
|
We <b>strongly</b> recommend that you create your own custom images when you
|
|
We <b>strongly</b> recommend that you create your own custom images when you
|
|
@@ -36,7 +37,7 @@ shipped container images and k8s resources as examples and guides to help you
|
|
</div>
|
|
</div>
|
|
|
|
|
|
* __production__:
|
|
* __production__:
|
|
- * We document how can you create your own docker image for your production cluster.
|
|
|
|
|
|
+ * We have documentation on how you can create your own docker image for your production cluster.
|
|
|
|
|
|
Let's check out each of the use-cases in more detail:
|
|
Let's check out each of the use-cases in more detail:
|
|
|
|
|
|
@@ -46,38 +47,41 @@ Ozone artifact contains example docker-compose directories to make it easier to
|
|
|
|
|
|
From distribution:
|
|
From distribution:
|
|
|
|
|
|
-```
|
|
|
|
|
|
+```bash
|
|
cd compose/ozone
|
|
cd compose/ozone
|
|
docker-compose up -d
|
|
docker-compose up -d
|
|
```
|
|
```
|
|
|
|
|
|
-After a local build
|
|
|
|
|
|
+After a local build:
|
|
|
|
|
|
-```
|
|
|
|
|
|
+```bash
|
|
cd hadoop-ozone/dist/target/ozone-*/compose
|
|
cd hadoop-ozone/dist/target/ozone-*/compose
|
|
docker-compose up -d
|
|
docker-compose up -d
|
|
```
|
|
```
|
|
|
|
|
|
These environments are very important tools to start different type of Ozone clusters at any time.
|
|
These environments are very important tools to start different type of Ozone clusters at any time.
|
|
|
|
|
|
-To be sure that the compose files are up-to-date, we also provide acceptance test suites which start the cluster and check the basic behaviour.
|
|
|
|
|
|
+To be sure that the compose files are up-to-date, we also provide acceptance test suites which start
|
|
|
|
+the cluster and check the basic behaviour.
|
|
|
|
|
|
-The acceptance tests are part of the distribution, and you can find the test definitions in `./smoketest` directory.
|
|
|
|
|
|
+The acceptance tests are part of the distribution, and you can find the test definitions in `smoketest` directory.
|
|
|
|
|
|
You can start the tests from any compose directory:
|
|
You can start the tests from any compose directory:
|
|
|
|
|
|
For example:
|
|
For example:
|
|
|
|
|
|
-```
|
|
|
|
|
|
+```bash
|
|
cd compose/ozone
|
|
cd compose/ozone
|
|
./test.sh
|
|
./test.sh
|
|
```
|
|
```
|
|
|
|
|
|
### Implementation details
|
|
### Implementation details
|
|
|
|
|
|
-`./compose` tests are based on the apache/hadoop-runner docker image. The image itself doesn't contain any Ozone jar file or binary just the helper scripts to start ozone.
|
|
|
|
|
|
+`compose` tests are based on the apache/hadoop-runner docker image. The image itself does not contain
|
|
|
|
+any Ozone jar file or binary just the helper scripts to start ozone.
|
|
|
|
|
|
-hadoop-runner provdes a fixed environment to run Ozone everywhere, but the ozone distribution itself is mounted from the including directory:
|
|
|
|
|
|
+hadoop-runner provdes a fixed environment to run Ozone everywhere, but the ozone distribution itself
|
|
|
|
+is mounted from the including directory:
|
|
|
|
|
|
(Example docker-compose fragment)
|
|
(Example docker-compose fragment)
|
|
|
|
|
|
@@ -91,7 +95,9 @@ hadoop-runner provdes a fixed environment to run Ozone everywhere, but the ozone
|
|
|
|
|
|
```
|
|
```
|
|
|
|
|
|
-The containers are conigured based on environment variables, but because the same environment variables should be set for each containers we maintain the list of the environment variables in a separated file:
|
|
|
|
|
|
+The containers are configured based on environment variables, but because the same environment
|
|
|
|
+variables should be set for each containers we maintain the list of the environment variables
|
|
|
|
+in a separated file:
|
|
|
|
|
|
```
|
|
```
|
|
scm:
|
|
scm:
|
|
@@ -111,23 +117,32 @@ OZONE-SITE.XML_ozone.enabled=True
|
|
#...
|
|
#...
|
|
```
|
|
```
|
|
|
|
|
|
-As you can see we use naming convention. Based on the name of the environment variable, the appropariate hadoop config XML (`ozone-site.xml` in our case) will be generated by a [script](https://github.com/apache/hadoop/tree/docker-hadoop-runner-latest/scripts) which is included in the `hadoop-runner` base image.
|
|
|
|
|
|
+As you can see we use naming convention. Based on the name of the environment variable, the
|
|
|
|
+appropriate hadoop config XML (`ozone-site.xml` in our case) will be generated by a
|
|
|
|
+[script](https://github.com/apache/hadoop/tree/docker-hadoop-runner-latest/scripts) which is
|
|
|
|
+included in the `hadoop-runner` base image.
|
|
|
|
|
|
-The [entrypoint](https://github.com/apache/hadoop/blob/docker-hadoop-runner-latest/scripts/starter.sh) of the `hadoop-runner` image contains a helper shell script which triggers this transformation and cab do additional actions (eg. initialize scm/om storage, download required keytabs, etc.) based on environment variables.
|
|
|
|
|
|
+The [entrypoint](https://github.com/apache/hadoop/blob/docker-hadoop-runner-latest/scripts/starter.sh)
|
|
|
|
+of the `hadoop-runner` image contains a helper shell script which triggers this transformation and
|
|
|
|
+can do additional actions (eg. initialize scm/om storage, download required keytabs, etc.)
|
|
|
|
+based on environment variables.
|
|
|
|
|
|
## Test/Staging
|
|
## Test/Staging
|
|
|
|
|
|
-The `docker-compose` based approach is recommended only for local test not for multi node cluster. To use containers on a multi-node cluster we need a Container Orchestrator like Kubernetes.
|
|
|
|
|
|
+The `docker-compose` based approach is recommended only for local test, not for multi node cluster.
|
|
|
|
+To use containers on a multi-node cluster we need a Container Orchestrator like Kubernetes.
|
|
|
|
|
|
Kubernetes example files are included in the `kubernetes` folder.
|
|
Kubernetes example files are included in the `kubernetes` folder.
|
|
|
|
|
|
-*Please note*: all the provided images are based the `hadoop-runner` image which contains all the required tool for testing in staging environments. For production we recommend to create your own, hardened image with your own base image.
|
|
|
|
|
|
+*Please note*: all the provided images are based the `hadoop-runner` image which contains all the
|
|
|
|
+required tool for testing in staging environments. For production we recommend to create your own,
|
|
|
|
+hardened image with your own base image.
|
|
|
|
|
|
### Test the release
|
|
### Test the release
|
|
|
|
|
|
The release can be tested with deploying any of the example clusters:
|
|
The release can be tested with deploying any of the example clusters:
|
|
|
|
|
|
-```
|
|
|
|
|
|
+```bash
|
|
cd kubernetes/examples/ozone
|
|
cd kubernetes/examples/ozone
|
|
kubectl apply -f
|
|
kubectl apply -f
|
|
```
|
|
```
|
|
@@ -139,13 +154,13 @@ Plese note that in this case the latest released container will be downloaded fr
|
|
To test a development build you can create your own image and upload it to your own docker registry:
|
|
To test a development build you can create your own image and upload it to your own docker registry:
|
|
|
|
|
|
|
|
|
|
-```
|
|
|
|
|
|
+```bash
|
|
mvn clean install -f pom.ozone.xml -DskipTests -Pdocker-build,docker-push -Ddocker.image=myregistry:9000/name/ozone
|
|
mvn clean install -f pom.ozone.xml -DskipTests -Pdocker-build,docker-push -Ddocker.image=myregistry:9000/name/ozone
|
|
```
|
|
```
|
|
|
|
|
|
The configured image will be used in all the generated kubernetes resources files (`image:` keys are adjusted during the build)
|
|
The configured image will be used in all the generated kubernetes resources files (`image:` keys are adjusted during the build)
|
|
|
|
|
|
-```
|
|
|
|
|
|
+```bash
|
|
cd kubernetes/examples/ozone
|
|
cd kubernetes/examples/ozone
|
|
kubectl apply -f
|
|
kubectl apply -f
|
|
```
|
|
```
|
|
@@ -160,10 +175,12 @@ adjust base image, umask, security settings, user settings according to your own
|
|
|
|
|
|
You can use the source of our development images as an example:
|
|
You can use the source of our development images as an example:
|
|
|
|
|
|
- * Base image: https://github.com/apache/hadoop/blob/docker-hadoop-runner-jdk11/Dockerfile
|
|
|
|
- * Docker image: https://github.com/apache/hadoop/blob/trunk/hadoop-ozone/dist/src/main/Dockerfile
|
|
|
|
|
|
+ * [Base image] (https://github.com/apache/hadoop/blob/docker-hadoop-runner-jdk11/Dockerfile)
|
|
|
|
+ * [Docker image] (https://github.com/apache/hadoop/blob/trunk/hadoop-ozone/dist/src/main/docker/Dockerfile)
|
|
|
|
|
|
- Most of the elements are optional and just helper function but to use the provided example kubernetes resources you may need the scripts from [here](https://github.com/apache/hadoop/tree/docker-hadoop-runner-jdk11/scripts)
|
|
|
|
|
|
+ Most of the elements are optional and just helper function but to use the provided example
|
|
|
|
+ kubernetes resources you may need the scripts from
|
|
|
|
+ [here](https://github.com/apache/hadoop/tree/docker-hadoop-runner-jdk11/scripts)
|
|
|
|
|
|
* The two python scripts convert environment variables to real hadoop XML config files
|
|
* The two python scripts convert environment variables to real hadoop XML config files
|
|
* The start.sh executes the python scripts (and other initialization) based on environment variables.
|
|
* The start.sh executes the python scripts (and other initialization) based on environment variables.
|
|
@@ -205,7 +222,7 @@ Ozone related container images and source locations:
|
|
<td>This is the base image used for testing Hadoop Ozone.
|
|
<td>This is the base image used for testing Hadoop Ozone.
|
|
This is a set of utilities that make it easy for us run ozone.</td>
|
|
This is a set of utilities that make it easy for us run ozone.</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr>
|
|
|
|
|
|
+ <!---tr>
|
|
<th scope="row">3</th>
|
|
<th scope="row">3</th>
|
|
<td>apache/ozone:build (WIP)</td>
|
|
<td>apache/ozone:build (WIP)</td>
|
|
<td>https://github.com/apache/hadoop-docker-ozone</td>
|
|
<td>https://github.com/apache/hadoop-docker-ozone</td>
|
|
@@ -213,6 +230,6 @@ Ozone related container images and source locations:
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td>TODO: Add more documentation here.</td>
|
|
<td>TODO: Add more documentation here.</td>
|
|
- </tr>
|
|
|
|
|
|
+ </tr-->
|
|
</tbody>
|
|
</tbody>
|
|
</table>
|
|
</table>
|