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 4c39a2e commit ef96574
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 76 deletions.
36 changes: 25 additions & 11 deletions .github/actions/setup-hadoop/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,32 @@
# specific language governing permissions and limitations
# under the License.

name: 'Setup Hadoop'
description: 'Setup and cache Hadoop binaries'
name: Setup Hadoop
description: 'Prepare Hadoop'

inputs:
hadoop-version:
description: 'Hadoop version to install'
required: true

outputs:
hadoop-path:
description: 'Path to the Hadoop installation'
need-hadoop:
description: "This setup needs hadoop or not"

runs:
using: 'node20'
main: 'index.js'
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
54 changes: 0 additions & 54 deletions .github/actions/setup-hadoop/index.js

This file was deleted.

10 changes: 0 additions & 10 deletions .github/actions/setup-hadoop/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/services/hdfs/hdfs_cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
- name: Setup hadoop
uses: ./.github/actions/setup-hadoop
with:
hadoop-version: 3.3.5
need-hadoop: true
- name: Setup hadoop env
shell: bash
run: |
Expand Down

0 comments on commit ef96574

Please sign in to comment.