From 25eca143019e6d7308c3118021b1c2652a75eec8 Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Thu, 9 Jun 2022 23:00:41 +0200 Subject: [PATCH 01/11] Update tools/config.py --- tools/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/config.py b/tools/config.py index e2c883a..bc2aa65 100644 --- a/tools/config.py +++ b/tools/config.py @@ -3,7 +3,7 @@ # Update with the Meilisearch version TAG you want to build the image with -MEILI_CLOUD_SCRIPTS_VERSION_TAG = 'v0.27.1' +MEILI_CLOUD_SCRIPTS_VERSION_TAG = 'v0.28.0' # Script settings From 6e6face0ef5b14932e1846b8b286151f2b5b152d Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 12 Jul 2022 10:04:19 +0200 Subject: [PATCH 02/11] Test CI build image without delete it --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 33da3de..b358043 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,11 +31,11 @@ jobs: run: echo "IMAGE_NAME=meilisearch_digitalocean_ci_test_$(date +'%d-%m-%Y-%H-%M-%S')" >> $GITHUB_ENV - name: Build image run: python3 tools/build_image.py $IMAGE_NAME --no-analytics - - name: Test image - run: python3 tools/test_image.py $IMAGE_NAME - - name: Clean image - if: ${{ always() }} - run: python3 tools/destroy_image.py $IMAGE_NAME + # - name: Test image + # run: python3 tools/test_image.py $IMAGE_NAME + # - name: Clean image + # if: ${{ always() }} + # run: python3 tools/destroy_image.py $IMAGE_NAME pylint: name: pylint From d573a550c40af6c016727defe01dad4fa9828d38 Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 12 Jul 2022 10:12:46 +0200 Subject: [PATCH 03/11] Revert dependencies --- .github/workflows/tests.yml | 10 +++++----- requirements.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b358043..33da3de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,11 +31,11 @@ jobs: run: echo "IMAGE_NAME=meilisearch_digitalocean_ci_test_$(date +'%d-%m-%Y-%H-%M-%S')" >> $GITHUB_ENV - name: Build image run: python3 tools/build_image.py $IMAGE_NAME --no-analytics - # - name: Test image - # run: python3 tools/test_image.py $IMAGE_NAME - # - name: Clean image - # if: ${{ always() }} - # run: python3 tools/destroy_image.py $IMAGE_NAME + - name: Test image + run: python3 tools/test_image.py $IMAGE_NAME + - name: Clean image + if: ${{ always() }} + run: python3 tools/destroy_image.py $IMAGE_NAME pylint: name: pylint diff --git a/requirements.txt b/requirements.txt index aa72fc4..5229a5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ pylint==2.13.9 python-digitalocean==1.17.0 requests==2.27.1 six==1.16.0 -urllib3==1.26.10 +urllib3==1.26.9 From 200281bee740881459625dd9baf6357d2f1eda65 Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 12 Jul 2022 10:25:14 +0200 Subject: [PATCH 04/11] Revert changes modify CI for test --- .github/workflows/tests.yml | 10 +++++----- requirements.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 33da3de..b358043 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,11 +31,11 @@ jobs: run: echo "IMAGE_NAME=meilisearch_digitalocean_ci_test_$(date +'%d-%m-%Y-%H-%M-%S')" >> $GITHUB_ENV - name: Build image run: python3 tools/build_image.py $IMAGE_NAME --no-analytics - - name: Test image - run: python3 tools/test_image.py $IMAGE_NAME - - name: Clean image - if: ${{ always() }} - run: python3 tools/destroy_image.py $IMAGE_NAME + # - name: Test image + # run: python3 tools/test_image.py $IMAGE_NAME + # - name: Clean image + # if: ${{ always() }} + # run: python3 tools/destroy_image.py $IMAGE_NAME pylint: name: pylint diff --git a/requirements.txt b/requirements.txt index 5229a5b..aa72fc4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ pylint==2.13.9 python-digitalocean==1.17.0 requests==2.27.1 six==1.16.0 -urllib3==1.26.9 +urllib3==1.26.10 From a71bfd94517c8f3f523882febd63a484011fe30e Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 12 Jul 2022 10:39:36 +0200 Subject: [PATCH 05/11] Modify build image for test CI --- tools/build_image.py | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/tools/build_image.py b/tools/build_image.py index 89a135c..3189b7a 100644 --- a/tools/build_image.py +++ b/tools/build_image.py @@ -41,59 +41,59 @@ # Wait for Health check after configuration is finished -print('Waiting for Health check (may take a few minutes: config and reboot)') -HEALTH = wait_for_health_check(droplet, timeout_seconds=600) -if HEALTH == STATUS_OK: - print(' Instance is healthy') -else: - print(' Timeout waiting for health check') - destroy_droplet_and_exit(droplet) +# print('Waiting for Health check (may take a few minutes: config and reboot)') +# HEALTH = wait_for_health_check(droplet, timeout_seconds=600) +# if HEALTH == STATUS_OK: +# print(' Instance is healthy') +# else: +# print(' Timeout waiting for health check') +# destroy_droplet_and_exit(droplet) # Check version -print('Waiting for Version check') -try: - check_meilisearch_version( - droplet, conf.MEILI_CLOUD_SCRIPTS_VERSION_TAG) -except Exception as err: - print(f' Exception: {err}') - destroy_droplet_and_exit(droplet) +# print('Waiting for Version check') +# try: +# check_meilisearch_version( +# droplet, conf.MEILI_CLOUD_SCRIPTS_VERSION_TAG) +# except Exception as err: +# print(f' Exception: {err}') +# destroy_droplet_and_exit(droplet) -print(' Version of meilisearch match!') +# print(' Version of meilisearch match!') # Power down Droplet -print('Powering down droplet...') -try: - shutdown = droplet.shutdown(return_dict=True) - wait_for_droplet_shutdown(droplet) -except Exception as err: - print(f' Exception: {err}') - destroy_droplet_and_exit(droplet) +# print('Powering down droplet...') +# try: +# shutdown = droplet.shutdown(return_dict=True) +# wait_for_droplet_shutdown(droplet) +# except Exception as err: +# print(f' Exception: {err}') +# destroy_droplet_and_exit(droplet) -print(' Droplet is OFF') +# print(' Droplet is OFF') # Create snapshot from Droplet -if len(sys.argv) > 1 and sys.argv[1] != '--no-analytics': - SNAPSHOT_NAME = sys.argv[1] -else: - SNAPSHOT_NAME = conf.SNAPSHOT_NAME +# if len(sys.argv) > 1 and sys.argv[1] != '--no-analytics': +# SNAPSHOT_NAME = sys.argv[1] +# else: +# SNAPSHOT_NAME = conf.SNAPSHOT_NAME -print(f'Creating a snapshot: {SNAPSHOT_NAME}') +# print(f'Creating a snapshot: {SNAPSHOT_NAME}') -try: - take_snapshot = droplet.take_snapshot( - SNAPSHOT_NAME, return_dict=False, power_off=True) - wait_for_snapshot_creation(droplet) -except Exception as err: - print(f' Exception: {err}') - destroy_droplet_and_exit(droplet) +# try: +# take_snapshot = droplet.take_snapshot( +# SNAPSHOT_NAME, return_dict=False, power_off=True) +# wait_for_snapshot_creation(droplet) +# except Exception as err: +# print(f' Exception: {err}') +# destroy_droplet_and_exit(droplet) -print(f' Snapshot created: {SNAPSHOT_NAME}') +# print(f' Snapshot created: {SNAPSHOT_NAME}') -# Destroy Droplet +# # Destroy Droplet -print('Destroying Droplet...') -droplet.destroy() -print(' Droplet destroyed') +# print('Destroying Droplet...') +# droplet.destroy() +# print(' Droplet destroyed') From 41699bb91d2f93bc88eb4b219e1efe1f7f8d6c14 Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 12 Jul 2022 10:58:33 +0200 Subject: [PATCH 06/11] Modify build image for test CI --- tools/build_image.py | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/tools/build_image.py b/tools/build_image.py index 3189b7a..9254ccb 100644 --- a/tools/build_image.py +++ b/tools/build_image.py @@ -41,59 +41,59 @@ # Wait for Health check after configuration is finished -# print('Waiting for Health check (may take a few minutes: config and reboot)') -# HEALTH = wait_for_health_check(droplet, timeout_seconds=600) -# if HEALTH == STATUS_OK: -# print(' Instance is healthy') -# else: -# print(' Timeout waiting for health check') -# destroy_droplet_and_exit(droplet) +print('Waiting for Health check (may take a few minutes: config and reboot)') +HEALTH = wait_for_health_check(droplet, timeout_seconds=1000) +if HEALTH == STATUS_OK: + print(' Instance is healthy') +else: + print(' Timeout waiting for health check') + destroy_droplet_and_exit(droplet) # Check version -# print('Waiting for Version check') -# try: -# check_meilisearch_version( -# droplet, conf.MEILI_CLOUD_SCRIPTS_VERSION_TAG) -# except Exception as err: -# print(f' Exception: {err}') -# destroy_droplet_and_exit(droplet) +print('Waiting for Version check') +try: + check_meilisearch_version( + droplet, conf.MEILI_CLOUD_SCRIPTS_VERSION_TAG) +except Exception as err: + print(f' Exception: {err}') + destroy_droplet_and_exit(droplet) -# print(' Version of meilisearch match!') +print(' Version of meilisearch match!') # Power down Droplet -# print('Powering down droplet...') -# try: -# shutdown = droplet.shutdown(return_dict=True) -# wait_for_droplet_shutdown(droplet) -# except Exception as err: -# print(f' Exception: {err}') -# destroy_droplet_and_exit(droplet) +print('Powering down droplet...') +try: + shutdown = droplet.shutdown(return_dict=True) + wait_for_droplet_shutdown(droplet) +except Exception as err: + print(f' Exception: {err}') + destroy_droplet_and_exit(droplet) -# print(' Droplet is OFF') +print(' Droplet is OFF') # Create snapshot from Droplet -# if len(sys.argv) > 1 and sys.argv[1] != '--no-analytics': -# SNAPSHOT_NAME = sys.argv[1] -# else: -# SNAPSHOT_NAME = conf.SNAPSHOT_NAME +if len(sys.argv) > 1 and sys.argv[1] != '--no-analytics': + SNAPSHOT_NAME = sys.argv[1] +else: + SNAPSHOT_NAME = conf.SNAPSHOT_NAME -# print(f'Creating a snapshot: {SNAPSHOT_NAME}') +print(f'Creating a snapshot: {SNAPSHOT_NAME}') -# try: -# take_snapshot = droplet.take_snapshot( -# SNAPSHOT_NAME, return_dict=False, power_off=True) -# wait_for_snapshot_creation(droplet) -# except Exception as err: -# print(f' Exception: {err}') -# destroy_droplet_and_exit(droplet) +try: + take_snapshot = droplet.take_snapshot( + SNAPSHOT_NAME, return_dict=False, power_off=True) + wait_for_snapshot_creation(droplet) +except Exception as err: + print(f' Exception: {err}') + destroy_droplet_and_exit(droplet) -# print(f' Snapshot created: {SNAPSHOT_NAME}') +print(f' Snapshot created: {SNAPSHOT_NAME}') -# # Destroy Droplet +# Destroy Droplet -# print('Destroying Droplet...') -# droplet.destroy() -# print(' Droplet destroyed') +print('Destroying Droplet...') +droplet.destroy() +print(' Droplet destroyed') From 86f5a5dc54633c9b5a69c23cffb15a3cd34cd148 Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 12 Jul 2022 12:12:32 +0200 Subject: [PATCH 07/11] Modify build image for test CI --- .github/workflows/tests.yml | 10 +++++----- tools/build_image.py | 2 +- tools/config.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b358043..33da3de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,11 +31,11 @@ jobs: run: echo "IMAGE_NAME=meilisearch_digitalocean_ci_test_$(date +'%d-%m-%Y-%H-%M-%S')" >> $GITHUB_ENV - name: Build image run: python3 tools/build_image.py $IMAGE_NAME --no-analytics - # - name: Test image - # run: python3 tools/test_image.py $IMAGE_NAME - # - name: Clean image - # if: ${{ always() }} - # run: python3 tools/destroy_image.py $IMAGE_NAME + - name: Test image + run: python3 tools/test_image.py $IMAGE_NAME + - name: Clean image + if: ${{ always() }} + run: python3 tools/destroy_image.py $IMAGE_NAME pylint: name: pylint diff --git a/tools/build_image.py b/tools/build_image.py index 9254ccb..89a135c 100644 --- a/tools/build_image.py +++ b/tools/build_image.py @@ -42,7 +42,7 @@ # Wait for Health check after configuration is finished print('Waiting for Health check (may take a few minutes: config and reboot)') -HEALTH = wait_for_health_check(droplet, timeout_seconds=1000) +HEALTH = wait_for_health_check(droplet, timeout_seconds=600) if HEALTH == STATUS_OK: print(' Instance is healthy') else: diff --git a/tools/config.py b/tools/config.py index bc2aa65..6d80773 100644 --- a/tools/config.py +++ b/tools/config.py @@ -11,7 +11,7 @@ DIGITALOCEAN_END_POINT = 'https://api.digitalocean.com/v2' SNAPSHOT_NAME = f'MeiliSearch-{MEILI_CLOUD_SCRIPTS_VERSION_TAG}-Debian-10.3' # https://developers.digitalocean.com/documentation/changelog/api-v2/new-size-slugs-for-droplet-plan-changes/ -SIZE_SLUG = 's-1vcpu-1gb' +SIZE_SLUG = 's-2vcpu-2gb' USER_DATA = requests.get( f'https://raw.githubusercontent.com/meilisearch/cloud-scripts/{MEILI_CLOUD_SCRIPTS_VERSION_TAG}/scripts/providers/digitalocean/cloud-config.yaml' ).text From 734a27fa4f65de0bf1f1b00080654b41f1fe3600 Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 12 Jul 2022 12:24:09 +0200 Subject: [PATCH 08/11] Modify size slug for test CI --- tools/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/config.py b/tools/config.py index 6d80773..bc2aa65 100644 --- a/tools/config.py +++ b/tools/config.py @@ -11,7 +11,7 @@ DIGITALOCEAN_END_POINT = 'https://api.digitalocean.com/v2' SNAPSHOT_NAME = f'MeiliSearch-{MEILI_CLOUD_SCRIPTS_VERSION_TAG}-Debian-10.3' # https://developers.digitalocean.com/documentation/changelog/api-v2/new-size-slugs-for-droplet-plan-changes/ -SIZE_SLUG = 's-2vcpu-2gb' +SIZE_SLUG = 's-1vcpu-1gb' USER_DATA = requests.get( f'https://raw.githubusercontent.com/meilisearch/cloud-scripts/{MEILI_CLOUD_SCRIPTS_VERSION_TAG}/scripts/providers/digitalocean/cloud-config.yaml' ).text From 659764a7b28ec0895f5572c47e0e975aceca0eeb Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 12 Jul 2022 12:42:58 +0200 Subject: [PATCH 09/11] Modify size slug for test CI --- tools/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/config.py b/tools/config.py index bc2aa65..6d80773 100644 --- a/tools/config.py +++ b/tools/config.py @@ -11,7 +11,7 @@ DIGITALOCEAN_END_POINT = 'https://api.digitalocean.com/v2' SNAPSHOT_NAME = f'MeiliSearch-{MEILI_CLOUD_SCRIPTS_VERSION_TAG}-Debian-10.3' # https://developers.digitalocean.com/documentation/changelog/api-v2/new-size-slugs-for-droplet-plan-changes/ -SIZE_SLUG = 's-1vcpu-1gb' +SIZE_SLUG = 's-2vcpu-2gb' USER_DATA = requests.get( f'https://raw.githubusercontent.com/meilisearch/cloud-scripts/{MEILI_CLOUD_SCRIPTS_VERSION_TAG}/scripts/providers/digitalocean/cloud-config.yaml' ).text From 0ceddabeeb1110a1bdfe5770dc706bd3681bcfa0 Mon Sep 17 00:00:00 2001 From: alallema Date: Wed, 13 Jul 2022 12:39:01 +0200 Subject: [PATCH 10/11] Revert slug size --- tools/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/config.py b/tools/config.py index 6d80773..bc2aa65 100644 --- a/tools/config.py +++ b/tools/config.py @@ -11,7 +11,7 @@ DIGITALOCEAN_END_POINT = 'https://api.digitalocean.com/v2' SNAPSHOT_NAME = f'MeiliSearch-{MEILI_CLOUD_SCRIPTS_VERSION_TAG}-Debian-10.3' # https://developers.digitalocean.com/documentation/changelog/api-v2/new-size-slugs-for-droplet-plan-changes/ -SIZE_SLUG = 's-2vcpu-2gb' +SIZE_SLUG = 's-1vcpu-1gb' USER_DATA = requests.get( f'https://raw.githubusercontent.com/meilisearch/cloud-scripts/{MEILI_CLOUD_SCRIPTS_VERSION_TAG}/scripts/providers/digitalocean/cloud-config.yaml' ).text From 768e376b9eb6d5e86b971f7ae878c8cd11e71199 Mon Sep 17 00:00:00 2001 From: alallema Date: Mon, 1 Aug 2022 13:38:15 +0200 Subject: [PATCH 11/11] Re modify size slug --- tools/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/config.py b/tools/config.py index bc2aa65..6d80773 100644 --- a/tools/config.py +++ b/tools/config.py @@ -11,7 +11,7 @@ DIGITALOCEAN_END_POINT = 'https://api.digitalocean.com/v2' SNAPSHOT_NAME = f'MeiliSearch-{MEILI_CLOUD_SCRIPTS_VERSION_TAG}-Debian-10.3' # https://developers.digitalocean.com/documentation/changelog/api-v2/new-size-slugs-for-droplet-plan-changes/ -SIZE_SLUG = 's-1vcpu-1gb' +SIZE_SLUG = 's-2vcpu-2gb' USER_DATA = requests.get( f'https://raw.githubusercontent.com/meilisearch/cloud-scripts/{MEILI_CLOUD_SCRIPTS_VERSION_TAG}/scripts/providers/digitalocean/cloud-config.yaml' ).text