From ce806f1444ed3759ad0c6bbc6768426752f544c7 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Wed, 29 Nov 2023 14:30:08 +0000 Subject: [PATCH 01/17] Fix rockcraft entry point and documentation --- README.md | 14 +++++--------- rockcraft.yaml | 8 ++++++++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 492339c..23a0dac 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Charmed MongoDB ROCK is an Open Container Initiative (OCI) image derived from the [Charmed MongoDB Snap](https://snapcraft.io/charmed-mongodb). The tool used to create this ROCK is called [Rockcraft](https://canonical-rockcraft.readthedocs-hosted.com/en/latest/index.html). -The [Charmed MongoDB ROCK](https://github.com/canonical/charmed-mongodb-rock/pkgs/container/charmed-mongodb) is an enhanced, source-available, fully-compatible, drop-in replacement of the OCI image of MongoDB 5.0.13 Community version. In addition, the Charmed MongoDB ROCK package offers more features than the MongoDB Community version, such as backup and restore, monitoring and security features. +The [Charmed MongoDB ROCK](https://github.com/canonical/charmed-mongodb-rock/pkgs/container/charmed-mongodb) is an enhanced, source-available, fully-compatible, drop-in replacement of the OCI image of MongoDB 6.0.6 Community version. In addition, the Charmed MongoDB ROCK package offers more features than the MongoDB Community version, such as backup and restore, monitoring and security features. One benefit of using the Charmed MongoDB ROCK is that it bundles MongoDB with other tools in its ecosystem to be used in the Charmed MongoDB Operator. One of the operators that uses this ROCK is the [Charmed MongoDB (Kubernetes Operator)](https://charmhub.io/mongodb-k8s). @@ -30,11 +30,11 @@ sudo snap install docker ``` Then to use the Charmed MongoDB ROCK run the following command ``` -sudo docker run --rm -it ghcr.io/canonical/charmed-mongodb:5.0.14-22.04_edge +sudo docker run --rm -it ghcr.io/canonical/charmed-mongodb:6.0.6-22.04_edge ``` By running this command you have already started the mongod service with Percona Server for MongoDB. Leave this command running and create another terminal. -*Note if you would like to start `mongod` with custom options you can append your desired options to the container run command i.e.*: `sudo docker run --rm -it ghcr.io/canonical/charmed-mongodb:5.0.14-22.04_edge --bind-ip-all --another-option` *you can read more about [mongod optons here](https://www.mongodb.com/docs/manual/reference/program/mongod/)* +*Note if you would like to start `mongod` with custom options you can append your desired options to the container run command i.e.*: `sudo docker run --rm -it ghcr.io/canonical/charmed-mongodb:6.0.6-22.04_edge --bind-ip-all --another-option` *you can read more about [mongod optons here](https://www.mongodb.com/docs/manual/reference/program/mongod/)* To access your now running MongoDB instance enter the command: ``` @@ -43,11 +43,11 @@ sudo docker container ls This should output something like this: ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -0dddcc9c71d6 ghcr.io/canonical/charmed-mongodb:5.0.14-22.04_edge "/usr/bin/setpriv --…" 44 seconds ago Up 44 seconds romantic_newton +bf08481d18a3 ghcr.io/canonical/charmed-mongodb:6.0.6-22.04_edge "/bin/pebble enter -…" About a minute ago Up About a minute quizzical_sinoussi ``` The name of the container is listed under `NAME` - use this name to connect to your now running database ``` -sudo docker exec --interactive mongo +sudo docker exec --interactive mongosh ``` Now enter `show dbs` this should show you all of your available databases and output something like: ``` @@ -119,7 +119,3 @@ The Charmed MongoDB Operator is free software, distributed under the [Apache Sof ## Trademark Notice "MongoDB" is a trademark or registered trademark of MongoDB, Inc. Other trademarks are property of their respective owners. Charmed MongoDB is not sponsored, endorsed, or affiliated with MongoDB, Inc. - - - - diff --git a/rockcraft.yaml b/rockcraft.yaml index 877c66d..fd34f36 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -71,3 +71,11 @@ parts: source: licenses organize: LICENSE-rock: licenses/LICENSE-rock + + entry: + plugin: dump + source: scripts + organize: + start.sh: bin/start.sh + stage: + - bin/start.sh From 4d9dac358d5c7c1b837b2d7a2f2b941c3c0ef001 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Wed, 29 Nov 2023 15:31:50 +0000 Subject: [PATCH 02/17] Update charmcraft version --- rockcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rockcraft.yaml b/rockcraft.yaml index fd34f36..d450db0 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -2,7 +2,7 @@ # See LICENSE file for licensing details. name: charmed-mongodb # the name of your ROCK base: ubuntu:22.04 # the base environment for this ROCK -version: "6.0.6-1" # just for humans. Semantic versioning is recommended +version: "major-6-minor-0-patch-6-rock-2" # just for humans. Semantic versioning is recommended summary: MongoDB in a rock. # 79 char long summary description: | MongoDB is a source-available cross-platform From 5e23594e60925ea8c3ee23b7f0e1cd62a347a359 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Wed, 29 Nov 2023 15:51:36 +0000 Subject: [PATCH 03/17] Another attempt to fix the version --- rockcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rockcraft.yaml b/rockcraft.yaml index d450db0..fd34f36 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -2,7 +2,7 @@ # See LICENSE file for licensing details. name: charmed-mongodb # the name of your ROCK base: ubuntu:22.04 # the base environment for this ROCK -version: "major-6-minor-0-patch-6-rock-2" # just for humans. Semantic versioning is recommended +version: "6.0.6-1" # just for humans. Semantic versioning is recommended summary: MongoDB in a rock. # 79 char long summary description: | MongoDB is a source-available cross-platform From af59834f61c95866527fad77f1f4314156edc8f0 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Wed, 29 Nov 2023 15:53:31 +0000 Subject: [PATCH 04/17] Another attempt to fix the version --- rockcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rockcraft.yaml b/rockcraft.yaml index fd34f36..319a43d 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -2,7 +2,7 @@ # See LICENSE file for licensing details. name: charmed-mongodb # the name of your ROCK base: ubuntu:22.04 # the base environment for this ROCK -version: "6.0.6-1" # just for humans. Semantic versioning is recommended +version: "6.0.6" # just for humans. Semantic versioning is recommended summary: MongoDB in a rock. # 79 char long summary description: | MongoDB is a source-available cross-platform From 704bcd6d3007a3ea0e528b4d4f4b12e2c8684a36 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Fri, 1 Dec 2023 05:43:54 +0000 Subject: [PATCH 05/17] Update workflow files --- .github/workflows/build.yaml | 5 ----- .github/workflows/integration.yaml | 3 +++ .github/workflows/publish.yaml | 4 ++-- retag_rock.sh | 2 +- rockcraft.yaml | 4 ++-- tox.ini | 7 ++++--- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4321a4a..92c8d89 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,11 +19,6 @@ jobs: sudo snap install charmcraft --classic --revision 1349 - name: Build ROCK run: | - app_version=$(yq '.version' rockcraft.yaml) - version=$(yq '(.version|split("-"))[0]' rockcraft.yaml) - base=$(yq '(.base|split(":"))[1]' rockcraft.yaml) - tag=${version}-${base}_edge - sed -i "s/${app_version}/${tag}/g" rockcraft.yaml rockcraft pack - name: Upload locally built ROCK artifact uses: actions/upload-artifact@v3 diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 005b369..0f47131 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -38,6 +38,9 @@ jobs: - name: Pin charmcraft version run: | sudo snap refresh --channel=2.2 charmcraft + - name: Install rockcraft + run: | + sudo snap install rockcraft --classic - uses: actions/download-artifact@v3 with: name: mongodb-rock diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 10c4c87..e8d1f1c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -40,9 +40,9 @@ jobs: - name: Import and push to GHCR run: | version=$(yq '(.version|split("-"))[0]' rockcraft.yaml) - base=$(yq '(.base|split(":"))[1]' rockcraft.yaml) + base=$(yq '(.base|split("@"))[1]' rockcraft.yaml) tag=${version}-${base}_edge sudo skopeo --insecure-policy copy \ - oci-archive:charmed-mongodb_${tag}_amd64.rock \ + oci-archive:charmed-mongodb_${version}_amd64.rock \ docker-daemon:ghcr.io/canonical/charmed-mongodb:${tag} docker push ghcr.io/canonical/charmed-mongodb:${tag} diff --git a/retag_rock.sh b/retag_rock.sh index 30a5f74..761e00d 100755 --- a/retag_rock.sh +++ b/retag_rock.sh @@ -5,7 +5,7 @@ NAME=$(yq '.name' rockcraft.yaml) APP_VERSION=$(yq '.version' rockcraft.yaml) VERSION=$(yq '(.version|split("-"))[0]' rockcraft.yaml) -BASE=$(yq '(.base|split(":"))[1]' rockcraft.yaml) +BASE=$(yq '(.base|split("@"))[1]' rockcraft.yaml) TAG=${VERSION}-${BASE}_edge REGISTRY_NAMESPACE=ghcr.io/canonical diff --git a/rockcraft.yaml b/rockcraft.yaml index 319a43d..49f7767 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -1,8 +1,8 @@ # Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. name: charmed-mongodb # the name of your ROCK -base: ubuntu:22.04 # the base environment for this ROCK -version: "6.0.6" # just for humans. Semantic versioning is recommended +base: ubuntu@22.04 # the base environment for this ROCK +version: "6.0.6-1" # just for humans. Semantic versioning is recommended summary: MongoDB in a rock. # 79 char long summary description: | MongoDB is a source-available cross-platform diff --git a/tox.ini b/tox.ini index 4b0d43e..44d2d2c 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ setenv = name=charmed-mongodb registry_namespace=ghcr.io/canonical repo=https://github.com/canonical/mongodb-k8s-operator.git + branch=6/edge [testenv:lint] description = run linters @@ -28,7 +29,7 @@ commands = then rockcraft pack; ./retag_rock.sh; fi' bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' - bash -ec 'if ! [ -d operator ]; then git clone {env:repo} operator; fi' {posargs} + bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} tox --workdir operator -c operator -e integration [testenv:ha-integration] @@ -42,7 +43,7 @@ commands = then rockcraft pack; ./retag_rock.sh; fi' bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' - bash -ec 'if ! [ -d operator ]; then git clone {env:repo} operator; fi' {posargs} + bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} tox --workdir operator -c operator -e ha-integration [testenv:tls-integration] @@ -56,5 +57,5 @@ commands = then rockcraft pack; ./retag_rock.sh; fi' bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' - bash -ec 'if ! [ -d operator ]; then git clone {env:repo} operator; fi' {posargs} + bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} tox --workdir operator -c operator -e tls-integration From 2dc5efc7c4e88f04a37213841ff7852691828c54 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Fri, 1 Dec 2023 06:26:33 +0000 Subject: [PATCH 06/17] Update build files --- .github/workflows/integration.yaml | 2 -- rockcraft.yaml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 0f47131..a16da67 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -23,8 +23,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - with: - ref: 6/edge - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: diff --git a/rockcraft.yaml b/rockcraft.yaml index 49f7767..95d47d7 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -2,7 +2,7 @@ # See LICENSE file for licensing details. name: charmed-mongodb # the name of your ROCK base: ubuntu@22.04 # the base environment for this ROCK -version: "6.0.6-1" # just for humans. Semantic versioning is recommended +version: "6.0.6-2" # just for humans. Semantic versioning is recommended summary: MongoDB in a rock. # 79 char long summary description: | MongoDB is a source-available cross-platform From b17da68b7bb6f7b1df9b659d1b0cea5c39fe9f25 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 1 Dec 2023 14:23:21 +0000 Subject: [PATCH 07/17] Add debug session for CI --- .github/workflows/integration.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index a16da67..ba21ff4 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -46,3 +46,9 @@ jobs: run: python3 -m pip install tox - name: Integration Tests run: sg snap_microk8s -c "tox -e ${{ matrix.env }}" + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + if: ${{ success() }} From b2ad366d446ecc852a9b9a093275078447156e9d Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Fri, 1 Dec 2023 15:33:28 +0000 Subject: [PATCH 08/17] Fix condition to initialize debug session --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index ba21ff4..9e41562 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -51,4 +51,4 @@ jobs: uses: mxschmitt/action-tmate@v3 with: limit-access-to-actor: true - if: ${{ success() }} + if: ${{ failure() }} From 6e4317062e11c6c91baa1f374f4f452948fbf252 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Fri, 1 Dec 2023 17:48:32 +0000 Subject: [PATCH 09/17] Add keep-models tox flag for debug --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 44d2d2c..1ed7ea3 100644 --- a/tox.ini +++ b/tox.ini @@ -30,7 +30,8 @@ commands = bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} - tox --workdir operator -c operator -e integration + tox --workdir operator -c operator -e integration -- --keep-models + [testenv:ha-integration] description = run operator integration tests @@ -44,7 +45,8 @@ commands = bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} - tox --workdir operator -c operator -e ha-integration + tox --workdir operator -c operator -e ha-integration -- --keep-models + [testenv:tls-integration] description = run operator integration tests From 98e55d7cd093aa2021b2b62cc1b9c04b34151eb1 Mon Sep 17 00:00:00 2001 From: Mia Altieri Date: Fri, 1 Dec 2023 18:37:14 +0000 Subject: [PATCH 10/17] update workflows to match Dmitrys working local enc --- .github/workflows/integration.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 9e41562..44dcc76 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -32,13 +32,15 @@ jobs: juju-channel: 3.1/stable # This is needed until # https://bugs.launchpad.net/juju/+bug/1977582 is fixed - bootstrap-options: "--agent-version 3.1.5" + bootstrap-options: "--agent-version 3.1.6" - name: Pin charmcraft version run: | - sudo snap refresh --channel=2.2 charmcraft + sudo snap refresh charmcraft --classic --revision 1349 + sudo snap refresh charmcraft --hold=forever - name: Install rockcraft run: | - sudo snap install rockcraft --classic + sudo snap install rockcraft --classic --revision 1206 + sudo snap refresh rockcraft --hold=forever - uses: actions/download-artifact@v3 with: name: mongodb-rock @@ -46,8 +48,8 @@ jobs: run: python3 -m pip install tox - name: Integration Tests run: sg snap_microk8s -c "tox -e ${{ matrix.env }}" - - - name: Setup tmate session + + - name: Setup tmate session uses: mxschmitt/action-tmate@v3 with: limit-access-to-actor: true From 58d390ec22493a8885b58cd5aab3b1f5311cea8a Mon Sep 17 00:00:00 2001 From: Mia Altieri Date: Fri, 1 Dec 2023 23:24:18 +0000 Subject: [PATCH 11/17] update build to match with 5-22.04 build --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 92c8d89..6d5268c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: - name: Install dependencies run: | sudo snap install yq - sudo snap install rockcraft --classic --edge + sudo snap install rockcraft --classic --channel=latest/stable --revision 1206 sudo snap install charmcraft --classic --revision 1349 - name: Build ROCK run: | From 88dd55894558a3d0df6ad7e3add3bd7cf3ee8c89 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Sat, 2 Dec 2023 07:47:18 +0000 Subject: [PATCH 12/17] Update checkout action --- .github/workflows/build.yaml | 2 +- .github/workflows/integration.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6d5268c..43e5ac3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,7 +9,7 @@ jobs: timeout-minutes: 15 steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup LXD uses: canonical/setup-lxd@main - name: Install dependencies diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 44dcc76..355b357 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -22,7 +22,7 @@ jobs: fail-fast: false steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: From 1f2b013c50a26969b6a363c995355c7854dabb4f Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Sat, 2 Dec 2023 18:19:05 +0000 Subject: [PATCH 13/17] Free disk space before running integration tests --- .github/workflows/integration.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 355b357..8eaa6a5 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -46,9 +46,22 @@ jobs: name: mongodb-rock - name: Install tox run: python3 -m pip install tox + + - name: Free disk space + run: | + echo "Free disk space before cleanup" + df -T + # free space in the runner + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/share/boost + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + echo "Free disk space after cleanup" + df -T + - name: Integration Tests run: sg snap_microk8s -c "tox -e ${{ matrix.env }}" - + - name: Setup tmate session uses: mxschmitt/action-tmate@v3 with: From ec6babb14dde35fc8d4b9ed3d2312f4e75143591 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Sat, 2 Dec 2023 19:06:30 +0000 Subject: [PATCH 14/17] Clean space as part of test start --- .github/workflows/integration.yaml | 1 + tox.ini | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 8eaa6a5..69c558b 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -52,6 +52,7 @@ jobs: echo "Free disk space before cleanup" df -T # free space in the runner + rockcraft clean sudo rm -rf /usr/share/dotnet sudo rm -rf /opt/ghc sudo rm -rf /usr/local/share/boost diff --git a/tox.ini b/tox.ini index 1ed7ea3..7112106 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,14 @@ commands = then rockcraft pack; ./retag_rock.sh; fi' bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' + bash -ec 'echo "Free disk space before cleanup"; df -T; \ + rockcraft clean \ + sudo rm -rf /usr/share/dotnet; \ + sudo rm -rf /opt/ghc \ + sudo rm -rf /usr/local/share/boost \ + sudo rm -rf "$AGENT_TOOLSDIRECTORY" \ + echo "Free disk space after cleanup"; \ + df -T' bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} tox --workdir operator -c operator -e integration -- --keep-models @@ -44,6 +52,14 @@ commands = then rockcraft pack; ./retag_rock.sh; fi' bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' + bash -ec 'echo "Free disk space before cleanup"; df -T; \ + rockcraft clean \ + sudo rm -rf /usr/share/dotnet; \ + sudo rm -rf /opt/ghc \ + sudo rm -rf /usr/local/share/boost \ + sudo rm -rf "$AGENT_TOOLSDIRECTORY" \ + echo "Free disk space after cleanup"; \ + df -T' bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} tox --workdir operator -c operator -e ha-integration -- --keep-models From 2afd3266741d6f5e1fdaf4f0be29e5ebc781bf12 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Tue, 5 Dec 2023 12:19:30 +0000 Subject: [PATCH 15/17] Remove unnecessary operation from tests start --- tox.ini | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tox.ini b/tox.ini index 7112106..1ed7ea3 100644 --- a/tox.ini +++ b/tox.ini @@ -29,14 +29,6 @@ commands = then rockcraft pack; ./retag_rock.sh; fi' bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' - bash -ec 'echo "Free disk space before cleanup"; df -T; \ - rockcraft clean \ - sudo rm -rf /usr/share/dotnet; \ - sudo rm -rf /opt/ghc \ - sudo rm -rf /usr/local/share/boost \ - sudo rm -rf "$AGENT_TOOLSDIRECTORY" \ - echo "Free disk space after cleanup"; \ - df -T' bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} tox --workdir operator -c operator -e integration -- --keep-models @@ -52,14 +44,6 @@ commands = then rockcraft pack; ./retag_rock.sh; fi' bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \ cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}' - bash -ec 'echo "Free disk space before cleanup"; df -T; \ - rockcraft clean \ - sudo rm -rf /usr/share/dotnet; \ - sudo rm -rf /opt/ghc \ - sudo rm -rf /usr/local/share/boost \ - sudo rm -rf "$AGENT_TOOLSDIRECTORY" \ - echo "Free disk space after cleanup"; \ - df -T' bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs} tox --workdir operator -c operator -e ha-integration -- --keep-models From 575a17d254f22d61a64c257c493714704c5c9255 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Tue, 5 Dec 2023 12:20:03 +0000 Subject: [PATCH 16/17] Temporary disable tests on CI until the fix is not merged to charm repo --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 69c558b..9be38e9 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -18,7 +18,7 @@ jobs: needs: build strategy: matrix: - env: [integration, ha-integration, tls-integration] + env: [] fail-fast: false steps: - name: Checkout repository From 18793e3a53fafd3e853663ab115f38674f996ee6 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Tue, 5 Dec 2023 12:50:51 +0000 Subject: [PATCH 17/17] Removed tmate debug session --- .github/workflows/integration.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 9be38e9..100b9ab 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -62,9 +62,3 @@ jobs: - name: Integration Tests run: sg snap_microk8s -c "tox -e ${{ matrix.env }}" - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - with: - limit-access-to-actor: true - if: ${{ failure() }}