From 4061925374d20f8987c16c300d819baf039ee676 Mon Sep 17 00:00:00 2001 From: Peefy Date: Wed, 20 Nov 2024 10:29:25 +0800 Subject: [PATCH 1/5] test: add kcl mod pull test in the image Signed-off-by: Peefy --- .github/workflows/image-e2e-tests.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/image-e2e-tests.yaml b/.github/workflows/image-e2e-tests.yaml index 23df435..44e268a 100644 --- a/.github/workflows/image-e2e-tests.yaml +++ b/.github/workflows/image-e2e-tests.yaml @@ -37,3 +37,7 @@ jobs: run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "kcl version" - name: Test docker arm64 non-user with KCL running run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "echo 'a=1' | kcl run -" + - name: Test docker arm64 non-user with KCL module OCI source pulling + run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "kcl mod pull subhelloworld:0.0.1 --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.4" + - name: Test docker arm64 non-user with KCL module Git source pulling + run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "kcl mod pull cc:0.0.1 --git git://github.com/kcl-lang/flask-demo-kcl-manifests.git --commit 8308200" From a202206534d22259c5987c349bc076f6bd722d34 Mon Sep 17 00:00:00 2001 From: Peefy Date: Wed, 20 Nov 2024 10:39:21 +0800 Subject: [PATCH 2/5] chore: use the test image Signed-off-by: Peefy --- .github/workflows/image-e2e-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-e2e-tests.yaml b/.github/workflows/image-e2e-tests.yaml index 44e268a..b5412ee 100644 --- a/.github/workflows/image-e2e-tests.yaml +++ b/.github/workflows/image-e2e-tests.yaml @@ -38,6 +38,6 @@ jobs: - name: Test docker arm64 non-user with KCL running run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "echo 'a=1' | kcl run -" - name: Test docker arm64 non-user with KCL module OCI source pulling - run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "kcl mod pull subhelloworld:0.0.1 --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.4" + run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "kcl mod pull subhelloworld:0.0.1 --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.4" - name: Test docker arm64 non-user with KCL module Git source pulling - run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "kcl mod pull cc:0.0.1 --git git://github.com/kcl-lang/flask-demo-kcl-manifests.git --commit 8308200" + run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "kcl mod pull cc:0.0.1 --git git://github.com/kcl-lang/flask-demo-kcl-manifests.git --commit 8308200" From 94e6694cf9b2aa0d6e4258df2be1cdd2129f06a3 Mon Sep 17 00:00:00 2001 From: Peefy Date: Wed, 20 Nov 2024 10:49:50 +0800 Subject: [PATCH 3/5] chore: add KCL_PKG_PATH env Signed-off-by: Peefy --- .github/workflows/image-e2e-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-e2e-tests.yaml b/.github/workflows/image-e2e-tests.yaml index b5412ee..ef95f2b 100644 --- a/.github/workflows/image-e2e-tests.yaml +++ b/.github/workflows/image-e2e-tests.yaml @@ -38,6 +38,6 @@ jobs: - name: Test docker arm64 non-user with KCL running run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "echo 'a=1' | kcl run -" - name: Test docker arm64 non-user with KCL module OCI source pulling - run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "kcl mod pull subhelloworld:0.0.1 --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.4" + run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "kcl mod pull subhelloworld:0.0.1 --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.4" - name: Test docker arm64 non-user with KCL module Git source pulling - run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "kcl mod pull cc:0.0.1 --git git://github.com/kcl-lang/flask-demo-kcl-manifests.git --commit 8308200" + run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "kcl mod pull cc:0.0.1 --git git://github.com/kcl-lang/flask-demo-kcl-manifests.git --commit 8308200" From 541806f31c32bdcd264c7636da617d2fe39f3353 Mon Sep 17 00:00:00 2001 From: Peefy Date: Wed, 20 Nov 2024 10:53:35 +0800 Subject: [PATCH 4/5] test in the temp dir Signed-off-by: Peefy --- .github/workflows/image-e2e-tests.yaml | 4 ++-- Dockerfile | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-e2e-tests.yaml b/.github/workflows/image-e2e-tests.yaml index ef95f2b..bc44a3f 100644 --- a/.github/workflows/image-e2e-tests.yaml +++ b/.github/workflows/image-e2e-tests.yaml @@ -38,6 +38,6 @@ jobs: - name: Test docker arm64 non-user with KCL running run: docker run --platform linux/arm64 --user=999 --rm kcllang/kcl sh -c "echo 'a=1' | kcl run -" - name: Test docker arm64 non-user with KCL module OCI source pulling - run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "kcl mod pull subhelloworld:0.0.1 --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.4" + run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "mkdir -p /tmp && cd /tmp && kcl mod pull subhelloworld:0.0.1 --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.4" - name: Test docker arm64 non-user with KCL module Git source pulling - run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "kcl mod pull cc:0.0.1 --git git://github.com/kcl-lang/flask-demo-kcl-manifests.git --commit 8308200" + run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "mkdir -p /tmp && cd /tmp && kcl mod pull cc:0.0.1 --git git://github.com/kcl-lang/flask-demo-kcl-manifests.git --commit 8308200" diff --git a/Dockerfile b/Dockerfile index d23760e..a720d56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,8 @@ RUN kcl version && \ RUN apt-get update && \ apt-get install -y --no-install-recommends git ca-certificates && \ rm -rf /var/lib/apt/lists/* +# Create the temporary directory +RUN mkdir -p /tmp # Configure KCL runtime environment # Set temporary directories for write permissions From e5681b712dec66c0ec10859be6714d8f9ce320e1 Mon Sep 17 00:00:00 2001 From: Peefy Date: Wed, 20 Nov 2024 10:56:44 +0800 Subject: [PATCH 5/5] test: the git repo Signed-off-by: Peefy --- .github/workflows/image-e2e-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image-e2e-tests.yaml b/.github/workflows/image-e2e-tests.yaml index bc44a3f..54d4b8d 100644 --- a/.github/workflows/image-e2e-tests.yaml +++ b/.github/workflows/image-e2e-tests.yaml @@ -40,4 +40,4 @@ jobs: - name: Test docker arm64 non-user with KCL module OCI source pulling run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "mkdir -p /tmp && cd /tmp && kcl mod pull subhelloworld:0.0.1 --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.4" - name: Test docker arm64 non-user with KCL module Git source pulling - run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "mkdir -p /tmp && cd /tmp && kcl mod pull cc:0.0.1 --git git://github.com/kcl-lang/flask-demo-kcl-manifests.git --commit 8308200" + run: docker run --platform linux/arm64 --user=999 -e KCL_PKG_PATH=/tmp --rm kcllang/kcl:release-kcl-image-0.10.x sh -c "mkdir -p /tmp && cd /tmp && kcl run --git https://github.com/kcl-lang/flask-demo-kcl-manifests"