Example #1
0
def custodian_archive(packages=None, deps=()):
    if not packages:
        packages = []
    packages.append('c7n_gcp')
    archive = base_archive(packages)

    # Requirements are fetched server-side, which helps for binary extensions
    # but for pure python packages, if we have a local install and its
    # relatively small, it might be faster to just upload.
    #
    # note we pin requirements to the same versions installed locally.
    requirements = set()
    requirements.update((
        'jmespath',
        'retrying',
        'python-dateutil',
        'ratelimiter',
        'google-auth',
        'google-auth-httplib2',
        'google-api-python-client'))
    requirements.update(deps)
    archive.add_contents(
        'requirements.txt',
        generate_requirements(requirements, include_self=True))
    return archive
Example #2
0
def custodian_archive(packages=None):
    if not packages:
        packages = []
    packages.append('c7n_gcp')
    archive = base_archive(packages)

    # Requirements are fetched server-side, which helps for binary extensions
    # but for pure python packages, if we have a local install and its
    # relatively small, it might be faster to just upload.
    #
    requirements = set()
    requirements.add('jmespath')
    requirements.add('retrying')
    requirements.add('ratelimiter>=1.2.0.post0')
    requirements.add('google-auth>=1.4.1')
    requirements.add('google-auth-httplib2>=0.0.3')
    requirements.add('google-api-python-client>=1.7.3')

    archive.add_contents('requirements.txt', '\n'.join(sorted(requirements)))
    return archive
Example #3
0
def custodian_archive(packages=None):
    if not packages:
        packages = []
    packages.append('c7n_gcp')
    archive = base_archive(packages)

    # Requirements are fetched server-side, which helps for binary extensions
    # but for pure python packages, if we have a local install and its
    # relatively small, it might be faster to just upload.
    #
    requirements = set()
    requirements.add('jmespath')
    requirements.add('retrying')
    requirements.add('ratelimiter>=1.2.0.post0')
    requirements.add('google-auth>=1.4.1')
    requirements.add('google-auth-httplib2>=0.0.3')
    requirements.add('google-api-python-client>=1.7.3')

    archive.add_contents(
        'requirements.txt',
        '\n'.join(sorted(requirements)))
    return archive
Example #4
0
def custodian_archive(packages=None):
    archive = base_archive(['c7n_gcp'])
    archive.add_contents('index.js', handler)

    # requirements are fetched server-side, which helps for binary extensions
    # but for pure python packages, if we have a local install and its
    # relatively small, it might be faster to just upload.
    #
    requirements = packages and set(packages) or set()
    requirements.add('retrying')
    requirements.add('ratelimiter>=1.2.0.post0')
    requirements.add('google-auth>=1.4.1')
    requirements.add('google-auth-httplib2>=0.0.3')
    requirements.add('google-api-python-client>=1.7.3')
    # both of these bring in grpc :-( which in turn brings in a whole
    # pile of random threads and protobufs.
    requirements.add('google-cloud-monitoring>=0.3.0')
    requirements.add('google-cloud-logging>=1.6.0')

    archive.add_contents('requirements.txt', '\n'.join(sorted(requirements)))
    archive.close()

    return archive