{"html_url": "https://github.com/simonw/datasette/pull/434#issuecomment-489250828", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/434", "id": 489250828, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4OTI1MDgyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-03T21:50:44Z", "updated_at": "2019-05-03T21:50:44Z", "author_association": "OWNER", "body": "Since there's a useful error message I'm OK with revisiting this in a few weeks to see if they change the CLI tool.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 434321685, "label": "\"datasette publish cloudrun\" command to publish to Google Cloud Run"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/434#issuecomment-489163939", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/434", "id": 489163939, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4OTE2MzkzOQ==", "user": {"value": 10352819, "label": "rprimet"}, "created_at": "2019-05-03T16:49:45Z", "updated_at": "2019-05-03T16:50:03Z", "author_association": "CONTRIBUTOR", "body": "> The second time I ran the command I got an error:\r\n\r\n> \r\n> ERROR: (gcloud.beta.run.deploy) Deployment endpoint was not found. Perhaps the\r\n> provided region was invalid. Set the `run/region` property to a valid region and\r\n> retry. Ex: `gcloud config set run/region us-central1`\r\n> \r\n\r\nYes, I was able to reproduce this; I used to get prompted for a run region interactively by the `gcloud` tool before, but maybe this is changing? (the [documentation](https://cloud.google.com/run/docs/deploying) now assumes `run/region` is set).\r\n\r\nNot sure which course of action is best: making `datasette` ensure that `run/region` is set beforehand or wait a bit until the gcloud CLI stabilizes?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 434321685, "label": "\"datasette publish cloudrun\" command to publish to Google Cloud Run"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/434#issuecomment-489154360", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/434", "id": 489154360, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4OTE1NDM2MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-03T16:18:18Z", "updated_at": "2019-05-03T16:18:18Z", "author_association": "OWNER", "body": "Documentation is now available here: https://datasette.readthedocs.io/en/latest/publish.html#publishing-to-google-cloud-run", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 434321685, "label": "\"datasette publish cloudrun\" command to publish to Google Cloud Run"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/434#issuecomment-489138554", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/434", "id": 489138554, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4OTEzODU1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-03T15:36:48Z", "updated_at": "2019-05-03T15:36:48Z", "author_association": "OWNER", "body": "Here's my first working deployment: https://datasette-j7hipcg4aq-uc.a.run.app/fixtures-c35b6a5/facetable?_facet_array=tags\r\n\r\nI deployed it using this:\r\n\r\n datasette publish cloudrun fixtures.db --branch=master\r\n\r\nThe second time I ran the command I got an error:\r\n\r\n ERROR: (gcloud.beta.run.deploy) Deployment endpoint was not found. Perhaps the\r\n provided region was invalid. Set the `run/region` property to a valid region and\r\n retry. Ex: `gcloud config set run/region us-central1`\r\n\r\nSo I ran the command it suggested and then everything worked:\r\n\r\n gcloud config set run/region us-central1\r\n datasette publish cloudrun fixtures.db --branch=master", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 434321685, "label": "\"datasette publish cloudrun\" command to publish to Google Cloud Run"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/434#issuecomment-489105665", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/434", "id": 489105665, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4OTEwNTY2NQ==", "user": {"value": 25778, "label": "eyeseast"}, "created_at": "2019-05-03T14:01:30Z", "updated_at": "2019-05-03T14:01:30Z", "author_association": "CONTRIBUTOR", "body": "This is exactly what I needed. Thank you.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 434321685, "label": "\"datasette publish cloudrun\" command to publish to Google Cloud Run"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/434#issuecomment-489104146", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/434", "id": 489104146, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4OTEwNDE0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-03T13:56:45Z", "updated_at": "2019-05-03T13:56:45Z", "author_association": "OWNER", "body": "This is amazing - works an absolute treat. Thank you very much!", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 1, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 434321685, "label": "\"datasette publish cloudrun\" command to publish to Google Cloud Run"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/434#issuecomment-484699119", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/434", "id": 484699119, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4NDY5OTExOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-04-18T21:40:45Z", "updated_at": "2019-04-18T21:40:45Z", "author_association": "OWNER", "body": "I asked @andrewgodwin about this and he confirmed that if we want to read an environment variable we can't use the `CMD [...]` syntax in the way that we were using it.\r\n\r\nHe did suggest that if we're doing `CMD [\"sh\", \"-c\", \"datasette serve --port $PORT ...\"]` we may as well do this instead:\r\n\r\n`CMD \"datasette serve --port $PORT ...\"`\r\n\r\nWe should apply some command-line escaping here - if the user passes `--version-note=hello$there` to `datasette publish` we need that $ not to be accidentally evaluated as an environment variable.\r\n\r\nIt looks like [shlex.quote](https://docs.python.org/dev/library/shlex.html#shlex.quote) is the right way to do that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 434321685, "label": "\"datasette publish cloudrun\" command to publish to Google Cloud Run"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/434#issuecomment-484694648", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/434", "id": 484694648, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4NDY5NDY0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-04-18T21:23:56Z", "updated_at": "2019-04-18T21:23:56Z", "author_association": "OWNER", "body": "Thanks for looking into this!\r\n\r\nTo clarify: currently, the Dockerfile that we generate looks something like this:\r\n\r\n```\r\nCMD [\"datasette\", \"serve\", \"--host\", \"0.0.0.0\", \"fixtures.db\", \"--cors\", \"--port\", \"8001\"]\r\n```\r\n\r\nYour code here changes that CMD line to look like this instead, in order to set the port based on an environment variable:\r\n\r\n```\r\nCMD [\"sh\", \"-c\", \"datasette serve --port $PORT ...\"]\r\n```\r\n\r\nI wonder if this is the only way to do this?\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 434321685, "label": "\"datasette publish cloudrun\" command to publish to Google Cloud Run"}, "performed_via_github_app": null}