Xuanwo commented on code in PR #4145:
URL: https://github.com/apache/opendal/pull/4145#discussion_r1477634216


##########
.github/workflows/service_test_hdfs.yml:
##########
@@ -173,3 +173,41 @@ jobs:
           OPENDAL_HDFS_ATOMIC_WRITE_DIR: /tmp/atomic_write_dir/opendal/
           OPENDAL_HDFS_NAME_NODE: default
           OPENDAL_HDFS_ENABLE_APPEND: false
+
+  hdfs-default-gcs:

Review Comment:
   We are working on the test migrate, please take a look over: 
https://github.com/apache/opendal/pull/4140.
   
   



##########
.github/workflows/service_test_hdfs.yml:
##########
@@ -173,3 +173,41 @@ jobs:
           OPENDAL_HDFS_ATOMIC_WRITE_DIR: /tmp/atomic_write_dir/opendal/
           OPENDAL_HDFS_NAME_NODE: default
           OPENDAL_HDFS_ENABLE_APPEND: false
+
+  hdfs-default-gcs:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+        with:
+          need-nextest: true
+
+      - name: Setup java env
+        uses: actions/setup-java@v4
+        with:
+          distribution: temurin
+          java-version: "11"
+      - 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
+          curl -LsSf -o 
/workspaces/opendal/tmp/hadoop-3.3.5/share/hadoop/common/lib/gcs-connector-hadoop2-2.2.19-shaded.jar
  
https://github.com/GoogleCloudDataproc/hadoop-connectors/releases/download/v2.2.19/gcs-connector-hadoop2-2.2.19-shaded.jar

Review Comment:
   Is it ok to download into `$HADOOP_HOME/share/hadoop/common/lib`?



##########
fixtures/hdfs/core-site.xml:
##########


Review Comment:
   It's best to name it `gcs-core-site.xml` for clarity.



##########
fixtures/hdfs/core-site.xml:
##########
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+  Licensed 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. See accompanying LICENSE file.
+-->
+
+<!-- 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>

Review Comment:
   How can we configure them via env?



##########
.github/workflows/service_test_hdfs.yml:
##########
@@ -173,3 +173,41 @@ jobs:
           OPENDAL_HDFS_ATOMIC_WRITE_DIR: /tmp/atomic_write_dir/opendal/
           OPENDAL_HDFS_NAME_NODE: default
           OPENDAL_HDFS_ENABLE_APPEND: false
+
+  hdfs-default-gcs:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+        with:
+          need-nextest: true
+
+      - name: Setup java env
+        uses: actions/setup-java@v4
+        with:
+          distribution: temurin
+          java-version: "11"
+      - 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
+          curl -LsSf -o 
/workspaces/opendal/tmp/hadoop-3.3.5/share/hadoop/common/lib/gcs-connector-hadoop2-2.2.19-shaded.jar
  
https://github.com/GoogleCloudDataproc/hadoop-connectors/releases/download/v2.2.19/gcs-connector-hadoop2-2.2.19-shaded.jar
+
+      - name: Test
+        shell: bash
+        working-directory: core
+        run: |
+          export CLASSPATH=$(${HADOOP_HOME}/bin/hadoop classpath --glob)
+          export LD_LIBRARY_PATH=${{ env.JAVA_HOME }}/lib/server:${{ 
env.HADOOP_HOME }}/lib/native
+          cp ${{ github.workspace }}/fixtures/hdfs/hdfs-site.xml ${{ 
env.HADOOP_HOME }}/etc/hadoop/hdfs-site.xml
+          cp ${{ github.workspace }}/fixtures/hdfs/core-site.xml ${{ 
env.HADOOP_HOME }}/etc/hadoop/core-site.xml
+
+          cargo test behavior --features tests,services-hdfs
+        env:
+          HADOOP_HOME: "/home/runner/hadoop-3.3.5"
+          OPENDAL_TEST: hdfs
+          OPENDAL_HDFS_ROOT: /tmp/opendal/
+          OPENDAL_HDFS_NAME_NODE: gs://bucket_name

Review Comment:
   After migrate to https://github.com/apache/opendal/pull/4140, this should be 
easy.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to