oppia / oppia/oppia-web-developer-docs
Add info to wiki explaining how to probe local emulated GCS
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18
- Forks
- 133
- PR merge metrics
- No merged PRs in 30d
Description
When working on code that interacts with Google Cloud Storage (GCS), it's often useful to be able to explore the files that exist in our local emulated GCS. You can do this as follows:
- Run the local dev server
- Open a shell to the oppia-dev-server container:
make shell.oppia-dev-server - Start a Python session
python - Depending on what Oppia tools you want to use, you may need to run
import scripts.startto get Python to look in the correct folders for imports. - import
models:from core.platform import models - Set up
storage_services:storage_services = models.Registry.import_storage_services()
Now you can explore GCS as follows:
# The `abc` is the GCS bucket name, which you can put anything for.
>>> storage_services.listdir('abc', 'exploration_suggestions/25/assets')
[EmulatorBlob(name=exploration_suggestions/25/assets/image/img_20241203_121203_tn09emjdm7_height_472_width_314_micro.svg, content_type=image/svg+xml), EmulatorBlob(name=exploration_suggestions/25/assets/image/img_20241203_121203_tn09emjdm7_height_472_width_314_compressed.svg, content_type=image/svg+xml), EmulatorBlob(name=exploration_suggestions/25/assets/image/img_20241203_121203_tn09emjdm7_height_472_width_314.svg, content_type=image/svg+xml)]
You can also mutate files in GCS. See the available functions here: https://github.com/oppia/oppia/blob/develop/core/platform/storage/dev_mode_storage_services.py
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Add the supplied local GCS exploration steps to the appropriate Oppia developer wiki page. Start by reviewing core/platform/storage/dev_mode_storage_services.py and the make shell.oppia-dev-server and scripts.start entry points referenced in the issue. Done means the page explains listing and mutating emulator files and links to the available storage functions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, google-cloud, python
- Domain
- cloud, documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100