Skip to content

Commit

Permalink
chore: move java setup && hadoop env to hadoop setup
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorgan committed Nov 23, 2024
1 parent 24d7f8b commit 60f5953
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
16 changes: 15 additions & 1 deletion .github/actions/setup-hadoop/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

name: Setup Hadoop
description: 'Prepare Hadoop'
description: 'Prepare hadoop binary and env'

inputs:
need-hadoop:
Expand All @@ -25,6 +25,12 @@ inputs:
runs:
using: "composite"
steps:
- name: Setup java env
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "11"

- name: Cache hadoop
id: cache-hadoop
uses: actions/cache@v4
Expand All @@ -40,6 +46,14 @@ runs:
set -e
curl -LsSf https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5.tar.gz | tar zxf - -C /home/runner
- name: Setup hadoop env
shell: bash
run: |
export HADOOP_HOME=/home/runner/hadoop-3.3.5
echo "HADOOP_HOME=${HADOOP_HOME}" >> $GITHUB_ENV
echo "CLASSPATH=$(${HADOOP_HOME}/bin/hadoop classpath --glob)" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${{ env.JAVA_HOME }}/lib/server:${HADOOP_HOME}/lib/native" >> $GITHUB_ENV
cp ${{ github.workspace }}/fixtures/hdfs/hdfs-site.xml ${HADOOP_HOME}/etc/hadoop/hdfs-site.xml
Expand Down
13 changes: 0 additions & 13 deletions .github/services/hdfs/hdfs_cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,10 @@ runs:
shell: bash
working-directory: fixtures/hdfs
run: docker compose -f docker-compose-hdfs-cluster.yml up -d --wait
- name: Setup java env
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "11"
- name: Setup hadoop
uses: ./.github/actions/setup-hadoop
with:
need-hadoop: true
- name: Setup hadoop env
shell: bash
run: |
export HADOOP_HOME=/home/runner/hadoop-3.3.5
echo "HADOOP_HOME=${HADOOP_HOME}" >> $GITHUB_ENV
echo "CLASSPATH=$(${HADOOP_HOME}/bin/hadoop classpath --glob)" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${{ env.JAVA_HOME }}/lib/server:${HADOOP_HOME}/lib/native" >> $GITHUB_ENV
cp ${{ github.workspace }}/fixtures/hdfs/hdfs-site.xml ${HADOOP_HOME}/etc/hadoop/hdfs-site.xml
- name: Setup opendal env
shell: bash
run: |
Expand Down

0 comments on commit 60f5953

Please # to comment.