浏览代码

HDDS-280. Support ozone dist-start-stitching on openbsd/osx. Contributed by Elek, Marton.

Mukul Kumar Singh 6 年之前
父节点
当前提交
692736f7cf

+ 3 - 3
dev-support/bin/ozone-dist-layout-stitching

@@ -117,9 +117,9 @@ ROOT=$(cd "${BASEDIR}"/../..;pwd)
 echo
 echo "Current directory $(pwd)"
 echo
-run rm -rf "ozone"
-run mkdir "ozone"
-run cd "ozone"
+run rm -rf "ozone-${HDDS_VERSION}"
+run mkdir "ozone-${HDDS_VERSION}"
+run cd "ozone-${HDDS_VERSION}"
 run cp -p "${ROOT}/LICENSE.txt" .
 run cp -p "${ROOT}/NOTICE.txt" .
 run cp -p "${ROOT}/README.txt" .

+ 2 - 7
dev-support/bin/ozone-dist-tar-stitching

@@ -36,13 +36,8 @@ function run()
   fi
 }
 
-#To make the final dist directory easily mountable from docker we don't use
-#version name in the directory name.
-#To include the version name in the root directory of the tar file
-# we create a symbolic link and dereference it during the tar creation
-ln -s -f ozone ozone-${VERSION}
-run tar -c --dereference -f "ozone-${VERSION}.tar" "ozone-${VERSION}"
+run tar -c -f "ozone-${VERSION}.tar" "ozone-${VERSION}"
 run gzip -f "ozone-${VERSION}.tar"
 echo
 echo "Ozone dist tar available at: ${BASEDIR}/ozone-${VERSION}.tar.gz"
-echo
+echo

+ 1 - 1
hadoop-ozone/acceptance-test/dev-support/bin/robot-all.sh

@@ -15,4 +15,4 @@
 # limitations under the License.
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-$DIR/robot.sh $DIR/../../src/test/acceptance
+"$DIR/robot.sh" "$DIR/../../src/test/acceptance"

+ 2 - 8
hadoop-ozone/acceptance-test/dev-support/bin/robot-dnd-all.sh

@@ -18,15 +18,9 @@ set -x
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-#Dir od the definition of the dind based test exeucution container
-DOCKERDIR="$DIR/../docker"
-
 #Dir to save the results
 TARGETDIR="$DIR/../../target/dnd"
 
-#Dir to mount the distribution from
-OZONEDIST="$DIR/../../../../hadoop-dist/target/ozone"
-
 #Name and imagename of the temporary, dind based test containers
 DOCKER_IMAGE_NAME=ozoneacceptance
 DOCKER_INSTANCE_NAME="${DOCKER_INSTANCE_NAME:-ozoneacceptance}"
@@ -47,10 +41,10 @@ chmod o+w "$OZONEDIST" || true
 
 rm "$TARGETDIR/docker-compose.log"
 docker rm "$DOCKER_INSTANCE_NAME" || true
-docker build -t "$DOCKER_IMAGE_NAME" $DIR/../docker
+docker build -t "$DOCKER_IMAGE_NAME" "$DIR/../docker"
 
 #Starting the dind based environment
-docker run --rm -v $DIR/../../../..:/opt/hadoop --privileged -d --name "$DOCKER_INSTANCE_NAME" $DOCKER_IMAGE_NAME
+docker run --rm -v "$DIR/../../../..:/opt/hadoop" --privileged -d --name "$DOCKER_INSTANCE_NAME" $DOCKER_IMAGE_NAME
 sleep 5
 
 #Starting the tests

+ 4 - 3
hadoop-ozone/acceptance-test/dev-support/bin/robot.sh

@@ -18,7 +18,7 @@ set -x
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-if [ ! "$(which robot)" ] ; then
+if [ ! "$(command -v robot)" ] ; then
     echo ""
     echo "robot is not on your PATH."
     echo ""
@@ -28,10 +28,11 @@ if [ ! "$(which robot)" ] ; then
     exit -1
 fi
 
