-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add test case for hdfs over gcs bucket (#3504)
- Loading branch information
Showing
3 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# 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: hdfs_default_gcs | ||
description: 'Behavior test for hdfs default over gcs' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup java env | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: "11" | ||
- name: Load secrets | ||
uses: 1password/load-secrets-action@v1 | ||
with: | ||
export-env: true | ||
env: | ||
OPENDAL_GCS_ROOT: op://services/gcs/root | ||
OPENDAL_GCS_BUCKET: op://services/gcs/bucket | ||
OPENDAL_GCS_CREDENTIAL: op://services/gcs/credential | ||
- 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) | ||
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 | ||
cp ./fixtures/hdfs/hdfs-site.xml ${HADOOP_HOME}/etc/hadoop/hdfs-site.xml | ||
cp ./fixtures/hdfs/gcs-core-site.xml ${HADOOP_HOME}/etc/hadoop/core-site.xml | ||
cat << EOF >> $GITHUB_ENV | ||
HADOOP_HOME=${HADOOP_HOME} | ||
CLASSPATH=${CLASSPATH} | ||
LD_LIBRARY_PATH=${JAVA_HOME}/lib/server:${HADOOP_HOME}/lib/native | ||
OPENDAL_HDFS_ROOT=${OPENDAL_GCS_ROOT} | ||
OPENDAL_HDFS_NAME_NODE=gs://${OPENDAL_GCS_BUCKET} | ||
OPENDAL_HDFS_ENABLE_APPEND=false | ||
EOF | ||
mkdir -p /tmp/hdfs | ||
cat << EOF > /tmp/hdfs/gcs-credentials.json | ||
`echo ${OPENDAL_GCS_CREDENTIAL} | base64 -d` | ||
EOF | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!-- | ||
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. | ||
--> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> | ||
|
||
<!-- Put site-specific property overrides in this file. --> | ||
|
||
<configuration> | ||
<property> | ||
<name>fs.AbstractFileSystem.gs.impl</name> | ||
<value>com.google.cloud.hadoop.fs.gcs.GoogleHadoopFS</value> | ||
<description>The AbstractFileSystem for 'gs:' URIs.</description> | ||
</property> | ||
<property> | ||
<name>fs.gs.project.id</name> | ||
<value></value> | ||
<description> | ||
Optional. Google Cloud Project ID with access to GCS buckets. | ||
Required only for list buckets and create bucket operations. | ||
</description> | ||
</property> | ||
<property> | ||
<name>google.cloud.auth.type</name> | ||
<value>SERVICE_ACCOUNT_JSON_KEYFILE</value> | ||
<description> | ||
Authentication type to use for GCS access. | ||
</description> | ||
</property> | ||
<property> | ||
<name>google.cloud.auth.service.account.json.keyfile</name> | ||
<value>/tmp/hdfs/gcs-credentials.json</value> | ||
<description> | ||
The JSON keyfile of the service account used for GCS | ||
access when google.cloud.auth.type is SERVICE_ACCOUNT_JSON_KEYFILE. | ||
</description> | ||
</property> | ||
</configuration> |