You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/06/09 14:38:31 UTC

(opendal) branch main updated: ci: start azurite via npm (#7715)

This is an automated email from the ASF dual-hosted git repository.

Xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 1e4e3da57 ci: start azurite via npm (#7715)
1e4e3da57 is described below

commit 1e4e3da57450c1c3fb0f2dffc31352edaf5eb069
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Tue Jun 9 22:38:25 2026 +0800

    ci: start azurite via npm (#7715)
---
 .github/services/azblob/azurite_azblob/action.yml  |  7 ++-
 .../hdfs/hdfs_default_on_azurite_azblob/action.yml |  7 ++-
 fixtures/azblob/docker-compose-azurite.yml         | 23 ---------
 fixtures/azblob/setup_azurite.sh                   | 57 ++++++++++++++++++++++
 4 files changed, 67 insertions(+), 27 deletions(-)

diff --git a/.github/services/azblob/azurite_azblob/action.yml b/.github/services/azblob/azurite_azblob/action.yml
index e45f4f949..5ab782638 100644
--- a/.github/services/azblob/azurite_azblob/action.yml
+++ b/.github/services/azblob/azurite_azblob/action.yml
@@ -21,10 +21,13 @@ description: 'Behavior test for azurite azblob'
 runs:
   using: "composite"
   steps:
+    - name: Setup node
+      uses: actions/setup-node@v6
+      with:
+        node-version: 20
     - name: Setup azurite azblob service
       shell: bash
-      working-directory: fixtures/azblob
-      run: docker compose -f docker-compose-azurite.yml up -d --wait
+      run: ./fixtures/azblob/setup_azurite.sh
     - name: Setup test bucket
       shell: bash
       run: |
diff --git a/.github/services/hdfs/hdfs_default_on_azurite_azblob/action.yml b/.github/services/hdfs/hdfs_default_on_azurite_azblob/action.yml
index 7433bbcbf..3087260b3 100644
--- a/.github/services/hdfs/hdfs_default_on_azurite_azblob/action.yml
+++ b/.github/services/hdfs/hdfs_default_on_azurite_azblob/action.yml
@@ -26,10 +26,13 @@ runs:
       with:
         distribution: zulu
         java-version: 11
+    - name: Setup node
+      uses: actions/setup-node@v6
+      with:
+        node-version: 20
     - name: Setup azurite azblob service
       shell: bash
-      working-directory: fixtures/azblob
-      run: docker compose -f docker-compose-azurite.yml up -d --wait
+      run: ./fixtures/azblob/setup_azurite.sh
     - name: Setup test bucket
       shell: bash
       run: |
diff --git a/fixtures/azblob/docker-compose-azurite.yml b/fixtures/azblob/docker-compose-azurite.yml
deleted file mode 100644
index 341023e6d..000000000
--- a/fixtures/azblob/docker-compose-azurite.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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.
-
-services:
-  azurite:
-    image: mcr.microsoft.com/azure-storage/azurite
-    ports:
-      - 10000:10000
-    command: ["azurite", "--blobHost", "0.0.0.0", "--skipApiVersionCheck"]
\ No newline at end of file
diff --git a/fixtures/azblob/setup_azurite.sh b/fixtures/azblob/setup_azurite.sh
new file mode 100755
index 000000000..513d23b35
--- /dev/null
+++ b/fixtures/azblob/setup_azurite.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+#
+# 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.
+
+set -euo pipefail
+
+azurite_version="${AZURITE_VERSION:-3.35.0}"
+azurite_log="${RUNNER_TEMP:-/tmp}/azurite-blob.log"
+azurite_data_dir="${RUNNER_TEMP:-/tmp}/azurite-blob-data"
+
+mkdir -p "$(dirname "${azurite_log}")"
+mkdir -p "${azurite_data_dir}"
+
+npm install -g "azurite@${azurite_version}" --no-audit --no-fund --loglevel=error
+
+nohup azurite-blob \
+  --location "${azurite_data_dir}" \
+  --blobHost 0.0.0.0 \
+  --blobPort 10000 \
+  --skipApiVersionCheck \
+  --silent \
+  >"${azurite_log}" 2>&1 &
+azurite_pid="$!"
+
+for _ in {1..30}; do
+  if bash -c "</dev/tcp/127.0.0.1/10000" 2>/dev/null; then
+    echo "Azurite ${azurite_version} is ready on 127.0.0.1:10000"
+    exit 0
+  fi
+
+  if ! kill -0 "${azurite_pid}" 2>/dev/null; then
+    echo "Azurite exited before becoming ready"
+    cat "${azurite_log}"
+    exit 1
+  fi
+
+  sleep 1
+done
+
+echo "Azurite did not become ready in time"
+cat "${azurite_log}"
+exit 1