From 42197efeddd940e210b0cd63936ed57a3db8086b Mon Sep 17 00:00:00 2001 From: Oren Epshtain Date: Wed, 7 Feb 2024 23:42:52 +0000 Subject: [PATCH 1/3] INFRADEV-16610: Add package test for different python versions to external CI and remove github actions except publish --- .github/workflows/python-package.yml | 32 ---------- .github/workflows/python-publish.yml | 37 ++++++----- .github/workflows/python-test-publish.yml | 38 ------------ .gitlab-ci.yml | 75 +++++++++++++++++++++++ Makefile | 2 +- infinisdk/infinibox/compatibility.py | 1 - 6 files changed, 94 insertions(+), 91 deletions(-) delete mode 100644 .github/workflows/python-package.yml delete mode 100644 .github/workflows/python-test-publish.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml deleted file mode 100644 index a60288b8..00000000 --- a/.github/workflows/python-package.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python package - -on: - push: - branches: [external] - pull_request: - branches: [external] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.7, 3.8, 3.9] - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install astroid>=2.0 pylint~=2.5.3 - pip install -e . - - name: Lint with pylint - run: | - pylint --rcfile=.pylintrc infinisdk setup.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 49f03047..09f56d20 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -9,27 +9,26 @@ on: jobs: deploy: - runs-on: ubuntu-latest environment: pypi steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: "__token__" + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.github/workflows/python-test-publish.yml b/.github/workflows/python-test-publish.yml deleted file mode 100644 index c2ca608d..00000000 --- a/.github/workflows/python-test-publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python test publish - -on: - push: - branches: [external] - pull_request: - branches: [external] - -jobs: - build: - runs-on: ubuntu-latest - - environment: pypi - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Test build and publish - env: - TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload --verbose --non-interactive --repository-url https://test.pypi.org/legacy/ dist/* - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple infinisdk - python -c "import infinisdk" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce5fa11e..0d52992a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -126,6 +126,81 @@ test-release: variables: - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" +test-package-py36: + image: $PYTHON_IMAGE:3.6 + stage: test + script: + - python -m pip install --upgrade pip + - pip install -e . + - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" + - make check_format + - make lint + only: + refs: + - merge_requests + variables: + - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" + +test-package-py37: + image: $PYTHON_IMAGE:3.7 + stage: test + script: + - python -m pip install --upgrade pip + - pip install -e . + - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" + - make check_format + - make lint + only: + refs: + - merge_requests + variables: + - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" + +test-package-py38: + image: $PYTHON_IMAGE:3.8 + stage: test + script: + - python -m pip install --upgrade pip + - pip install -e . + - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" + - make check_format + - make lint + only: + refs: + - merge_requests + variables: + - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" + +test-package-py39: + image: $PYTHON_IMAGE:3.9 + stage: test + script: + - python -m pip install --upgrade pip + - pip install -e . + - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" + - make check_format + - make lint + only: + refs: + - merge_requests + variables: + - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" + +test-package-py310: + image: $PYTHON_IMAGE:3.10 + stage: test + script: + - python -m pip install --upgrade pip + - pip install -e . + - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" + - make check_format + - make lint + only: + refs: + - merge_requests + variables: + - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" + push-to-github: # Refer to https://wiki.infinidat.com/display/ID/InfiniSDK+New+Release+Strategy#InfiniSDKNewReleaseStrategy-new_flow image: $PYTHON_IMAGE:3.9 diff --git a/Makefile b/Makefile index 0ab4b80c..1dccace0 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ all: @exit 2 lint: - pylint --rcfile .pylintrc -j $(shell nproc) infinisdk scripts tests doc/*.doctest_context + pylint --rcfile .pylintrc -j $(shell nproc) infinisdk check_format: black --check infinisdk diff --git a/infinisdk/infinibox/compatibility.py b/infinisdk/infinibox/compatibility.py index 799304d8..58135d65 100644 --- a/infinisdk/infinibox/compatibility.py +++ b/infinisdk/infinibox/compatibility.py @@ -260,7 +260,6 @@ def has_standard_counts(self): def has_vvol_counts(self): return self.get_parsed_system_version() >= "7.0" and self.has_vvol() - def has_ethernet_interface_state(self): return self.get_parsed_system_version() >= "7.3.10" From aa1ba4a8ad93e13c30dba19cd8701aa00dc72228 Mon Sep 17 00:00:00 2001 From: Oren Epshtain Date: Thu, 8 Feb 2024 10:27:17 +0000 Subject: [PATCH 2/3] INFRADEV-16384: Add documentation for snapshot replication when creating async replica --- CHANGELOG | 4 ++++ doc/replication.rst | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5e655e8d..c5350c29 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 240.1.2 (Released 2024-02-08) +------------------------------------- +* #16384: Add documentation for snapshot replication when creating async replica + Version 240.1.1 (Released 2024-01-31) ------------------------------------- * #16462: Add pagination for the new metadata of get all assigned entities diff --git a/doc/replication.rst b/doc/replication.rst index 626f172a..7d6fd87c 100644 --- a/doc/replication.rst +++ b/doc/replication.rst @@ -37,7 +37,20 @@ As for the remote entity, it depends on the scenario being used to create the re * Creating a new entity on the remote side (`_create_target` or default) requires the remote pool to be provided * Creating over an existing, formatted target (`_existing_target`) requires the remote target to be provided via ``remote_entity`` parameter +To allow for snapshot replication you would use something like the following: +.. code-block:: python + + from datetime import timedelta + + replica = primary_system.replicas.replicate_entity(vol, link=link, remote_pool=remote_pool, + including_snapshots=True, snapshots_retention=3600, + lock_remote_snapshot_retention=timedelta(seconds=3600), + rpo=timedelta(seconds=4), sync_interval=timedelta(seconds=4)) + +`lock_remote_snapshot_retention` is an optional parameter. It places a lock on the exposed snapshot +for a duration defined by the parameter's value (number of seconds since the original snapshot was created). +For an explanation about `rpo` and `sync_interval` parameters please see section below on RgReplica. .. seealso:: :class:`infinisdk.infinibox.replica.Replica` From 90561164ecbc3ecb964b23489fbf0021d4f3dea3 Mon Sep 17 00:00:00 2001 From: infinidat-infradev Date: Thu, 8 Feb 2024 10:32:10 +0000 Subject: [PATCH 3/3] Version 240.1.2 release --- .gitlab-ci.yml | 218 ------------------------------------------------- 1 file changed, 218 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 0d52992a..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,218 +0,0 @@ -include: - - project: infradev/gitlab-ci - ref: master - file: /templates/variables.yml - - - project: infradev/gitlab-ci - ref: master - file: /templates/codecov.yml - - - project: infradev/gitlab-ci - ref: master - file: /jobs/pypi.yml - - - project: infradev/gitlab-ci - ref: master - file: /templates/itzik_setup.yml - -variables: - BUNDLE_NAME: new-infra - BUNDLE_VERSION: master - RUN_ITZIK_PARAMETERS: --no-dev --src $INSTALL_DIR --bundle $BUNDLE_NAME --bundle-version $BUNDLE_VERSION --until $CI_PROJECT_NAME -p $CI_PROJECT_DIR[testing] --curr-branch $CI_COMMIT_REF_NAME - -stages: - - test - - deploy - - post - - release - -.install-and-lint: - stage: test - tags: - - infradev - - ubuntu - except: - - /^customer-.*$/ - - external - before_script: - - !reference [.itzik, before_script] - - make check_format - - make lint - -py36: - extends: .install-and-lint - image: $PYTHON_IMAGE:3.6 - script: - - pytest - -py37: - extends: .install-and-lint - image: $PYTHON_IMAGE:3.7 - script: - - pytest - -py38: - extends: .install-and-lint - image: $PYTHON_IMAGE:3.8 - script: - - pytest - -py39-codecov: - extends: - - .install-and-lint - - .codecov - image: $PYTHON_IMAGE:3.9 - -py310: - extends: .install-and-lint - image: $PYTHON_IMAGE:3.10 - script: - - pytest - -docs: - extends: .install-and-lint - image: $PYTHON_IMAGE:3.7 - script: - - pip install -e ".[doc]" - - sphinx-build -a -W -E doc build/sphinx/html - -trigger: - image: $PYTHON_IMAGE:3.8 - tags: - - infradev - - ubuntu - stage: post - only: - - master - - /^(dev|stable)-\d+(\.\d+)*$/ - script: - - curl --request POST --form "token=$CI_JOB_TOKEN" --form "ref=$CI_COMMIT_REF_NAME" https://git.infinidat.com/api/v4/projects/222/trigger/pipeline - -sanity-tests: - image: $PYTHON_IMAGE:3.9 - variables: - BUNDLE_NAME: infradev - BUNDLE_VERSION: master - RUN_ITZIK_PARAMETERS: --no-dev --src $INSTALL_DIR --bundle $BUNDLE_NAME --bundle-version $BUNDLE_VERSION - stage: test - before_script: - - !reference [.itzik, before_script] - script: - - cd $INSTALL_DIR/infinibox_tests - - mkdir -p ~/.slash - - mkdir -p ~/.infinidat - - echo $INFINILAB_TOKEN > ~/.infinidat/infinilab.tkn - - cat $SLASH_RC_FILE > ~/.slash/slashrc - - slash run -S -f suites/integration/dev_sanity.suite --session-label infra-compatibility - only: - refs: - - merge_requests - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" - -test-release: - image: $PYTHON_IMAGE:3.9 - stage: test - script: - - python -m pip install --upgrade pip - - pip install setuptools wheel twine - - python setup.py sdist bdist_wheel - - twine upload -u "__token__" -p $TEST_PYPI_API_TOKEN --verbose --non-interactive --repository-url https://test.pypi.org/legacy/ dist/* - - python -m pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple infinisdk - - python -c "import infinisdk" - only: - refs: - - merge_requests - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" - -test-package-py36: - image: $PYTHON_IMAGE:3.6 - stage: test - script: - - python -m pip install --upgrade pip - - pip install -e . - - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" - - make check_format - - make lint - only: - refs: - - merge_requests - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" - -test-package-py37: - image: $PYTHON_IMAGE:3.7 - stage: test - script: - - python -m pip install --upgrade pip - - pip install -e . - - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" - - make check_format - - make lint - only: - refs: - - merge_requests - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" - -test-package-py38: - image: $PYTHON_IMAGE:3.8 - stage: test - script: - - python -m pip install --upgrade pip - - pip install -e . - - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" - - make check_format - - make lint - only: - refs: - - merge_requests - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" - -test-package-py39: - image: $PYTHON_IMAGE:3.9 - stage: test - script: - - python -m pip install --upgrade pip - - pip install -e . - - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" - - make check_format - - make lint - only: - refs: - - merge_requests - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" - -test-package-py310: - image: $PYTHON_IMAGE:3.10 - stage: test - script: - - python -m pip install --upgrade pip - - pip install -e . - - pip install click~=8.0.4 black~=21.8b0 isort~=5.0.9 "pylint>=2" - - make check_format - - make lint - only: - refs: - - merge_requests - variables: - - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "external" - -push-to-github: - # Refer to https://wiki.infinidat.com/display/ID/InfiniSDK+New+Release+Strategy#InfiniSDKNewReleaseStrategy-new_flow - image: $PYTHON_IMAGE:3.9 - variables: - BUNDLE_NAME: infradev - BUNDLE_VERSION: master - RUN_ITZIK_PARAMETERS: --no-dev --src $INSTALL_DIR --bundle $BUNDLE_NAME --bundle-version $BUNDLE_VERSION --curr-branch $CI_COMMIT_REF_NAME - stage: release - when: manual - before_script: - - !reference [.itzik, before_script] - script: - - infradev customer-sdk push-external-to-github --email $INFINISDK_RELEASE_EMAIL --auth-token $INFINISDK_RELEASE_TOKEN --gitlab-repo $INFINISDK_GITLAB_REPO --github-repo $INFINISDK_GITHUB_REPO --github-username $INFINISDK_RELEASE_USER --version $RELEASE_VERSION - only: - - external