Skip to content

Commit

Permalink
chore: add setup action for hadoop
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorgan committed Nov 23, 2024
1 parent 6f732e1 commit 24d7f8b
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 20 deletions.
46 changes: 46 additions & 0 deletions .github/actions/setup-hadoop/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Setup Hadoop
description: 'Prepare Hadoop'

inputs:
need-hadoop:
description: "This setup needs hadoop or not"

runs:
using: "composite"
steps:
- name: Cache hadoop
id: cache-hadoop
uses: actions/cache@v4
if: inputs.need-hadoop == 'true'
with:
path: /home/runner/hadoop-3.3.5
key: cache-hadoop-3.3.5

- name: Build hadoop if not cached
if: steps.cache-hadoop.outputs.cache-hit != 'true' && inputs.need-hadoop == 'true'
shell: bash
run: |
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
17 changes: 0 additions & 17 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ inputs:
github-token:
description: "Github Token"
default: ""
need-hadoop:
description: "This setup needs hadoop or not"

runs:
using: "composite"
Expand Down Expand Up @@ -154,18 +152,3 @@ runs:
rm foundationdb-clients_7.1.17-1_amd64.deb
rm foundationdb-server_7.1.17-1_amd64.deb
- name: Cache hadoop
id: cache-hadoop
uses: actions/cache@v4
if: inputs.need-hadoop == 'true'
with:
path: /home/runner/hadoop-3.3.5
key: r0-hadoop-3.3.5

- name: Build hadoop if not cached
if: steps.cache-hadoop.outputs.cache-hit != 'true' && inputs.need-hadoop == 'true'
shell: bash
run: |
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
4 changes: 4 additions & 0 deletions .github/services/hdfs/hdfs_cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ runs:
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: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ runs:
- name: Setup hadoop env
shell: bash
run: |
curl -LsSf https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5.tar.gz | tar zxf - -C /home/runner
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
Expand Down
2 changes: 2 additions & 0 deletions .github/services/hdfs/hdfs_default/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ runs:
- name: Setup
shell: bash
run: |
curl -LsSf https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5.tar.gz | tar zxf - -C /home/runner
export HADOOP_HOME="/home/runner/hadoop-3.3.5"
export CLASSPATH=$(${HADOOP_HOME}/bin/hadoop classpath --glob)
Expand Down
2 changes: 2 additions & 0 deletions .github/services/hdfs/hdfs_default_gcs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ runs:
- name: Setup
shell: bash
run: |
curl -LsSf https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5.tar.gz | tar zxf - -C /home/runner
export HADOOP_HOME="/home/runner/hadoop-3.3.5"
curl -LsSf -o ${HADOOP_HOME}/share/hadoop/common/lib/gcs-connector-hadoop3-2.2.19-shaded.jar https://github.com/GoogleCloudDataproc/hadoop-connectors/releases/download/v2.2.19/gcs-connector-hadoop3-2.2.19-shaded.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ runs:
OPENDAL_AZBLOB_ACCOUNT_NAME=devstoreaccount1
OPENDAL_AZBLOB_ACCOUNT_KEY=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
curl -LsSf https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5.tar.gz | tar zxf - -C /home/runner
export HADOOP_HOME="/home/runner/hadoop-3.3.5"
curl -LsSf -o ${HADOOP_HOME}/share/hadoop/common/lib/hadoop-azure-3.3.5.jar https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-azure/3.3.5/hadoop-azure-3.3.5.jar
Expand Down
2 changes: 2 additions & 0 deletions .github/services/hdfs/hdfs_default_on_minio_s3/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ runs:
- name: Setup
shell: bash
run: |
curl -LsSf https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5.tar.gz | tar zxf - -C /home/runner
export HADOOP_HOME="/home/runner/hadoop-3.3.5"
curl -LsSf -o ${HADOOP_HOME}/share/hadoop/common/lib/hadoop-aws-3.3.5.jar https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-aws/3.3.5/hadoop-aws-3.3.5.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ runs:
- name: Setup
shell: bash
run: |
curl -LsSf https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5.tar.gz | tar zxf - -C /home/runner
export HADOOP_HOME="/home/runner/hadoop-3.3.5"
export CLASSPATH=$(${HADOOP_HOME}/bin/hadoop classpath --glob)
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test_behavior_binding_nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
need-nextest: true
need-protoc: true
need-rocksdb: true
need-hadoop: true
github-token: ${{ secrets.GITHUB_TOKEN }}

# TODO: 1password is only supported on linux
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test_behavior_binding_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
need-nextest: true
need-protoc: true
need-rocksdb: true
need-hadoop: true
github-token: ${{ secrets.GITHUB_TOKEN }}

# TODO: 1password is only supported on linux
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test_behavior_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
with:
need-protoc: true
need-rocksdb: true
need-hadoop: true
github-token: ${{ secrets.GITHUB_TOKEN }}

# TODO: 1password is only supported on linux
Expand Down

0 comments on commit 24d7f8b

Please sign in to comment.