예제 #1
0
    def __init__(self, bindings, agent=None):
        """Constructor.

    Args:
      bindings: [dict] The data bindings to use to configure the scenario.
      agent: [GateAgent] The agent for invoking the test operations on Gate.
    """
        super(KubeV2GcsTestScenario, self).__init__(bindings, agent)
        bindings = self.bindings

        # We'll call out the app name because it is widely used
        # because it scopes the context of our activities.
        # pylint: disable=invalid-name
        self.TEST_APP = bindings['TEST_APP']

        # Take just the first if there are multiple
        # because some uses below assume just one.
        self.TEST_NAMESPACE = bindings['TEST_NAMESPACE'].split(',')[0]

        self.ARTIFACT_ACCOUNT = bindings['TEST_GCS_ARTIFACT_ACCOUNT']
        self.BUCKET = bindings['TEST_GCS_BUCKET']

        self.mf = sk.KubernetesManifestFactory(self)
        self.mp = sk.KubernetesManifestPredicateFactory()
        self.gcs = sk.GcsFileUploadAgent(bindings['TEST_GCS_CREDENTIALS_PATH'])
    def __init__(self, bindings, agent=None):
        super(AppengineGcsPubsubTestScenario, self).__init__(bindings, agent)
        self.logger = logging.getLogger(__name__)

        bindings = self.bindings

        if not bindings["GIT_REPO_URL"]:
            raise ValueError("Must supply value for --git_repo_url")

        if not bindings["APP_DIRECTORY_ROOT"]:
            raise ValueError("Must supply value for --app_directory_root")

        # We'll call out the app name because it is widely used
        # because it scopes the context of our activities.
        self.TEST_APP = bindings["TEST_APP"]
        self.TEST_STACK = bindings["TEST_STACK"]
        self.__EXPECTED_ARTIFACT_ID = "deployable-gae-app-artifact"

        self.__gcp_project = bindings["APPENGINE_PRIMARY_MANAGED_PROJECT_ID"]
        self.__cluster_name = frigga.Naming.cluster(self.TEST_APP,
                                                    self.TEST_STACK)
        self.__server_group_name = frigga.Naming.server_group(
            self.TEST_APP, self.TEST_STACK)
        self.__lb_name = self.__cluster_name

        self.__subscription_name = bindings["TEST_SUBSCRIPTION_NAME"]
        self.__gcs_pubsub_agent = sk.GcsFileUploadAgent(
            bindings["APPENGINE_CREDENTIALS_PATH"])

        # Python is clearly hard-coded as the runtime here, but we're just asking App Engine to be a static file server.
        self.__app_yaml = "\n".join([
            "runtime: python27",
            "api_version: 1",
            "threadsafe: true",
            "service: {service}",
            "handlers:",
            " - url: /.*",
            "   static_dir: .",
        ]).format(service=self.__lb_name)

        self.__app_directory_root = bindings["APP_DIRECTORY_ROOT"]
        self.__branch = bindings["BRANCH"]

        self.pipeline_id = None

        self.bucket = bindings["TEST_GCS_BUCKET"]
        self.__test_repository_url = "gs://" + self.bucket
        self.__pipeline_id = None
예제 #3
0
    def __init__(self, bindings, agent=None):
        super(GcsPubsubGaeTestScenario, self).__init__(bindings, agent)
        self.logger = logging.getLogger(__name__)

        bindings = self.bindings

        if not bindings['GIT_REPO_URL']:
            raise ValueError('Must supply value for --git_repo_url')

        if not bindings['APP_DIRECTORY_ROOT']:
            raise ValueError('Must supply value for --app_directory_root')

        # We'll call out the app name because it is widely used
        # because it scopes the context of our activities.
        self.TEST_APP = bindings['TEST_APP']
        self.TEST_STACK = bindings['TEST_STACK']
        self.__EXPECTED_ARTIFACT_ID = 'deployable-gae-app-artifact'

        self.__gcp_project = bindings['APPENGINE_PRIMARY_MANAGED_PROJECT_ID']
        self.__cluster_name = frigga.Naming.cluster(self.TEST_APP,
                                                    self.TEST_STACK)
        self.__server_group_name = frigga.Naming.server_group(
            self.TEST_APP, self.TEST_STACK)
        self.__lb_name = self.__cluster_name

        self.__subscription_name = bindings['TEST_SUBSCRIPTION_NAME']
        self.__gcs_pubsub_agent = sk.GcsFileUploadAgent(
            bindings['APPENGINE_CREDENTIALS_PATH'])

        # Python is clearly hard-coded as the runtime here, but we're just asking App Engine to be a static file server.
        self.__app_yaml = ('\n'.join([
            'runtime: python27', 'api_version: 1', 'threadsafe: true',
            'service: {service}', 'handlers:', ' - url: /.*',
            '   static_dir: .'
        ]).format(service=self.__lb_name))

        self.__app_directory_root = bindings['APP_DIRECTORY_ROOT']
        self.__branch = bindings['BRANCH']

        self.pipeline_id = None

        self.bucket = bindings['TEST_GCS_BUCKET']
        self.__test_repository_url = 'gs://' + self.bucket