DataBiosphere / azul

Metadata indexer and query service used for AnVIL, HCA, LungMAP, and CGP
Apache License 2.0
7 stars 2 forks source link

_select, _deauth and _preauth emit envhook warnings #4813

Closed hannes-ucsc closed 1 year ago

hannes-ucsc commented 1 year ago
$ _select 
lrwxr-xr-x  1 hannes  staff  12 Dec  9 16:41 .active -> hannes.local
$ _select dev.shared
Revoked temporary AWS credentials.
Google Cloud application default credentials are system-global. You should revoke the existing credentials unless you are *certain* that you are already logged in using the appropriate account and project. If in doubt, enter 'y'.
envhook.py: Warning: AZUL_AGGREGATION_CONCURRENCY is '8' but should be '64', you must run `source environment`
… more of the same …
envhook.py: Warning: azul_terraform_component is '' but should be 'shared', you must run `source environment`
You are about to revoke the credentials stored in: [/Users/hannes/.config/gcloud/application_default_credentials.json]

Do you want to continue (Y/n)?  y

Credentials revoked.
Revoked temporary Google credentials.
envhook.py: Currently disabled because the ENVHOOK environment variable is set to 0.
export_environment.py: Loading environment from deployments/dev.shared/environment.local.py
export_environment.py: Loading environment from deployments/dev/environment.local.py
export_environment.py: Loading environment from environment.local.py
export_environment.py: Loading environment from deployments/dev.shared/environment.py
export_environment.py: Loading environment from deployments/dev/environment.py
export_environment.py: Loading environment from environment.py
export_environment.py: Unsetting azul_aws_support_roles
export_environment.py: Setting azul_env_vars to AZUL_DEBUG,AZUL_DSS_DIRECT_ACCESS,AZUL_DRS_DOMAIN_NAME,AZUL_SUBDOMAIN_TEMPLATE,AZUL_PRIVATE_API,AZUL_RESOURCE_PREFIX,AZUL_ES_DOMAIN,AZUL_SHARE_ES_DOMAIN,AZUL_INDEX_PREFIX,AZUL_ES_VOLUME_SIZE,AZUL_ES_TIMEOUT,AZUL_DSS_WORKERS,AZUL_TDR_WORKERS,AZUL_DEPLOYMENT_INCARNATION,AZUL_GOOGLE_SERVICE_ACCOUNT,AZUL_GOOGLE_SERVICE_ACCOUNT_PUBLIC,AZUL_GOOGLE_SERVICE_ACCOUNT_UNREGISTERED,AZUL_CONTRIBUTION_CONCURRENCY,AZUL_AGGREGATION_CONCURRENCY,AZUL_ENABLE_MONITORING,azul_terraform_component,azul_github_project,azul_github_access_token,PYTHONPATH,MYPYPATH,azul_chalice_bin,PIP_DISABLE_PIP_VERSION_CHECK,BOTO_DISABLE_COMMONNAME,azul_easyrsa_pki,TF_DATA_DIR,AZUL_TDR_ALLOWED_SOURCE_LOCATIONS,AZUL_BIGQUERY_BATCH_MODE,AZUL_TERRA_TIMEOUT,azul_cloudtrail_bucket_region,azul_cloudtrail_trail_region,azul_main_deployments,AZUL_IS_SANDBOX,AZUL_DEPLOYMENT_STAGE,AZUL_DOMAIN_NAME,AZUL_VERSIONED_BUCKET,AZUL_S3_BUCKET,AZUL_CATALOGS,AZUL_TDR_SOURCE_LOCATION,AZUL_TDR_SERVICE_URL,AZUL_SAM_SERVICE_URL,AZUL_ES_INSTANCE_TYPE,AZUL_ES_INSTANCE_COUNT,AZUL_BILLING,AZUL_OWNER,AZUL_MONITORING_EMAIL,AZUL_AWS_ACCOUNT_ID,AWS_DEFAULT_REGION,GOOGLE_PROJECT,AZUL_GOOGLE_OAUTH2_CLIENT_ID,PYENV_VERSION,GITHUB_TOKEN,BUILDKIT_PROGRESS,AWS_PROFILE,project_root
… more of the same …
export_environment.py: Setting project_root to /Users/hannes/workspace/hca/azul
Updated property [core/project].
Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fsqlservice.login+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=kmdNGfcqVIUu5ka0HE9VSOJtNuNiAc&access_type=offline&code_challenge=fuHN2vQ1n_Y7O3prcxBiWgxo4uZjGL5u7fzrfsW5R_Y&code_challenge_method=S256

Credentials saved to file: [/Users/hannes/.config/gcloud/application_default_credentials.json]

