From cf45f1d6120d0ea1b9d9b858e654cf12bf0d5d3a Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Thu, 27 Jul 2023 22:25:38 +0300 Subject: [PATCH 01/11] fix: refactor docker build command Signed-off-by: Vitaliy Gulyy --- .github/workflows/smoke-test-pr-check.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 3d066e9b18a..528e7aed120 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -59,7 +59,9 @@ jobs: # build linux-libc-amd64:latest docker image # docker image prune -a -f - docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + + # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + docker buildx build --memory-swap -1 --memory 10g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . - name: Build Che-Code Docker image run: | @@ -72,7 +74,10 @@ jobs: REPLACE_FROM="COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl" sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile export DOCKER_BUILDKIT=1 - docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + + # docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + + docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . docker tag che-code:latest che-code:next docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next From e3594b53d4d8c79ada41af5b1b2a202a86554909 Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Fri, 28 Jul 2023 11:05:14 +0300 Subject: [PATCH 02/11] fix: refactor docker build command Signed-off-by: Vitaliy Gulyy --- .github/workflows/smoke-test-pr-check.yaml | 27 +++++++++++++--------- build/dockerfiles/linux-libc.Dockerfile | 7 +++++- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 528e7aed120..45be688049b 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -28,15 +28,20 @@ jobs: steps: - name: Checkout che-code source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Configuring nodejs 14.x version - uses: actions/setup-node@v3 - with: - node-version: '16' + # - name: Configuring nodejs 14.x version + # uses: actions/setup-node@v3 + # with: + # node-version: '16' + + # - name: Install yq + # run: sudo pip install yq - - name: Install yq - run: sudo pip install yq + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Prepare Che-Code Dockerfile ( remove tests ) run: | @@ -44,8 +49,8 @@ jobs: # truncate Dockerfile, remove section that runs tests # cp -f build/dockerfiles/linux-libc.Dockerfile build/dockerfiles/linux-libc.no-test.Dockerfile - REMOVE_FROM="### Testing" - REMOVE_TO="# Store the content of the result" + REMOVE_FROM="### Beginning of tests" + REMOVE_TO="### Ending of tests" sed -i "/${REMOVE_FROM}/,/${REMOVE_TO}/{/${REMOVE_FROM}/n;/${REMOVE_TO}/!d;}" build/dockerfiles/linux-libc.no-test.Dockerfile # @@ -59,9 +64,9 @@ jobs: # build linux-libc-amd64:latest docker image # docker image prune -a -f - + # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - docker buildx build --memory-swap -1 --memory 10g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . + docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . - name: Build Che-Code Docker image run: | diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 18791f8b37f..d9aa6156968 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -75,7 +75,9 @@ RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \ RUN chmod a+x /checode/out/server-main.js \ && chgrp -R 0 /checode && chmod -R g+rwX /checode -### Testing +### Beginning of tests +# Do not change line above! It is used to cut this section to skip tests + # Compile tests RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \ compile-extension:markdown-language-features \ @@ -120,6 +122,9 @@ RUN [[ $(uname -m) == "x86_64" ]] && NODE_ARCH=$(echo "console.log(process.arch) VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" +# Do not change line below! It is used to cut this section to skip tests +### Ending of tests + # Store the content of the result FROM scratch as linux-libc-content COPY --from=linux-libc-builder /checode /checode-linux-libc From 07e8f285b4a7ea9a929a106498aa3f1b60582533 Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Fri, 28 Jul 2023 18:56:42 +0300 Subject: [PATCH 03/11] fix: refactor docker build command Signed-off-by: Vitaliy Gulyy --- .github/workflows/smoke-test-pr-check.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 45be688049b..50cad3a3c9f 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -66,7 +66,8 @@ jobs: docker image prune -a -f # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . + # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . + docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - name: Build Che-Code Docker image run: | @@ -82,7 +83,9 @@ jobs: # docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . + # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . + docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + docker tag che-code:latest che-code:next docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next From e36bc825820f50e85889eb80ce5475a9ff3bdf93 Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Mon, 31 Jul 2023 11:27:09 +0300 Subject: [PATCH 04/11] fix: refactor docker build command Signed-off-by: Vitaliy Gulyy --- .github/workflows/smoke-test-pr-check.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 50cad3a3c9f..1f63d7d5aab 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -66,8 +66,13 @@ jobs: docker image prune -a -f # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + docker build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . - docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + + - name: Display docker images + run: | + docker images - name: Build Che-Code Docker image run: | @@ -79,12 +84,13 @@ jobs: sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile REPLACE_FROM="COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl" sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile - export DOCKER_BUILDKIT=1 + export DOCKER_BUILDKIT=1 # docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + docker build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . - docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . docker tag che-code:latest che-code:next docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next From 65a22ff058310af38c9c2e936485c23a036b2707 Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Tue, 12 Sep 2023 00:29:05 +0300 Subject: [PATCH 05/11] chore: temporary disable some github workflows Signed-off-by: Vitaliy Gulyy --- ...heck-image-publish.yml => pr-check-image-publish.yml.disabled} | 0 .github/workflows/{pr-check.yml => pr-check.yml.disabled} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{pr-check-image-publish.yml => pr-check-image-publish.yml.disabled} (100%) rename .github/workflows/{pr-check.yml => pr-check.yml.disabled} (100%) diff --git a/.github/workflows/pr-check-image-publish.yml b/.github/workflows/pr-check-image-publish.yml.disabled similarity index 100% rename from .github/workflows/pr-check-image-publish.yml rename to .github/workflows/pr-check-image-publish.yml.disabled diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml.disabled similarity index 100% rename from .github/workflows/pr-check.yml rename to .github/workflows/pr-check.yml.disabled From c80c27f9e598b5fc8235de02d64dbb9a240b95cc Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Tue, 12 Sep 2023 10:59:51 +0300 Subject: [PATCH 06/11] chore: fix smoke test pull request check Signed-off-by: Vitaliy Gulyy --- ...publish.yml => image-publish.yml.disabled} | 0 .github/workflows/smoke-test-pr-check.yaml | 117 +++++++++--------- 2 files changed, 59 insertions(+), 58 deletions(-) rename .github/workflows/{image-publish.yml => image-publish.yml.disabled} (100%) diff --git a/.github/workflows/image-publish.yml b/.github/workflows/image-publish.yml.disabled similarity index 100% rename from .github/workflows/image-publish.yml rename to .github/workflows/image-publish.yml.disabled diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 1f63d7d5aab..c7657843ef5 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -30,70 +30,70 @@ jobs: - name: Checkout che-code source code uses: actions/checkout@v3 - # - name: Configuring nodejs 14.x version - # uses: actions/setup-node@v3 - # with: - # node-version: '16' - - # - name: Install yq - # run: sudo pip install yq - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Prepare Che-Code Dockerfile ( remove tests ) - run: | - # - # truncate Dockerfile, remove section that runs tests - # - cp -f build/dockerfiles/linux-libc.Dockerfile build/dockerfiles/linux-libc.no-test.Dockerfile - REMOVE_FROM="### Beginning of tests" - REMOVE_TO="### Ending of tests" - sed -i "/${REMOVE_FROM}/,/${REMOVE_TO}/{/${REMOVE_FROM}/n;/${REMOVE_TO}/!d;}" build/dockerfiles/linux-libc.no-test.Dockerfile - - # - # show the Dockerfile - # - cat build/dockerfiles/linux-libc.no-test.Dockerfile - - - name: Compile Che-Code editor - run: | - # - # build linux-libc-amd64:latest docker image - # - docker image prune -a -f - - # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - docker build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . - # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + ### - name: Configuring nodejs 14.x version + ### uses: actions/setup-node@v3 + ### with: + ### node-version: '16' + + ### - name: Install yq + ### run: sudo pip install yq + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v2 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + + # - name: Prepare Che-Code Dockerfile ( remove tests ) + # run: | + # # + # # truncate Dockerfile, remove section that runs tests + # # + # cp -f build/dockerfiles/linux-libc.Dockerfile build/dockerfiles/linux-libc.no-test.Dockerfile + # REMOVE_FROM="### Beginning of tests" + # REMOVE_TO="### Ending of tests" + # sed -i "/${REMOVE_FROM}/,/${REMOVE_TO}/{/${REMOVE_FROM}/n;/${REMOVE_TO}/!d;}" build/dockerfiles/linux-libc.no-test.Dockerfile + + # # + # # show the Dockerfile + # # + # cat build/dockerfiles/linux-libc.no-test.Dockerfile + + # - name: Compile Che-Code editor + # run: | + # # + # # build linux-libc-amd64:latest docker image + # # + # docker image prune -a -f + + # # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + # docker build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + # # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . + # # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - name: Display docker images run: | docker images - - name: Build Che-Code Docker image - run: | - # - # build che-code:latest docker image - # - cp -f build/dockerfiles/assembly.Dockerfile build/dockerfiles/assembly.copy.Dockerfile - REPLACE_FROM="FROM linux-musl-amd64 as linux-musl-content" - sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile - REPLACE_FROM="COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl" - sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile + # - name: Build Che-Code Docker image + # run: | + # # + # # build che-code:latest docker image + # # + # cp -f build/dockerfiles/assembly.Dockerfile build/dockerfiles/assembly.copy.Dockerfile + # REPLACE_FROM="FROM linux-musl-amd64 as linux-musl-content" + # sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile + # REPLACE_FROM="COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl" + # sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile - export DOCKER_BUILDKIT=1 - # docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - docker build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - - # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . - # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + # export DOCKER_BUILDKIT=1 + # # docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + # docker build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + + # # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . + # # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - docker tag che-code:latest che-code:next - docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next + # docker tag che-code:latest che-code:next + # docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next - name: Start minikube id: run-minikube @@ -109,7 +109,8 @@ jobs: # # load che-code images from /tmp/che-code-latest.tar # - eval $(minikube docker-env) && docker load -i /tmp/che-code-latest.tar && rm /tmp/che-code-latest.tar + # temporary + # eval $(minikube docker-env) && docker load -i /tmp/che-code-latest.tar && rm /tmp/che-code-latest.tar # # deploy Che From 3b812ac1f600ca0963db3284b03a23258d133746 Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Tue, 12 Sep 2023 11:24:52 +0300 Subject: [PATCH 07/11] chore: fix smoke test pull request check Signed-off-by: Vitaliy Gulyy --- .github/workflows/smoke-test-pr-check.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index c7657843ef5..5f2c5d8bb51 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -74,6 +74,22 @@ jobs: run: | docker images + - name: Disk free TO + run: | + df -h + + - name: Cleanup docker images + run: | + docker system prune -af + + - name: Display docker images again + run: | + docker images + + - name: Disk free AFTER + run: | + df -h + # - name: Build Che-Code Docker image # run: | # # From 2289ef477764e92ca49dbef630b26befbd02f064 Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Thu, 14 Sep 2023 15:23:01 +0300 Subject: [PATCH 08/11] chore: fix smoke test pull request check Signed-off-by: Vitaliy Gulyy --- .github/workflows/smoke-test-pr-check.yaml | 100 +++++++++++---------- 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 5f2c5d8bb51..38988e9db06 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -40,40 +40,66 @@ jobs: # - name: Set up QEMU # uses: docker/setup-qemu-action@v2 + # - name: Set up Docker Buildx # uses: docker/setup-buildx-action@v2 - # - name: Prepare Che-Code Dockerfile ( remove tests ) - # run: | - # # - # # truncate Dockerfile, remove section that runs tests - # # - # cp -f build/dockerfiles/linux-libc.Dockerfile build/dockerfiles/linux-libc.no-test.Dockerfile - # REMOVE_FROM="### Beginning of tests" - # REMOVE_TO="### Ending of tests" - # sed -i "/${REMOVE_FROM}/,/${REMOVE_TO}/{/${REMOVE_FROM}/n;/${REMOVE_TO}/!d;}" build/dockerfiles/linux-libc.no-test.Dockerfile - - # # - # # show the Dockerfile - # # - # cat build/dockerfiles/linux-libc.no-test.Dockerfile - - # - name: Compile Che-Code editor - # run: | - # # - # # build linux-libc-amd64:latest docker image - # # - # docker image prune -a -f - - # # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - # docker build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - # # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . - # # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + - name: Prepare Che-Code Dockerfile ( remove tests ) + run: | + # + # truncate Dockerfile, remove section that runs tests + # + cp -f build/dockerfiles/linux-libc.Dockerfile build/dockerfiles/linux-libc.no-test.Dockerfile + REMOVE_FROM="### Beginning of tests" + REMOVE_TO="### Ending of tests" + sed -i "/${REMOVE_FROM}/,/${REMOVE_TO}/{/${REMOVE_FROM}/n;/${REMOVE_TO}/!d;}" build/dockerfiles/linux-libc.no-test.Dockerfile + + # + # show the Dockerfile + # + cat build/dockerfiles/linux-libc.no-test.Dockerfile + + - name: Compile Che-Code editor + run: | + # + # build linux-libc-amd64:latest docker image + # + docker image prune -a -f + + # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + docker build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . + # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - name: Display docker images run: | docker images + - name: Build Che-Code Docker image + run: | + # + # build che-code:latest docker image + # + cp -f build/dockerfiles/assembly.Dockerfile build/dockerfiles/assembly.copy.Dockerfile + REPLACE_FROM="FROM linux-musl-amd64 as linux-musl-content" + sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile + REPLACE_FROM="COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl" + sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile + + export DOCKER_BUILDKIT=1 + # docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + docker build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + + # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . + # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + + docker tag che-code:latest che-code:next + docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next + + + + + - name: Disk free TO run: | df -h @@ -90,26 +116,9 @@ jobs: run: | df -h - # - name: Build Che-Code Docker image - # run: | - # # - # # build che-code:latest docker image - # # - # cp -f build/dockerfiles/assembly.Dockerfile build/dockerfiles/assembly.copy.Dockerfile - # REPLACE_FROM="FROM linux-musl-amd64 as linux-musl-content" - # sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile - # REPLACE_FROM="COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl" - # sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile - - # export DOCKER_BUILDKIT=1 - # # docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - # docker build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - # # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . - # # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - # docker tag che-code:latest che-code:next - # docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next + - name: Start minikube id: run-minikube @@ -125,8 +134,7 @@ jobs: # # load che-code images from /tmp/che-code-latest.tar # - # temporary - # eval $(minikube docker-env) && docker load -i /tmp/che-code-latest.tar && rm /tmp/che-code-latest.tar + eval $(minikube docker-env) && docker load -i /tmp/che-code-latest.tar && rm /tmp/che-code-latest.tar # # deploy Che From 959875688e14c75050795ade68bde008878de654 Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Thu, 14 Sep 2023 18:39:22 +0300 Subject: [PATCH 09/11] chore: fix smoke test pull request check Signed-off-by: Vitaliy Gulyy --- .github/workflows/smoke-test-pr-check.yaml | 43 ++++++---------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 38988e9db06..42b28527d05 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -30,20 +30,6 @@ jobs: - name: Checkout che-code source code uses: actions/checkout@v3 - ### - name: Configuring nodejs 14.x version - ### uses: actions/setup-node@v3 - ### with: - ### node-version: '16' - - ### - name: Install yq - ### run: sudo pip install yq - - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v2 - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - - name: Prepare Che-Code Dockerfile ( remove tests ) run: | # @@ -65,15 +51,7 @@ jobs: # build linux-libc-amd64:latest docker image # docker image prune -a -f - - # docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . docker build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 . - # docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - - - name: Display docker images - run: | - docker images - name: Build Che-Code Docker image run: | @@ -96,25 +74,28 @@ jobs: docker tag che-code:latest che-code:next docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next + - name: Display docker images + run: | + docker images - - name: Disk free TO - run: | - df -h + # - name: Disk free TO + # run: | + # df -h - name: Cleanup docker images run: | docker system prune -af - - name: Display docker images again - run: | - docker images + # - name: Display docker images again + # run: | + # docker images - - name: Disk free AFTER - run: | - df -h + # - name: Disk free AFTER + # run: | + # df -h From 089a2d1d38b800347b8a3ddd9ba346df9f9a006b Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Thu, 14 Sep 2023 20:10:04 +0300 Subject: [PATCH 10/11] chore: fix smoke test pull request check Signed-off-by: Vitaliy Gulyy --- ...publish.yml.disabled => image-publish.yml} | 0 ...ml.disabled => pr-check-image-publish.yml} | 0 .../{pr-check.yml.disabled => pr-check.yml} | 0 .github/workflows/smoke-test-pr-check.yaml | 25 +++---------------- 4 files changed, 3 insertions(+), 22 deletions(-) rename .github/workflows/{image-publish.yml.disabled => image-publish.yml} (100%) rename .github/workflows/{pr-check-image-publish.yml.disabled => pr-check-image-publish.yml} (100%) rename .github/workflows/{pr-check.yml.disabled => pr-check.yml} (100%) diff --git a/.github/workflows/image-publish.yml.disabled b/.github/workflows/image-publish.yml similarity index 100% rename from .github/workflows/image-publish.yml.disabled rename to .github/workflows/image-publish.yml diff --git a/.github/workflows/pr-check-image-publish.yml.disabled b/.github/workflows/pr-check-image-publish.yml similarity index 100% rename from .github/workflows/pr-check-image-publish.yml.disabled rename to .github/workflows/pr-check-image-publish.yml diff --git a/.github/workflows/pr-check.yml.disabled b/.github/workflows/pr-check.yml similarity index 100% rename from .github/workflows/pr-check.yml.disabled rename to .github/workflows/pr-check.yml diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 42b28527d05..041ea43d452 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -65,12 +65,8 @@ jobs: sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile export DOCKER_BUILDKIT=1 - # docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . docker build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile --load -t che-code . - # docker buildx build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . - docker tag che-code:latest che-code:next docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next @@ -78,28 +74,13 @@ jobs: run: | docker images - - - - # - name: Disk free TO - # run: | - # df -h - - name: Cleanup docker images run: | docker system prune -af - # - name: Display docker images again - # run: | - # docker images - - # - name: Disk free AFTER - # run: | - # df -h - - - - + - name: Disk free + run: | + df -h - name: Start minikube id: run-minikube From 935a0a564846b6016c3b674f14add8f0b51ceb8d Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Fri, 15 Sep 2023 12:53:50 +0300 Subject: [PATCH 11/11] chore: code cleanup Signed-off-by: Vitaliy Gulyy --- .github/workflows/smoke-test-pr-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-test-pr-check.yaml b/.github/workflows/smoke-test-pr-check.yaml index 041ea43d452..fd8803209ab 100644 --- a/.github/workflows/smoke-test-pr-check.yaml +++ b/.github/workflows/smoke-test-pr-check.yaml @@ -51,7 +51,7 @@ jobs: # build linux-libc-amd64:latest docker image # docker image prune -a -f - docker build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . + docker build --memory-swap -1 --memory 12g -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 . - name: Build Che-Code Docker image run: | @@ -65,7 +65,7 @@ jobs: sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile export DOCKER_BUILDKIT=1 - docker build --platform linux/amd64 -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . + docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code . docker tag che-code:latest che-code:next docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next