-OZONEDISTDIR="$DIR/../../../../hadoop-dist/target/ozone"
+MARKERFILE=$(find "$DIR/../../../../hadoop-dist/target" -name hadoop-ozone.sh)
+OZONEDISTDIR="$(dirname "$(dirname "$(dirname "$MARKERFILE")")")"
 if [ ! -d "$OZONEDISTDIR" ]; then
    echo "Ozone can't be found in the $OZONEDISTDIR."
    echo "You may need a full build with -Phdds and -Pdist profiles"
    exit -1
 fi
-robot -x junit-results.xml "$@"
+robot --variable "OZONEDIR:$OZONEDISTDIR" -x junit-results.xml "$@"

+ 3 - 4
hadoop-ozone/acceptance-test/pom.xml

@@ -19,9 +19,8 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.hadoop</groupId>
-    <artifactId>hadoop-project</artifactId>
-    <version>3.2.0-SNAPSHOT</version>
-    <relativePath>../../hadoop-project</relativePath>
+    <artifactId>hadoop-ozone</artifactId>
+    <version>0.2.1-SNAPSHOT</version>
   </parent>
   <artifactId>hadoop-ozone-acceptance-test</artifactId>
   <version>3.2.0-SNAPSHOT</version>
@@ -45,7 +44,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
                 <configuration>
                   <testCasesDirectory>src/test/acceptance</testCasesDirectory>
                   <variables>
-                    <variable>basedir:${project.basedir}/../..</variable>
+                    <variable>OZONEDIR:${project.basedir}/../../hadoop-dist/target/ozone-${ozone.version}</variable>
                   </variables>
                   <skip>false</skip>
                   <skipTests>false</skipTests>

+ 0 - 1
hadoop-ozone/acceptance-test/src/test/acceptance/basic/ozone-shell.robot

@@ -22,7 +22,6 @@ Resource            ../commonlib.robot
 Test Timeout        2 minute
 
 *** Variables ***
-${basedir}
 ${COMPOSEFILE}          ${CURDIR}/docker-compose.yaml
 ${PROJECTDIR}           ${CURDIR}/../../../../../..
 

+ 1 - 1
hadoop-ozone/acceptance-test/src/test/acceptance/commonlib.robot

@@ -71,7 +71,7 @@ Execute on
 Run docker compose
     [arguments]                     ${command}
                                     Set Environment Variable    COMPOSE_INTERACTIVE_NO_CLI             1
-                                    Set Environment Variable    OZONEDIR      ${PROJECTDIR}/hadoop-dist/target/ozone
+                                    Set Environment Variable    OZONEDIR      ${OZONEDIR}
     ${rc}                           ${output} =                 Run And Return Rc And Output           docker-compose -f ${COMPOSEFILE} ${command}
     Log                             ${output}
     Should Be Equal As Integers     ${rc}                       0

+ 1 - 4
hadoop-ozone/common/pom.xml

@@ -29,11 +29,8 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <packaging>jar</packaging>
 
   <properties>
-    <ozone.version>0.2.1-SNAPSHOT</ozone.version>
-    <ozone.release>Acadia</ozone.release>
     <hadoop.component>ozone</hadoop.component>
     <is.hadoop.component>true</is.hadoop.component>
-    <declared.ozone.version>${ozone.version}</declared.ozone.version>
   </properties>
 
   <dependencies>
@@ -120,4 +117,4 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
       </plugin>
     </plugins>
   </build>
-</project>
+</project>

+ 2 - 1
hadoop-ozone/docs/content/GettingStarted.md

@@ -80,8 +80,9 @@ on the machine.
 Go to the directory where the docker compose files exist and tell
 `docker-compose` to start Ozone. This will start SCM, OM and a single datanode
 in the background.
+
 ```
-cd hadoop-dist/target/ozone/compose/ozone
+cd hadoop-dist/target/ozone-*/compose/ozone
 
 docker-compose up -d
 ```

+ 5 - 0
hadoop-ozone/pom.xml

@@ -29,6 +29,11 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <name>Apache Hadoop Ozone</name>
   <packaging>pom</packaging>
 
+  <properties>
+    <ozone.version>0.2.1-SNAPSHOT</ozone.version>
+    <ozone.release>Acadia</ozone.release>
+    <declared.ozone.version>${ozone.version}</declared.ozone.version>
+  </properties>
   <modules>
     <module>common</module>
     <module>client</module>