These credentials will be used by any library that requests Application Default Credentials (ADC).

Quota project "platform-hca-dev" was added to ADC which can be used by Google client libraries for billing and quota. Note that some services may still bill the project owning the resource.
Temporary session credentials are in effect for AWS and Google. Use '_deauth' to revert the effect of this command.
lrwxr-xr-x  1 hannes  staff  10 Dec  9 17:26 .active -> dev.shared
$ _select hannes.local 
Revoked temporary AWS credentials.
Google Cloud application default credentials are system-global. You should revoke the existing credentials unless you are *certain* that you are already logged in using the appropriate account and project. If in doubt, enter 'y'.
envhook.py: Warning: AZUL_AGGREGATION_CONCURRENCY is '64' but should be '8', you must run `source environment`
… more of the same …
envhook.py: Warning: azul_terraform_component is 'shared' but should be '', you must run `source environment`
You are about to revoke the credentials stored in: [/Users/hannes/.config/gcloud/application_default_credentials.json]

Do you want to continue (Y/n)?  n

ERROR: (gcloud.auth.application-default.revoke) Aborted by user.
Revoked temporary Google credentials.
envhook.py: Currently disabled because the ENVHOOK environment variable is set to 0.
export_environment.py: Loading environment from deployments/hannes.local/environment.local.py
export_environment.py: Loading environment from environment.local.py
export_environment.py: Loading environment from deployments/hannes.local/environment.py
export_environment.py: Loading environment from environment.py
export_environment.py: Unsetting AZUL_ES_INSTANCE_TYPE
export_environment.py: Unsetting AZUL_ES_INSTANCE_COUNT
export_environment.py: Setting azul_env_vars to AZUL_DEBUG,AZUL_DSS_DIRECT_ACCESS,AZUL_DRS_DOMAIN_NAME,AZUL_SUBDOMAIN_TEMPLATE,AZUL_PRIVATE_API,AZUL_RESOURCE_PREFIX,AZUL_ES_DOMAIN,AZUL_SHARE_ES_DOMAIN,AZUL_INDEX_PREFIX,AZUL_ES_VOLUME_SIZE,AZUL_ES_TIMEOUT,AZUL_DSS_WORKERS,AZUL_TDR_WORKERS,AZUL_DEPLOYMENT_INCARNATION,AZUL_GOOGLE_SERVICE_ACCOUNT,AZUL_GOOGLE_SERVICE_ACCOUNT_PUBLIC,AZUL_GOOGLE_SERVICE_ACCOUNT_UNREGISTERED,AZUL_CONTRIBUTION_CONCURRENCY,AZUL_AGGREGATION_CONCURRENCY,AZUL_ENABLE_MONITORING,azul_terraform_component,azul_github_project,azul_github_access_token,PYTHONPATH,MYPYPATH,azul_chalice_bin,PIP_DISABLE_PIP_VERSION_CHECK,BOTO_DISABLE_COMMONNAME,azul_easyrsa_pki,TF_DATA_DIR,AZUL_TDR_ALLOWED_SOURCE_LOCATIONS,AZUL_BIGQUERY_BATCH_MODE,AZUL_TERRA_TIMEOUT,azul_cloudtrail_bucket_region,azul_cloudtrail_trail_region,azul_main_deployments,AZUL_IS_SANDBOX,AZUL_DEPLOYMENT_STAGE,AZUL_DOMAIN_NAME,AZUL_VERSIONED_BUCKET,AZUL_S3_BUCKET,AZUL_CATALOGS,AZUL_TDR_SOURCE_LOCATION,AZUL_TDR_SERVICE_URL,AZUL_SAM_SERVICE_URL,AZUL_BILLING,AZUL_OWNER,AZUL_MONITORING_EMAIL,AZUL_AWS_ACCOUNT_ID,AWS_DEFAULT_REGION,GOOGLE_PROJECT,AZUL_GOOGLE_OAUTH2_CLIENT_ID,PYENV_VERSION,GITHUB_TOKEN,BUILDKIT_PROGRESS,AWS_PROFILE,project_root
… more of the same …
export_environment.py: Setting project_root to /Users/hannes/workspace/hca/azul
Updated property [core/project].
Temporary session credentials are in effect for AWS and Google. Use '_deauth' to revert the effect of this command.
lrwxr-xr-x  1 hannes  staff  12 Dec  9 17:27 .active -> hannes.local

Note the lines of the form

envhook.py: Warning: AZUL_AGGREGATION_CONCURRENCY is '8' but should be '64', you must run `source environment`

They should not be emitted.

hannes-ucsc commented 1 year ago

For demo, attempt to reproduce.