Skip to content

Commit

Permalink
Address comments and add licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
aaudiber committed Jan 29, 2017
1 parent 2fd089e commit 6590797
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
12 changes: 6 additions & 6 deletions docs/en/Running-Alluxio-On-Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ docker build -t alluxio --build-arg ALLUXIO_TARBALL=alluxio-snapshot.tar.gz .
## Run the Alluxio master

```bash
docker run -d alluxio master
docker run -d --net=host alluxio master
```

## Run the Alluxio worker

We need to tell the worker where to find the master. Set HOSTNAME to the hostname of
your instance and run
We need to tell the worker where to find the master. Set the ALLUXIO_MASTER_HOSTNAME
environment variable to your machine's hostname when launching the worker Docker container.

```bash
docker run -d -e ALLUXIO_MASTER_HOSTNAME=${HOSTNAME} alluxio worker
docker run -d -e ALLUXIO_MASTER_HOSTNAME=${INSTANCE_HOSTNAME} --net=host alluxio worker
```

# Test the cluster
Expand All @@ -76,5 +76,5 @@ bin/alluxio runTests
# Configuration

Configuration may be passed to the Alluxio containers using the `-e` flag when launching the container.
Any environment variables beginning with `"ALLUXIO_"` will be saved to `conf/alluxio-site.properties` inside
the container.
Any environment variables beginning with `ALLUXIO_` will be saved to `conf/alluxio-site.properties` inside
the container.
15 changes: 12 additions & 3 deletions integration/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#
# The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
# (the "License"). You may not use this work except in compliance with the License, which is
# available at www.apache.org/licenses/LICENSE-2.0
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied, as more fully set forth in the License.
#
# See the NOTICE file distributed with this work for information regarding copyright ownership.
#

FROM openjdk:7-jdk-alpine
MAINTAINER Andrew Audibert ([email protected])

Expand All @@ -10,10 +21,8 @@ ADD ${ALLUXIO_TARBALL} /opt/

# if the tarball was remote, it needs to be untarred
RUN cd /opt && \
(tar -xzf alluxio* || true) && \
(rm *.tar.gz || true)
(if ls | grep -q ".tar.gz"; then tar -xzf alluxio* && rm *.tar.gz; fi)

COPY entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]

30 changes: 28 additions & 2 deletions integration/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env bash
#
# The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
# (the "License"). You may not use this work except in compliance with the License, which is
# available at www.apache.org/licenses/LICENSE-2.0
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied, as more fully set forth in the License.
#
# See the NOTICE file distributed with this work for information regarding copyright ownership.
#

set -e

Expand All @@ -12,12 +22,28 @@ service=$1
home=/opt/$(ls /opt | grep alluxio)
cd ${home}

# List of environment variables starting with ALLUXIO_ which
# don't have corresponding configuration keys.
special_env_vars=(
ALLUXIO_CLASSPATH
ALLUXIO_HOSTNAME
ALLUXIO_JARS
ALLUXIO_JAVA_OPTS
ALLUXIO_MASTER_JAVA_OPTS
ALLUXIO_PROXY_JAVA_OPTS
ALLUXIO_RAM_FOLDER
ALLUXIO_USER_JAVA_OPTS
ALLUXIO_WORKER_JAVA_OPTS
)

for keyvaluepair in $(env | grep "ALLUXIO_"); do
# split around the "="
key=$(echo ${keyvaluepair} | cut -d= -f1)
value=$(echo ${keyvaluepair} | cut -d= -f2)
key=$(echo ${key} | sed "s/_/./g" | tr '[:upper:]' '[:lower:]')
echo "${key}=${value}" >> conf/alluxio-site.properties
if [[ ! "${special_env_vars[*]}" =~ "${key}" ]]; then
confkey=$(echo ${key} | sed "s/_/./g" | tr '[:upper:]' '[:lower:]')
echo "${confkey}=${value}" >> conf/alluxio-site.properties
fi
done

case ${service,,} in
Expand Down

0 comments on commit 6590797

Please sign in to comment.