adoroszlai commented on code in PR #46:
URL: 
https://github.com/apache/ozone-docker-runner/pull/46#discussion_r2034853855


##########
Dockerfile:
##########
@@ -110,6 +110,19 @@ RUN set -eux ; \
     curl -L ${url} | tar xvz ; \
     mv async-profiler-* /opt/profiler
 
+# Hadoop native libary (Hadoop 3.4.1 doesn't have aarch64 binary)
+ENV LD_LIBRARY_PATH=/usr/lib

Review Comment:
   Let's not define this environment variable, please see #43.



##########
Dockerfile:
##########
@@ -110,6 +110,19 @@ RUN set -eux ; \
     curl -L ${url} | tar xvz ; \
     mv async-profiler-* /opt/profiler
 
+# Hadoop native libary (Hadoop 3.4.1 doesn't have aarch64 binary)
+ENV LD_LIBRARY_PATH=/usr/lib
+RUN set -eux ; \
+    ARCH="$(arch)" ; \
+    case "${ARCH}" in \
+        x86_64)  
url='https://dlcdn.apache.org/hadoop/common/hadoop-3.4.0/hadoop-3.4.0.tar.gz' 
;; \
+        aarch64) 
url='https://dlcdn.apache.org/hadoop/common/hadoop-3.4.0/hadoop-3.4.0-aarch64.tar.gz'
 ;; \
+        *) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
+    esac; \
+    curl -L ${url} -o hadoop-3.4.0.tar.gz && \
+    tar xzvf hadoop-3.4.0.tar.gz -C /tmp && \
+    mv /tmp/hadoop-3.4.0/lib/native/libhadoop.*  $LD_LIBRARY_PATH/

Review Comment:
   - Define Hadoop version in variable.
   - Prefer to use `closer.lua`.
   - We can add the base URL in the `curl` command, set only `filename` in the 
`case`.
   
   ```bash
       hadoop_version=3.4.0 ; \
       case "${ARCH}" in \
           x86_64)  filename='hadoop-${hadoop_version}.tar.gz' ;; \
           aarch64) filename='hadoop-${hadoop_version}-aarch64.tar.gz' ;; \
           *) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
       esac; \
       curl -L 
"https://www.apache.org/dyn/closer.lua?action=download&filename=hadoop/common/hadoop-${hadoop_version}/$filename";
 -o "hadoop-${hadoop_version}.tar.gz" && \
       tar xzvf "hadoop-${hadoop_version}.tar.gz" -C /tmp && \
       mv /tmp/hadoop-${hadoop_version}/lib/native/libhadoop.* /usr/lib/
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to