Exemplo n.º 1
0
    def MonthlyGenerateTestArgs(**kwargs):
        """Loads the configuration that will be used for this Iteration."""
        env_conf = kwargs['dag_run'].conf
        if env_conf is None:
            env_conf = dict()

        docker_hub = env_conf.get('CB_DOCKER_HUB')
        if docker_hub is None:
            docker_hub = 'docker.io/istio'

        # If version is overridden then we should use it otherwise we use it's
        # default or monthly value.
        version = env_conf.get(
            'CB_VERSION') or istio_common_dag.GetVariableOrDefault(
                'monthly-version', None)
        if not version or version == 'INVALID':
            raise ValueError('version needs to be provided')
        Variable.set('monthly-version', 'INVALID')

        #GCS_MONTHLY_STAGE_PATH is of the form ='prerelease/{version}'
        gcs_path = 'prerelease/%s' % (version)

        branch = env_conf.get(
            'CB_BRANCH') or istio_common_dag.GetVariableOrDefault(
                'monthly-branch', None)
        if not branch or branch == 'INVALID':
            raise ValueError('branch needs to be provided')
        Variable.set('monthly-branch', 'INVALID')
        commit = env_conf.get('CB_COMMIT') or branch

        github_org = env_conf.get('CB_GITHUB_ORG') or "istio"

        default_conf = environment_config.GetDefaultAirflowConfig(
            branch=branch,
            commit=commit,
            docker_hub=docker_hub,
            gcs_path=gcs_path,
            github_org=github_org,
            pipeline_type='monthly',
            verify_consistency='true',
            version=version)

        # These are the extra params that are passed to the dags for monthly release
        monthly_conf = dict()
        # CB_GCS_MONTHLY_RELEASE_PATH is of the form  'istio-release/releases/{version}'
        monthly_conf[
            'CB_GCS_MONTHLY_RELEASE_PATH'] = 'istio-release/releases/%s' % (
                version)

        config_settings = istio_common_dag.MergeEnvironmentIntoConfig(
            env_conf, default_conf, monthly_conf)
        testMonthlyConfigSettings(config_settings)
        return config_settings
Exemplo n.º 2
0
    def MonthlyGenerateTestArgs(**kwargs):
        """Loads the configuration that will be used for this Iteration."""
        conf = kwargs['dag_run'].conf
        if conf is None:
            conf = dict()

        # If version is overridden then we should use it otherwise we use it's
        # default or monthly value.
        version = conf.get('VERSION') or istio_common_dag.GetVariableOrDefault(
            'monthly-version', None)
        if not version or version == 'INVALID':
            raise ValueError('version needs to be provided')
        Variable.set('monthly-version', 'INVALID')

        #GCS_MONTHLY_STAGE_PATH is of the form ='prerelease/{version}'
        gcs_path = 'prerelease/%s' % (version)

        branch = conf.get('BRANCH') or istio_common_dag.GetVariableOrDefault(
            'monthly-branch', None)
        if not branch or branch == 'INVALID':
            raise ValueError('branch needs to be provided')
        Variable.set('monthly-branch', 'INVALID')
        commit = conf.get('COMMIT') or branch
        mfest_commit = conf.get('MFEST_COMMIT') or branch

        default_conf = environment_config.GetDefaultAirflowConfig(
            branch=branch,
            commit=commit,
            gcs_path=gcs_path,
            mfest_commit=mfest_commit,
            pipeline_type='monthly',
            verify_consistency='true',
            version=version)

        config_settings = dict()
        for name in default_conf.iterkeys():
            config_settings[name] = conf.get(name) or default_conf[name]

        # These are the extra params that are passed to the dags for monthly release
        monthly_conf = dict()
        monthly_conf['DOCKER_HUB'] = 'istio'
        monthly_conf['GCR_RELEASE_DEST'] = 'istio-io'
        monthly_conf['GCS_GITHUB_PATH'] = 'istio-secrets/github.txt.enc'
        monthly_conf['RELEASE_PROJECT_ID'] = 'istio-io'
        # GCS_MONTHLY_RELEASE_PATH is of the form  'istio-release/releases/{version}'
        monthly_conf[
            'GCS_MONTHLY_RELEASE_PATH'] = 'istio-release/releases/%s' % (
                version)
        for name in monthly_conf.iterkeys():
            config_settings[name] = conf.get(name) or monthly_conf[name]

        testMonthlyConfigSettings(config_settings)
        return config_settings
  def DailyGenerateTestArgs(**kwargs):
    """Loads the configuration that will be used for this Iteration."""
    conf = kwargs['dag_run'].conf
    if conf is None:
      conf = dict()

    # If variables are overridden then we should use it otherwise we use it's
    # default value.
    date = datetime.datetime.now()
    date_string = date.strftime('%Y%m%d-%H-%M')

    version = conf.get('VERSION')
    if version is None:
      # VERSION is of the form '{branch}-{date_string}'
      version = '%s-%s' % (branch, date_string)

    gcs_path = conf.get('GCS_DAILY_PATH')
    if gcs_path is None:
       # GCS_DAILY_PATH is of the form 'daily-build/{version}'
       gcs_path = 'daily-build/%s' % (version)

    commit = conf.get('COMMIT') or ""

    mfest_commit = conf.get('MFEST_COMMIT')
    if mfest_commit is None:
       timestamp = time.mktime(date.timetuple())
       # MFEST_COMMIT is of the form '{branch}@{{{timestamp}}}',
       mfest_commit = '%s@{%s}' % (branch, timestamp)

    default_conf = environment_config.GetDefaultAirflowConfig(
        branch=branch,
        commit=commit,
        gcs_path=gcs_path,
        mfest_commit=mfest_commit,
        pipeline_type='daily',
        verify_consistency='false',
        version=version)

    config_settings = dict()
    for name in default_conf.iterkeys():
      config_settings[name] = conf.get(name) or default_conf[name]

    testDailyConfigSettings(config_settings)
    return config_settings
Exemplo n.º 4
0
    def DailyGenerateTestArgs(**kwargs):
        """Loads the configuration that will be used for this Iteration."""
        env_conf = kwargs['dag_run'].conf
        if env_conf is None:
            env_conf = dict()

        # If variables are overridden then we should use it otherwise we use it's
        # default value.
        date = datetime.datetime.now()
        date_string = date.strftime('%Y%m%d-%H-%M')

        docker_hub = env_conf.get('CB_DOCKER_HUB')
        if docker_hub is None:
            docker_hub = 'gcr.io/istio-release'

        version = env_conf.get('CB_VERSION')
        if version is None:
            # VERSION is of the form '{branch}-{date_string}'
            version = '%s-%s' % (branch, date_string)

        gcs_path = env_conf.get('CB_GCS_DAILY_PATH')
        if gcs_path is None:
            # GCS_DAILY_PATH is of the form 'daily-build/{version}'
            gcs_path = 'daily-build/%s' % (version)

        commit = env_conf.get('CB_COMMIT') or ""

        github_org = env_conf.get('CB_GITHUB_ORG') or "istio"

        default_conf = environment_config.GetDefaultAirflowConfig(
            branch=branch,
            commit=commit,
            docker_hub=docker_hub,
            gcs_path=gcs_path,
            github_org=github_org,
            pipeline_type='daily',
            verify_consistency='false',
            version=version)

        config_settings = istio_common_dag.MergeEnvironmentIntoConfig(
            env_conf, default_conf)

        testDailyConfigSettings(config_settings)
        return config_settings