lilab-bcb / cirrocumulus

Bring your single-cell data to life
https://cirrocumulus.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
75 stars 16 forks source link

Static Website on Google App Engine and Cloud Storage #195

Closed officialprofile closed 1 year ago

officialprofile commented 1 year ago

Hello,

I am trying to deploy a static website using google cloud app engine. The examples work well, both locally and on the app engine itself. However, due to the size limitations of the app engine (32 MB I believe), I have to upload my dataset somewhere else. I have tried to deploy whole website to the cloud storage, but I think the storage is not suitable in this case. Nonetheless, I would like to have my datasets to be in the bucket, whereas the rest of the website to be run by the app engine.

I tried to simply do something like this:

[
    {
        "id": "mydata",
        "name": "mydata",
        "url": "gs://my-public-bucket/mydata/mydata.jsonl"
    }
]

but I doesn't work. All I see is a blank, white page with no errors. Of course all the files in the bucket are public.

Is there any quick fix to this problem?

joshua-gould commented 1 year ago

For a static website, there is no need to use app engine-you can host the entire website in a bucket.

officialprofile commented 1 year ago

But how does one open the website then? I need to run npx http-server ., and simple opening index.html is not sufficient (result below). Likewise, when opening https://storage.googleapis.com/my-public-bucket/index.html the result is the same.

cirro screen

joshua-gould commented 1 year ago

Please see https://cloud.google.com/storage/docs/hosting-static-website

officialprofile commented 1 year ago

I went over the guide few times and make most of the configuration described there (except e.g. registering a new domain), but I don't see which of these steps translates into step npx http-server . which is performed locally.

joshua-gould commented 1 year ago

There is no need to run a server locally. Perhaps this step by step tutorial at https://codelabs.developers.google.com/codelabs/cloud-webapp-hosting-gcs will be easier to follow?

officialprofile commented 1 year ago

Thank you for the links, however I already know how to set up a static website in the google cloud storage. What I don't know is why there is npx http-server . in the tutorial if there is no need to run any server. Does this mean that opening index.html should be sufficient if everything is configured correctly? Or am I missing some other ways of running the website?

joshua-gould commented 1 year ago

Sorry for the confusion. The command npx http-server . is only for testing the static website using a local http server. Once your bucket is configured correctly, you will be able to directly go to your configured URL in your web browser. Does this make sense? Thanks.

officialprofile commented 1 year ago

Thank you @joshua-gould for your patience and support! Everything works. I thought connecting to domain can be skipped simply by using the direct google storage url (which works, but only to a degree).