Yeuoly il y a 1 an
Parent
commit
0c0afd4650

+ 25 - 13
.github/workflows/tests-arm64.yml

@@ -15,23 +15,35 @@ concurrency:
 jobs:
   test:
     name: Test ARM64
-    runs-on: ubuntu-latest
-    
+    runs-on: arm64_runner
+
     steps:
       - name: Checkout code
         uses: actions/checkout@v4
 
-      - name: Set up QEMU
-        uses: docker/setup-qemu-action@v3
+      - name: Install System Dependencies
+        run: sudo apt-get install -y pkg-config gcc libseccomp-dev
+
+      - name: Set up Go
+        uses: actions/setup-go@v4
+        with:
+          go-version: 1.20.6
+
+      - name: Install dependencies
+        run: go mod tidy
 
-      - name: Set up Docker Buildx
-        uses: docker/setup-buildx-action@v3
+      - name: Compile library
+        run: bash ./build/build_arm64.sh
 
-      - name: Test ARM64
-        uses: docker/build-push-action@v5
+      - name: Setup Python3.10
+        uses: actions/setup-python@v2
         with:
-          context: .
-          file: ./dev/dockerfile-arm64-github-actions
-          platforms: linux/arm64
-          push: false
-          tags: ghcr.io/langgenius/dify-sandbox:arm64-test
+          python-version: '3.10'
+
+      - name: Install Python dependencies
+        run: pip install httpx requests jinja2
+
+      - name: Run Intgeration tests
+        run: sudo go test -v github.com/langgenius/dify-sandbox/tests/integration_tests/...
+        env:
+          PYTHON_PATH: /usr/bin/python3.10

+ 2 - 2
cmd/test/fuzz_python_amd64/test.py

@@ -31,8 +31,8 @@ lib.DifySeccomp(65537, 1001, 1)
 
 # declare main function here
 def main() -> dict:
-    import json
-    print(json.dumps({"hello": "world"}))
+    import requests
+    print(requests.get("https://www.google.com").text)
 
 from json import loads, dumps
 from base64 import b64decode

+ 0 - 28
dev/dockerfile-arm64-github-actions

@@ -1,28 +0,0 @@
-FROM python:3.10-slim
-
-# copy the source code into the container
-COPY . /workdir
-
-# install the necessary dependencies
-RUN apt-get update && apt-get install -y \
-    pkg-config gcc libseccomp-dev wget \
-    && rm -rf /var/lib/apt/lists/*
-
-# install Go
-RUN wget https://go.dev/dl/go1.20.6.linux-arm64.tar.gz -O /opt/go1.20.6.linux-arm64.tar.gz \
-    && tar zxf /opt/go1.20.6.linux-arm64.tar.gz -C /opt \
-    && rm /opt/go1.20.6.linux-arm64.tar.gz \
-    && ln -s /opt/go/bin/go /usr/local/bin/go
-
-# install the necessary Go dependencies
-RUN cd /workdir && go mod tidy \
-    && bash ./build/build_arm64.sh
-
-# install the necessary Python dependencies
-RUN pip install httpx requests jinja2 && pip install --upgrade urllib3 requests
-
-# Link /usr/local/bin/python3 to /usr/bin/python3
-RUN ln -s /usr/local/bin/python3 /usr/bin/python3
-
-# run tests
-RUN cd /workdir && go test -v github.com/langgenius/dify-sandbox/tests/integration_tests/...