Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Kaggle Cache Resolver #19

Merged
merged 3 commits into from
Nov 2, 2023
Merged

Implement Kaggle Cache Resolver #19

merged 3 commits into from
Nov 2, 2023

Conversation

rosbo
Copy link
Contributor

@rosbo rosbo commented Nov 1, 2023

If we detect we are inside a Kaggle notebook (via the KAGGLE_KERNEL_RUN_TYPE env variable), then we call the AttachDatasourceUsingJwtHandler.

Also, I added a DISABLE_KAGGLE_CACHE environment variable. If set to a truthy value, the KaggleCacheResolver will be skipped.

Next: Call AttachDatasourceUsingJwtHandler through the Data Proxy inside internet disabled sessions.

http://b/305947763

rosbo added 2 commits November 1, 2023 19:10
If we detect we are inside a Kaggle notebook (via the `KAGGLE_KERNEL_RUN_TYPE` env variable),
then we call the `AttachDatasourceUsingJwtHandler`.

http://b/305947763
@rosbo rosbo requested a review from Philmod November 1, 2023 21:28

logger.info(f"Mounting files to {cached_path}...")
while not os.path.exists(cached_path):
time.sleep(5)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This waits until the file is ready. We can add later a separate endpoint to poll for progress. Given that we already show progress in the editor UI, probably not high priority.

A user can always send an interrupt (e.g. ctrl + c or click "stop cell" button in a notebook) if they want to stop the waiting.

@@ -28,6 +34,7 @@
"error": logging.ERROR,
"critical": logging.CRITICAL,
}
TRUTHY_VALUES = ["true", "1", "t"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is t sometimes used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen this for a few env vars in the past.

@rosbo rosbo merged commit b3a6f4c into main Nov 2, 2023
@rosbo rosbo deleted the kaggle-cache-resolver branch November 2, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants