Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Feb 5, 2024
1 parent a9d0539 commit dc62eae
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/services/hdfs/hdfs_default/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,30 @@ runs:
export HADOOP_HOME="/home/runner/hadoop-3.3.5"
export CLASSPATH=$(${HADOOP_HOME}/bin/hadoop classpath --glob)
# Trick for mvn to make sure CLASSPATH from hadoop is set
export MAVEN_OPTS="-cp $CLASSPATH"
# Inject local hdfs dependencies into pom.xml
POM_FILE="bindings/java/pom.xml"
IFS=':' read -ra ADDR <<< "$CLASSPATH"
for i in "${ADDR[@]}"; do
if [[ $i == *.jar ]]; then
JAR_NAME=$(basename "$i")
DEPENDENCY="<dependency>\n\
\t<groupId>local.dependency</groupId>\n\
\t<artifactId>${JAR_NAME%.*}</artifactId>\n\
\t<version>1.0</version>\n\
\t<scope>system</scope>\n\
\t<systemPath>\${project.basedir}/${i}</systemPath>\n\
</dependency>"
sed -i "/<\/dependencies>/i $DEPENDENCY" "$POM_FILE"
fi
done
cp ./fixtures/hdfs/hdfs-site.xml ${HADOOP_HOME}/etc/hadoop/hdfs-site.xml
cat << EOF >> $GITHUB_ENV
HADOOP_HOME=${HADOOP_HOME}
CLASSPATH=${CLASSPATH}
MAVEN_OPTS=${MAVEN_OPTS}
LD_LIBRARY_PATH=${JAVA_HOME}/lib/server:${HADOOP_HOME}/lib/native
OPENDAL_HDFS_ROOT=/tmp/opendal/
OPENDAL_HDFS_NAME_NODE=default
Expand Down

0 comments on commit dc62eae

Please sign in to comment.