Esempio n. 1
0
    def setAWSCredentials(self, awsAccessKeyId, awsSecretAccessKey):
        """
        Manually set AWS access credentials to be used by Thunder.

        Provided for hosted cloud environments without filesystem access. If
        launching a cluster using the thunder-ec2 script, credentials will be
        configured automatically (inside core-site.xml and ~/.boto), so this
        method should not need to be called.

        Parameters
        ----------
        awsAccessKeyId : string
            AWS public key, usually starts with "AKIA"

        awsSecretAccessKey : string
            AWS private key
        
        """
        from thunder.utils.aws import AWSCredentials
        self._credentials = AWSCredentials(awsAccessKeyId, awsSecretAccessKey)
        self._credentials.setOnContext(self._sc)
Esempio n. 2
0
    def __init__(self, awsCredentialsOverride=None):
        """Initialization; validates that AWS keys are available as environment variables.

        Will let boto library look up credentials itself according to its own rules - e.g. first looking for
        AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, then going through several possible config files and finally
        looking for a ~/.aws/credentials .ini-formatted file. See boto docs:
        http://boto.readthedocs.org/en/latest/boto_config_tut.html

        However, if an AWSCredentials object is provided, its `awsAccessKeyId` and `awsSecretAccessKey` attributes
        will be used instead of those found by the standard boto credential lookup process.
        """
        if not _haveBoto:
            raise ValueError("The boto package does not appear to be available; boto is required for BotoReader")
        self.awsCredentialsOverride = awsCredentialsOverride if awsCredentialsOverride else AWSCredentials()