From e9c76991bcb8313dabd70e753224ec7bbac9fd20 Mon Sep 17 00:00:00 2001 From: Marius Mitrofan Date: Thu, 4 Jun 2020 20:27:50 +0300 Subject: [PATCH] Do a random sleep between tasks when running as parallel pipeline --- Dockerfile | 2 +- setup.py | 2 +- src/stackuchin/__init__.py | 2 +- src/stackuchin/start_pipeline.py | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ab1017..cda9a2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.7-alpine -RUN pip install stackuchin==1.5.0 +RUN pip install stackuchin==1.5.1 VOLUME /project diff --git a/setup.py b/setup.py index 0c71235..a42b05a 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ here = path.abspath(path.dirname(__file__)) -current_version = str('1.5.0') +current_version = str('1.5.1') # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: diff --git a/src/stackuchin/__init__.py b/src/stackuchin/__init__.py index 73ed434..2bb5bbb 100644 --- a/src/stackuchin/__init__.py +++ b/src/stackuchin/__init__.py @@ -43,7 +43,7 @@ def __init__(self): # noinspection PyMethodMayBeStatic def version(self): - print("1.5.0") + print("1.5.1") # noinspection PyMethodMayBeStatic def create(self): diff --git a/src/stackuchin/start_pipeline.py b/src/stackuchin/start_pipeline.py index 11947a7..121c879 100644 --- a/src/stackuchin/start_pipeline.py +++ b/src/stackuchin/start_pipeline.py @@ -1,6 +1,8 @@ import yaml import concurrent.futures import boto3 +import time +import random from stackuchin.create import create @@ -12,6 +14,8 @@ def perform_parallel_changes(stack): + time.sleep(random.randint(0, 30)) + if stack['action'] == 'create': return create( stack['profile_name'],