From 2f86fc497094655ec24c8ef73019840a0eb29989 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 05:02:26 +0000 Subject: [PATCH 01/24] create actions for building --- .../build_images_with_cache/action.yml | 43 +++++++++++++++++++ .github/workflows/test-server-all.yml | 27 +++--------- 2 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 .github/actions/build_images_with_cache/action.yml diff --git a/.github/actions/build_images_with_cache/action.yml b/.github/actions/build_images_with_cache/action.yml new file mode 100644 index 000000000..f487ac7b4 --- /dev/null +++ b/.github/actions/build_images_with_cache/action.yml @@ -0,0 +1,43 @@ +inputs: + container-name: + description: "container name to build" + required: true + + cache-key: + description: "key for actions/cache" + required: true + + builder-name: + description: "buildx.outputs.name" + required: true + + target: + description: "target image" + required: true + +runs: + using: "composite" + steps: + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache-${{ inputs.container-name }} + key: ${{ runner.os }}-${{ inputs.container-name }}-${{ inputs.cache-key }} + restore-keys: ${{ runner.os }}-${{ inputs.container-name }}- + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: ./ + file: ./packages/server/manage_container/Dockerfile + builder: ${{ steps.buildx.outputs.name }} + cache-from: type=local,scope=${{ inputs.container-name }},src=/tmp/.buildx-cache-${{ inputs.container-name }} + cache-to: type=local,mode=max,scope=${{ inputs.container-name }},dest=/tmp/.buildx-cache-${{ inputs.container-name }}-new + target: ${{ inputs.target }} + tags: tags_${{ inputs.container-name }} + load: true + + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache-${{ inputs.container-name }} + mv /tmp/.buildx-cache-${{ inputs.container-name }}-new /tmp/.buildx-cache-${{ inputs.container-name }} \ No newline at end of file diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 5bfbd3e18..b45a69234 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -252,38 +252,21 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-medium_mc-${{ hashFiles('./packages/server/manage_container/**') }} - restore-keys: ${{ runner.os }}-medium_mc- - - name: Set up Docker buildx id: buildx uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v3 + - uses: ./.github/actions/build_images_with_cache with: - context: ./ - file: ./packages/server/manage_container/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=medium_mc,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,scope=medium_mc,dest=/tmp/.buildx-cache-new - target: medium - tags: tags_medium_mc - load: true + container-name: "medium_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "medium" - name: Run bazel test in manage_container run: make test t=./manage_container m=run p=medium working-directory: ./scripts - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - medium_test_libclient: runs-on: ubuntu-latest needs: [lint] From abbae709a04080f948ed787d28a07eae3dc81433 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 05:05:34 +0000 Subject: [PATCH 02/24] format --- .github/actions/build_images_with_cache/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/build_images_with_cache/action.yml b/.github/actions/build_images_with_cache/action.yml index f487ac7b4..3ff4c66c8 100644 --- a/.github/actions/build_images_with_cache/action.yml +++ b/.github/actions/build_images_with_cache/action.yml @@ -38,6 +38,7 @@ runs: load: true - name: Move cache - run: | - rm -rf /tmp/.buildx-cache-${{ inputs.container-name }} - mv /tmp/.buildx-cache-${{ inputs.container-name }}-new /tmp/.buildx-cache-${{ inputs.container-name }} \ No newline at end of file + shell: bash + run: | + rm -rf /tmp/.buildx-cache-${{ inputs.container-name }} + mv /tmp/.buildx-cache-${{ inputs.container-name }}-new /tmp/.buildx-cache-${{ inputs.container-name }} From d8ee5dbc2660c2a0ba32593daf0e4385d770d965 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 06:04:38 +0000 Subject: [PATCH 03/24] uses for all container --- .github/workflows/test-server-all.yml | 282 +++++--------------------- 1 file changed, 55 insertions(+), 227 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index b45a69234..ee2bf8908 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -50,38 +50,21 @@ jobs: env: BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-small_cc-${{ hashFiles('./packages/server/computation_container/**') }} - restore-keys: ${{ runner.os }}-small_cc- - - name: Set up Docker buildx id: buildx uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v3 + - uses: ./.github/actions/build_images_with_cache with: - context: ./ - file: ./packages/server/computation_container/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=small_cc,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,scope=small_cc,dest=/tmp/.buildx-cache-new - target: small - tags: tags_small_cc - load: true + container-name: "small_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "small" - name: Run bazel test in computation_container run: make test t=./computation_container m=run p=small working-directory: ./scripts - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - small_test_mc: runs-on: ubuntu-latest needs: [lint] @@ -90,38 +73,21 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-small_mc-${{ hashFiles('./packages/server/manage_container/**') }} - restore-keys: ${{ runner.os }}-small_mc- - - name: Set up Docker buildx id: buildx uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v3 + - uses: ./.github/actions/build_images_with_cache with: - context: ./ - file: ./packages/server/manage_container/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=small_mc,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,scope=small_mc,dest=/tmp/.buildx-cache-new - target: small - tags: tags_small_mc - load: true + container-name: "small_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "small" - name: Run Go test in manage_container run: make test t=./manage_container m=run p=small working-directory: ./scripts - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - small_test_bts: runs-on: ubuntu-latest needs: [lint] @@ -130,38 +96,21 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-small_bts-${{ hashFiles('./packages/server/beaver_triple_service/**') }} - restore-keys: ${{ runner.os }}-small_bts- - - name: Set up Docker buildx id: buildx uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v3 + - uses: ./.github/actions/build_images_with_cache with: - context: ./ - file: ./packages/server/beaver_triple_service/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=small_bts,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,scope=small_bts,dest=/tmp/.buildx-cache-new - target: small - tags: tags_small_bts - load: true + container-name: "small_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "small" - name: Run test in beaver_triple_service run: make test t=./beaver_triple_service m=run working-directory: ./scripts - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - small_test: runs-on: ubuntu-latest needs: [lint, small_test_cc, small_test_mc, small_test_bts] @@ -196,55 +145,24 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - name: Cache Docker layers cc - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache-cc - key: ${{ runner.os }}-medium_cc-${{ hashFiles('./packages/server/computation_container/**') }} - restore-keys: ${{ runner.os }}-medium_cc- - - - name: Build and push cc - uses: docker/build-push-action@v3 - with: - context: ./ - file: ./packages/server/computation_container/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=medium_cc,src=/tmp/.buildx-cache-cc - cache-to: type=local,mode=max,scope=medium_cc,dest=/tmp/.buildx-cache-cc-new - target: medium - tags: tags_medium_cc - load: true - - - name: Cache Docker layers bts - uses: actions/cache@v3 + - uses: ./.github/actions/build_images_with_cache with: - path: /tmp/.buildx-cache-bts - key: ${{ runner.os }}-dev_bts-${{ hashFiles('./packages/server/beaver_triple_service/**') }} - restore-keys: ${{ runner.os }}-dev_bts- + container-name: "medium_mc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "medium_mc" - - name: Build and push bts - uses: docker/build-push-action@v3 + - uses: ./.github/actions/build_images_with_cache with: - context: ./ - file: ./packages/server/beaver_triple_service/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=dev_bts,src=/tmp/.buildx-cache-bts - cache-to: type=local,mode=max,scope=dev_bts,dest=/tmp/.buildx-cache-bts-new - target: dev - tags: tags_dev_bts - load: true + container-name: "dev_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" - name: Run bazel test in computation_container run: make test t=./computation_container m=run p=medium working-directory: ./scripts - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache-cc - mv /tmp/.buildx-cache-cc-new /tmp/.buildx-cache-cc - rm -rf /tmp/.buildx-cache-bts - mv /tmp/.buildx-cache-bts-new /tmp/.buildx-cache-bts - medium_test_mc: runs-on: ubuntu-latest needs: [lint] @@ -296,76 +214,31 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - name: Cache Docker layers libc - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache-libc - key: ${{ runner.os }}-medium_libc-${{ hashFiles('./packages/client/libclient-py/**') }} - restore-keys: ${{ runner.os }}-medium_libc- - - - name: Build and push libc - uses: docker/build-push-action@v3 - with: - context: ./ - file: ./scripts/libclient/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=medium_libc,src=/tmp/.buildx-cache-libc - cache-to: type=local,mode=max,scope=medium_libc,dest=/tmp/.buildx-cache-libc-new - target: medium - tags: tags_medium_libc - load: true - - - name: Cache Docker layers cc - uses: actions/cache@v3 + - uses: ./.github/actions/build_images_with_cache with: - path: /tmp/.buildx-cache-cc - key: ${{ runner.os }}-dev_cc-${{ hashFiles('./packages/server/computation_container/**') }} - restore-keys: ${{ runner.os }}-dev_cc- + container-name: "medium_libc" + cache-key: ${{ hashFiles('./packages/client/libclient-py/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "medium" - - name: Build and push cc - uses: docker/build-push-action@v3 - with: - context: ./ - file: ./packages/server/computation_container/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=dev_cc,src=/tmp/.buildx-cache-cc - cache-to: type=local,mode=max,scope=dev_cc,dest=/tmp/.buildx-cache-cc-new - target: dev - tags: tags_dev_cc - load: true - - - name: Cache Docker layers mc - uses: actions/cache@v3 + - uses: ./.github/actions/build_images_with_cache with: - path: /tmp/.buildx-cache-mc - key: ${{ runner.os }}-dev_mc-${{ hashFiles('./packages/server/manage_container/**') }} - restore-keys: ${{ runner.os }}-dev_mc- + container-name: "dev_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" - - name: Build and push mc - uses: docker/build-push-action@v3 + - uses: ./.github/actions/build_images_with_cache with: - context: ./ - file: ./packages/server/manage_container/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=dev_mc,src=/tmp/.buildx-cache-mc - cache-to: type=local,mode=max,scope=dev_mc,dest=/tmp/.buildx-cache-mc-new - target: dev - tags: tags_dev_mc - load: true + container-name: "dev_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" - name: Run bazel test in libclient run: make test t=./libclient m=run p=medium working-directory: ./scripts - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache-libc - mv /tmp/.buildx-cache-libc-new /tmp/.buildx-cache-libc - rm -rf /tmp/.buildx-cache-cc - mv /tmp/.buildx-cache-cc-new /tmp/.buildx-cache-cc - rm -rf /tmp/.buildx-cache-mc - mv /tmp/.buildx-cache-mc-new /tmp/.buildx-cache-mc - medium_test_container: runs-on: ubuntu-latest needs: [lint] @@ -404,76 +277,31 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - name: Cache Docker layers bts - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache-bts - key: ${{ runner.os }}-dev_bts-${{ hashFiles('./packages/server/beaver_triple_service/**') }} - restore-keys: ${{ runner.os }}-dev_bts- - - - name: Build and push bts - uses: docker/build-push-action@v3 - with: - context: ./ - file: ./packages/server/beaver_triple_service/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=dev_bts,src=/tmp/.buildx-cache-bts - cache-to: type=local,mode=max,scope=dev_bts,dest=/tmp/.buildx-cache-bts-new - target: dev - tags: tags_dev_bts - load: true - - - name: Cache Docker layers cc - uses: actions/cache@v3 + - uses: ./.github/actions/build_images_with_cache with: - path: /tmp/.buildx-cache-cc - key: ${{ runner.os }}-dev_cc-${{ hashFiles('./packages/server/computation_container/**') }} - restore-keys: ${{ runner.os }}-dev_cc- + container-name: "dev_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" - - name: Build and push cc - uses: docker/build-push-action@v3 - with: - context: ./ - file: ./packages/server/computation_container/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=dev_cc,src=/tmp/.buildx-cache-cc - cache-to: type=local,mode=max,scope=dev_cc,dest=/tmp/.buildx-cache-cc-new - target: dev - tags: tags_dev_cc - load: true - - - name: Cache Docker layers - uses: actions/cache@v3 + - uses: ./.github/actions/build_images_with_cache with: - path: /tmp/.buildx-cache-mc - key: ${{ runner.os }}-dev_mc-${{ hashFiles('./packages/server/manage_container/**') }} - restore-keys: ${{ runner.os }}-dev_mc- + container-name: "dev_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" - - name: Build and push mc - uses: docker/build-push-action@v3 + - uses: ./.github/actions/build_images_with_cache with: - context: ./ - file: ./packages/server/manage_container/Dockerfile - builder: ${{ steps.buildx.outputs.name }} - cache-from: type=local,scope=dev_mc,src=/tmp/.buildx-cache-mc - cache-to: type=local,mode=max,scope=dev_mc,dest=/tmp/.buildx-cache-mc-new - target: dev - tags: tags_dev_mc - load: true + container-name: "dev_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" - name: Run container test run: make test t=./container_test m=run p=medium working-directory: ./scripts - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache-bts - mv /tmp/.buildx-cache-bts-new /tmp/.buildx-cache-bts - rm -rf /tmp/.buildx-cache-cc - mv /tmp/.buildx-cache-cc-new /tmp/.buildx-cache-cc - rm -rf /tmp/.buildx-cache-mc - mv /tmp/.buildx-cache-mc-new /tmp/.buildx-cache-mc - medium_test: runs-on: ubuntu-latest needs: From 2c10508baa8278ba8cc533a0c326c017cec061dd Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 06:07:30 +0000 Subject: [PATCH 04/24] typo --- .github/workflows/test-server-all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index ee2bf8908..93b91c1a9 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -147,10 +147,10 @@ jobs: - uses: ./.github/actions/build_images_with_cache with: - container-name: "medium_mc" + container-name: "medium_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} builder-name: ${{ steps.buildx.outputs.name }} - target: "medium_mc" + target: "medium_cc" - uses: ./.github/actions/build_images_with_cache with: From e3573e93cf307a9d85ddbed5c2d72b194033c3c1 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 06:09:48 +0000 Subject: [PATCH 05/24] typo --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 93b91c1a9..7ec3b6a38 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -150,7 +150,7 @@ jobs: container-name: "medium_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} builder-name: ${{ steps.buildx.outputs.name }} - target: "medium_cc" + target: "medium" - uses: ./.github/actions/build_images_with_cache with: From af379a01c37a276a88e9f15ec1cd67c560c8180d Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 06:13:52 +0000 Subject: [PATCH 06/24] display container name --- .github/workflows/test-server-all.yml | 36 ++++++++++++++++++--------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 7ec3b6a38..da296a0c5 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -54,7 +54,8 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - uses: ./.github/actions/build_images_with_cache + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "small_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} @@ -77,7 +78,8 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - uses: ./.github/actions/build_images_with_cache + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "small_mc" cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} @@ -100,7 +102,8 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - uses: ./.github/actions/build_images_with_cache + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "small_bts" cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} @@ -145,14 +148,16 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - uses: ./.github/actions/build_images_with_cache + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "medium_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} builder-name: ${{ steps.buildx.outputs.name }} target: "medium" - - uses: ./.github/actions/build_images_with_cache + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "dev_bts" cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} @@ -174,7 +179,8 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - uses: ./.github/actions/build_images_with_cache + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "medium_mc" cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} @@ -214,21 +220,24 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - uses: ./.github/actions/build_images_with_cache + - name: Build libc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "medium_libc" cache-key: ${{ hashFiles('./packages/client/libclient-py/**') }} builder-name: ${{ steps.buildx.outputs.name }} target: "medium" - - uses: ./.github/actions/build_images_with_cache + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "dev_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} builder-name: ${{ steps.buildx.outputs.name }} target: "dev" - - uses: ./.github/actions/build_images_with_cache + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "dev_mc" cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} @@ -277,21 +286,24 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - uses: ./.github/actions/build_images_with_cache + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "dev_bts" cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} builder-name: ${{ steps.buildx.outputs.name }} target: "dev" - - uses: ./.github/actions/build_images_with_cache + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "dev_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} builder-name: ${{ steps.buildx.outputs.name }} target: "dev" - - uses: ./.github/actions/build_images_with_cache + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache with: container-name: "dev_mc" cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} From 5e8ce84933d7f032d43f40fa2accacc1dccad72e Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 06:31:57 +0000 Subject: [PATCH 07/24] dockerfile path --- .github/actions/build_images_with_cache/action.yml | 6 +++++- .github/workflows/test-server-all.yml | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/actions/build_images_with_cache/action.yml b/.github/actions/build_images_with_cache/action.yml index 3ff4c66c8..c3bb0c73a 100644 --- a/.github/actions/build_images_with_cache/action.yml +++ b/.github/actions/build_images_with_cache/action.yml @@ -7,6 +7,10 @@ inputs: description: "key for actions/cache" required: true + dockerfile-path: + description: "path to dockerfile" + required: true + builder-name: description: "buildx.outputs.name" required: true @@ -29,7 +33,7 @@ runs: uses: docker/build-push-action@v3 with: context: ./ - file: ./packages/server/manage_container/Dockerfile + file: ${{ inputs.dockerfile-path }} builder: ${{ steps.buildx.outputs.name }} cache-from: type=local,scope=${{ inputs.container-name }},src=/tmp/.buildx-cache-${{ inputs.container-name }} cache-to: type=local,mode=max,scope=${{ inputs.container-name }},dest=/tmp/.buildx-cache-${{ inputs.container-name }}-new diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index da296a0c5..b0b9981a4 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -59,6 +59,7 @@ jobs: with: container-name: "small_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "small" @@ -83,6 +84,7 @@ jobs: with: container-name: "small_mc" cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "small" @@ -107,6 +109,7 @@ jobs: with: container-name: "small_bts" cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "small" @@ -153,6 +156,7 @@ jobs: with: container-name: "medium_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "medium" @@ -161,6 +165,7 @@ jobs: with: container-name: "dev_bts" cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "dev" @@ -184,6 +189,7 @@ jobs: with: container-name: "medium_mc" cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "medium" @@ -225,6 +231,7 @@ jobs: with: container-name: "medium_libc" cache-key: ${{ hashFiles('./packages/client/libclient-py/**') }} + dockerfile-path: ./scripts/libclient/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "medium" @@ -233,6 +240,7 @@ jobs: with: container-name: "dev_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "dev" @@ -241,6 +249,7 @@ jobs: with: container-name: "dev_mc" cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "dev" @@ -291,6 +300,7 @@ jobs: with: container-name: "dev_bts" cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ../packages/server/beaver_triple_service/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "dev" @@ -299,6 +309,7 @@ jobs: with: container-name: "dev_cc" cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "dev" @@ -307,6 +318,7 @@ jobs: with: container-name: "dev_mc" cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "dev" From 8b7e9c5905eb1649b195bf283db2868e1042faa0 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 06:39:26 +0000 Subject: [PATCH 08/24] typo --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index b0b9981a4..56533a762 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -300,7 +300,7 @@ jobs: with: container-name: "dev_bts" cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} - dockerfile-path: ../packages/server/beaver_triple_service/Dockerfile + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} target: "dev" From ea67f3088f8e7d00b98efc435015afb5186f8822 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 07:00:44 +0000 Subject: [PATCH 09/24] separate medium container test --- .github/workflows/test-server-all.yml | 317 ++++++++++++++++++++++++-- 1 file changed, 304 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 56533a762..a0d4a586e 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -257,7 +257,7 @@ jobs: run: make test t=./libclient m=run p=medium working-directory: ./scripts - medium_test_container: + medium_test_container_restart: runs-on: ubuntu-latest needs: [lint] steps: @@ -323,20 +323,311 @@ jobs: target: "dev" - name: Run container test - run: make test t=./container_test m=run p=medium + run: | + pipenv sync + pipenv install --skip-lock ../../packages/client/libclient-py + pipenv run pytest ./tests/test_restart_request.py -s -v -log-cli-level=DEBUG + working-directory: ./scripts/container_test + + medium_test_container_down_test_failed_send_share_with_down: + runs-on: ubuntu-latest + needs: [lint] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + submodules: true + + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install pipenv + run: pip install pipenv working-directory: ./scripts - medium_test: + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Run container test + run: | + pipenv sync + pipenv install --skip-lock ../../packages/client/libclient-py + pipenv run pytest ./tests/test_down_request.py::test_failed_send_share_with_down -s -v -log-cli-level=DEBUG + working-directory: ./scripts/container_test + + medium_test_container_down_test_failed_execute_computation_with_down_0: runs-on: ubuntu-latest - needs: - [ - lint, - medium_test_cc, - medium_test_mc, - medium_test_libclient, - medium_test_container, - ] + needs: [lint] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + submodules: true + + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install pipenv + run: pip install pipenv + working-directory: ./scripts + + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v2 + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Run container test + run: | + pipenv sync + pipenv install --skip-lock ../../packages/client/libclient-py + pipenv run pytest ./tests/test_down_request.py::test_failed_execute_computation_with_down -k [down_container0] -s -v -log-cli-level=DEBUG + working-directory: ./scripts/container_test + + medium_test_container_down_test_failed_execute_computation_with_down_1: + runs-on: ubuntu-latest + needs: [lint] steps: - - name: Merge All medium_test - run: echo "ok" + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + submodules: true + + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install pipenv + run: pip install pipenv + working-directory: ./scripts + + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Run container test + run: | + pipenv sync + pipenv install --skip-lock ../../packages/client/libclient-py + pipenv run pytest ./tests/test_down_request.py::test_failed_execute_computation_with_down -k [down_container1] -s -v -log-cli-level=DEBUG + working-directory: ./scripts/container_test + + medium_test_container_down_test_failed_get_computation_result_with_down: + runs-on: ubuntu-latest + needs: [lint] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + submodules: true + + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install pipenv + run: pip install pipenv + working-directory: ./scripts + + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Run container test + run: | + pipenv sync + pipenv install --skip-lock ../../packages/client/libclient-py + pipenv run pytest ./tests/test_down_request.py::test_failed_get_computation_result_with_down -s -v -log-cli-level=DEBUG + working-directory: ./scripts/container_test + + # medium_test: + # runs-on: ubuntu-latest + # needs: + # [ + # lint, + # medium_test_cc, + # medium_test_mc, + # medium_test_libclient, + # medium_test_container, + # ] + + # steps: + # - name: Merge All medium_test + # run: echo "ok" From f98f1bfe7c939f19a7157f1cdd7f2b2bd38051d9 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 07:05:59 +0000 Subject: [PATCH 10/24] add up test --- .github/workflows/test-server-all.yml | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index a0d4a586e..71bc57934 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -257,6 +257,78 @@ jobs: run: make test t=./libclient m=run p=medium working-directory: ./scripts + medium_test_container_up: + runs-on: ubuntu-latest + needs: [lint] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }} + submodules: true + + - name: Update GCP service account JSON + run: echo ${CI_REMOTE_CACHE_JSON} | base64 --decode >> ./packages/server/computation_container/sa.json + env: + CI_REMOTE_CACHE_JSON: ${{ secrets.CI_REMOTE_CACHE_JSON }} + + - name: Update .bazelrc for using remote cache + run: | + eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc + env: + BAZEL_CACHE_BUCKET: ${{ secrets.BAZEL_CACHE_BUCKET }} + + - name: Log into registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install pipenv + run: pip install pipenv + working-directory: ./scripts + + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Run container test + run: | + pipenv sync + pipenv install --skip-lock ../../packages/client/libclient-py + pipenv run pytest ./tests/test_up.py -s -v -log-cli-level=DEBUG + working-directory: ./scripts/container_test + medium_test_container_restart: runs-on: ubuntu-latest needs: [lint] From b1a7bee06281e08634dff5756ab7ca94ce7f55b5 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 07:57:33 +0000 Subject: [PATCH 11/24] small -> small_tmp --- .github/workflows/test-server-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 71bc57934..00dfca4c6 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -61,7 +61,7 @@ jobs: cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} dockerfile-path: ./packages/server/computation_container/Dockerfile builder-name: ${{ steps.buildx.outputs.name }} - target: "small" + target: "small_tmp" - name: Run bazel test in computation_container run: make test t=./computation_container m=run p=small From 1370a69616d7c647b5a506aec3898277e2c6b665 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 08:46:41 +0000 Subject: [PATCH 12/24] re:medium_test --- .github/workflows/test-server-all.yml | 33 +++++++++++++++------------ 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 00dfca4c6..6e9519a5f 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -689,17 +689,22 @@ jobs: pipenv run pytest ./tests/test_down_request.py::test_failed_get_computation_result_with_down -s -v -log-cli-level=DEBUG working-directory: ./scripts/container_test - # medium_test: - # runs-on: ubuntu-latest - # needs: - # [ - # lint, - # medium_test_cc, - # medium_test_mc, - # medium_test_libclient, - # medium_test_container, - # ] - - # steps: - # - name: Merge All medium_test - # run: echo "ok" + medium_test: + runs-on: ubuntu-latest + needs: + [ + lint, + medium_test_cc, + medium_test_mc, + medium_test_libclient, + medium_test_container_up, + medium_test_container_restart, + medium_test_container_down_test_failed_send_share_with_down, + medium_test_container_down_test_failed_execute_computation_with_down_0, + medium_test_container_down_test_failed_execute_computation_with_down_1, + medium_test_container_down_test_failed_get_computation_result_with_down, + ] + + steps: + - name: Merge All medium_test + run: echo "ok" From 0010c29f7c1c866f2f70431d6f1f822fc49fe411 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 10:11:25 +0000 Subject: [PATCH 13/24] comment out down_all --- scripts/container_test/tests/test_down_request.py | 6 +++--- scripts/container_test/tests/test_restart_request.py | 10 +++++----- scripts/container_test/tests/test_up.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/container_test/tests/test_down_request.py b/scripts/container_test/tests/test_down_request.py index 0ca5c8a2a..b6011d23b 100644 --- a/scripts/container_test/tests/test_down_request.py +++ b/scripts/container_test/tests/test_down_request.py @@ -19,7 +19,7 @@ def test_failed_send_share_with_down(down_container): down_container.down() res = send_share() - Containers.down_all() + # Containers.down_all() assert not res["is_ok"] @@ -42,7 +42,7 @@ def test_failed_execute_computation_with_down(down_container): down_container.down() res = execute_computation(data_id1, data_id2) - Containers.down_all() + # Containers.down_all() assert not res["is_ok"] @@ -63,5 +63,5 @@ def test_failed_get_computation_result_with_down(down_container): down_container.down() res = get_computation_result(job_uuid1) - Containers.down_all() + # Containers.down_all() assert not res["is_ok"] diff --git a/scripts/container_test/tests/test_restart_request.py b/scripts/container_test/tests/test_restart_request.py index fbf285409..c5b505557 100644 --- a/scripts/container_test/tests/test_restart_request.py +++ b/scripts/container_test/tests/test_restart_request.py @@ -19,7 +19,7 @@ def test_succes_send_share_with_restart(restart_container): restart_container.restart() res = send_share() - Containers.down_all() + # Containers.down_all() assert res["is_ok"] @@ -42,7 +42,7 @@ def test_success_execute_computation_with_restart(restart_container): restart_container.restart() res = execute_computation(data_id1, data_id2) - Containers.down_all() + # Containers.down_all() assert res["is_ok"] @@ -64,7 +64,7 @@ def test_success_execute_computations_with_restart(restart_container): restart_container.restart() res = execute_computation(data_id1, data_id2) - Containers.down_all() + # Containers.down_all() assert res["is_ok"] @@ -85,7 +85,7 @@ def test_success_get_computation_result_with_restart(restart_container): restart_container.restart() res = get_computation_result(job_uuid1) - Containers.down_all() + # Containers.down_all() assert res["is_ok"] @@ -103,4 +103,4 @@ def test_success_execute_multiple_with_restart(restart_container): job_uuid() restart_container.restart() - Containers.down_all() + # Containers.down_all() diff --git a/scripts/container_test/tests/test_up.py b/scripts/container_test/tests/test_up.py index 933dca0e8..71faeefeb 100644 --- a/scripts/container_test/tests/test_up.py +++ b/scripts/container_test/tests/test_up.py @@ -18,4 +18,4 @@ def test_up(container): # コンテナ単体で起動してhealthcheckが通るかtest Containers.down_all() container.up() - Containers.down_all() + # Containers.down_all() From 8bf9ea2cad214a8acd8fc38e7dcd088099137439 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 11:10:22 +0000 Subject: [PATCH 14/24] durations --- .github/workflows/test-server-all.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index 6e9519a5f..f3c2ac4bd 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -326,7 +326,7 @@ jobs: run: | pipenv sync pipenv install --skip-lock ../../packages/client/libclient-py - pipenv run pytest ./tests/test_up.py -s -v -log-cli-level=DEBUG + pipenv run pytest ./tests/test_up.py -s -v -log-cli-level=DEBUG --durations=0 working-directory: ./scripts/container_test medium_test_container_restart: @@ -398,7 +398,7 @@ jobs: run: | pipenv sync pipenv install --skip-lock ../../packages/client/libclient-py - pipenv run pytest ./tests/test_restart_request.py -s -v -log-cli-level=DEBUG + pipenv run pytest ./tests/test_restart_request.py -s -v -log-cli-level=DEBUG --durations=0 working-directory: ./scripts/container_test medium_test_container_down_test_failed_send_share_with_down: @@ -470,7 +470,7 @@ jobs: run: | pipenv sync pipenv install --skip-lock ../../packages/client/libclient-py - pipenv run pytest ./tests/test_down_request.py::test_failed_send_share_with_down -s -v -log-cli-level=DEBUG + pipenv run pytest ./tests/test_down_request.py::test_failed_send_share_with_down -s -v -log-cli-level=DEBUG --durations=0 working-directory: ./scripts/container_test medium_test_container_down_test_failed_execute_computation_with_down_0: @@ -542,7 +542,7 @@ jobs: run: | pipenv sync pipenv install --skip-lock ../../packages/client/libclient-py - pipenv run pytest ./tests/test_down_request.py::test_failed_execute_computation_with_down -k [down_container0] -s -v -log-cli-level=DEBUG + pipenv run pytest ./tests/test_down_request.py::test_failed_execute_computation_with_down -k [down_container0] -s -v -log-cli-level=DEBUG --durations=0 working-directory: ./scripts/container_test medium_test_container_down_test_failed_execute_computation_with_down_1: @@ -614,7 +614,7 @@ jobs: run: | pipenv sync pipenv install --skip-lock ../../packages/client/libclient-py - pipenv run pytest ./tests/test_down_request.py::test_failed_execute_computation_with_down -k [down_container1] -s -v -log-cli-level=DEBUG + pipenv run pytest ./tests/test_down_request.py::test_failed_execute_computation_with_down -k [down_container1] -s -v -log-cli-level=DEBUG --durations=0 working-directory: ./scripts/container_test medium_test_container_down_test_failed_get_computation_result_with_down: @@ -686,7 +686,7 @@ jobs: run: | pipenv sync pipenv install --skip-lock ../../packages/client/libclient-py - pipenv run pytest ./tests/test_down_request.py::test_failed_get_computation_result_with_down -s -v -log-cli-level=DEBUG + pipenv run pytest ./tests/test_down_request.py::test_failed_get_computation_result_with_down -s -v -log-cli-level=DEBUG --durations=0 working-directory: ./scripts/container_test medium_test: From b323effd274d3ad8ecdba337bff6647f251daf97 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 11:30:13 +0000 Subject: [PATCH 15/24] action : prepare container test --- .../actions/prepare_container_test/action.yml | 42 ++++ .github/workflows/test-server-all.yml | 231 +----------------- 2 files changed, 48 insertions(+), 225 deletions(-) create mode 100644 .github/actions/prepare_container_test/action.yml diff --git a/.github/actions/prepare_container_test/action.yml b/.github/actions/prepare_container_test/action.yml new file mode 100644 index 000000000..b9d02919d --- /dev/null +++ b/.github/actions/prepare_container_test/action.yml @@ -0,0 +1,42 @@ +runs: + using: "composite" + steps: + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install pipenv + run: pip install pipenv + working-directory: ./scripts + + - name: Set up Docker buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Build bts with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_bts" + cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} + dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build cc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_cc" + cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} + dockerfile-path: ./packages/server/computation_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" + + - name: Build mc with cache + uses: ./.github/actions/build_images_with_cache + with: + container-name: "dev_mc" + cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} + dockerfile-path: ./packages/server/manage_container/Dockerfile + builder-name: ${{ steps.buildx.outputs.name }} + target: "dev" diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index f3c2ac4bd..ae9b56cd6 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -282,45 +282,7 @@ jobs: - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install pipenv - run: pip install pipenv - working-directory: ./scripts - - - name: Set up Docker buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Build bts with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_bts" - cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} - dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build cc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_cc" - cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} - dockerfile-path: ./packages/server/computation_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build mc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_mc" - cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} - dockerfile-path: ./packages/server/manage_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" + - uses: ./.github/actions/prepare_container_test - name: Run container test run: | @@ -363,36 +325,7 @@ jobs: run: pip install pipenv working-directory: ./scripts - - name: Set up Docker buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Build bts with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_bts" - cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} - dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build cc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_cc" - cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} - dockerfile-path: ./packages/server/computation_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build mc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_mc" - cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} - dockerfile-path: ./packages/server/manage_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" + - uses: ./.github/actions/prepare_container_test - name: Run container test run: | @@ -426,45 +359,7 @@ jobs: - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install pipenv - run: pip install pipenv - working-directory: ./scripts - - - name: Set up Docker buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Build bts with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_bts" - cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} - dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build cc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_cc" - cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} - dockerfile-path: ./packages/server/computation_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build mc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_mc" - cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} - dockerfile-path: ./packages/server/manage_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" + - uses: ./.github/actions/prepare_container_test - name: Run container test run: | @@ -498,45 +393,7 @@ jobs: - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install pipenv - run: pip install pipenv - working-directory: ./scripts - - - name: Set up Docker buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Build bts with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_bts" - cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} - dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build cc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_cc" - cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} - dockerfile-path: ./packages/server/computation_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build mc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_mc" - cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} - dockerfile-path: ./packages/server/manage_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" + - uses: ./.github/actions/prepare_container_test - name: Run container test run: | @@ -570,45 +427,7 @@ jobs: - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install pipenv - run: pip install pipenv - working-directory: ./scripts - - - name: Set up Docker buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Build bts with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_bts" - cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} - dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build cc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_cc" - cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} - dockerfile-path: ./packages/server/computation_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build mc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_mc" - cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} - dockerfile-path: ./packages/server/manage_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" + - uses: ./.github/actions/prepare_container_test - name: Run container test run: | @@ -642,45 +461,7 @@ jobs: - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install pipenv - run: pip install pipenv - working-directory: ./scripts - - - name: Set up Docker buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Build bts with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_bts" - cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }} - dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build cc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_cc" - cache-key: ${{ hashFiles('./packages/server/computation_container/**') }} - dockerfile-path: ./packages/server/computation_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" - - - name: Build mc with cache - uses: ./.github/actions/build_images_with_cache - with: - container-name: "dev_mc" - cache-key: ${{ hashFiles('./packages/server/manage_container/**') }} - dockerfile-path: ./packages/server/manage_container/Dockerfile - builder-name: ${{ steps.buildx.outputs.name }} - target: "dev" + - uses: ./.github/actions/prepare_container_test - name: Run container test run: | From ee6d77ee19d2da82b195eef2ff6571a973507e58 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 11:33:09 +0000 Subject: [PATCH 16/24] shell bash --- .github/actions/prepare_container_test/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/prepare_container_test/action.yml b/.github/actions/prepare_container_test/action.yml index b9d02919d..b08a5759f 100644 --- a/.github/actions/prepare_container_test/action.yml +++ b/.github/actions/prepare_container_test/action.yml @@ -7,6 +7,7 @@ runs: python-version: 3.7 - name: Install pipenv + shell: bash run: pip install pipenv working-directory: ./scripts From 0742c30b79614b9dbc92ebd102450f4b6df759ff Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 11:34:48 +0000 Subject: [PATCH 17/24] format --- .github/actions/prepare_container_test/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/prepare_container_test/action.yml b/.github/actions/prepare_container_test/action.yml index b08a5759f..de8e2d00a 100644 --- a/.github/actions/prepare_container_test/action.yml +++ b/.github/actions/prepare_container_test/action.yml @@ -2,9 +2,9 @@ runs: using: "composite" steps: - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 - name: Install pipenv shell: bash From 84b3d362718370ebd145df49f43841cea2619e99 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Fri, 12 May 2023 11:37:51 +0000 Subject: [PATCH 18/24] del set up and install --- .github/workflows/test-server-all.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/test-server-all.yml b/.github/workflows/test-server-all.yml index ae9b56cd6..bc8a157e1 100644 --- a/.github/workflows/test-server-all.yml +++ b/.github/workflows/test-server-all.yml @@ -316,15 +316,6 @@ jobs: - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install pipenv - run: pip install pipenv - working-directory: ./scripts - - uses: ./.github/actions/prepare_container_test - name: Run container test From bcc5bce8b83501b1de63acc6eecfa921078c7220 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Mon, 15 May 2023 03:09:11 +0000 Subject: [PATCH 19/24] change hash --- packages/server/computation_container/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/computation_container/README.md b/packages/server/computation_container/README.md index a4a64b2ce..d1a0958c8 100644 --- a/packages/server/computation_container/README.md +++ b/packages/server/computation_container/README.md @@ -1,5 +1,5 @@ Computation Container -=== +==== ## 使用方法 バックグラウンドでコンテナを起動したい場合は今のコマンドを実行 From b35caedaeb73bae34cda72c043a7bf7fef86c4d6 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Mon, 15 May 2023 06:11:04 +0000 Subject: [PATCH 20/24] rm -> stop --- scripts/container_test/tests/container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/container_test/tests/container.py b/scripts/container_test/tests/container.py index 4f15c2ccd..57b9bdd7a 100644 --- a/scripts/container_test/tests/container.py +++ b/scripts/container_test/tests/container.py @@ -57,7 +57,7 @@ def up(self) -> None: def down(self) -> None: sn_str = " ".join(self.__service_names) - command = f"docker-compose {compose_files_opt} rm -fsv {sn_str}" + command = f"docker-compose {compose_files_opt} stop {sn_str}" subprocess.run([command], shell=True) def restart(self) -> None: From 92a77d032e0e2c91e7bfb63fde64ab2f03b1a650 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Mon, 15 May 2023 06:13:31 +0000 Subject: [PATCH 21/24] del comment out --- scripts/container_test/tests/test_down_request.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/container_test/tests/test_down_request.py b/scripts/container_test/tests/test_down_request.py index b6011d23b..dccc93ee8 100644 --- a/scripts/container_test/tests/test_down_request.py +++ b/scripts/container_test/tests/test_down_request.py @@ -19,7 +19,6 @@ def test_failed_send_share_with_down(down_container): down_container.down() res = send_share() - # Containers.down_all() assert not res["is_ok"] @@ -42,7 +41,6 @@ def test_failed_execute_computation_with_down(down_container): down_container.down() res = execute_computation(data_id1, data_id2) - # Containers.down_all() assert not res["is_ok"] @@ -63,5 +61,4 @@ def test_failed_get_computation_result_with_down(down_container): down_container.down() res = get_computation_result(job_uuid1) - # Containers.down_all() assert not res["is_ok"] From 19c90dfac5004bf6bdcd23df30db605eb1f60f25 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Mon, 15 May 2023 07:31:59 +0000 Subject: [PATCH 22/24] del comment out --- scripts/container_test/tests/test_restart_request.py | 6 ------ scripts/container_test/tests/test_up.py | 1 - 2 files changed, 7 deletions(-) diff --git a/scripts/container_test/tests/test_restart_request.py b/scripts/container_test/tests/test_restart_request.py index c5b505557..1211c124e 100644 --- a/scripts/container_test/tests/test_restart_request.py +++ b/scripts/container_test/tests/test_restart_request.py @@ -19,7 +19,6 @@ def test_succes_send_share_with_restart(restart_container): restart_container.restart() res = send_share() - # Containers.down_all() assert res["is_ok"] @@ -42,7 +41,6 @@ def test_success_execute_computation_with_restart(restart_container): restart_container.restart() res = execute_computation(data_id1, data_id2) - # Containers.down_all() assert res["is_ok"] @@ -64,7 +62,6 @@ def test_success_execute_computations_with_restart(restart_container): restart_container.restart() res = execute_computation(data_id1, data_id2) - # Containers.down_all() assert res["is_ok"] @@ -85,7 +82,6 @@ def test_success_get_computation_result_with_restart(restart_container): restart_container.restart() res = get_computation_result(job_uuid1) - # Containers.down_all() assert res["is_ok"] @@ -102,5 +98,3 @@ def test_success_execute_multiple_with_restart(restart_container): for _ in range(3): job_uuid() restart_container.restart() - - # Containers.down_all() diff --git a/scripts/container_test/tests/test_up.py b/scripts/container_test/tests/test_up.py index 71faeefeb..267914909 100644 --- a/scripts/container_test/tests/test_up.py +++ b/scripts/container_test/tests/test_up.py @@ -18,4 +18,3 @@ def test_up(container): # コンテナ単体で起動してhealthcheckが通るかtest Containers.down_all() container.up() - # Containers.down_all() From ff91452fdc64192a3f36a13f5c5d73264a922d61 Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Mon, 15 May 2023 07:32:27 +0000 Subject: [PATCH 23/24] stop -> rm --- scripts/container_test/tests/container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/container_test/tests/container.py b/scripts/container_test/tests/container.py index 57b9bdd7a..4f15c2ccd 100644 --- a/scripts/container_test/tests/container.py +++ b/scripts/container_test/tests/container.py @@ -57,7 +57,7 @@ def up(self) -> None: def down(self) -> None: sn_str = " ".join(self.__service_names) - command = f"docker-compose {compose_files_opt} stop {sn_str}" + command = f"docker-compose {compose_files_opt} rm -fsv {sn_str}" subprocess.run([command], shell=True) def restart(self) -> None: From 3b4f327522bca0334f03f71aec3bf317dfa5d80f Mon Sep 17 00:00:00 2001 From: Sakamoto Souta Date: Wed, 24 May 2023 09:12:11 +0000 Subject: [PATCH 24/24] reset the length of "===" in README.md --- packages/server/computation_container/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/computation_container/README.md b/packages/server/computation_container/README.md index d1a0958c8..a4a64b2ce 100644 --- a/packages/server/computation_container/README.md +++ b/packages/server/computation_container/README.md @@ -1,5 +1,5 @@ Computation Container -==== +=== ## 使用方法 バックグラウンドでコンテナを起動したい場合は今のコマンドを実行